From 6054d1c5176ca3e9600142baf6798618214c1dfc Mon Sep 17 00:00:00 2001 From: Chris Apers Date: Thu, 29 May 2003 12:09:33 +0000 Subject: Fix a sound problem on exit svn-id: r8097 --- backends/midi/ypa1.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'backends/midi') 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; } } -- cgit v1.2.3