|
ADC Home > Reference Library > Reference > Audio > Carbon > Disc Recording Framework Reference
|
DRErase |
A DRErase object handles the process of erasing a rewritable CD or DVD disc.
Each time you want to erase a disc, an instance of this class 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
{
DRDevice* device;
DRErase* erase;
...determine correct device to erase...
erase = [[DRErase alloc] initWithDevice:device];
// we'll do a quick erase. It's typically all that's needed.
[erase setEraseType:DREraseTypeQuick];
// register to receive notification about the erase status.
[[DRNotificationCenter currentRunLoopCenter] addObserver:self
selector:@selector(eraseNotification:)
name:DREraseStatusChangedNotification
object:erase];
// start the erase
[erase start];
}
- (void) eraseNotification:(NSNotification*)notification
{
DRErase* erase = [notification object];
NSDictionary* status = [notification userInfo];
...do what you wish with the notification...
}
device |
Returns the device being used for the erase.
- (DRDevice*) device;
The DRDevice the erase will use.
eraseForDevice: |
Creates and returns an erase object.
+ (DRErase*) eraseForDevice:(DRDevice*)device;
deviceAn autoreleased DRErase object.
An erase object created with this method is ready to erase media.
initWithDevice: |
Initializes an erase object.
- (id) initWithDevice:(DRDevice*)device;
deviceA DRErase object.
An erase object created with this method is ready to erase media.
properties |
Returns the properties dictionary of the erase.
- (NSDictionary*) properties;
An NSDictionary containing the properties of the erase.
setProperties: |
Sets the properties dictionary of the erase
- (void) setProperties:(NSDictionary*)properties;
propertiesstart |
Begin the process of erasing media.
- (void) start;
This method only kicks off the erase. Once the erasure starts, control returns to the caller. The caller can monitor the progress of the erase by listening for a notification or by polling status .
status |
Returns a dictionary containing the status of the erase.
- (NSDictionary*) status;
An NSDictionary containing the status of the erase.
The same dictionary is returned through the DREraseStatusChangedNotification notification.
|