Commit ec6bd187 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

midimap: Open lower devices when opening MIDI Mapper.

Without this change, the lower device can't get a long message at the beginning. The mapper didn't open it before receiving a short message in modData function. Signed-off-by: 's avatarAkihiro Sagawa <sagawa.aki@gmail.com> Signed-off-by: 's avatarAndrew Eikum <aeikum@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 96896023
......@@ -283,13 +283,25 @@ static DWORD modOpen(DWORD_PTR *lpdwUser, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
if (MIDIMAP_LoadSettings(mom))
{
UINT chn;
*lpdwUser = (DWORD_PTR)mom;
mom->self = mom;
mom->wCbFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK);
mom->midiDesc = *lpDesc;
MIDIMAP_NotifyClient(mom, MOM_OPEN, 0L, 0L);
for (chn = 0; chn < 16; chn++)
{
if (mom->ChannelMap[chn]->loaded) continue;
if (midiOutOpen(&mom->ChannelMap[chn]->hMidi, mom->ChannelMap[chn]->uDevID,
0L, 0L, CALLBACK_NULL) == MMSYSERR_NOERROR)
mom->ChannelMap[chn]->loaded = 1;
else
mom->ChannelMap[chn]->loaded = -1;
/* FIXME: should load here the IDF midi data... and allow channel and
* patch mappings
*/
}
MIDIMAP_NotifyClient(mom, MOM_OPEN, 0L, 0L);
return MMSYSERR_NOERROR;
}
HeapFree(GetProcessHeap(), 0, mom);
......@@ -381,17 +393,6 @@ static DWORD modData(MIDIMAPDATA* mom, DWORD_PTR dwParam)
case 0xC0:
case 0xD0:
case 0xE0:
if (mom->ChannelMap[chn]->loaded == 0)
{
if (midiOutOpen(&mom->ChannelMap[chn]->hMidi, mom->ChannelMap[chn]->uDevID,
0L, 0L, CALLBACK_NULL) == MMSYSERR_NOERROR)
mom->ChannelMap[chn]->loaded = 1;
else
mom->ChannelMap[chn]->loaded = -1;
/* FIXME: should load here the IDF midi data... and allow channel and
* patch mappings
*/
}
if (mom->ChannelMap[chn]->loaded > 0)
{
/* change channel */
......
......@@ -461,7 +461,7 @@ static void test_midiOut_device(UINT udev, HWND hwnd)
trace("ShortMsg type %x (muted)\n", LOBYTE(LOWORD(e)));
rc = midiOutShortMsg(hm, e);
ok(!rc, "midiOutShortMsg rc=%s\n", mmsys_error(rc));
/* FIXME (for MIDI Mapper): we shouldn't hear this voice due to volume settings */
/* We can't hear this voice due to volume settings */
if (!rc) Sleep(200);
rc = midiOutShortMsg(hm, 0x00004593); /* velocity 0 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment