From: Fabian Maurer Subject: [PATCH] midimap: Add warning for user in case midi won't work Message-Id: <20170923205224.25158-1-dark.shadow4@web.de> Date: Sat, 23 Sep 2017 22:52:24 +0200 When no midi port or only the midi-through port is found, we can inform the user that midi won't work as expected. Signed-off-by: Fabian Maurer --- dlls/midimap/midimap.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/midimap/midimap.c b/dlls/midimap/midimap.c index 64b4dc8546..c80834515b 100644 --- a/dlls/midimap/midimap.c +++ b/dlls/midimap/midimap.c @@ -553,6 +553,7 @@ static LRESULT MIDIMAP_drvOpen(void) { MIDIOUTCAPSW moc; unsigned dev, i; + WCHAR throughportW[] = {'M','i','d','i',' ','T','h','r','o','u','g','h',0}; if (midiOutPorts) return 0; @@ -578,6 +579,13 @@ static LRESULT MIDIMAP_drvOpen(void) } } + if(numMidiOutPorts == 0) + MESSAGE("Midi sound output won't work - No midi port found.\n"); + else if(numMidiOutPorts == 1 && midiOutPorts[0].loaded == -1) + MESSAGE("Midi sound output won't work - No working midi port found.\n"); + else if(numMidiOutPorts == 1 && strncmpW(midiOutPorts[0].name, throughportW, strlenW(throughportW)) == 0) + MESSAGE("Midi sound output probably won't work - Only 'midi through' port found. Make sure your setup is correct.\n"); + return 1; } -- 2.14.1