Mac Developer Library


DRErase.h Reference

Deployment Target:

On This Page

DRErase.h Reference

Perform and monitor the erasing a rewritable CD or DVD disc.

Each time you want to erase a disc, an instance of DRErase needs to be created.

When an instance is created, you pass in an instance of DRDevice to let the object know what device to erase. This object is retained for the life of the DRErase instance.

A DRErase object will send out notifications through the DRNotificationCenter mechanism to broadcast the erase state to any interested observers. However, if for some reason you don't want to use notifications, you can poll the erase object at any time for the current status using status . This is not recommended in any application using a run loop, because it involves polling.

Here's an example that shows you how to use this class:

- (void) doErase <br/> { <br/> DRDevice* device; <br/> DRErase* erase; <br/>

...determine correct device to erase... <br/>

erase = [[DRErase alloc] initWithDevice:device]; <br/>

// we'll do a quick erase. It's typically all that's needed. <br/> [erase setEraseType:DREraseTypeQuick]; <br/>

// register to receive notification about the erase status. <br/> [[DRNotificationCenter currentRunLoopCenter] addObserver:self <br/> selector:@selector(eraseNotification:) <br/> name:DREraseStatusChangedNotification <br/> object:erase]; <br/>

// start the erase <br/> [erase start]; <br/> }

- (void) eraseNotification:(NSNotification*)notification <br/> { <br/> DRErase* erase = [notification object]; <br/> NSDictionary* status = [notification userInfo]; <br/> what you wish with the notification... <br/> }

Included Headers

  • <Foundation/Foundation.h>

  • <DiscRecording/DRCoreErase.h>

  • <DiscRecording/DRDevice.h>

  • <AvailabilityMacros.h>


See the Overview section above for header-level documentation.

  • Declaration

    extern NSString* const DREraseTypeComplete; extern NSString* const DREraseTypeKey;


    • DREraseTypeComplete

      An NString value for the DREraseTypeKey . Configures the erase object to perform a complete erase, erasing every byte on the disk. This operation is slow (on the order of 30 minutes) to complete.

    • DREraseTypeKey

      The key for the erase's properties dictionary storing the type of erase to perform