[Scummvm-cvs-logs] SF.net SVN: scummvm:[36030] scummvm/trunk
wjpalenstijn at users.sourceforge.net
wjpalenstijn at users.sourceforge.net
Sat Jan 24 02:29:52 CET 2009
Revision: 36030
http://scummvm.svn.sourceforge.net/scummvm/?rev=36030&view=rev
Author: wjpalenstijn
Date: 2009-01-24 01:29:52 +0000 (Sat, 24 Jan 2009)
Log Message:
-----------
fixing #2531282: don't fall back to a real audio CD when playing enhanced midi tracks
Modified Paths:
--------------
scummvm/trunk/engines/tinsel/music.cpp
scummvm/trunk/sound/audiocd.cpp
scummvm/trunk/sound/audiocd.h
Modified: scummvm/trunk/engines/tinsel/music.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/music.cpp 2009-01-24 01:23:04 UTC (rev 36029)
+++ scummvm/trunk/engines/tinsel/music.cpp 2009-01-24 01:29:52 UTC (rev 36030)
@@ -199,7 +199,8 @@
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
Modified: scummvm/trunk/sound/audiocd.cpp
===================================================================
--- scummvm/trunk/sound/audiocd.cpp 2009-01-24 01:23:04 UTC (rev 36029)
+++ scummvm/trunk/sound/audiocd.cpp 2009-01-24 01:29:52 UTC (rev 36030)
@@ -47,7 +47,7 @@
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 @@
_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);
}
}
}
Modified: scummvm/trunk/sound/audiocd.h
===================================================================
--- scummvm/trunk/sound/audiocd.h 2009-01-24 01:23:04 UTC (rev 36029)
+++ scummvm/trunk/sound/audiocd.h 2009-01-24 01:29:52 UTC (rev 36030)
@@ -53,8 +53,9 @@
* @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;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list