aboutsummaryrefslogtreecommitdiff
path: root/backends/midi/ypa1.cpp
diff options
context:
space:
mode:
authorChris Apers2003-05-29 12:09:33 +0000
committerChris Apers2003-05-29 12:09:33 +0000
commit6054d1c5176ca3e9600142baf6798618214c1dfc (patch)
tree95b86158ee0d9cbe45e9068d33e27fbb6861dc7e /backends/midi/ypa1.cpp
parentb31ff8d6d50cf6600b57adc753c4b8c481574abd (diff)
downloadscummvm-rg350-6054d1c5176ca3e9600142baf6798618214c1dfc.tar.gz
scummvm-rg350-6054d1c5176ca3e9600142baf6798618214c1dfc.tar.bz2
scummvm-rg350-6054d1c5176ca3e9600142baf6798618214c1dfc.zip
Fix a sound problem on exit
svn-id: r8097
Diffstat (limited to 'backends/midi/ypa1.cpp')
-rw-r--r--backends/midi/ypa1.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/backends/midi/ypa1.cpp b/backends/midi/ypa1.cpp
index 6e6a2f90de..e741f290ae 100644
--- a/backends/midi/ypa1.cpp
+++ b/backends/midi/ypa1.cpp
@@ -25,19 +25,18 @@ int MidiDriver_YamahaPa1::open() {
if (!(_isOpen = Pa1Lib_midiOpen(NULL, &_midiHandle)))
return MERR_DEVICE_NOT_AVAILABLE;
- Pa1Lib_midiControlChange(_midiHandle,0,120,0); // all sound off
- Pa1Lib_midiControlChange(_midiHandle,0,121,0); // reset all controller
- Pa1Lib_midiControlChange(_midiHandle,0,123,0); // all notes off
-
return 0;
}
void MidiDriver_YamahaPa1::close() {
if (_isOpen) {
- Pa1Lib_midiControlChange(_midiHandle,0,120,0); // all sound off
- Pa1Lib_midiControlChange(_midiHandle,0,121,0); // reset all controller
- Pa1Lib_midiControlChange(_midiHandle,0,123,0); // all notes off
+ for (UInt8 channel = 0; channel < 16; channel++) {
+ Pa1Lib_midiControlChange(_midiHandle, channel, 120,0); // all sound off
+ Pa1Lib_midiControlChange(_midiHandle, channel, 121,0); // reset all controller
+ Pa1Lib_midiControlChange(_midiHandle, channel, 123, 0); // all notes off
+ }
Pa1Lib_midiClose(_midiHandle);
+ _isOpen = false;
}
}