ADC Home > Reference Library > Reference > Audio > Carbon > Disc Recording Framework Reference
|
DRTrackDataProduction |
Declared In: |
Informal protocol describing methods implemented by a track data producer.
The DRTrackDataProduction informal protocol defines those methods that a track data producer
instance can implement. A track data producer is the object that is
resposible for providing the track data to the burn engine on request.
In concept a track data producer similar to an NSTable data source in Cocoa.
Each producer method receives a pointer to the track it should produce data for.
There is one method that must be implemented -
produceDataForTrack:intoBuffer:length:atAddress:blockSize:ioFlags: .
The methods of this protocol will be called in roughly this order:
cleanupTrackAfterBurn: |
Cleans up the track after the burn completes.
- (void) cleanupTrackAfterBurn:(DRTrack*)track;
track
YES to indicate that the burn should proceed and NO to indicate a failure occurred.
Called after burning is complete. Typically you'll clean up what was setup in prepareTrackForBurn. Since this method is called after the laser is turned off and the burn is finished, this method can perform time consuming tasks.
cleanupTrackAfterVerification: |
Cleans up the track after the verification completes.
- (BOOL) cleanupTrackAfterVerification:(DRTrack*)track;
track
Return YES to indicate success, NO to indicate failure.
Once the verification phase is complete, this method is called. The class implementing the method has a chance to do anything up to and including failing the verification.
estimateLengthOfTrack: |
Estimates the size of the track to be burned.
- (uint64_t) estimateLengthOfTrack:(DRTrack*)track;
track
The number of blocks of data that the track will occupy. The estimate should be reasonably accurate, and no smaller than the actual size that will be needed.
This message is sent outside of a burn cycle in response to a -estimateLength message
sent to the track.
prepareTrack:forBurn:toMedia: |
Prepares the track for burning.
- (BOOL) prepareTrack:(DRTrack*)track forBurn:(DRBurn*)burn toMedia:(NSDictionary*)mediaInfo;
track
burn
mediaInfo
YES to indicate that the burn should proceed and NO to indicate a failure occurred.
Called before any burning starts. Do any sort of setup that needs to be performed
(such as opening files). This method can calculate and update the exact track length
that will be burned.
Since this method is called before the laser is turned on, this method can perform
time consuming tasks.
prepareTrackForVerification: |
Prepare the track to be verified.
- (BOOL) prepareTrackForVerification:(DRTrack*)track;
track
YES to indicate that the verification should proceed and NO to indicate a failure occurred.
This method is called after the burn complets writing data to disc and before verification phase starts. Now would be a good time to prepare to produce data again by rewinding to the start of files, etc.
produceDataForTrack:intoBuffer:length:atAddress:blockSize:ioFlags: |
Produces the track data.
- (uint32_t) produceDataForTrack:(DRTrack*)track intoBuffer:(char*)buffer length:(uint32_t)bufferLength atAddress:(uint64_t)address blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags;
track
buffer
bufferLength
address
blockSize
flags
The number of bytes produced.
This method is called many times over the course of a burn to obtain data for the track.
The buffer passed in will be a multiple of blockSize (bufferLength == blockSize * N, where N > 1)
and should be filled as full as possible with data. address is the sector address on the disc from
the start of the track that is the buffer will be written to.
Since while burning, keeping the drive's buffer full is
of utmost importance, you should not perform lengthy operations or block for data in this method.
This method should return the number of bytes actually in the buffer or 0 to indicate that there
was an error producing the data..
producePreGapForTrack:intoBuffer:length:atAddress:blockSize:ioFlags: |
Produces the pregap data.
- (uint32_t) producePreGapForTrack:(DRTrack*)track intoBuffer:(char*)buffer length:(uint32_t)bufferLength atAddress:(uint64_t)address blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags;
track
buffer
bufferLength
address
blockSize
flags
The number of bytes produced.
This method is called to obtain data for the track's pregap. If the DRPreGapLengthKey
key is present in the track properties, the track producer will be asked for the pregap
data first. If the producer implements this selector, then it's the responsibility
of the producer to provide data for the pregap, otherwise that length of
silence will be produced by DiscRecording.
The buffer passed in will be a multiple of blockSize (bufferLength == blockSize * N, where N > 1)
and should be filled as full as possible with data. address is the sector address on the disc from
the start of the track that is the buffer will be written to.
Since while burning, keeping the drive's buffer full is
of utmost importance, you should not perform lengthy operations or block for data in this method.
This method should return the number of bytes actually in the buffer or 0 to indicate that there
was an error producing the data..
verifyDataForTrack:inBuffer:length:atAddress:blockSize:ioFlags: |
Cleans up the track after the burn completes.
- (BOOL) verifyDataForTrack:(DRTrack*)track inBuffer:(const char*)buffer length:(uint32_t)bufferLength atAddress:(uint64_t)address blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags;
track
buffer
bufferLength
address
blockSize
flags
YES to indicate that the data compared successfully and NO to indicate a failure occurred.
If the class implementing this method asks for a verification type of DRVerificationTypeReceiveData , then a series of calls to this method will start. It's up to the class to reproduce the data again and compare it to the data passed in buffer. The buffer passed in will be a multiple of blockSize (bufferLength == blockSize * N, where N > 1). address is the sector address on the disc from the start of the track that is the buffer was written to.
verifyPreGapForTrack:inBuffer:length:atAddress:blockSize:ioFlags: |
Checks the integrity track pregap after a burn.
- (BOOL) verifyPreGapForTrack:(DRTrack*)track inBuffer:(const char*)buffer length:(uint32_t)bufferLength atAddress:(uint64_t)address blockSize:(uint32_t)blockSize ioFlags:(uint32_t*)flags;
track
buffer
bufferLength
address
blockSize
flags
YES to indicate that the data compared successfully and NO to indicate a failure occurred.
If the class implementing this method asks for a verification type of DRVerificationTypeReceiveData , then a series of calls to this method will start. It's up to the class to reproduce the pregap again and compare it to the data passed in buffer. The buffer passed in will be a multiple of blockSize (bufferLength == blockSize * N, where N > 1). address is the sector address on the disc from the start of the track that is the buffer was written to.
|