From 9b51dd7d667e97338a92711543fc3e942faae52f Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Mon, 21 Sep 2020 00:43:58 +0300 Subject: 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 --- utils/winmm_drv/src/stdafx.h | 83 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 utils/winmm_drv/src/stdafx.h (limited to 'utils/winmm_drv/src/stdafx.h') diff --git a/utils/winmm_drv/src/stdafx.h b/utils/winmm_drv/src/stdafx.h new file mode 100644 index 0000000..dd8b15c --- /dev/null +++ b/utils/winmm_drv/src/stdafx.h @@ -0,0 +1,83 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include +#include +#ifndef __MINGW32__ +#include +#endif +#include +#include +#include +#include +#include "MidiSynth.h" + +#ifdef __MINGW32__ +// Define missing in MinGW macros here + +#ifndef EXTERN_C +#ifdef __cplusplus + #define EXTERN_C extern "C" + #define EXTERN_C_START extern "C" { + #define EXTERN_C_END } +#else + #define EXTERN_C extern + #define EXTERN_C_START + #define EXTERN_C_END +#endif +#endif + +#ifndef STDAPICALLTYPE +#define STDAPICALLTYPE __stdcall +#endif + +#ifndef STDAPI_ +#define STDAPI_(type) EXTERN_C type STDAPICALLTYPE +#endif + +#define DRV_PNPINSTALL (DRV_RESERVED + 11) + +#ifndef MMNOMIDI + +typedef struct midiopenstrmid_tag +{ + DWORD dwStreamID; + UINT uDeviceID; +} MIDIOPENSTRMID; + +typedef struct midiopendesc_tag { + HMIDI hMidi; + DWORD_PTR dwCallback; + DWORD_PTR dwInstance; + DWORD_PTR dnDevNode; + DWORD cIds; + MIDIOPENSTRMID rgIds[1]; +} MIDIOPENDESC; + +typedef MIDIOPENDESC FAR *LPMIDIOPENDESC; + +#endif // MMNOMIDI + +#define MODM_GETNUMDEVS 1 +#define MODM_GETDEVCAPS 2 +#define MODM_OPEN 3 +#define MODM_CLOSE 4 +#define MODM_PREPARE 5 +#define MODM_UNPREPARE 6 +#define MODM_DATA 7 +#define MODM_LONGDATA 8 +#define MODM_RESET 9 +#define MODM_GETVOLUME 10 +#define MODM_SETVOLUME 11 +#define MODM_CACHEPATCHES 12 +#define MODM_CACHEDRUMPATCHES 13 + +#endif // __MINGW32__ -- cgit v1.2.3