aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/agos.cpp3
-rw-r--r--engines/agos/event.cpp6
-rw-r--r--engines/agos/res_snd.cpp7
-rw-r--r--engines/drascula/drascula.cpp2
-rw-r--r--engines/drascula/sound.cpp13
-rw-r--r--engines/engine.cpp5
-rw-r--r--engines/gob/gob.cpp2
-rw-r--r--engines/gob/sound/cdrom.cpp5
-rw-r--r--engines/groovie/groovie.cpp2
-rw-r--r--engines/groovie/music.cpp15
-rw-r--r--engines/kyra/sound_towns.cpp27
-rw-r--r--engines/made/made.cpp7
-rw-r--r--engines/made/made.h1
-rw-r--r--engines/made/scriptfuncs.cpp13
-rw-r--r--engines/saga/music.h2
-rw-r--r--engines/sci/engine/workarounds.cpp1
-rw-r--r--engines/sci/sound/audio.cpp11
-rw-r--r--engines/scumm/he/sound_he.cpp1
-rw-r--r--engines/scumm/saveload.cpp9
-rw-r--r--engines/scumm/scumm.cpp2
-rw-r--r--engines/scumm/sound.cpp11
-rw-r--r--engines/teenagent/teenagent.cpp3
-rw-r--r--engines/tinsel/music.cpp9
-rw-r--r--engines/tinsel/tinsel.cpp7
24 files changed, 71 insertions, 93 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 670c701198..c5841ff05e 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -41,7 +41,6 @@
#include "sound/mididrv.h"
#include "sound/mods/protracker.h"
-#include "sound/audiocd.h"
using Common::File;
@@ -903,7 +902,7 @@ AGOSEngine::~AGOSEngine() {
_midi.close();
delete _driver;
- AudioCD.stop();
+ _system->getAudioCDManager()->stop();
for (uint i = 0; i < _itemHeap.size(); i++) {
delete[] _itemHeap[i];
diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp
index 95c9db906a..32c26752a2 100644
--- a/engines/agos/event.cpp
+++ b/engines/agos/event.cpp
@@ -36,8 +36,6 @@
#include "graphics/surface.h"
-#include "sound/audiocd.h"
-
namespace AGOS {
void AGOSEngine::addTimeEvent(uint16 timeout, uint16 subroutine_id) {
@@ -429,7 +427,7 @@ void AGOSEngine::delay(uint amount) {
uint32 cur = start;
uint this_delay, vgaPeriod;
- AudioCD.updateCD();
+ _system->getAudioCDManager()->updateCD();
_debugger->onFrame();
@@ -534,7 +532,7 @@ void AGOSEngine::delay(uint amount) {
if (_leftButton == 1)
_leftButtonCount++;
- AudioCD.updateCD();
+ _system->getAudioCDManager()->updateCD();
_system->updateScreen();
diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp
index 6e54d926c4..c6417962fb 100644
--- a/engines/agos/res_snd.cpp
+++ b/engines/agos/res_snd.cpp
@@ -30,7 +30,6 @@
#include "agos/agos.h"
#include "agos/vga.h"
-#include "sound/audiocd.h"
#include "sound/audiostream.h"
#include "sound/mididrv.h"
#include "sound/mods/protracker.h"
@@ -228,9 +227,9 @@ void AGOSEngine_Simon1::playMusic(uint16 music, uint16 track) {
stopMusic();
// Support for compressed music from the ScummVM Music Enhancement Project
- AudioCD.stop();
- AudioCD.play(music + 1, -1, 0, 0);
- if (AudioCD.isPlaying())
+ _system->getAudioCDManager()->stop();
+ _system->getAudioCDManager()->play(music + 1, -1, 0, 0);
+ if (_system->getAudioCDManager()->isPlaying())
return;
if (getPlatform() == Common::kPlatformAmiga) {
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 7e9f68a355..7c87f3574d 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -101,7 +101,7 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam
int cd_num = ConfMan.getInt("cdrom");
if (cd_num >= 0)
- _system->openCD(cd_num);
+ _system->getAudioCDManager()->openCD(cd_num);
_lang = kEnglish;
diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp
index ad9ec6ca5e..2233115f3d 100644
--- a/engines/drascula/sound.cpp
+++ b/engines/drascula/sound.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "sound/audiocd.h"
#include "sound/audiostream.h"
#include "sound/mixer.h"
#include "sound/decoders/raw.h"
@@ -123,20 +122,20 @@ void DrasculaEngine::finishSound() {
}
void DrasculaEngine::playMusic(int p) {
- AudioCD.stop();
- AudioCD.play(p - 1, 1, 0, 0);
+ _system->getAudioCDManager()->stop();
+ _system->getAudioCDManager()->play(p - 1, 1, 0, 0);
}
void DrasculaEngine::stopMusic() {
- AudioCD.stop();
+ _system->getAudioCDManager()->stop();
}
void DrasculaEngine::updateMusic() {
- AudioCD.updateCD();
+ _system->getAudioCDManager()->updateCD();
}
int DrasculaEngine::musicStatus() {
- return AudioCD.isPlaying();
+ return _system->getAudioCDManager()->isPlaying();
}
void DrasculaEngine::stopSound() {
@@ -157,7 +156,7 @@ void DrasculaEngine::MusicFadeout() {
_system->updateScreen();
_system->delayMillis(50);
}
- AudioCD.stop();
+ _system->getAudioCDManager()->stop();
_system->delayMillis(100);
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, org_vol);
}
diff --git a/engines/engine.cpp b/engines/engine.cpp
index e2c0bb79f3..627de87723 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -154,10 +154,7 @@ void initCommonGFX(bool defaultTo1XScaler) {
// See if the game should default to 1x scaler
if (useDefaultGraphicsMode && defaultTo1XScaler) {
- // FIXME: As a hack, we use "1x" here. Would be nicer to use
- // getDefaultGraphicsMode() instead, but right now, we do not specify
- // whether that is a 1x scaler or not...
- g_system->setGraphicsMode("1x");
+ g_system->resetGraphicsScale();
} else {
// Override global scaler with any game-specific define
if (ConfMan.hasKey("gfx_mode")) {
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index f904c8c802..03c0b1d991 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -248,7 +248,7 @@ Common::Error GobEngine::run() {
int cd_num = ConfMan.getInt("cdrom");
if (cd_num >= 0)
- _system->openCD(cd_num);
+ _system->getAudioCDManager()->openCD(cd_num);
_global->_debugFlag = 1;
_video->_doRangeClamp = true;
diff --git a/engines/gob/sound/cdrom.cpp b/engines/gob/sound/cdrom.cpp
index 8f0b1df23e..ec7da29fdb 100644
--- a/engines/gob/sound/cdrom.cpp
+++ b/engines/gob/sound/cdrom.cpp
@@ -25,7 +25,6 @@
#include "common/endian.h"
#include "common/util.h"
-#include "sound/audiocd.h"
#include "gob/gob.h"
#include "gob/sound/cdrom.h"
@@ -116,7 +115,7 @@ void CDROM::play(uint32 from, uint32 to) {
// HSG encodes frame information into a double word:
// minute multiplied by 4500, plus second multiplied by 75,
// plus frame, minus 150
- AudioCD.play(1, 1, from, to - from + 1);
+ g_system->getAudioCDManager()->play(1, 1, from, to - from + 1);
_cdPlaying = true;
}
@@ -161,7 +160,7 @@ void CDROM::stopPlaying() {
void CDROM::stop() {
_curTrackBuffer = 0;
- AudioCD.stop();
+ g_system->getAudioCDManager()->stop();
_cdPlaying = false;
}
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index cdf5171ab9..82eda1efe2 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -217,7 +217,7 @@ Common::Error GroovieEngine::run() {
// Initialize the CD
int cd_num = ConfMan.getInt("cdrom");
if (cd_num >= 0)
- _system->openCD(cd_num);
+ _system->getAudioCDManager()->openCD(cd_num);
while (!shouldQuit()) {
// Give the debugger a chance to act
diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp
index 6959a6a6f1..34b180a68e 100644
--- a/engines/groovie/music.cpp
+++ b/engines/groovie/music.cpp
@@ -29,7 +29,6 @@
#include "common/config-manager.h"
#include "common/macresman.h"
-#include "sound/audiocd.h"
#include "sound/midiparser.h"
namespace Groovie {
@@ -42,7 +41,7 @@ MusicPlayer::MusicPlayer(GroovieEngine *vm) :
}
MusicPlayer::~MusicPlayer() {
- AudioCD.stop();
+ g_system->getAudioCDManager()->stop();
}
void MusicPlayer::playSong(uint32 fileref) {
@@ -90,7 +89,7 @@ void MusicPlayer::playCD(uint8 track) {
// the song number (it's track 2 on the 2nd CD)
} else if ((track == 98) && (_prevCDtrack == 3)) {
// Track 98 is used as a hack to stop the credits song
- AudioCD.stop();
+ g_system->getAudioCDManager()->stop();
return;
}
@@ -101,20 +100,20 @@ void MusicPlayer::playCD(uint8 track) {
// It was in the original interpreter, but it introduces a big delay
// in the middle of the introduction, so it's disabled right now
/*
- AudioCD.updateCD();
- while (AudioCD.isPlaying()) {
+ g_system->getAudioCDManager()->updateCD();
+ while (g_system->getAudioCDManager()->isPlaying()) {
// Wait a bit and try again
_vm->_system->delayMillis(100);
- AudioCD.updateCD();
+ g_system->getAudioCDManager()->updateCD();
}
*/
// Play the track starting at the requested offset (1000ms = 75 frames)
- AudioCD.play(track - 1, 1, startms * 75 / 1000, 0);
+ g_system->getAudioCDManager()->play(track - 1, 1, startms * 75 / 1000, 0);
// If the audio is not playing from the CD, play the "fallback" MIDI.
// The Mac version has no CD tracks, so it will always use the MIDI.
- if (!AudioCD.isPlaying()) {
+ if (!g_system->getAudioCDManager()->isPlaying()) {
if (track == 2) {
// Intro MIDI fallback
if (_vm->getPlatform() == Common::kPlatformMacintosh)
diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp
index 95e2a5e63f..8d01d47262 100644
--- a/engines/kyra/sound_towns.cpp
+++ b/engines/kyra/sound_towns.cpp
@@ -30,7 +30,6 @@
#include "kyra/sound_intern.h"
#include "kyra/screen.h"
-#include "sound/audiocd.h"
#include "sound/audiostream.h"
#include "sound/decoders/raw.h"
@@ -46,7 +45,7 @@ SoundTowns::SoundTowns(KyraEngine_v1 *vm, Audio::Mixer *mixer)
}
SoundTowns::~SoundTowns() {
- AudioCD.stop();
+ g_system->getAudioCDManager()->stop();
haltTrack();
delete[] _musicTrackData;
delete[] _sfxFileData;
@@ -72,7 +71,7 @@ bool SoundTowns::init() {
}
void SoundTowns::process() {
- AudioCD.updateCD();
+ g_system->getAudioCDManager()->updateCD();
}
void SoundTowns::playTrack(uint8 track) {
@@ -93,8 +92,8 @@ void SoundTowns::playTrack(uint8 track) {
if (_musicEnabled == 2 && trackNum != -1) {
_driver->cdaSetVolume(1, 118, 118);
- AudioCD.play(trackNum+1, loop ? -1 : 1, 0, 0);
- AudioCD.updateCD();
+ g_system->getAudioCDManager()->play(trackNum + 1, loop ? -1 : 1, 0, 0);
+ g_system->getAudioCDManager()->updateCD();
_cdaPlaying = true;
} else if (_musicEnabled) {
playEuphonyTrack(READ_LE_UINT32(&tTable[tTableIndex]), loop);
@@ -106,8 +105,8 @@ void SoundTowns::playTrack(uint8 track) {
void SoundTowns::haltTrack() {
_lastTrack = -1;
- AudioCD.stop();
- AudioCD.updateCD();
+ g_system->getAudioCDManager()->stop();
+ g_system->getAudioCDManager()->updateCD();
_cdaPlaying = false;
for (int i = 0; i < 6; i++)
@@ -434,8 +433,8 @@ void SoundPC98::playTrack(uint8 track) {
void SoundPC98::haltTrack() {
_lastTrack = -1;
- AudioCD.stop();
- AudioCD.updateCD();
+ g_system->getAudioCDManager()->stop();
+ g_system->getAudioCDManager()->updateCD();
_driver->reset();
}
@@ -518,7 +517,7 @@ void SoundTownsPC98_v2::loadSoundFile(Common::String file) {
}
void SoundTownsPC98_v2::process() {
- AudioCD.updateCD();
+ g_system->getAudioCDManager()->updateCD();
}
void SoundTownsPC98_v2::playTrack(uint8 track) {
@@ -555,8 +554,8 @@ void SoundTownsPC98_v2::playTrack(uint8 track) {
_driver->loadMusicData(_musicTrackData, true);
if (_musicEnabled == 2 && trackNum != -1) {
- AudioCD.play(trackNum+1, _driver->looping() ? -1 : 1, 0, 0);
- AudioCD.updateCD();
+ g_system->getAudioCDManager()->play(trackNum+1, _driver->looping() ? -1 : 1, 0, 0);
+ g_system->getAudioCDManager()->updateCD();
} else if (_musicEnabled) {
_driver->cont();
}
@@ -566,8 +565,8 @@ void SoundTownsPC98_v2::playTrack(uint8 track) {
void SoundTownsPC98_v2::haltTrack() {
_lastTrack = -1;
- AudioCD.stop();
- AudioCD.updateCD();
+ g_system->getAudioCDManager()->stop();
+ g_system->getAudioCDManager()->updateCD();
_driver->reset();
}
diff --git a/engines/made/made.cpp b/engines/made/made.cpp
index 94926014d3..20b4dc1e1b 100644
--- a/engines/made/made.cpp
+++ b/engines/made/made.cpp
@@ -38,7 +38,6 @@
#include "base/plugins.h"
#include "base/version.h"
-#include "sound/audiocd.h"
#include "sound/mixer.h"
#include "made/made.h"
@@ -81,7 +80,7 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng
int cd_num = ConfMan.getInt("cdrom");
if (cd_num >= 0)
- _system->openCD(cd_num);
+ _system->getAudioCDManager()->openCD(cd_num);
_pmvPlayer = new PmvPlayer(this, _mixer);
_res = new ResourceReader();
@@ -129,7 +128,7 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng
}
MadeEngine::~MadeEngine() {
- AudioCD.stop();
+ _system->getAudioCDManager()->stop();
delete _rnd;
delete _pmvPlayer;
@@ -241,7 +240,7 @@ void MadeEngine::handleEvents() {
}
}
- AudioCD.updateCD();
+ _system->getAudioCDManager()->updateCD();
}
diff --git a/engines/made/made.h b/engines/made/made.h
index 08f9add33d..553476540a 100644
--- a/engines/made/made.h
+++ b/engines/made/made.h
@@ -42,7 +42,6 @@
#include "sound/audiostream.h"
#include "sound/mixer.h"
#include "sound/decoders/voc.h"
-#include "sound/audiocd.h"
#include "engines/engine.h"
diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp
index 8d01ec70f3..2f069e882e 100644
--- a/engines/made/scriptfuncs.cpp
+++ b/engines/made/scriptfuncs.cpp
@@ -27,7 +27,6 @@
#include "common/util.h"
#include "common/events.h"
#include "graphics/cursorman.h"
-#include "sound/audiocd.h"
#include "sound/softsynth/pcspk.h"
#include "made/made.h"
@@ -654,9 +653,9 @@ int16 ScriptFunctions::sfPlayVoice(int16 argc, int16 *argv) {
}
int16 ScriptFunctions::sfPlayCd(int16 argc, int16 *argv) {
- AudioCD.play(argv[0] - 1, 1, 0, 0);
+ g_system->getAudioCDManager()->play(argv[0] - 1, 1, 0, 0);
_vm->_cdTimeStart = _vm->_system->getMillis();
- if (AudioCD.isPlaying()) {
+ if (g_system->getAudioCDManager()->isPlaying()) {
return 1;
} else {
return 0;
@@ -664,8 +663,8 @@ int16 ScriptFunctions::sfPlayCd(int16 argc, int16 *argv) {
}
int16 ScriptFunctions::sfStopCd(int16 argc, int16 *argv) {
- if (AudioCD.isPlaying()) {
- AudioCD.stop();
+ if (g_system->getAudioCDManager()->isPlaying()) {
+ g_system->getAudioCDManager()->stop();
return 1;
} else {
return 0;
@@ -673,11 +672,11 @@ int16 ScriptFunctions::sfStopCd(int16 argc, int16 *argv) {
}
int16 ScriptFunctions::sfGetCdStatus(int16 argc, int16 *argv) {
- return AudioCD.isPlaying() ? 1 : 0;
+ return g_system->getAudioCDManager()->isPlaying() ? 1 : 0;
}
int16 ScriptFunctions::sfGetCdTime(int16 argc, int16 *argv) {
- if (AudioCD.isPlaying()) {
+ if (g_system->getAudioCDManager()->isPlaying()) {
uint32 deltaTime = _vm->_system->getMillis() - _vm->_cdTimeStart;
// This basically converts the time from milliseconds to MSF format to MADE's format
return (deltaTime / 1000 * 30) + (deltaTime % 1000 / 75 * 30 / 75);
diff --git a/engines/saga/music.h b/engines/saga/music.h
index 5cce3d4c04..f3b0f177b0 100644
--- a/engines/saga/music.h
+++ b/engines/saga/music.h
@@ -28,7 +28,7 @@
#ifndef SAGA_MUSIC_H
#define SAGA_MUSIC_H
-#include "sound/audiocd.h"
+#include "sound/mixer.h"
#include "sound/mididrv.h"
#include "sound/midiparser.h"
#include "sound/decoders/mp3.h"
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index e153fadca5..bc6d457f7f 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -84,7 +84,6 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
{ GID_HOYLE3, -1, 0, 1, "Character", "say", -1, 504, { WORKAROUND_FAKE, 0 } }, // when starting checkers or dominoes, first time a character says something
{ GID_HOYLE3, -1, 0, 1, "Character", "say", -1, 505, { WORKAROUND_FAKE, 0 } }, // when starting checkers or dominoes, first time a character says something
{ GID_HOYLE3, -1, 700, 0, "gcWindow", "open", -1, -1, { WORKAROUND_FAKE, 0 } }, // when entering control menu
- { GID_HOYLE3, 100, 100, 0, "dominoHand2", "cue", -1, 1, { WORKAROUND_FAKE, 0 } }, // while playing domino - bug #3036918
{ GID_HOYLE4, -1, 0, 0, "gcWindow", "open", -1, -1, { WORKAROUND_FAKE, 0 } }, // when selecting "Control" from the menu (temp vars 0-3) - bug #3039294
{ GID_HOYLE4, 910, 910, 0, "IconBarList", "setup", -1, 3, { WORKAROUND_FAKE, 0 } }, // when selecting "Tutorial" from the main menu - bug #3039294
{ GID_ISLANDBRAIN, 140, 140, 0, "piece", "init", -1, 3, { WORKAROUND_FAKE, 1 } }, // first puzzle right at the start, some initialization variable. bnt is done on it, and it should be non-0
diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp
index 4a2a8e65d7..640273c20e 100644
--- a/engines/sci/sound/audio.cpp
+++ b/engines/sci/sound/audio.cpp
@@ -32,7 +32,6 @@
#include "common/file.h"
#include "common/system.h"
-#include "sound/audiocd.h"
#include "sound/audiostream.h"
#include "sound/decoders/aiff.h"
#include "sound/decoders/flac.h"
@@ -413,7 +412,7 @@ int AudioPlayer::audioCdPlay(int track, int start, int duration) {
// Subtract one from track. KQ6 starts at track 1, while ScummVM
// ignores the data track and considers track 2 to be track 1.
- AudioCD.play(track - 1, 1, start, duration);
+ g_system->getAudioCDManager()->play(track - 1, 1, start, duration);
return 1;
} else {
// Jones in the Fast Lane CD Audio format
@@ -436,7 +435,7 @@ int AudioPlayer::audioCdPlay(int track, int start, int duration) {
// Jones uses the track as the resource value in the map
if (res == track) {
- AudioCD.play(1, 1, startFrame, length);
+ g_system->getAudioCDManager()->play(1, 1, startFrame, length);
_audioCdStart = g_system->getMillis();
break;
}
@@ -450,16 +449,16 @@ int AudioPlayer::audioCdPlay(int track, int start, int duration) {
void AudioPlayer::audioCdStop() {
_audioCdStart = 0;
- AudioCD.stop();
+ g_system->getAudioCDManager()->stop();
}
void AudioPlayer::audioCdUpdate() {
- AudioCD.updateCD();
+ g_system->getAudioCDManager()->update();
}
int AudioPlayer::audioCdPosition() {
// Return -1 if the sample is done playing. Converting to frames to compare.
- if (((g_system->getMillis() - _audioCdStart) * 75 / 1000) >= (uint32)AudioCD.getStatus().duration)
+ if (((g_system->getMillis() - _audioCdStart) * 75 / 1000) >= (uint32)g_system->getAudioCDManager()->getStatus().duration)
return -1;
// Return the position otherwise (in ticks).
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 3cc619f630..81762d87a8 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"
@@ -1103,7 +1102,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)),
@@ -1375,15 +1374,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->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)
- AudioCD.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 fc95060b6f..ab7be02c48 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->getAudioCDManager()->openCD(cd_num);
}
// Create the sound manager
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index a845f623c2..840f8fc779 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->getAudioCDManager()->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->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
@@ -1078,15 +1077,15 @@ void Sound::playCDTrack(int track, int numLoops, int startFrame, int duration) {
}
void Sound::stopCD() {
- AudioCD.stop();
+ g_system->getAudioCDManager()->stop();
}
int Sound::pollCD() const {
- return AudioCD.isPlaying();
+ return g_system->getAudioCDManager()->isPlaying();
}
void Sound::updateCD() {
- AudioCD.updateCD();
+ g_system->getAudioCDManager()->updateCD();
}
void Sound::saveLoadWithSerializer(Serializer *ser) {
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index c30809eef4..f1527fc78d 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -31,7 +31,6 @@
#include "engines/advancedDetector.h"
#include "engines/util.h"
-#include "sound/audiocd.h"
#include "sound/mixer.h"
#include "sound/decoders/raw.h"
@@ -983,7 +982,7 @@ void TeenAgentEngine::setMusic(byte id) {
}
byte track = track2cd[id - 1];
debug(0, "playing cd track %u", track);
- Audio::AudioCDManager::instance().play(track, -1, 0, 0);
+ _system->getAudioCDManager()->play(track, -1, 0, 0);
} else if (music->load(id))
music->start();
}
diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp
index cef7f0a781..cb246bc8b3 100644
--- a/engines/tinsel/music.cpp
+++ b/engines/tinsel/music.cpp
@@ -30,7 +30,6 @@
#include "sound/audiostream.h"
#include "sound/mididrv.h"
#include "sound/midiparser.h"
-#include "sound/audiocd.h"
#include "sound/decoders/adpcm.h"
#include "common/config-manager.h"
#include "common/file.h"
@@ -212,11 +211,11 @@ bool PlayMidiSequence(uint32 dwFileOffset, bool bLoop) {
currentLoop = bLoop;
// try to play track, but don't fall back to a true CD
- AudioCD.play(track, bLoop ? -1 : 1, 0, 0, true);
+ g_system->getAudioCDManager()->play(track, bLoop ? -1 : 1, 0, 0, true);
// Check if an enhanced audio track is being played.
// If it is, stop here and don't load a MIDI track
- if (AudioCD.isPlaying()) {
+ if (g_system->getAudioCDManager()->isPlaying()) {
return true;
}
}
@@ -291,7 +290,7 @@ bool PlayMidiSequence(uint32 dwFileOffset, bool bLoop) {
*/
bool MidiPlaying() {
if (_vm->getFeatures() & GF_ENHANCED_AUDIO_SUPPORT) {
- if (AudioCD.isPlaying())
+ if (g_system->getAudioCDManager()->isPlaying())
return true;
}
return _vm->_midiMusic->isPlaying();
@@ -305,7 +304,7 @@ bool StopMidi() {
currentLoop = false;
if (_vm->getFeatures() & GF_ENHANCED_AUDIO_SUPPORT) {
- AudioCD.stop();
+ g_system->getAudioCDManager()->stop();
}
_vm->_midiMusic->stop();
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index 6c77a98dda..dc706c82d9 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -45,7 +45,6 @@
#include "sound/mididrv.h"
#include "sound/mixer.h"
-#include "sound/audiocd.h"
#include "tinsel/actors.h"
#include "tinsel/background.h"
@@ -854,7 +853,7 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc)
int cd_num = ConfMan.getInt("cdrom");
if (cd_num >= 0)
- _system->openCD(cd_num);
+ _system->getAudioCDManager()->openCD(cd_num);
MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM);
bool native_mt32 = ((MidiDriver::getMusicType(dev) == MT_MT32) || ConfMan.getBool("native_mt32"));
@@ -885,7 +884,7 @@ TinselEngine::~TinselEngine() {
if (_bmv->MoviePlaying())
_bmv->FinishBMV();
- AudioCD.stop();
+ _system->getAudioCDManager()->stop();
delete _bmv;
delete _sound;
delete _midiMusic;
@@ -1006,7 +1005,7 @@ Common::Error TinselEngine::run() {
// Check for time to do next game cycle
if ((g_system->getMillis() > timerVal + GAME_FRAME_DELAY)) {
timerVal = g_system->getMillis();
- AudioCD.updateCD();
+ _system->getAudioCDManager()->updateCD();
NextGameCycle();
}