• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Ejecting the CD tray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Ejecting the CD tray (From: Chad Armstrong <email@hidden>)

  • Prev by Date: Re: Dealing with non-standard character sets...
  • Next by Date: Re: Undo / Redo
  • Previous by thread: Ejecting the CD tray
  • Next by thread: Delaying a method return
  • Index(es):
    • Date
    • Thread