Functions



audioPause

Abstract: Pause or resume the audio playback.
public:

virtual IOReturn audioPause(bool pause);

Parameters

NameDescription
pauseTrue to pause playback; False to resume.

audioPlay

Abstract: Play audio.
public:

virtual IOReturn audioPlay(positioningType addressType,cdAddress address, audioPlayMode mode);

Parameters

NameDescription
addressTypeThe type of positioning address. See positioningType for details.
addressThe position from which to begin.
modeThe mode for playing the audio. See audioPlayMode for details.

audioScan

Abstract: Perform a fast-forward or fast-backward operation.
public:

virtual IOReturn audioScan(positioningType addressType,cdAddress address,bool reverse);

Parameters

NameDescription
addressTypeThe type of positioning address. See positioningType for details.
addressThe position from which to begin.
reverseTrue to go backward; False to go forward.

audioTrackSearch

Abstract: Position the optical pick-up at the specified audio address.
public:

virtual IOReturn audioTrackSearch(positioningType addressType,cdAddress address, bool startPlay,audioPlayMode mode);

Parameters

NameDescription
addressTypeThe type of positioning address. See positioningType for details.
addressThe position from which to begin.
startPlayTrue to begin playing audio after positioning; False to enter the pause state.
modeThe mode for playing the audio. See audioPlayMode for details.

convertMSFToLba

Abstract: Convert an MM:SS:FF value to a Logical Block Address
protected:

virtual IOReturn convertMSFToLba(UInt32 *lba,cdAddress address);

Parameters

NameDescription
lbaA pointer to the returned LBA.
addressThe address to convert from MM:SS:FF format.

deviceTypeMatches

Abstract: Determine if the device type matches that which we expect.
public:

virtual bool deviceTypeMatches(UInt8 inqBuf[],UInt32 inqLen);

This override allows us to check for the SCSI CD-ROM device type instead of hard disk. See IOBasicSCSI for details.


doAudioPlayCommand

Abstract: Issue an audio play command to the device.
protected:

virtual IOReturn doAudioPlayCommand(positioningType startType,cdAddress startAddress, positioningType endType,cdAddress endAddress);

Parameters

NameDescription
startTypeThe type of positioning address. See positioningType for details.
startAddressThe position from which to begin.
endTypeThe type of positioning address. See positioningType for details.
endAddressThe position at which to end.

getAudioStatus

Abstract: Return the current audio play status information.
public:

virtual IOReturn getAudioStatus(struct audioStatus *status);

Parameters

NameDescription
statusThe buffer for the returned information.

getDeviceTypeName

Abstract: Return a character string for the device type.
public:

virtual const char * getDeviceTypeName(void);

This override returns kDeviceTypeCDROM.


initAudioModes

Abstract: Initialize audio modes for the device when media is changed.
protected:

virtual void initAudioModes(void);


instantiateNub

Abstract: Create the device nub.
public:

virtual IOService * instantiateNub(void);

This override instantiates an IOSCSICDDriveNub instead of an IOSCSIHDDriveNub.


mediaGone

Abstract: React to media going away.
protected:

virtual void mediaGone(void);


playModeToDriveBits

Abstract: Convert an audioPlayMode value to the format used by the device.
protected:

virtual UInt8 playModeToDriveBits(audioPlayMode mode,channel chan);

Parameters

NameDescription
modeThe audioPlayMode value to be converted.
chanThe desired audio channel.

readAudioData

Abstract: Read audio data blocks.
public:

virtual IOReturn readAudioData(positioningType addressType,cdAddress address, UInt8 blockCount,UInt8 *buffer);

Parameters

NameDescription
addressTypeThe type of positioning address. See positioningType for details.
addressThe position from which to begin.
blockCountThe number of blocks to read.
bufferThe buffer for the data.

readAudioSubcodes

Abstract: Read audio subcodes only.
public:

virtual IOReturn readAudioSubcodes(positioningType addressType,cdAddress address, UInt8 blockCount,UInt8 *buffer);

Parameters

NameDescription
addressTypeThe type of positioning address. See positioningType for details.
addressThe position from which to begin.
blockCountThe number of blocks to read.
bufferThe buffer for the data.

readAudioVolume

Abstract: Read the current audio volume.
public:

virtual IOReturn readAudioVolume(UInt8 *leftVolume,UInt8 *rightVolume);

Parameters

NameDescription
leftVolumeA pointer to the returned left-channel volume.
rightVolumeA pointer to the returned right-channel volume.

readAudioWithAllSubcodes

Abstract: Read audio data along with all subcodes.
public:

virtual IOReturn readAudioWithAllSubcodes(positioningType addressType,cdAddress address, UInt8 blockCount,UInt8 *buffer);

Parameters

