aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/tinsel/music.cpp3
-rw-r--r--sound/audiocd.cpp5
-rw-r--r--sound/audiocd.h3
3 files changed, 7 insertions, 4 deletions
diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp
index 54a7656d44..bb6e794f8d 100644
--- a/engines/tinsel/music.cpp
+++ b/engines/tinsel/music.cpp
@@ -199,7 +199,8 @@ bool PlayMidiSequence(uint32 dwFileOffset, bool bLoop) {
if (track > 0) {
StopMidi();
- AudioCD.play(track, bLoop ? -1 : 1, 0, 0);
+ // try to play track, but don't fall back to a true CD
+ AudioCD.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
diff --git a/sound/audiocd.cpp b/sound/audiocd.cpp
index b2c91234a4..b1bd474a4c 100644
--- a/sound/audiocd.cpp
+++ b/sound/audiocd.cpp
@@ -47,7 +47,7 @@ AudioCDManager::AudioCDManager() {
assert(_mixer);
}
-void AudioCDManager::play(int track, int numLoops, int startFrame, int duration) {
+void AudioCDManager::play(int track, int numLoops, int startFrame, int duration, bool only_emulate) {
if (numLoops != 0 || startFrame != 0) {
_cd.track = track;
_cd.numLoops = numLoops;
@@ -80,7 +80,8 @@ void AudioCDManager::play(int track, int numLoops, int startFrame, int duration)
_mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_handle, stream);
} else {
_emulating = false;
- g_system->playCD(track, numLoops, startFrame, duration);
+ if (!only_emulate)
+ g_system->playCD(track, numLoops, startFrame, duration);
}
}
}
diff --git a/sound/audiocd.h b/sound/audiocd.h
index ced5410a1f..4c4ff26147 100644
--- a/sound/audiocd.h
+++ b/sound/audiocd.h
@@ -53,8 +53,9 @@ public:
* @param num_loops how often playback should be repeated (-1 = infinitely often).
* @param start_frame the frame at which playback should start (75 frames = 1 second).
* @param duration the number of frames to play (0: play until end)
+ * @param only_emulate if true, don't try to play from a real CD
*/
- void play(int track, int numLoops, int startFrame, int duration);
+ void play(int track, int numLoops, int startFrame, int duration, bool only_emulate = false);
void stop();
bool isPlaying() const;