aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-10-11 17:48:16 +0000
committerTorbjörn Andersson2005-10-11 17:48:16 +0000
commitbb14140ca727fa3681785d331c523d5584083c67 (patch)
treec3b8f93ceb017dd90c6c43c2d224f38e32ca7eaa /sound
parente44213c8324052f74d0a9766b29edcaf01c3a6d1 (diff)
downloadscummvm-rg350-bb14140ca727fa3681785d331c523d5584083c67.tar.gz
scummvm-rg350-bb14140ca727fa3681785d331c523d5584083c67.tar.bz2
scummvm-rg350-bb14140ca727fa3681785d331c523d5584083c67.zip
Moved the pitch wheel centering to unloadMusic() instead, since having it
in allNotesOff() broke the Kyra music. I have no idea why. svn-id: r19023
Diffstat (limited to 'sound')
-rw-r--r--sound/midiparser.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/sound/midiparser.cpp b/sound/midiparser.cpp
index d394d5310e..1a1b210abb 100644
--- a/sound/midiparser.cpp
+++ b/sound/midiparser.cpp
@@ -257,13 +257,10 @@ void MidiParser::allNotesOff() {
_hanging_notes_count = 0;
// To be sure, send an "All Note Off" event (but not all MIDI devices
- // support this...). We also center the pitch wheel. Perhaps we should
- // reset all controllers, but at the time of writing that isn't
- // supported on all our MIDI drivers.
+ // support this...).
for (i = 0; i < 16; ++i) {
_driver->send(0x007BB0 | i); // All notes off
- _driver->send(0x4000E0 | i); // Center the pitch wheel
}
memset(_active_notes, 0, sizeof(_active_notes));
@@ -398,4 +395,13 @@ void MidiParser::unloadMusic() {
_num_tracks = 0;
_active_track = 255;
_abort_parse = true;
+
+ // Center the pitch wheels in preparation for the next piece of music.
+ // It's not safe to do this from within allNotesOff().
+
+ if (_driver) {
+ for (int i = 0; i < 16; ++i) {
+ _driver->send(0x4000E0 | i); // Center the pitch wheel
+ }
+ }
}