Use these members to query information and states for the CD audio device and the
loaded compact disc. For example, you can query and
set autoPlay and continuousPlay, and you can query the number
of tracks, the disc title, the disc identifier, and the universal product code (upc).
- currentTrack
public:
unsigned long currentTrack() const
Returns the current track.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- disableAutoPlay
public:
IMMAudioCD& disableAutoPlay()
Sets autoplay off. Autoplay causes
the CD audio device to start playing whenever a CD
is loaded.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- disableContinuousPlay
public:
IMMAudioCD& disableContinuousPlay()
Sets continuous play off. If the
continuous play is set, then the current track is repeated continuously on playback.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- discId
public:
IString discId(CallType call = wait) const
Returns the identifier of the current disc. If there is no identifier
on the CD, then it returns a null IString.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- discTitle
public:
IString discTitle() const
Returns the disc title. A null IString is returned if you have not set a title.
- Exception
IInvalidRequest
| There must be media present in the device.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- enableAutoPlay
public:
IMMAudioCD& enableAutoPlay(bool autoPlay = true)
Turns autoplay on or off. Autoplay causes
the audio CD device to start playing whenever a CD
is loaded.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- enableContinuousPlay
public:
IMMAudioCD&
enableContinuousPlay( bool continuousPlay = true )
Turns continuous play on or off. If the
continuous play is set, then the current track is repeated continuously on playback.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- isAutoPlayEnabled
public:
bool isAutoPlayEnabled() const
Returns true, if autoplay is turned on. Autoplay causes
the audio CD device to start playing whenever a CD
is loaded.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- isContinuousPlayEnabled
public:
bool isContinuousPlayEnabled() const
Returns true, if continuous play is turned on. If the
continuous play is set, then the current track is repeated continuously on playback.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- numberOfTracks
public:
unsigned long numberOfTracks(CallType call = wait) const
Returns the number of tracks.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- setDiscTitle
public:
IMMAudioCD& setDiscTitle(const IString& title)
Sets the disc's title. The disc title is stored in the currently set profile.
See
setProfile
for more information on profiles.
- Exception
IInvalidRequest
| There must be media present in the device.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- setTrackTitle
public:
IMMAudioCD&
setTrackTitle( const IString& title,
unsigned long track )
Sets the track's title. The track title is stored in the currently set profile.
See
setProfile
for more information on profiles.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- trackTitle
public:
IString trackTitle(unsigned long track) const
Returns the track's title. A null IString is
returned if you have not set a title for the passed-in track.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- upc
public:
IString upc(CallType call = wait) const
Returns the disc's universal product code (serial number). If
the disc does not contain a upc, then a null IString is returned.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
These INotificationId strings are used for all notifications that
IMMAudioCD provides to its observers.
Use these members to stop playing or scanning, start scanning or
playing, resume or pause the playback, or move the current position
to a new location.
- goToEntry
Moves the current position to the passed in location. This location
is a track number and the time into the track.
Overload 1
public:
virtual IMMAudioCD& goToEntry(unsigned long index)
Moves to the track stored in
the current program at the passed-in index. If you passed in
3, it looks up the track number in the current program at that location. If
you have not set your own program then the default program is used. This
program is a straight mapping of the tracks; for example, at index 3, track number
3 is stored. You can set your own program. For example, you could have
the following: at index 1, track 5; at index 2, track 4; and at index 3, track 6. If
you passed in index 3, this function moves the current
position to track number 6.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
Overload 2
public:
virtual IMMAudioCD&
goToEntry( IMMAudioCDContents::Cursor cursor )
Moves to the track stored in the current program at the passed-in cursor. If you passed in
a cursor that points to index 3, it looks up the track number in the current program at that location. If
you have not set your own program then the default program is used. This
program is a straight mapping of the tracks; for example, at index 3, track number
3 is stored. You can set your own program. For example, you could have
the following: at index 1, track 5; at index 2, track 4; and at index 3, track 6. If
you passed in a cursor that points to index 3, this function moves the current
position to track number 6.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- pause
public:
virtual IMMAudioCD& pause(CallType call = wait)
Pauses the audio CD device if the audio CD device is playing.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- play
public:
virtual IMMAudioCD&
play( const IMMTime& from = IMMTime ( ),
const IMMTime& to = IMMTime ( ),
bool resumeIfPaused = true,
CallType call = nowait )
Starts playing the CD device from the passed-in start position
to the passed-in end position. If from is omitted, the CD device starts playing at the current position; if
to is omitted, play stops at the end of the disc. If the resumeIfPaused boolean is true and the CD player
is paused, it resumes playing at the current location; otherwise, it starts playing
at the passed-in from location.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
IAccessError
| Invalid from position; possibly the from position is greater than the end position or the
from position is greater than the to position.
|
IAccessError
| Invalid to position; possibly the to position is greater than the contents of the CD.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- resume
public:
virtual IMMAudioCD&
resume( bool resume = true,
CallType call = wait )
Resumes playback of the compact disc from a paused state. The previous specified to parameter in the
play
function remains in effect.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- startScanningBackward
public:
IMMAudioCD& startScanningBackward()
Causes the audio CD device to search backward at high speed. If the device is
currently scanning backward, this function has no effect, but, if the device
is currently scanning forward, this causes the scanning to stop and to start
scanning backward. You can stop the scanning by calling the
stop
function, or, if the CD was playing when scanning started, the play function
stops the scanning and resumes playback at
the new location. The scanning wraps to the
end when it reaches the beginning of the compact disc.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- startScanningForward
public:
IMMAudioCD& startScanningForward()
Causes the audio CD device to search forward at high speed. If the device is
currently scanning forward, this function has no effect, but, if the device
is currently scanning backward, this causes the scanning to stop and to start
scanning forward. You can stop the scanning by calling the
stop
function, or, if the CD was playing when scanning started, the play function
stops the scanning and resumes playback at
the new location. The scanning wraps to the
beginning when it reaches the end of the compact disc.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- stop
public:
virtual IMMAudioCD& stop(CallType call = wait)
Stops playback and backward or forward scanning of the compact disc.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- trackBackward
public:
IMMAudioCD& trackBackward(unsigned long decrement = 1)
Moves the current position backwards the passed-in number of tracks. If the device
was playing, it starts playing at the new position.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- trackForward
public:
IMMAudioCD& trackForward(unsigned long increment = 1)
Moves the current position forwards the passed-in number of tracks. If the device
was playing, it starts playing at the new position.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- contents
public:
IMMAudioCDContents contents() const
Returns a copy of the CD's table of contents.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- currentContentsEntry
public:
unsigned long currentContentsEntry() const
Returns the position number of the current contents.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- profile
public:
IProfile profile() const
Returns the current profile. The profile contains one or more compact disc titles and
their IMMAudioCDContents. This can be useful if you want to retain a table of contents
for one or more compact discs. For example, you might have a demo CD that you want to
play the third track first, followed by the second, and so on. You would not want to have to
rearrange the tracks every time you loaded that CD. By storing the information in a profile,
the IMMAudioCD class can load that disc's information from the profile so you do not have to
reenter anything.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- setProfile
public:
IMMAudioCD& setProfile(IProfile& profile)
Sets a new profile. The profile contains one or more compact disc titles and
their IMMAudioCDContents. This can be useful if you want to retain a table of contents
for one or more compact discs. For example, you might have a demo CD that you want to
play the third track first, followed by the second, and so on. You would not want to have to
rearrange the tracks every time you loaded that CD. By storing the information in a profile,
the IMMAudioCD class can load that disc's information from the profile so you do not have to
reenter anything.
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
- setProgram
public:
IMMAudioCD& setProgram(const IMMAudioCDContents& program)
Sets a new table of contents. The table of contents is stored in the currently set profile. The
IMMAudioCD class plays and scans the compact disc according to
the current table of contents. This allows you create your own table of contents for the current disc.
For instance, you might want to store your compact discs (title and table of contents) in a
database. Then, when you insert a CD, you could query its ID and see if it is in your database. If
so, then you could retrieve your table of contents and set it into the device so that it always
plays back the same way.
- Exception
IAccessError
| The device identifier is not valid; possibly the device is closed.
|
IAccessError
| The device cannot acquire access to the hardware device; possibly another device of this same
type was acquired for exclusive use in this or another process.
|
IAccessError
| An internal driver error occurred.
|
IInvalidRequest
| The device must be in the open state before calling this function.
|
IInvalidRequest
| There must be media present in the device.
|
- Supported Platforms
Windows |
OS/2 |
AIX |
Yes |
Yes |
No |
Use these members to query the hard-coded table of contents stored
on the compact disc.