Skip to content

Commit

Permalink
Version 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
KaleidonKep99 committed Nov 29, 2018
1 parent df35daa commit 36766ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Binary file modified winmmwrp/Resource.aps
Binary file not shown.
Binary file modified winmmwrp/Resource.rc
Binary file not shown.
15 changes: 6 additions & 9 deletions winmmwrp/WinMMWrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ static DWORD DrvMajor = 0, DrvMinor = 0, DrvBuild = 0, DrvRevision = 0;
// OM funcs
static LARGE_INTEGER frequency = { 0 }; // QPC Frequency
static HMODULE OM = NULL; // OM lib
static BOOL IsCallbackWindow = FALSE; // WMMC
static DWORD_PTR OMUser; // Dummy pointer, used for KDMAPI Output
static HMIDI OMDummy = 0x10001; // Dummy pointer, used for KDMAPI Output
static VOID(WINAPI*SCE)(DWORD, DWORD, DWORD) = 0; // SendCustomEvent
Expand Down Expand Up @@ -374,20 +373,19 @@ MMRESULT WINAPI KDMAPI_midiOutOpen(LPHMIDIOUT lphmo, UINT uDeviceID, DWORD_PTR d
WMMC = (void*)dwCallback;
WMMCI = dwCallbackInstance;

IsCallbackWindow = (dwFlags == CALLBACK_WINDOW);
if (WMMC) WMMC((*lphmo), IsCallbackWindow ? MM_MOM_OPEN : MOM_OPEN, WMMCI, 0, 0);
if (WMMC) WMMC((*lphmo), MM_MOM_OPEN, WMMCI, 0, 0);
}

return MMSYSERR_NOERROR;
}

MMRESULT WINAPI KDMAPI_midiOutClose(HMIDIOUT hMidiOut) {
#ifdef _DAWRELEASE
if (hMidiOut == OMDummy) return MMOutClose(hMidiOut);
if (hMidiOut != OMDummy) return MMOutClose(hMidiOut);
#endif
// Close OM
if (!TOMS()) return MMSYSERR_INVALHANDLE;
if (WMMC) WMMC(hMidiOut, IsCallbackWindow ? MM_MOM_CLOSE : MOM_CLOSE, WMMCI, 0, 0);
if (WMMC) WMMC(hMidiOut, MM_MOM_OPEN, WMMCI, 0, 0);
hMidiOut = (HMIDI)0;
return MMSYSERR_NOERROR;
}
Expand Down Expand Up @@ -427,7 +425,7 @@ MMRESULT WINAPI KDMAPI_midiOutLongMsg(HMIDIOUT hMidiOut, MIDIHDR* lpMidiOutHdr,
MMRESULT Ret = SDLD(lpMidiOutHdr);

// Inform the app that the driver successfully received the long message (Required for vanBasco to work), and return the MMRESULT
if (WMMC) WMMC(hMidiOut, IsCallbackWindow ? MM_MOM_DONE : MOM_DONE, WMMCI, lpMidiOutHdr, lpMidiOutHdr->dwBufferLength);
if (WMMC) WMMC(hMidiOut, MM_MOM_DONE, WMMCI, lpMidiOutHdr, lpMidiOutHdr->dwBufferLength);

return Ret;
}
Expand Down Expand Up @@ -552,7 +550,7 @@ MMRESULT WINAPI KDMAPI_midiStreamOpen(LPHMIDISTRM lphStream, LPUINT puDeviceID,
return retval;
}
}
#else
#endif
*lphStream = OMDummy;

MIDIOUTCAPSW myCapsW = { 0 };
Expand All @@ -569,7 +567,6 @@ MMRESULT WINAPI KDMAPI_midiStreamOpen(LPHMIDISTRM lphStream, LPUINT puDeviceID,

// Everything is oki-doki
return retval;
#endif
}

MMRESULT WINAPI KDMAPI_midiStreamClose(HMIDISTRM hStream) {
Expand Down Expand Up @@ -618,7 +615,7 @@ MMRESULT WINAPI KDMAPI_midiStreamStop(HMIDISTRM hStream) {

MMRESULT WINAPI KDMAPI_midiStreamProperty(HMIDISTRM hStream, LPBYTE lppropdata, DWORD dwProperty) {
#ifdef _DAWRELEASE
if (hStream == OMDummy) return MMStreamProperty(hStream, lppropdata, dwProperty);
if (hStream != OMDummy) return MMStreamProperty(hStream, lppropdata, dwProperty);
#endif
// Pass the prop. data to modMessage
return mM(0, MODM_PROPERTIES, OMUser, lppropdata, dwProperty);
Expand Down

0 comments on commit 36766ed

Please sign in to comment.