Cdrom

Provide a device-independent interface to an audio CD player. More...

Publicly inherits QObject.

Public Methods

Cdrom( );
booleject( );
CompactDiscID*id( );
boolpause( );
boolplay( int track );
boolresume( );
boolstatus( CdromStatus& status, int& absTime, int& volume );
boolstop( );
const char*typeConstant( int i );
const char*typeName( int i );
boolvolume( int vol );
~Cdrom( );

Public Slots

voidchangePath( );
voidchangeType( );

Private Data Members

CdromBase*_cdrom;
int_fd;
QString_typeConstants[];
QString_typeNames[];

Detailed Documentation

Provide a device-independent interface to an audio CD player.

This class is used to indirectly control a CDROM device. Only a subset of the available audio commands are provided, so that compatibility can be maintained across several different drive types. The interface is the same for both IDE and SCSI drives.

Public Methods Documentation

Cdrom ( );

Initialize the Cdrom object.

There should be only one instance of this object, mainly because there is a global pointer to it. It would not be difficult to modify this class to support multiple instances (read: multiple devices) within the same application.

bool eject ( );

Command the CDROM to eject/retract the tray.

CompactDiscID* id ( );

Query the table of contents from the CDROM.

If successful, this function returns the number of tracks on the disc, along with their absolute start times (in frames). This information can be used to (hopefully) uniquely identify the disc. If any error occurs, this function returns 0.

bool pause ( );

Command the CDROM to pause the playing disc.

bool play ( int track );

Command the CDROM to play a single track, from start to finish.

bool resume ( );

Command the CDROM to resume playing the disc.

bool status ( CdromStatus& status, int& absTime, int& volume );

Query the current audio status of the CDROM, including the current play time, and volume setting.

bool stop ( );

Command the CDROM to stop any active play/pause operation.

const char* typeConstant ( int i );

Return the constant string for the given CdromType.

This is the string that is used on the command line and in the $HOME/.xcdrc file to select the CDROM device driver class.

const char* typeName ( int i );

Return the name string for the given CdromType.

This is the string that is displayed on the Preferences window.

bool volume ( int vol );

Command the CDROM to change the volume setting.

~Cdrom ( );

Cleanup the device driver object that we created.

Public Slots Documentation

void changePath ( );

Process a change in the CDROM device path.

The open device (if any) is closed, and the new device is opened.

void changeType ( );

Process a change in the CDROM device driver.

This function destroys the old driver object (if any), and creates a new driver object of the desired type. Once created, the driver object is used to initialized the CDROM drive.


Return to Index.
Automatically generated on Dec 29 18:17