From e991cd8c53ad21af037df1e0a16816aeea2d0fe2 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Wed, 9 Jun 2010 20:09:57 +0000 Subject: - Revised abstract AudioCDManager. - Removed AudioCDManager Singleton, and changed code for using AudioCDManager in OSystem. - Added initialization code for new AudioCDManager in BaseBackend and OSystem_SDL. svn-id: r49548 --- engines/scumm/he/sound_he.cpp | 1 - engines/scumm/saveload.cpp | 9 ++++----- engines/scumm/scumm.cpp | 2 +- engines/scumm/sound.cpp | 11 +++++------ 4 files changed, 10 insertions(+), 13 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp index 7bfd1de4cf..314697869c 100644 --- a/engines/scumm/he/sound_he.cpp +++ b/engines/scumm/he/sound_he.cpp @@ -36,7 +36,6 @@ #include "common/util.h" #include "sound/decoders/adpcm.h" -#include "sound/audiocd.h" #include "sound/decoders/flac.h" #include "sound/mididrv.h" #include "sound/mixer.h" diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 7362dcd8cf..c178a883c4 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -42,7 +42,6 @@ #include "scumm/he/sprite_he.h" #include "scumm/verbs.h" -#include "sound/audiocd.h" #include "sound/mixer.h" #include "graphics/thumbnail.h" @@ -1099,7 +1098,7 @@ void ScummEngine::saveOrLoad(Serializer *s) { // as AudioCDManager::Status::playing, and MSVC6 has // a fit with that. This typedef simplifies the notation // to something MSVC6 can grasp. - typedef Audio::AudioCDManager::Status AudioCDManager_Status; + typedef AudioCDManager::Status AudioCDManager_Status; const SaveLoadEntry audioCDEntries[] = { MKLINE(AudioCDManager_Status, playing, sleUint32, VER(24)), MKLINE(AudioCDManager_Status, track, sleInt32, VER(24)), @@ -1371,15 +1370,15 @@ void ScummEngine::saveOrLoad(Serializer *s) { // Save/load the Audio CD status // if (s->getVersion() >= VER(24)) { - Audio::AudioCDManager::Status info; + AudioCDManager::Status info; if (s->isSaving()) - info = AudioCD.getStatus(); + info = _system->getAudioCD()->getStatus(); s->saveLoadArrayOf(&info, 1, sizeof(info), audioCDEntries); // If we are loading, and the music being loaded was supposed to loop // forever, then resume playing it. This helps a lot when the audio CD // is used to provide ambient music (see bug #788195). if (s->isLoading() && info.playing && info.numLoops < 0) - AudioCD.play(info.track, info.numLoops, info.start, info.duration); + _system->getAudioCD()->play(info.track, info.numLoops, info.start, info.duration); } diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index bb50ce7bb2..e348785884 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1149,7 +1149,7 @@ void ScummEngine::setupScumm() { int cd_num = ConfMan.getInt("cdrom"); if (cd_num >= 0) - _system->openCD(cd_num); + _system->getAudioCD()->openCD(cd_num); } // Create the sound manager diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 65c50aff14..1516054679 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -36,7 +36,6 @@ #include "scumm/util.h" #include "sound/decoders/adpcm.h" -#include "sound/audiocd.h" #include "sound/decoders/flac.h" #include "sound/mididrv.h" #include "sound/mixer.h" @@ -87,7 +86,7 @@ Sound::Sound(ScummEngine *parent, Audio::Mixer *mixer) Sound::~Sound() { stopCDTimer(); - AudioCD.stop(); + g_system->getAudioCD()->stop(); delete _sfxFile; } @@ -1069,7 +1068,7 @@ void Sound::playCDTrack(int track, int numLoops, int startFrame, int duration) { // Play it if (!_soundsPaused) - AudioCD.play(track, numLoops, startFrame, duration); + g_system->getAudioCD()->play(track, numLoops, startFrame, duration); // Start the timer after starting the track. Starting an MP3 track is // almost instantaneous, but a CD player may take some time. Hopefully @@ -1078,15 +1077,15 @@ void Sound::playCDTrack(int track, int numLoops, int startFrame, int duration) { } void Sound::stopCD() { - AudioCD.stop(); + g_system->getAudioCD()->stop(); } int Sound::pollCD() const { - return AudioCD.isPlaying(); + return g_system->getAudioCD()->isPlaying(); } void Sound::updateCD() { - AudioCD.updateCD(); + g_system->getAudioCD()->updateCD(); } void Sound::saveLoadWithSerializer(Serializer *ser) { -- cgit v1.2.3 From e1ef3cd9fc059ebe8c606d330173bc3f71f8dce7 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Tue, 15 Jun 2010 04:13:12 +0000 Subject: Renamed getAudioCD to getAudioCDManager. svn-id: r49678 --- engines/scumm/saveload.cpp | 4 ++-- engines/scumm/scumm.cpp | 2 +- engines/scumm/sound.cpp | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index c178a883c4..1375281aaf 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -1372,13 +1372,13 @@ void ScummEngine::saveOrLoad(Serializer *s) { if (s->getVersion() >= VER(24)) { AudioCDManager::Status info; if (s->isSaving()) - info = _system->getAudioCD()->getStatus(); + info = _system->getAudioCDManager()->getStatus(); s->saveLoadArrayOf(&info, 1, sizeof(info), audioCDEntries); // If we are loading, and the music being loaded was supposed to loop // forever, then resume playing it. This helps a lot when the audio CD // is used to provide ambient music (see bug #788195). if (s->isLoading() && info.playing && info.numLoops < 0) - _system->getAudioCD()->play(info.track, info.numLoops, info.start, info.duration); + _system->getAudioCDManager()->play(info.track, info.numLoops, info.start, info.duration); } diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index e348785884..2d83622f05 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1149,7 +1149,7 @@ void ScummEngine::setupScumm() { int cd_num = ConfMan.getInt("cdrom"); if (cd_num >= 0) - _system->getAudioCD()->openCD(cd_num); + _system->getAudioCDManager()->openCD(cd_num); } // Create the sound manager diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 1516054679..98fa3d0e4a 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -86,7 +86,7 @@ Sound::Sound(ScummEngine *parent, Audio::Mixer *mixer) Sound::~Sound() { stopCDTimer(); - g_system->getAudioCD()->stop(); + g_system->getAudioCDManager()->stop(); delete _sfxFile; } @@ -1068,7 +1068,7 @@ void Sound::playCDTrack(int track, int numLoops, int startFrame, int duration) { // Play it if (!_soundsPaused) - g_system->getAudioCD()->play(track, numLoops, startFrame, duration); + g_system->getAudioCDManager()->play(track, numLoops, startFrame, duration); // Start the timer after starting the track. Starting an MP3 track is // almost instantaneous, but a CD player may take some time. Hopefully @@ -1077,15 +1077,15 @@ void Sound::playCDTrack(int track, int numLoops, int startFrame, int duration) { } void Sound::stopCD() { - g_system->getAudioCD()->stop(); + g_system->getAudioCDManager()->stop(); } int Sound::pollCD() const { - return g_system->getAudioCD()->isPlaying(); + return g_system->getAudioCDManager()->isPlaying(); } void Sound::updateCD() { - g_system->getAudioCD()->updateCD(); + g_system->getAudioCDManager()->updateCD(); } void Sound::saveLoadWithSerializer(Serializer *ser) { -- cgit v1.2.3