midimap: Add warning for user in case midi won't work.

Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Fabian Maurer 2017-09-30 22:07:08 +02:00 committed by Alexandre Julliard
parent f9a5ad1348
commit e9d25b834c

View file

@ -77,6 +77,7 @@
*/ */
WINE_DEFAULT_DEBUG_CHANNEL(msacm); WINE_DEFAULT_DEBUG_CHANNEL(msacm);
WINE_DECLARE_DEBUG_CHANNEL(winediag);
typedef struct tagMIDIOUTPORT typedef struct tagMIDIOUTPORT
{ {
@ -553,6 +554,8 @@ static LRESULT MIDIMAP_drvOpen(void)
{ {
MIDIOUTCAPSW moc; MIDIOUTCAPSW moc;
unsigned dev, i; unsigned dev, i;
WCHAR throughportW[] = {'M','i','d','i',' ','T','h','r','o','u','g','h',0};
BOOL found_valid_port = FALSE;
if (midiOutPorts) if (midiOutPorts)
return 0; return 0;
@ -571,6 +574,8 @@ static LRESULT MIDIMAP_drvOpen(void)
midiOutPorts[dev].lpbPatch = NULL; midiOutPorts[dev].lpbPatch = NULL;
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
midiOutPorts[dev].aChn[i] = i; midiOutPorts[dev].aChn[i] = i;
if (strncmpW(midiOutPorts[0].name, throughportW, strlenW(throughportW)) != 0)
found_valid_port = TRUE;
} }
else else
{ {
@ -578,6 +583,9 @@ static LRESULT MIDIMAP_drvOpen(void)
} }
} }
if (!found_valid_port)
ERR_(winediag)("No software synthesizer midi port found, Midi sound output probably won't work.\n");
return 1; return 1;
} }