diff options
author | Bastien Bouclet | 2018-07-31 21:41:10 +0200 |
---|---|---|
committer | Bastien Bouclet | 2018-07-31 21:44:26 +0200 |
commit | de886a8b5852248898ff86088dc867cf12a7e245 (patch) | |
tree | 2beec1457e3b487f854e7dfd9d67cd96bf6678e7 /backends/audiocd | |
parent | 2586ca2345751a0ca5eb2c694e5e2c753054f069 (diff) | |
download | scummvm-rg350-de886a8b5852248898ff86088dc867cf12a7e245.tar.gz scummvm-rg350-de886a8b5852248898ff86088dc867cf12a7e245.tar.bz2 scummvm-rg350-de886a8b5852248898ff86088dc867cf12a7e245.zip |
AUDIO: Fix broken physical audio CD playback on non-win32
The play method did not override the base class due to the addition of
the soundType parameter.
Diffstat (limited to 'backends/audiocd')
-rw-r--r-- | backends/audiocd/linux/linux-audiocd.cpp | 18 | ||||
-rw-r--r-- | backends/audiocd/macosx/macosx-audiocd.cpp | 18 | ||||
-rw-r--r-- | backends/audiocd/sdl/sdl-audiocd.cpp | 5 | ||||
-rw-r--r-- | backends/audiocd/sdl/sdl-audiocd.h | 15 | ||||
-rw-r--r-- | backends/audiocd/win32/win32-audiocd.cpp | 12 |
5 files changed, 37 insertions, 31 deletions
diff --git a/backends/audiocd/linux/linux-audiocd.cpp b/backends/audiocd/linux/linux-audiocd.cpp index eb311569e9..a985662b37 100644 --- a/backends/audiocd/linux/linux-audiocd.cpp +++ b/backends/audiocd/linux/linux-audiocd.cpp @@ -178,13 +178,14 @@ public: LinuxAudioCDManager(); ~LinuxAudioCDManager(); - bool open(); - void close(); - bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate = false); + bool open() override; + void close() override; + bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate, + Audio::Mixer::SoundType soundType) override; protected: - bool openCD(int drive); - bool openCD(const Common::String &drive); + bool openCD(int drive) override; + bool openCD(const Common::String &drive) override; private: struct Device { @@ -285,9 +286,10 @@ bool LinuxAudioCDManager::openCD(const Common::String &drive) { return true; } -bool LinuxAudioCDManager::play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate) { +bool LinuxAudioCDManager::play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate, + Audio::Mixer::SoundType soundType) { // Prefer emulation - if (DefaultAudioCDManager::play(track, numLoops, startFrame, duration, onlyEmulate)) + if (DefaultAudioCDManager::play(track, numLoops, startFrame, duration, onlyEmulate, soundType)) return true; // If we're set to only emulate, or have no CD drive, return here @@ -320,7 +322,7 @@ bool LinuxAudioCDManager::play(int track, int numLoops, int startFrame, int dura _emulating = true; _mixer->playStream( - Audio::Mixer::kMusicSoundType, + soundType, &_handle, Audio::makeLoopingAudioStream(audioStream, start, end, (numLoops < 1) ? numLoops + 1 : numLoops), -1, diff --git a/backends/audiocd/macosx/macosx-audiocd.cpp b/backends/audiocd/macosx/macosx-audiocd.cpp index e8d41c3e10..69cabfa736 100644 --- a/backends/audiocd/macosx/macosx-audiocd.cpp +++ b/backends/audiocd/macosx/macosx-audiocd.cpp @@ -72,13 +72,14 @@ public: MacOSXAudioCDManager() {} ~MacOSXAudioCDManager(); - bool open(); - void close(); - bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate = false); + bool open() override; + void close() override; + bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate, + Audio::Mixer::SoundType soundType) override; protected: - bool openCD(int drive); - bool openCD(const Common::String &drive); + bool openCD(int drive) override; + bool openCD(const Common::String &drive) override; private: struct Drive { @@ -209,9 +210,10 @@ MacOSXAudioCDManager::DriveList MacOSXAudioCDManager::detectAllDrives() { return drives; } -bool MacOSXAudioCDManager::play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate) { +bool MacOSXAudioCDManager::play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate, + Audio::Mixer::SoundType soundType) { // Prefer emulation - if (DefaultAudioCDManager::play(track, numLoops, startFrame, duration, onlyEmulate)) + if (DefaultAudioCDManager::play(track, numLoops, startFrame, duration, onlyEmulate, soundType)) return true; // If we're set to only emulate, or have no CD drive, return here @@ -248,7 +250,7 @@ bool MacOSXAudioCDManager::play(int track, int numLoops, int startFrame, int dur // Fake emulation since we're really playing an AIFF file _emulating = true; - _mixer->playStream(Audio::Mixer::kMusicSoundType, &_handle, + _mixer->playStream(soundType, &_handle, Audio::makeLoopingAudioStream(seekStream, start, end, (numLoops < 1) ? numLoops + 1 : numLoops), -1, _cd.volume, _cd.balance); return true; } diff --git a/backends/audiocd/sdl/sdl-audiocd.cpp b/backends/audiocd/sdl/sdl-audiocd.cpp index 3558fb5671..e2e4f1d069 100644 --- a/backends/audiocd/sdl/sdl-audiocd.cpp +++ b/backends/audiocd/sdl/sdl-audiocd.cpp @@ -91,9 +91,10 @@ void SdlAudioCDManager::stop() { _cdNumLoops = 0; } -bool SdlAudioCDManager::play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate) { +bool SdlAudioCDManager::play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate, + Audio::Mixer::SoundType soundType) { // Prefer emulation - if (DefaultAudioCDManager::play(track, numLoops, startFrame, duration, onlyEmulate)) + if (DefaultAudioCDManager::play(track, numLoops, startFrame, duration, onlyEmulate, soundType)) return true; // If we're set to only emulate, or have no CD, return here diff --git a/backends/audiocd/sdl/sdl-audiocd.h b/backends/audiocd/sdl/sdl-audiocd.h index 91895dac99..567def936d 100644 --- a/backends/audiocd/sdl/sdl-audiocd.h +++ b/backends/audiocd/sdl/sdl-audiocd.h @@ -37,15 +37,16 @@ public: SdlAudioCDManager(); virtual ~SdlAudioCDManager(); - virtual bool open(); - virtual void close(); - virtual bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate = false); - virtual void stop(); - virtual bool isPlaying() const; - virtual void update(); + bool open() override; + void close() override; + bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate, + Audio::Mixer::SoundType soundType) override; + void stop() override; + bool isPlaying() const override; + void update() override; protected: - virtual bool openCD(int drive); + bool openCD(int drive) override; SDL_CD *_cdrom; int _cdTrack, _cdNumLoops, _cdStartFrame, _cdDuration; diff --git a/backends/audiocd/win32/win32-audiocd.cpp b/backends/audiocd/win32/win32-audiocd.cpp index 6eff1ef0b3..7269910506 100644 --- a/backends/audiocd/win32/win32-audiocd.cpp +++ b/backends/audiocd/win32/win32-audiocd.cpp @@ -149,14 +149,14 @@ public: Win32AudioCDManager(); ~Win32AudioCDManager(); - 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); + bool open() override; + void close() override; + bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate, + Audio::Mixer::SoundType soundType) override; protected: - virtual bool openCD(int drive); - virtual bool openCD(const Common::String &drive); + bool openCD(int drive) override; + bool openCD(const Common::String &drive) override; private: bool loadTOC(); |