aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamieson Christian2003-09-24 09:32:38 +0000
committerJamieson Christian2003-09-24 09:32:38 +0000
commita7dfe35706d6a618476b78d5542e1c2ffd0923db (patch)
tree54f6f5d529494547e9054da0220187a3efb386ab
parentc8fbafda9a3f7e3cc40612e6fa2f450a5a6459ff (diff)
downloadscummvm-rg350-a7dfe35706d6a618476b78d5542e1c2ffd0923db.tar.gz
scummvm-rg350-a7dfe35706d6a618476b78d5542e1c2ffd0923db.tar.bz2
scummvm-rg350-a7dfe35706d6a618476b78d5542e1c2ffd0923db.zip
Fix for Bug [805923] BASS: Notes left on when quitting game
Explicitly send All Notes Off messages on every channel when shutting down music driver. This fixes hanging notes on exit when using external synths or some less intelligent internal synths. svn-id: r10398
-rw-r--r--sky/music/gmmusic.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/sky/music/gmmusic.cpp b/sky/music/gmmusic.cpp
index b4fdeeb510..58f65e73e6 100644
--- a/sky/music/gmmusic.cpp
+++ b/sky/music/gmmusic.cpp
@@ -44,6 +44,9 @@ SkyGmMusic::~SkyGmMusic(void) {
_midiDrv->setTimerCallback(NULL, NULL);
if (_currentMusic) stopMusic();
+ // Send All Notes Off (for external synths)
+ for (int i = 0; i < 16; ++i)
+ _midiDrv->send ((123 << 8) | 0xB0 | i);
_midiDrv->close();
delete _midiDrv;
}