ScummVM API documentation
DefaultAudioCDManager Class Reference

#include <default-audiocd.h>

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

Public Member Functions

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

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()

bool DefaultAudioCDManager::open ( )
overridevirtual

Initialize the specified CD drive for audio playback.

Returns
true if the CD drive was inited successfully

Implements AudioCDManager.

Reimplemented in SdlAudioCDManager.

◆ close()

void DefaultAudioCDManager::close ( )
overridevirtual

Close the currently open CD drive

Implements AudioCDManager.

Reimplemented in SdlAudioCDManager.

◆ play()

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

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()

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

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()

void DefaultAudioCDManager::stop ( )
overridevirtual

Stop audio playback.

Implements AudioCDManager.

Reimplemented in DCCDManager, and SdlAudioCDManager.

◆ isPlaying()

bool DefaultAudioCDManager::isPlaying ( ) const
overridevirtual

Get if audio is being played.

Returns
true if CD audio is playing

Implements AudioCDManager.

Reimplemented in DCCDManager, and SdlAudioCDManager.

◆ setVolume()

void DefaultAudioCDManager::setVolume ( byte  volume)
overridevirtual

Set the audio volume

Implements AudioCDManager.

◆ setBalance()

void DefaultAudioCDManager::setBalance ( int8  balance)
overridevirtual

Set the speakers balance

Implements AudioCDManager.

◆ update()

void DefaultAudioCDManager::update ( )
overridevirtual

Update audio status.

Implements AudioCDManager.

Reimplemented in SdlAudioCDManager.

◆ getStatus()

Status DefaultAudioCDManager::getStatus ( ) const
overridevirtual

Get the playback status.

Returns
a Status struct with playback data.

Implements AudioCDManager.

◆ existExtractedCDAudioFiles()

bool DefaultAudioCDManager::existExtractedCDAudioFiles ( uint  track)
overridevirtual

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()

bool DefaultAudioCDManager::isDataAndCDAudioReadFromSameCD ( )
inlineoverridevirtual

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 AtariAudioCDManager, and 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: