ScummVM API documentation
DefaultAudioCDManager Class Reference

#include <default-audiocd.h>

Inheritance diagram for DefaultAudioCDManager:
AudioCDManager Common::NonCopyable DCCDManager SdlAudioCDManager

Public Member Functions

virtual bool open ()
 
virtual void close ()
 
virtual bool play (int track, int numLoops, int startFrame, int duration, bool onlyEmulate=false, Audio::Mixer::SoundType soundType=Audio::Mixer::kMusicSoundType)
 
virtual bool playAbsolute (int startFrame, int numLoops, int duration, bool onlyEmulate=false, Audio::Mixer::SoundType soundType=Audio::Mixer::kMusicSoundType, const char *cuesheet="disc.cue")
 
virtual void stop ()
 
virtual bool isPlaying () const
 
virtual void setVolume (byte volume)
 
virtual void setBalance (int8 balance)
 
virtual void update ()
 
virtual Status getStatus () const
 
virtual bool existExtractedCDAudioFiles (uint track)
 
virtual bool isDataAndCDAudioReadFromSameCD ()
 

Protected Member Functions

bool openRealCD ()
 
virtual bool openCD (int drive)
 
virtual bool openCD (const Common::Path &drive)
 

Protected Attributes

Audio::SoundHandle _handle
 
bool _emulating
 
Status _cd
 
Audio::Mixer_mixer
 

Detailed Description

The default audio cd manager. Implements emulation of audio cd playback.

Member Function Documentation

◆ open()

virtual bool DefaultAudioCDManager::open ( )
virtual

Initialize the specified CD drive for audio playback.

Returns
true if the CD drive was inited successfully

Implements AudioCDManager.

Reimplemented in SdlAudioCDManager.

◆ close()

virtual void DefaultAudioCDManager::close ( )
virtual

Close the currently open CD drive

Implements AudioCDManager.

Reimplemented in SdlAudioCDManager.

◆ play()

virtual bool DefaultAudioCDManager::play ( int  track,
int  numLoops,
int  startFrame,
int  duration,
bool  onlyEmulate = false,
Audio::Mixer::SoundType  soundType = Audio::Mixer::kMusicSoundType 
)
virtual

Start audio CD playback

Parameters
trackthe track to play.
numLoopshow often playback should be repeated (<=0 means infinitely often).
startFramethe frame at which playback should start (75 frames = 1 second).
durationthe number of frames to play.
onlyEmulatedetermines if the track should be emulated only
soundTypeWhat sound type to play as. By default, it's as music
Note
The onlyEmulate parameter is deprecated.
Returns
true if the track started playing, false otherwise

Implements AudioCDManager.

Reimplemented in DCCDManager, and SdlAudioCDManager.

◆ playAbsolute()

virtual bool DefaultAudioCDManager::playAbsolute ( int  startFrame,
int  numLoops,
int  duration,
bool  onlyEmulate = false,
Audio::Mixer::SoundType  soundType = Audio::Mixer::kMusicSoundType,
const char *  cuesheet = "disc.cue" 
)
virtual

Start audio CD playback at a specific absolute timestamp

Parameters
startFramethe frame at which playback should start (75 frames = 1 second).
numLoopshow often playback should be repeated (<=0 means infinitely often).
durationthe number of frames to play.
onlyEmulatedetermines if the track should be emulated only
soundTypeWhat sound type to play as. By default, it's as music
cuesheetThe name of the cuesheet to use for timing data
Note
The onlyEmulate parameter is deprecated.
Returns
true if the track started playing, false otherwise

Implements AudioCDManager.

◆ stop()

virtual void DefaultAudioCDManager::stop ( )
virtual

Stop audio playback.

Implements AudioCDManager.

Reimplemented in DCCDManager, and SdlAudioCDManager.

◆ isPlaying()

virtual bool DefaultAudioCDManager::isPlaying ( ) const
virtual

Get if audio is being played.

Returns
true if CD audio is playing

Implements AudioCDManager.

Reimplemented in DCCDManager, and SdlAudioCDManager.

◆ setVolume()

virtual void DefaultAudioCDManager::setVolume ( byte  volume)
virtual

Set the audio volume

Implements AudioCDManager.

◆ setBalance()

virtual void DefaultAudioCDManager::setBalance ( int8  balance)
virtual

Set the speakers balance

Implements AudioCDManager.

◆ update()

virtual void DefaultAudioCDManager::update ( )
virtual

Update audio status.

Implements AudioCDManager.

Reimplemented in SdlAudioCDManager.

◆ getStatus()

virtual Status DefaultAudioCDManager::getStatus ( ) const
virtual

Get the playback status.

Returns
a Status struct with playback data.

Implements AudioCDManager.

◆ existExtractedCDAudioFiles()

virtual bool DefaultAudioCDManager::existExtractedCDAudioFiles ( uint  track)
virtual

Checks whether the extracted audio cd tracks exists as files in the search paths.

Returns
true if audio files of the expected naming scheme are found, and supported by ScummVM.

Implements AudioCDManager.

◆ isDataAndCDAudioReadFromSameCD()

virtual bool DefaultAudioCDManager::isDataAndCDAudioReadFromSameCD ( )
inlinevirtual

Checks if game data are read from the same CD drive which should also play game CD audio.

Returns
true, if this case is applicable, and the system doesn't allow it.

Implements AudioCDManager.

◆ openRealCD()

bool DefaultAudioCDManager::openRealCD ( )
protected

Open a CD using the cdrom config variable

◆ openCD() [1/2]

virtual bool DefaultAudioCDManager::openCD ( int  drive)
inlineprotectedvirtual

Open a CD using the specified drive index

Parameters
driveThe index of the drive
Note
The index is implementation-defined, but 0 is always the best choice

Reimplemented in SdlAudioCDManager.

◆ openCD() [2/2]

virtual bool DefaultAudioCDManager::openCD ( const Common::Path drive)
inlineprotectedvirtual

Open a CD from a specific drive

Parameters
driveThe name of the drive/path
Note
The drive parameter is platform-specific

The documentation for this class was generated from the following file: