diff options
author | Vitaly Novichkov <Wohlstand@users.noreply.github.com> | 2020-09-21 00:43:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-21 00:43:58 +0300 |
commit | 9b51dd7d667e97338a92711543fc3e942faae52f (patch) | |
tree | 63539cbf427912686565dab81b3aa820346967b5 /utils/winmm_drv/cpl/adlconfig.c | |
parent | e082315b04cbc75b4cfce744e9274bb8c5cedd38 (diff) | |
download | libADLMIDI-9b51dd7d667e97338a92711543fc3e942faae52f.tar.gz libADLMIDI-9b51dd7d667e97338a92711543fc3e942faae52f.tar.bz2 libADLMIDI-9b51dd7d667e97338a92711543fc3e942faae52f.zip |
Added WinMM driver for windows (#236)
* ADLMIDI2: Fixed an MSVC build
However, it may work glitchy!
* Experimental WinMM MIDI driver
TODO: Make a control panel to configure the driver
* WinMM-DRV: A workaround for older MinGW
* WinMM-DRV: WIP control panel appled / tool
* WinMM-DRV: Better test a driver's work
* WinMM-DRV: More progress on a control panel
* WinMM-DRV: And more progress on this control panel
It's almost completed, I need to make the working setup through a registry.
* WinMM-DRV: Driver is almost ready
However, control panel can't ping a driver to reload settings yet
* WinMM-DRV: Fix the missing volume model setup
* WinMM-DRV: Setup reload on the fly now work!
* WinMM-DRV: Stabilize the thing
* WinMM-DRV: Stabilizing
* WinMM-DRV: Avoid all "setup" in names
to avoid a stupid PCA thing:
https://stackoverflow.com/questions/17660404/how-to-programmatically-disable-program-compatibility-assistant-in-windows-7-and
* A small warning fix at the WOPL module
* WinMM-DRV: Fixed some warnings
* WinMM-DRV: Avoid PCA dialog on the installer
* WiNMM-DRV: Make the linking of pthread being optional
Required to use MinGW-w64 toolchain with the "win32" threading mode
* WinMM-DRV: Receive the MODM_RESET to reset the MIDI state
* WinMM-DRV: Attempt to fix a sound distorsion on song song
* WinMM-Drv: Fixed a build on some older MinGW toolchains
* WinMM-Drv: Fixed default settings not being loaded
Diffstat (limited to 'utils/winmm_drv/cpl/adlconfig.c')
-rw-r--r-- | utils/winmm_drv/cpl/adlconfig.c | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/utils/winmm_drv/cpl/adlconfig.c b/utils/winmm_drv/cpl/adlconfig.c new file mode 100644 index 0000000..744fc14 --- /dev/null +++ b/utils/winmm_drv/cpl/adlconfig.c @@ -0,0 +1,101 @@ +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <cpl.h> + +#include "resource.h" + +#include "config_dialog.h" + +static HANDLE hModule = NULL; + +BOOL WINAPI DllMain( + PVOID hmod, + ULONG ulReason, + PCONTEXT pctx OPTIONAL +) +{ + if(ulReason != DLL_PROCESS_ATTACH) + { + return TRUE; + } + else + { + hModule = hmod; + } + + return TRUE; + + UNREFERENCED_PARAMETER(pctx); +} + +LONG APIENTRY CPlApplet( + HWND hwndCPL, // handle of Control Panel window + UINT uMsg, // message + LONG_PTR lParam1, // first message parameter + LONG_PTR lParam2 // second message parameter +) +{ + LPCPLINFO lpCPlInfo; + LPNEWCPLINFO lpNewCPlInfo; + LONG retCode = 0; + + switch (uMsg) + { + // first message, sent once + case CPL_INIT: + initAdlSetupBox(hModule, hwndCPL); + return TRUE; + + // second message, sent once + case CPL_GETCOUNT: + return 1L; + + // third message, sent once per app + case CPL_INQUIRE: + lpCPlInfo = (LPCPLINFO)lParam2; + lpCPlInfo->idIcon = IDI_ICON1; + lpCPlInfo->idName = IDC_DRIVERNAME; + lpCPlInfo->idInfo = IDC_DRIVERDESC; + lpCPlInfo->lData = 0L; + break; + + // third message, sent once per app + case CPL_NEWINQUIRE: + lpNewCPlInfo = (LPNEWCPLINFO)lParam2; + lpNewCPlInfo->dwSize = (DWORD) sizeof(NEWCPLINFO); + lpNewCPlInfo->dwFlags = 0; + lpNewCPlInfo->dwHelpContext = 0; + lpNewCPlInfo->lData = 0; + lpNewCPlInfo->hIcon = LoadIconW(hModule, (LPCTSTR)MAKEINTRESOURCEW(IDI_ICON1)); + lpNewCPlInfo->szHelpFile[0] = '\0'; + + LoadStringW(hModule, IDC_DRIVERNAME, lpNewCPlInfo->szName, 32); + LoadStringW(hModule, IDC_DRIVERDESC, lpNewCPlInfo->szInfo, 64); + break; + + // application icon selected + case CPL_SELECT: + break; + + // application icon double-clicked + case CPL_DBLCLK: + runAdlSetupBox(hModule, hwndCPL); + break; + + case CPL_STOP: + break; + + case CPL_EXIT: + cleanUpAdlSetupBox(hModule, hwndCPL); + break; + + default: + break; + } + + return retCode; + + UNREFERENCED_PARAMETER(lParam1); +} |