diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/midi/windows.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp index 10653eb928..bb2f33c050 100644 --- a/backends/midi/windows.cpp +++ b/backends/midi/windows.cpp @@ -31,35 +31,32 @@ //////////////////////////////////////// class MidiDriver_WIN : public MidiDriver_MPU401 { -public: - MidiDriver_WIN(); - int open(int mode); - void close(); - void send(uint32 b); - private: HMIDIOUT _mo; + bool _isOpen; void check_error(MMRESULT result); - uint32 property(int prop, uint32 param); -}; + uint32 property(int prop, uint32 param) { return 0; } -MidiDriver_WIN::MidiDriver_WIN() -{ - _isOpen = false; -} +public: + MidiDriver_WIN() : _isOpen (false) { } + int open(); + void close(); + void send(uint32 b); +}; int MidiDriver_WIN::open() { if (_isOpen) return MERR_ALREADY_OPEN; - _isOpen = true; - MMRESULT res = midiOutOpen((HMIDIOUT *) &_mo, MIDI_MAPPER, 0, 0, 0); - if (res != MMSYSERR_NOERROR) + if (res != MMSYSERR_NOERROR) { check_error(res); + return MERR_DEVICE_NOT_AVAILABLE; + } + _isOpen = true; return 0; } |