[PATCH] midimap: Add warning for user in case midi won't work

Fabian Maurer dark.shadow4 at web.de
Sat Sep 23 15:52:24 CDT 2017


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 <dark.shadow4 at web.de>
---
 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




More information about the wine-patches mailing list