ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference

 


IOCDMedia

Inherits from:
Declared In:

Overview

The IOCDMedia class is a random-access disk device abstraction for CDs.

Discussion

The IOCDMedia class is a random-access disk device abstraction for CDs. It extends the IOMedia class by implementing special CD APIs, such as readCD, and publishing the TOC as a property of the IOCDMedia object.



Functions

getSpeed
getTOC
read
readCD(IOService *, UInt64, IOMemoryDescriptor *, CDSectorArea, CDSectorType, IOStorageCompletion)
readCD(IOService *, UInt64, IOMemoryDescriptor *, CDSectorArea, CDSectorType, UInt64 *)
readDiscInfo
readISRC
readMCN
readTOC
readTrackInfo
setSpeed

getSpeed


public

virtual IOReturn getSpeed( UInt16 *kilobytesPerSecond);
Parameters
kilobytesPerSecond

Returns the current speed used for data transfers, in kB/s.

kCDSpeedMin specifies the minimum speed for all CD media (1X). kCDSpeedMax specifies the maximum speed supported in hardware.

Return Value

Returns the status of the operation.

Discussion

Get the current speed used for data transfers.


getTOC


public

virtual CDTOC * getTOC();
Return Value

Returns a pointer to the TOC buffer (do not deallocate).

Discussion

Get the full Table Of Contents.

All CDTOC fields passed across I/O Kit APIs are guaranteed to be binary-encoded (no BCD-encoded numbers are ever passed).


read


public

virtual void read( IOService *client, UInt64 byteStart, IOMemoryDescriptor *buffer, IOStorageCompletion completion);
Parameters
client

Client requesting the read.

byteStart

Starting byte offset for the data transfer.

buffer

Buffer for the data transfer. The size of the buffer implies the size of the data transfer.

completion

Completion routine to call once the data transfer is complete.

Discussion

Read data from the storage object at the specified byte offset into the specified buffer, asynchronously. When the read completes, the caller will be notified via the specified completion action.

The buffer will be retained for the duration of the read.


readCD(IOService *, UInt64, IOMemoryDescriptor *, CDSectorArea, CDSectorType, IOStorageCompletion)


public

virtual void readCD( IOService *client, UInt64 byteStart, IOMemoryDescriptor *buffer, CDSectorArea sectorArea, CDSectorType sectorType, IOStorageCompletion completion);
Parameters
client

Client requesting the read.

byteStart

Starting byte offset for the data transfer (see sectorArea parameter).

buffer

Buffer for the data transfer. The size of the buffer implies the size of the data transfer.

sectorArea

Sector area(s) to read. The sum of each area's size defines the natural block size of the media for the call. This should be taken into account when computing the address of byteStart. See IOCDTypes.h.

sectorType

Sector type that is expected. The data transfer is terminated as soon as data is encountered that does not match the expected type.

completion

Completion routine to call once the data transfer is complete.

Discussion

Read data from the CD media object at the specified byte offset into the specified buffer, asynchronously. Special areas of the CD sector can be read via this method, such as the header and subchannel data. When the read completes, the caller will be notified via the specified completion action.

The buffer will be retained for the duration of the read.


readCD(IOService *, UInt64, IOMemoryDescriptor *, CDSectorArea, CDSectorType, UInt64 *)


public

virtual IOReturn readCD( IOService *client, UInt64 byteStart, IOMemoryDescriptor *buffer, CDSectorArea sectorArea, CDSectorType sectorType, UInt64 *actualByteCount = 0);
Parameters
client

Client requesting the read.

byteStart

Starting byte offset for the data transfer (see sectorArea parameter).

buffer

Buffer for the data transfer. The size of the buffer implies the size of the data transfer.

sectorArea

Sector area(s) to read. The sum of each area's size defines the natural block size of the media for the call. This should be taken into account when computing the address of byteStart. See IOCDTypes.h.

sectorType

Sector type that is expected. The data transfer is terminated as soon as data is encountered that does not match the expected type.

actualByteCount

Returns the actual number of bytes transferred in the data transfer.

Return Value

Returns the status of the data transfer.

Discussion

Read data from the CD media object at the specified byte offset into the specified buffer, synchronously. Special areas of the CD sector can be read via this method, such as the header and subchannel data. When the read completes, this method will return to the caller. The actual byte count field is optional.


readDiscInfo


public

virtual IOReturn readDiscInfo( IOMemoryDescriptor *buffer, UInt16 *actualByteCount);
Parameters
buffer

Buffer for the data transfer. The size of the buffer implies the size of the data transfer.

actualByteCount

Returns the actual number of bytes transferred in the data transfer.

Return Value

Returns the status of the data transfer.

Discussion

Issue an MMC READ DISC INFORMATION command.


readISRC


public

virtual IOReturn readISRC( UInt8 track, CDISRC isrc);
Parameters
track

Track number from which to read the ISRC.

isrc

Buffer for the ISRC data. Buffer contents will be zero-terminated.

Return Value

Returns the status of the operation.

Discussion

Read the International Standard Recording Code for the specified track.


readMCN


public

virtual IOReturn readMCN( CDMCN mcn);
Parameters
mcn

Buffer for the MCN data. Buffer contents will be zero-terminated.

Return Value

Returns the status of the operation.

Discussion

Read the Media Catalog Number (also known as the Universal Product Code).


readTOC


public

virtual IOReturn readTOC( IOMemoryDescriptor *buffer, CDTOCFormat format, UInt8 formatAsTime, UInt8 trackOrSessionNumber, UInt16 *actualByteCount);
Parameters
buffer

Buffer for the data transfer. The size of the buffer implies the size of the data transfer.

format

As documented by MMC.

formatAsTime

As documented by MMC.

trackOrSessionNumber

As documented by MMC.

actualByteCount

Returns the actual number of bytes transferred in the data transfer.

Return Value

Returns the status of the data transfer.

Discussion

Issue an MMC READ TOC/PMA/ATIP command.


readTrackInfo


public

virtual IOReturn readTrackInfo( IOMemoryDescriptor *buffer, UInt32 address, CDTrackInfoAddressType addressType, UInt16 *actualByteCount);
Parameters
buffer

Buffer for the data transfer. The size of the buffer implies the size of the data transfer.

address

As documented by MMC.

addressType

As documented by MMC.

actualByteCount

Returns the actual number of bytes transferred in the data transfer.

Return Value

Returns the status of the data transfer.

Discussion

Issue an MMC READ TRACK INFORMATION command.


setSpeed


public

virtual IOReturn setSpeed( UInt16 kilobytesPerSecond);
Parameters
kilobytesPerSecond

Speed to be used for data transfers, in kB/s.

kCDSpeedMin specifies the minimum speed for all CD media (1X). kCDSpeedMax specifies the maximum speed supported in hardware.

Return Value

Returns the status of the operation.

Discussion

Set the speed to be used for data transfers.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2008-12-19