From c81b58d38eb8ca38e8614152000bceb7b2c012ad Mon Sep 17 00:00:00 2001 From: Jamieson Christian Date: Sun, 18 May 2003 23:55:53 +0000 Subject: 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 --- backends/midi/adlib.cpp | 3 +++ backends/midi/windows.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'backends') 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)); } -- cgit v1.2.3