From 749cf8a083460e18db96c24220f756307dd0b4d0 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 18 Mar 2005 11:05:15 +0000 Subject: Apply patch #1162546 "BASS: Hanging notes fix / patch". Thanks __tom. svn-id: r17177 --- sky/control.cpp | 9 +++++++++ sky/music/musicbase.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'sky') diff --git a/sky/control.cpp b/sky/control.cpp index 7041d81a00..3a9cb09ff2 100644 --- a/sky/control.cpp +++ b/sky/control.cpp @@ -1573,6 +1573,15 @@ void Control::showGameQuitMsg(bool useScreen) { _skyScreen->halvePalette(); _skyScreen->showScreen(screenData); free(textBuf1); free(textBuf2); + + // __tom (FIXME): This is a poor method of turning + // off music. ~GmMusic, ~AdlibMusic, and ~MT32Music + // should do it themselves so the appropriate MIDI + // controller events (e.g. 123/'All Notes Off') can + // be sent. However, that requires a re-write of + // other code and for now this fixes hanging notes + // on MT-32 + other external GMIDI synths. + _skyMusic->stopMusic(); delay(1500); ConfMan.flushToDisk(); _system->quit(); diff --git a/sky/music/musicbase.h b/sky/music/musicbase.h index f44c828d83..40785c7cfd 100644 --- a/sky/music/musicbase.h +++ b/sky/music/musicbase.h @@ -53,6 +53,7 @@ public: void loadSection(uint8 pSection); void musicCommand(uint16 command); void startMusic(uint16 param) { _onNextPoll.musicToProcess = param & 0xF; }; // 4 + void stopMusic(); // 7 bool musicIsPlaying(void); virtual void setVolume(uint8 volume) = 0; uint8 giveVolume(void) { return (uint8)_musicVolume; }; @@ -87,7 +88,6 @@ protected: void setTempo(uint16 newTempo); // 2 void pollMusic(); // 3 void reinitFM(void) { _onNextPoll.doReInit = true; }; // 6 - void stopMusic(); // 7 void setFMVolume(uint16 param); // 13 }; -- cgit v1.2.3