diff options
Diffstat (limited to 'drivers/winmidi')
-rw-r--r-- | drivers/winmidi/SCsub | 2 | ||||
-rw-r--r-- | drivers/winmidi/win_midi.cpp | 9 | ||||
-rw-r--r-- | drivers/winmidi/win_midi.h | 6 |
3 files changed, 11 insertions, 6 deletions
diff --git a/drivers/winmidi/SCsub b/drivers/winmidi/SCsub index 233593b0f9..4c24925192 100644 --- a/drivers/winmidi/SCsub +++ b/drivers/winmidi/SCsub @@ -4,5 +4,3 @@ Import('env') # Driver source files env.add_source_files(env.drivers_sources, "*.cpp") - -Export('env') diff --git a/drivers/winmidi/win_midi.cpp b/drivers/winmidi/win_midi.cpp index 6da6e31b2b..1d4bf1a1e2 100644 --- a/drivers/winmidi/win_midi.cpp +++ b/drivers/winmidi/win_midi.cpp @@ -31,7 +31,8 @@ #ifdef WINMIDI_ENABLED #include "win_midi.h" -#include "print_string.h" + +#include "core/print_string.h" void MIDIDriverWinMidi::read(HMIDIIN hMidiIn, UINT wMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { @@ -53,6 +54,12 @@ Error MIDIDriverWinMidi::open() { char err[256]; midiInGetErrorText(res, err, 256); ERR_PRINTS("midiInOpen error: " + String(err)); + + MIDIINCAPS caps; + res = midiInGetDevCaps(i, &caps, sizeof(MIDIINCAPS)); + if (res == MMSYSERR_NOERROR) { + ERR_PRINTS("Can't open MIDI device \"" + String(caps.szPname) + "\", is it being used by another application?"); + } } } diff --git a/drivers/winmidi/win_midi.h b/drivers/winmidi/win_midi.h index 1cf9b19b5d..87a349d5d1 100644 --- a/drivers/winmidi/win_midi.h +++ b/drivers/winmidi/win_midi.h @@ -33,14 +33,14 @@ #ifndef WIN_MIDI_H #define WIN_MIDI_H +#include "core/os/midi_driver.h" +#include "core/vector.h" + #include <stdio.h> #include <windows.h> #include <mmsystem.h> -#include "core/vector.h" -#include "os/midi_driver.h" - class MIDIDriverWinMidi : public MIDIDriver { Vector<HMIDIIN> connected_sources; |