CdPlay

Plays back CD-DA tracks

int CdPlay (
        int mode,
        int *tracks,
        int offset
)

Arguments

mode Mode (see below)
tracks Pointer to array that specifies the track to be played. The last element must be 0.
offset Index into the tracks array where playback will begin.

Return Value

The array index of the track currently being played is returned (not the track number itself).
-1 is returned on error or if there is no song playing.

Explanation

The sequence of track numbers starting at the array element specified by tracks[offset] is played one after another. When the end of the sequence is reached, playback is repeated or ended according to the setting of mode as shown in the table below:
 
Value Description
0 Stop playback immediately.
1 The tracks specified by tracks are played consecutively, and playback is stopped when all the specified tracks have been played.
2 The tracks specified by tracks are played consecutively, and playback is returned to the start and repeated when all the specified tracks have been played.
3 The index of the tracks array for the track currently being played is returned. (No other action is taken.)

Notes

All playback is in units of tracks. Therefore, it is not possible to start or stop or playing in the middle of a track.