NameDescription
addressTypeThe type of positioning address. See positioningType for details.
addressThe position from which to begin.
blockCountThe number of blocks to read.
bufferThe buffer for the data.

readAudioWithQSubcode

Abstract: Read audio blocks along with the Q subcode.
public:

virtual IOReturn readAudioWithQSubcode(positioningType addressType,cdAddress address, UInt8 blockCount,UInt8 *buffer);

Parameters

NameDescription
addressTypeThe type of positioning address. See positioningType for details.
addressThe position from which to begin.
blockCountThe number of blocks to read.
bufferThe buffer for the data.

readHeader

Abstract: Read the header for the specified logical block.
public:

virtual IOReturn readHeader(UInt32 blockAddress,struct headerInfo *buffer);

Parameters

NameDescription
addressThe logical block from which to read the header data.
bufferThe buffer for the header data.

readISRC

Abstract: Read the ISRC data for the disc.
public:

virtual IOReturn readISRC(UInt32 track,UInt8 *buffer,bool *found);

Parameters

NameDescription
trackThe track number from which to read the ISRC.
bufferThe buffer for the ISRC data.
foundA pointer to the result: True if the ISRC was found, else False.

readISRCMCN

Abstract: Perform the command necessary to read ISRC or MCN data.
protected:

virtual IOReturn readISRCMCN(UInt8 dataformat,UInt32 track,UInt8 *buffer,bool *found);

Parameters

NameDescription
dataformatThe desired data format: ISRC or MCN.
trackThe desired track from which to read the data
bufferThe buffer for the data.
foundA pointer to the result: True if the item was found; false if not.

readMCN

Abstract: Read the MCN (Media Catalog Number) for the disc.
public:

virtual IOReturn readMCN(UInt8 *buffer,bool *found);

Parameters

NameDescription
bufferThe buffer for the MCN data.
foundA pointer to the result: True if the ISRC was found, else False.

readQSubcodes

Abstract: Read the Q subcode entries in the lead-in areas of the disc.
public:

virtual IOReturn readQSubcodes(struct qSubcodeTocInfo *buffer,UInt32 bufSize);

Parameters

NameDescription
bufferThe buffer for the returned data
bufSizeThe size of the buffer in bytes.

readSubchannel

Abstract: Issue the command necessary to read subchannel data.
protected:

virtual IOReturn readSubchannel(UInt8 *buffer,UInt32 length,UInt8 track,UInt8 dataFormat);

Parameters

NameDescription
bufferThe buffer for the data.
lengthThe maximum data length desired.
trackThe desired track from which to read the data
dataFormatThe subchannel data desired.

readSubcodeBuffer

Abstract: Read the device subcode buffer while audio is playing.
public:

virtual IOReturn readSubcodeBuffer(UInt8 *buffer,bool purge,UInt32 entryCount);

Parameters

NameDescription
bufferThe buffer for the returned data
purgeTrue if the buffer should be purged before doing the read.
entryCountThe number of consecutive subcode blocks (96 bytes each) to return.

readTOC

Abstract: Read the entire Table Of Contents (TOC) for the disc.
public:

virtual IOReturn readTOC(struct rawToc *buffer,UInt32 length,tocFormat format);

Parameters

NameDescription
bufferThe buffer for the returned data
lengthThe maximum length of the buffer.
formatThe desired TOC format desired. See tocFormat for details.

readTheQSubcode

Abstract: Read the Q-subcode information for the current track.
public:

virtual IOReturn readTheQSubcode(struct qSubcode *buffer);

Parameters

NameDescription
bufferThe buffer for the returned data

reportMediaState

Abstract: Report the device's media state.
public:

virtual IOReturn reportMediaState(bool *mediaPresent,bool *changed);

This override allows us to reset device settings when media changes.


seek

Abstract: Issue the command necessary to position the device at the specified LBA.
protected:

virtual IOReturn seek(UInt32 lba);

Parameters

NameDescription
lbaThe desired Logical Block Address at which to position the device.

setAudioStopAddress

Abstract: Set the address at which the device is to stop playing audio.
public:

virtual IOReturn setAudioStopAddress(positioningType addressType,cdAddress address);

Parameters

NameDescription
addressTypeThe type of positioning address. See positioningType for details.
addressThe position from which to begin.

setDefaultAudioModes

Abstract: Set the device audio modes to the default.
protected:

virtual IOReturn setDefaultAudioModes(void);

This method calls initAudioModes and then sets volume to the max.


setVolume

Abstract: Set the audio volume.
public:

virtual IOReturn setVolume(UInt8 leftVolume,UInt8 rightVolume);

Parameters

NameDescription
leftVolumeThe desired left-channel volume.
rightVolumeThe desired right-channel volume.

© 2000 Apple Computer, Inc. — (Last Updated 2/23/2000)