Re: Ejecting the CD tray
Re: Ejecting the CD tray
- Subject: Re: Ejecting the CD tray
- From: Pascal Pochet <email@hidden>
- Date: Sat, 8 Oct 2005 09:51:46 +0200
Solution is in DiscRecording framework
#import <DiscRecording/DRDevice.h>
...
NSArray *devices = [DRDevice devices] ;
NSEnumerator *aEnum = [devices objectEnumerator];
DRDevice *aDevice ;
while ((aDevice = [aEnum nextObject]) != nil) {
if ([[[aDevice info]
objectForKey:DRDeviceLoadingMechanismCanOpenKey] boolValue]) {
// there are also
DRDeviceLoadingMechanismCanInjectKey and
DRDeviceLoadingMechanismCanEjectKey
// the device supports openTray and closeTray
[aDevice openTray] ;
...
[aDevice closeTray] ;
}
}
Pascal Pochet
email@hidden
Le 08-oct.-05 à 05:10, Chad Armstrong a écrit :
Is there a way to eject the CD tray using Cocoa? I found
NSWorkspace's unmountAndEjectDeviceAtPath, but that seems to only
work if you know the name of the CD in the drive. I would like to
be able to eject the main disc drive, similar to when I press the
Eject key on my keyboard.
Chad
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden