aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorHenry Bush2009-01-08 23:01:34 +0000
committerHenry Bush2009-01-08 23:01:34 +0000
commit8eb7d55eca5aaf1acb005654c28b88b1e14111b2 (patch)
tree447f6d1453f7fc6e3b4fc76613ff8ed3953b4330 /engines
parentc8f16d8716963cdd96df5c83024621170bbfdeb6 (diff)
downloadscummvm-rg350-8eb7d55eca5aaf1acb005654c28b88b1e14111b2.tar.gz
scummvm-rg350-8eb7d55eca5aaf1acb005654c28b88b1e14111b2.tar.bz2
scummvm-rg350-8eb7d55eca5aaf1acb005654c28b88b1e14111b2.zip
T7G: Reset midi volume to 100 on starting a track, cleanup
svn-id: r35792
Diffstat (limited to 'engines')
-rw-r--r--engines/groovie/music.cpp15
-rw-r--r--engines/groovie/music.h1
2 files changed, 12 insertions, 4 deletions
diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp
index 2fe9b42c67..8c4d846b65 100644
--- a/engines/groovie/music.cpp
+++ b/engines/groovie/music.cpp
@@ -174,6 +174,14 @@ void MusicPlayer::setGameVolume(uint16 volume, uint16 time) {
_fadingEndVolume = 100;
}
+void MusicPlayer::endTrack() {
+ debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: End of song");
+ unload();
+ if (_backgroundFileRef) {
+ play(_backgroundFileRef, true);
+ }
+}
+
void MusicPlayer::applyFading() {
Common::StackLock lock(_mutex);
@@ -182,6 +190,7 @@ void MusicPlayer::applyFading() {
if (time >= _fadingDuration) {
// If we were fading to 0, stop the playback and restore the volume
if (_fadingEndVolume == 0) {
+ debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Faded to zero: end of song");
unload();
_fadingEndVolume = 100;
}
@@ -221,6 +230,7 @@ bool MusicPlayer::play(uint16 fileref, bool loop) {
// Set the looping option
_midiParser->property(MidiParser::mpAutoLoop, loop);
+ _gameVolume = 100;
// Load the new file
return load(fileref);
@@ -334,10 +344,7 @@ void MusicPlayer::metaEvent(byte type, byte *data, uint16 length) {
switch (type) {
case 0x2F:
// End of Track, play the background song
- debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: End of song");
- if (_backgroundFileRef) {
- play(_backgroundFileRef, true);
- }
+ endTrack();
break;
default:
_driver->metaEvent(type, data, length);
diff --git a/engines/groovie/music.h b/engines/groovie/music.h
index 43d020b198..0883e7814b 100644
--- a/engines/groovie/music.h
+++ b/engines/groovie/music.h
@@ -56,6 +56,7 @@ private:
uint16 _fadingStartVolume;
uint16 _fadingEndVolume;
uint16 _fadingDuration;
+ void endTrack();
void applyFading();
// Song volumes