aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJamieson Christian2003-05-18 23:55:53 +0000
committerJamieson Christian2003-05-18 23:55:53 +0000
commitc81b58d38eb8ca38e8614152000bceb7b2c012ad (patch)
tree9401a74b381ab63a31562e0b3e5ddb05c2da2500 /backends
parentb43bca21cbea217d980887eabbfc73e92fce4c71 (diff)
downloadscummvm-rg350-c81b58d38eb8ca38e8614152000bceb7b2c012ad.tar.gz
scummvm-rg350-c81b58d38eb8ca38e8614152000bceb7b2c012ad.tar.bz2
scummvm-rg350-c81b58d38eb8ca38e8614152000bceb7b2c012ad.zip
Implemented new Simon MIDI module, switching from MidiStreamer to MidiParser. Restructuring enables XMIDI support and vc_72 implementation. Various cleanup on MidiParser's and MidiDriver's.
svn-id: r7654
Diffstat (limited to 'backends')
-rw-r--r--backends/midi/adlib.cpp3
-rw-r--r--backends/midi/windows.cpp3
2 files changed, 5 insertions, 1 deletions
diff --git a/backends/midi/adlib.cpp b/backends/midi/adlib.cpp
index 769ad3e0d2..909aa655a8 100644
--- a/backends/midi/adlib.cpp
+++ b/backends/midi/adlib.cpp
@@ -867,6 +867,9 @@ int MidiDriver_ADLIB::open() {
}
void MidiDriver_ADLIB::close() {
+ if (!_isOpen)
+ return;
+
uint i;
for (i = 0; i < ARRAYSIZE(_voices); ++i) {
if (_voices [i]._part)
diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp
index 91cb3ccf87..e1b61cbaa6 100644
--- a/backends/midi/windows.cpp
+++ b/backends/midi/windows.cpp
@@ -65,6 +65,8 @@ int MidiDriver_WIN::open() {
}
void MidiDriver_WIN::close() {
+ if (!_isOpen)
+ return;
_isOpen = false;
midiOutUnprepareHeader (_mo, &_streamHeader, sizeof (_streamHeader));
check_error(midiOutClose(_mo));
@@ -83,7 +85,6 @@ void MidiDriver_WIN::send(uint32 b)
u.bData[1] = (byte)((b & 0x0000FF00) >> 8);
u.bData[0] = (byte)(b & 0x000000FF);
- // printMidi(u.bData[0], u.bData[1], u.bData[2], u.bData[3]);
check_error(midiOutShortMsg(_mo, u.dwData));
}