module win32.ansi.mmsystem;

// Translated from Microsoft Platform SDK August 2001 Edition
// by Y.Tomino (demoonlit@inter7.jp)

import win32.ansi.winbase;

// #ifndef _INC_MMSYSTEM
// #define _INC_MMSYSTEM

// #ifdef _WIN32
align(1):
// #else
// #ifndef RC_INVOKED
// #...
// #endif
// #endif

// #ifdef __cplusplus
// extern "C" {            /* Assume C declarations for C++ */
// #endif  /* __cplusplus */

// #ifdef _WIN32
// #ifndef _WINMM_
// #define WINMMAPI DECLSPEC_IMPORT
// #else
// #...
// #endif
// #define _loadds
// #define _huge
// #else
// #...
// #endif

// #ifdef _MAC
// #...
// #endif //_MAC

enum : uint { MAXPNAMELEN = 32 }
enum : uint { MAXERRORLENGTH = 256 }
enum : uint { MAX_JOYSTICKOEMVXDNAME = 260 }

// #if (WINVER <= 0x0400)
// #ifndef MM_MICROSOFT
// #...
// #endif

// #ifndef MM_MIDI_MAPPER
// #...
// #...
// #...
// #...
// #...
// #...
// #...
// #...
// #...
// #...
// #...
// #endif
// #endif

// #ifdef _WIN32
alias UINT MMVERSION;
// #else
// ...
// #endif
alias UINT MMRESULT;

// #define _MMRESULT_

alias UINT* LPUINT;

struct mmtime_tag {
  UINT wType;
union {
  DWORD ms;
  DWORD sample;
  DWORD cb;
  DWORD ticks;

struct {
  BYTE hour;
  BYTE min;
  BYTE sec;
  BYTE frame;
  BYTE fps;
  BYTE dummy;
// #ifdef _WIN32
  BYTE pad[2];
// #endif
}

struct {
  DWORD songptrpos;
}

}

}
alias mmtime_tag MMTIME;
alias mmtime_tag* PMMTIME;
alias mmtime_tag* NPMMTIME;
alias mmtime_tag* LPMMTIME;

enum : uint { TIME_MS = 0x0001 }
enum : uint { TIME_SAMPLES = 0x0002 }
enum : uint { TIME_BYTES = 0x0004 }
enum : uint { TIME_SMPTE = 0x0008 }
enum : uint { TIME_MIDI = 0x0010 }
enum : uint { TIME_TICKS = 0x0020 }

uint MAKEFOURCC(ubyte ch0, ubyte ch1, ubyte ch2, ubyte ch3){ return ch0 | (ch1 << 8) | (ch2 << 16) | (ch3 << 24); }

enum : uint { MM_JOY1MOVE = 0x3A0 }
enum : uint { MM_JOY2MOVE = 0x3A1 }
enum : uint { MM_JOY1ZMOVE = 0x3A2 }
enum : uint { MM_JOY2ZMOVE = 0x3A3 }
enum : uint { MM_JOY1BUTTONDOWN = 0x3B5 }
enum : uint { MM_JOY2BUTTONDOWN = 0x3B6 }
enum : uint { MM_JOY1BUTTONUP = 0x3B7 }
enum : uint { MM_JOY2BUTTONUP = 0x3B8 }

enum : uint { MM_MCINOTIFY = 0x3B9 }

enum : uint { MM_WOM_OPEN = 0x3BB }
enum : uint { MM_WOM_CLOSE = 0x3BC }
enum : uint { MM_WOM_DONE = 0x3BD }

enum : uint { MM_WIM_OPEN = 0x3BE }
enum : uint { MM_WIM_CLOSE = 0x3BF }
enum : uint { MM_WIM_DATA = 0x3C0 }

enum : uint { MM_MIM_OPEN = 0x3C1 }
enum : uint { MM_MIM_CLOSE = 0x3C2 }
enum : uint { MM_MIM_DATA = 0x3C3 }
enum : uint { MM_MIM_LONGDATA = 0x3C4 }
enum : uint { MM_MIM_ERROR = 0x3C5 }
enum : uint { MM_MIM_LONGERROR = 0x3C6 }

enum : uint { MM_MOM_OPEN = 0x3C7 }
enum : uint { MM_MOM_CLOSE = 0x3C8 }
enum : uint { MM_MOM_DONE = 0x3C9 }

// #ifndef MM_DRVM_OPEN
enum : uint { MM_DRVM_OPEN = 0x3D0 }
enum : uint { MM_DRVM_CLOSE = 0x3D1 }
enum : uint { MM_DRVM_DATA = 0x3D2 }
enum : uint { MM_DRVM_ERROR = 0x3D3 }
// #endif

enum : uint { MM_STREAM_OPEN = 0x3D4 }
enum : uint { MM_STREAM_CLOSE = 0x3D5 }
enum : uint { MM_STREAM_DONE = 0x3D6 }
enum : uint { MM_STREAM_ERROR = 0x3D7 }

// #if(WINVER >= 0x0400)
enum : uint { MM_MOM_POSITIONCB = 0x3CA }

// #ifndef MM_MCISIGNAL
enum : uint { MM_MCISIGNAL = 0x3CB }
// #endif

enum : uint { MM_MIM_MOREDATA = 0x3CC }

// #endif /* WINVER >= 0x0400 */
enum : uint { MM_MIXM_LINE_CHANGE = 0x3D0 }
enum : uint { MM_MIXM_CONTROL_CHANGE = 0x3D1 }

enum : uint { MMSYSERR_BASE = 0 }
enum : uint { WAVERR_BASE = 32 }
enum : uint { MIDIERR_BASE = 64 }
enum : uint { TIMERR_BASE = 96 }
enum : uint { JOYERR_BASE = 160 }
enum : uint { MCIERR_BASE = 256 }
enum : uint { MIXERR_BASE = 1024 }

enum : uint { MCI_STRING_OFFSET = 512 }
enum : uint { MCI_VD_OFFSET = 1024 }
enum : uint { MCI_CD_OFFSET = 1088 }
enum : uint { MCI_WAVE_OFFSET = 1152 }
enum : uint { MCI_SEQ_OFFSET = 1216 }

enum : uint { MMSYSERR_NOERROR = 0 }
enum : uint { MMSYSERR_ERROR = MMSYSERR_BASE + 1 }
enum : uint { MMSYSERR_BADDEVICEID = MMSYSERR_BASE + 2 }
enum : uint { MMSYSERR_NOTENABLED = MMSYSERR_BASE + 3 }
enum : uint { MMSYSERR_ALLOCATED = MMSYSERR_BASE + 4 }
enum : uint { MMSYSERR_INVALHANDLE = MMSYSERR_BASE + 5 }
enum : uint { MMSYSERR_NODRIVER = MMSYSERR_BASE + 6 }
enum : uint { MMSYSERR_NOMEM = MMSYSERR_BASE + 7 }
enum : uint { MMSYSERR_NOTSUPPORTED = MMSYSERR_BASE + 8 }
enum : uint { MMSYSERR_BADERRNUM = MMSYSERR_BASE + 9 }
enum : uint { MMSYSERR_INVALFLAG = MMSYSERR_BASE + 10 }
enum : uint { MMSYSERR_INVALPARAM = MMSYSERR_BASE + 11 }
enum : uint { MMSYSERR_HANDLEBUSY = MMSYSERR_BASE + 12 }

enum : uint { MMSYSERR_INVALIDALIAS = MMSYSERR_BASE + 13 }
enum : uint { MMSYSERR_BADDB = MMSYSERR_BASE + 14 }
enum : uint { MMSYSERR_KEYNOTFOUND = MMSYSERR_BASE + 15 }
enum : uint { MMSYSERR_READERROR = MMSYSERR_BASE + 16 }
enum : uint { MMSYSERR_WRITEERROR = MMSYSERR_BASE + 17 }
enum : uint { MMSYSERR_DELETEERROR = MMSYSERR_BASE + 18 }
enum : uint { MMSYSERR_VALNOTFOUND = MMSYSERR_BASE + 19 }
enum : uint { MMSYSERR_NODRIVERCB = MMSYSERR_BASE + 20 }
enum : uint { MMSYSERR_MOREDATA = MMSYSERR_BASE + 21 }
enum : uint { MMSYSERR_LASTERROR = MMSYSERR_BASE + 21 }

// #if (WINVER < 0x030a) || defined(_WIN32)
alias void* HDRVR;
// #endif /* ifdef WINVER < 0x030a */

// #ifndef MMNODRV

// #ifdef _WIN32
struct DRVCONFIGINFOEX {
  DWORD dwDCISize;
  LPCWSTR lpszDCISectionName;
  LPCWSTR lpszDCIAliasName;
  DWORD dnDevNode;
}
alias DRVCONFIGINFOEX* PDRVCONFIGINFOEX;
alias DRVCONFIGINFOEX* NPDRVCONFIGINFOEX;
alias DRVCONFIGINFOEX* LPDRVCONFIGINFOEX;

// #else
// ...
// #endif

// #if (WINVER < 0x030a) || defined(_WIN32)

// #ifndef DRV_LOAD

enum : uint { DRV_LOAD = 0x0001 }
enum : uint { DRV_ENABLE = 0x0002 }
enum : uint { DRV_OPEN = 0x0003 }
enum : uint { DRV_CLOSE = 0x0004 }
enum : uint { DRV_DISABLE = 0x0005 }
enum : uint { DRV_FREE = 0x0006 }
enum : uint { DRV_CONFIGURE = 0x0007 }
enum : uint { DRV_QUERYCONFIGURE = 0x0008 }
enum : uint { DRV_INSTALL = 0x0009 }
enum : uint { DRV_REMOVE = 0x000A }
enum : uint { DRV_EXITSESSION = 0x000B }
enum : uint { DRV_POWER = 0x000F }
enum : uint { DRV_RESERVED = 0x0800 }
enum : uint { DRV_USER = 0x4000 }

// #ifdef _WIN32
struct tagDRVCONFIGINFO {
  DWORD dwDCISize;
  LPCWSTR lpszDCISectionName;
  LPCWSTR lpszDCIAliasName;
}
alias tagDRVCONFIGINFO DRVCONFIGINFO;
alias tagDRVCONFIGINFO* PDRVCONFIGINFO;
alias tagDRVCONFIGINFO* NPDRVCONFIGINFO;
alias tagDRVCONFIGINFO* LPDRVCONFIGINFO;

// #else
// ...
// #endif

enum : uint { DRVCNF_CANCEL = 0x0000 }
enum : uint { DRVCNF_OK = 0x0001 }
enum : uint { DRVCNF_RESTART = 0x0002 }

// #ifdef _WIN32

extern(Windows) alias LRESULT function(DWORD_PTR, HDRVR, UINT, LPARAM, LPARAM) DRIVERPROC;

extern(Windows) export LRESULT CloseDriver(HDRVR hDriver, LPARAM lParam1, LPARAM lParam2);
extern(Windows) export HDRVR OpenDriver(LPCWSTR szDriverName, LPCWSTR szSectionName, LPARAM lParam2);
extern(Windows) export LRESULT SendDriverMessage(HDRVR hDriver, UINT message, LPARAM lParam1, LPARAM lParam2);
extern(Windows) export HMODULE DrvGetModuleHandle(HDRVR hDriver);
extern(Windows) export HMODULE GetDriverModuleHandle(HDRVR hDriver);
extern(Windows) export LRESULT DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hdrvr, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
// #else
// ...
// #...
// #endif /* ifdef _WIN32 */
// #endif /* DRV_LOAD */
// #endif /* ifdef (WINVER < 0x030a) || defined(_WIN32) */

// #if (WINVER >= 0x030a)

alias DRVCNF_CANCEL DRV_CANCEL;
alias DRVCNF_OK DRV_OK;
alias DRVCNF_RESTART DRV_RESTART;

// #endif /* ifdef WINVER >= 0x030a */

alias DRV_RESERVED DRV_MCI_FIRST;
enum : uint { DRV_MCI_LAST = DRV_RESERVED + 0xFFF }

// #endif  /* ifndef MMNODRV */

enum : uint { CALLBACK_TYPEMASK = 0x00070000 }
enum : uint { CALLBACK_NULL = 0x00000000 }
enum : uint { CALLBACK_WINDOW = 0x00010000 }
enum : uint { CALLBACK_TASK = 0x00020000 }
enum : uint { CALLBACK_FUNCTION = 0x00030000 }
// #ifdef _WIN32
enum : uint { CALLBACK_THREAD = CALLBACK_TASK }
enum : uint { CALLBACK_EVENT = 0x00050000 }
// #endif
// typedef void (CALLBACK DRVCALLBACK)(HDRVR hdrvr, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2);

extern(Windows) alias void function(HDRVR hdrvr, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) LPDRVCALLBACK;
// #ifdef _WIN32
alias LPDRVCALLBACK PDRVCALLBACK;
// #endif

// #ifndef MMNOMMSYSTEM

// #if (WINVER <= 0x030A)
// ...
// #endif
// #ifdef _WIN32
alias OutputDebugString OutputDebugStr;
// #else
// ...
// #endif

// #endif  /* ifndef MMNOMMSYSTEM */

// #ifndef MMNOSOUND

// #ifdef _WIN32

extern(Windows) export BOOL sndPlaySoundA(LPCSTR pszSound, UINT fuSound);
extern(Windows) export BOOL sndPlaySoundW(LPCWSTR pszSound, UINT fuSound);
// #ifdef UNICODE
// #...
// #else
alias sndPlaySoundA sndPlaySound;
// #endif // !UNICODE

// #else
// ...
// #endif

enum : uint { SND_SYNC = 0x0000 }
enum : uint { SND_ASYNC = 0x0001 }
enum : uint { SND_NODEFAULT = 0x0002 }
enum : uint { SND_MEMORY = 0x0004 }
enum : uint { SND_LOOP = 0x0008 }
enum : uint { SND_NOSTOP = 0x0010 }

enum : uint { SND_NOWAIT = 0x00002000 }
enum : uint { SND_ALIAS = 0x00010000 }
enum : uint { SND_ALIAS_ID = 0x00110000 }
enum : uint { SND_FILENAME = 0x00020000 }
enum : uint { SND_RESOURCE = 0x00040004 }
// #if(WINVER >= 0x0400)
enum : uint { SND_PURGE = 0x0040 }
enum : uint { SND_APPLICATION = 0x0080 }
// #endif /* WINVER >= 0x0400 */

enum : uint { SND_ALIAS_START = 0 }

// #ifdef _WIN32
// #define sndAlias(ch0, ch1) (SND_ALIAS_START + (DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8))

// #define SND_ALIAS_SYSTEMASTERISK sndAlias('S', '*')
// #define SND_ALIAS_SYSTEMQUESTION sndAlias('S', '?')
// #define SND_ALIAS_SYSTEMHAND sndAlias('S', 'H')
// #define SND_ALIAS_SYSTEMEXIT sndAlias('S', 'E')
// #define SND_ALIAS_SYSTEMSTART sndAlias('S', 'S')
// #define SND_ALIAS_SYSTEMWELCOME sndAlias('S', 'W')
// #define SND_ALIAS_SYSTEMEXCLAMATION sndAlias('S', '!')
// #define SND_ALIAS_SYSTEMDEFAULT sndAlias('S', 'D')

extern(Windows) export BOOL PlaySoundA(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound);
extern(Windows) export BOOL PlaySoundW(LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound);
// #ifdef UNICODE
// #...
// #else
alias PlaySoundA PlaySound;
// #endif // !UNICODE

// #else
// ...
// #endif

// #endif  /* ifndef MMNOSOUND */

// #ifndef MMNOWAVE

enum : uint { WAVERR_BADFORMAT = WAVERR_BASE + 0 }
enum : uint { WAVERR_STILLPLAYING = WAVERR_BASE + 1 }
enum : uint { WAVERR_UNPREPARED = WAVERR_BASE + 2 }
enum : uint { WAVERR_SYNC = WAVERR_BASE + 3 }
enum : uint { WAVERR_LASTERROR = WAVERR_BASE + 3 }

alias void* HWAVE;
alias void* HWAVEIN;
alias void* HWAVEOUT;
alias HWAVEIN* LPHWAVEIN;
alias HWAVEOUT* LPHWAVEOUT;
// typedef DRVCALLBACK WAVECALLBACK;
alias LPDRVCALLBACK LPWAVECALLBACK;

alias MM_WOM_OPEN WOM_OPEN;
alias MM_WOM_CLOSE WOM_CLOSE;
alias MM_WOM_DONE WOM_DONE;
alias MM_WIM_OPEN WIM_OPEN;
alias MM_WIM_CLOSE WIM_CLOSE;
alias MM_WIM_DATA WIM_DATA;

enum : uint { WAVE_MAPPER = cast(UINT)-1 }

enum : uint { WAVE_FORMAT_QUERY = 0x0001 }
enum : uint { WAVE_ALLOWSYNC = 0x0002 }
// #if(WINVER >= 0x0400)
enum : uint { WAVE_MAPPED = 0x0004 }
enum : uint { WAVE_FORMAT_DIRECT = 0x0008 }
enum : uint { WAVE_FORMAT_DIRECT_QUERY = WAVE_FORMAT_QUERY | WAVE_FORMAT_DIRECT }
// #endif /* WINVER >= 0x0400 */

struct wavehdr_tag {
  LPSTR lpData;
  DWORD dwBufferLength;
  DWORD dwBytesRecorded;
  DWORD_PTR dwUser;
  DWORD dwFlags;
  DWORD dwLoops;
  wavehdr_tag *lpNext;
  DWORD_PTR reserved;
}
alias wavehdr_tag WAVEHDR;
alias wavehdr_tag* PWAVEHDR;
alias wavehdr_tag* NPWAVEHDR;
alias wavehdr_tag* LPWAVEHDR;

enum : uint { WHDR_DONE = 0x00000001 }
enum : uint { WHDR_PREPARED = 0x00000002 }
enum : uint { WHDR_BEGINLOOP = 0x00000004 }
enum : uint { WHDR_ENDLOOP = 0x00000008 }
enum : uint { WHDR_INQUEUE = 0x00000010 }

// #ifdef _WIN32

struct tagWAVEOUTCAPSA {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  CHAR szPname[MAXPNAMELEN];
  DWORD dwFormats;
  WORD wChannels;
  WORD wReserved1;
  DWORD dwSupport;
}
alias tagWAVEOUTCAPSA WAVEOUTCAPSA;
alias tagWAVEOUTCAPSA* PWAVEOUTCAPSA;
alias tagWAVEOUTCAPSA* NPWAVEOUTCAPSA;
alias tagWAVEOUTCAPSA* LPWAVEOUTCAPSA;

struct tagWAVEOUTCAPSW {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  WCHAR szPname[MAXPNAMELEN];
  DWORD dwFormats;
  WORD wChannels;
  WORD wReserved1;
  DWORD dwSupport;
}
alias tagWAVEOUTCAPSW WAVEOUTCAPSW;
alias tagWAVEOUTCAPSW* PWAVEOUTCAPSW;
alias tagWAVEOUTCAPSW* NPWAVEOUTCAPSW;
alias tagWAVEOUTCAPSW* LPWAVEOUTCAPSW;

// #ifdef UNICODE
// ...
// #else
alias WAVEOUTCAPSA WAVEOUTCAPS;
alias PWAVEOUTCAPSA PWAVEOUTCAPS;
alias NPWAVEOUTCAPSA NPWAVEOUTCAPS;
alias LPWAVEOUTCAPSA LPWAVEOUTCAPS;
// #endif // UNICODE
struct tagWAVEOUTCAPS2A {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  CHAR szPname[MAXPNAMELEN];
  DWORD dwFormats;
  WORD wChannels;
  WORD wReserved1;
  DWORD dwSupport;
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagWAVEOUTCAPS2A WAVEOUTCAPS2A;
alias tagWAVEOUTCAPS2A* PWAVEOUTCAPS2A;
alias tagWAVEOUTCAPS2A* NPWAVEOUTCAPS2A;
alias tagWAVEOUTCAPS2A* LPWAVEOUTCAPS2A;

struct tagWAVEOUTCAPS2W {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  WCHAR szPname[MAXPNAMELEN];
  DWORD dwFormats;
  WORD wChannels;
  WORD wReserved1;
  DWORD dwSupport;
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagWAVEOUTCAPS2W WAVEOUTCAPS2W;
alias tagWAVEOUTCAPS2W* PWAVEOUTCAPS2W;
alias tagWAVEOUTCAPS2W* NPWAVEOUTCAPS2W;
alias tagWAVEOUTCAPS2W* LPWAVEOUTCAPS2W;

// #ifdef UNICODE
// ...
// #else
alias WAVEOUTCAPS2A WAVEOUTCAPS2;
alias PWAVEOUTCAPS2A PWAVEOUTCAPS2;
alias NPWAVEOUTCAPS2A NPWAVEOUTCAPS2;
alias LPWAVEOUTCAPS2A LPWAVEOUTCAPS2;
// #endif // UNICODE

// #else
// ...
// #endif

enum : uint { WAVECAPS_PITCH = 0x0001 }
enum : uint { WAVECAPS_PLAYBACKRATE = 0x0002 }
enum : uint { WAVECAPS_VOLUME = 0x0004 }
enum : uint { WAVECAPS_LRVOLUME = 0x0008 }
enum : uint { WAVECAPS_SYNC = 0x0010 }
enum : uint { WAVECAPS_SAMPLEACCURATE = 0x0020 }

// #ifdef _WIN32

struct tagWAVEINCAPSA {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  CHAR szPname[MAXPNAMELEN];
  DWORD dwFormats;
  WORD wChannels;
  WORD wReserved1;
}
alias tagWAVEINCAPSA WAVEINCAPSA;
alias tagWAVEINCAPSA* PWAVEINCAPSA;
alias tagWAVEINCAPSA* NPWAVEINCAPSA;
alias tagWAVEINCAPSA* LPWAVEINCAPSA;

struct tagWAVEINCAPSW {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  WCHAR szPname[MAXPNAMELEN];
  DWORD dwFormats;
  WORD wChannels;
  WORD wReserved1;
}
alias tagWAVEINCAPSW WAVEINCAPSW;
alias tagWAVEINCAPSW* PWAVEINCAPSW;
alias tagWAVEINCAPSW* NPWAVEINCAPSW;
alias tagWAVEINCAPSW* LPWAVEINCAPSW;

// #ifdef UNICODE
// ...
// #else
alias WAVEINCAPSA WAVEINCAPS;
alias PWAVEINCAPSA PWAVEINCAPS;
alias NPWAVEINCAPSA NPWAVEINCAPS;
alias LPWAVEINCAPSA LPWAVEINCAPS;
// #endif // UNICODE
struct tagWAVEINCAPS2A {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  CHAR szPname[MAXPNAMELEN];
  DWORD dwFormats;
  WORD wChannels;
  WORD wReserved1;
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagWAVEINCAPS2A WAVEINCAPS2A;
alias tagWAVEINCAPS2A* PWAVEINCAPS2A;
alias tagWAVEINCAPS2A* NPWAVEINCAPS2A;
alias tagWAVEINCAPS2A* LPWAVEINCAPS2A;

struct tagWAVEINCAPS2W {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  WCHAR szPname[MAXPNAMELEN];
  DWORD dwFormats;
  WORD wChannels;
  WORD wReserved1;
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagWAVEINCAPS2W WAVEINCAPS2W;
alias tagWAVEINCAPS2W* PWAVEINCAPS2W;
alias tagWAVEINCAPS2W* NPWAVEINCAPS2W;
alias tagWAVEINCAPS2W* LPWAVEINCAPS2W;

// #ifdef UNICODE
// ...
// #else
alias WAVEINCAPS2A WAVEINCAPS2;
alias PWAVEINCAPS2A PWAVEINCAPS2;
alias NPWAVEINCAPS2A NPWAVEINCAPS2;
alias LPWAVEINCAPS2A LPWAVEINCAPS2;
// #endif // UNICODE

// #else
// ...
// #endif

enum : uint { WAVE_INVALIDFORMAT = 0x00000000 }
enum : uint { WAVE_FORMAT_1M08 = 0x00000001 }
enum : uint { WAVE_FORMAT_1S08 = 0x00000002 }
enum : uint { WAVE_FORMAT_1M16 = 0x00000004 }
enum : uint { WAVE_FORMAT_1S16 = 0x00000008 }
enum : uint { WAVE_FORMAT_2M08 = 0x00000010 }
enum : uint { WAVE_FORMAT_2S08 = 0x00000020 }
enum : uint { WAVE_FORMAT_2M16 = 0x00000040 }
enum : uint { WAVE_FORMAT_2S16 = 0x00000080 }
enum : uint { WAVE_FORMAT_4M08 = 0x00000100 }
enum : uint { WAVE_FORMAT_4S08 = 0x00000200 }
enum : uint { WAVE_FORMAT_4M16 = 0x00000400 }
enum : uint { WAVE_FORMAT_4S16 = 0x00000800 }

enum : uint { WAVE_FORMAT_44M08 = 0x00000100 }
enum : uint { WAVE_FORMAT_44S08 = 0x00000200 }
enum : uint { WAVE_FORMAT_44M16 = 0x00000400 }
enum : uint { WAVE_FORMAT_44S16 = 0x00000800 }
enum : uint { WAVE_FORMAT_48M08 = 0x00001000 }
enum : uint { WAVE_FORMAT_48S08 = 0x00002000 }
enum : uint { WAVE_FORMAT_48M16 = 0x00004000 }
enum : uint { WAVE_FORMAT_48S16 = 0x00008000 }
enum : uint { WAVE_FORMAT_96M08 = 0x00010000 }
enum : uint { WAVE_FORMAT_96S08 = 0x00020000 }
enum : uint { WAVE_FORMAT_96M16 = 0x00040000 }
enum : uint { WAVE_FORMAT_96S16 = 0x00080000 }

// #ifndef WAVE_FORMAT_PCM

struct waveformat_tag {
  WORD wFormatTag;
  WORD nChannels;
  DWORD nSamplesPerSec;
  DWORD nAvgBytesPerSec;
  WORD nBlockAlign;
}
alias waveformat_tag WAVEFORMAT;
alias waveformat_tag* PWAVEFORMAT;
alias waveformat_tag* NPWAVEFORMAT;
alias waveformat_tag* LPWAVEFORMAT;

enum : uint { WAVE_FORMAT_PCM = 1 }

struct pcmwaveformat_tag {
  WAVEFORMAT wf;
  WORD wBitsPerSample;
}
alias pcmwaveformat_tag PCMWAVEFORMAT;
alias pcmwaveformat_tag* PPCMWAVEFORMAT;
alias pcmwaveformat_tag* NPPCMWAVEFORMAT;
alias pcmwaveformat_tag* LPPCMWAVEFORMAT;

// #endif /* WAVE_FORMAT_PCM */

// #ifndef _WAVEFORMATEX_
// #define _WAVEFORMATEX_

struct tWAVEFORMATEX {
  WORD wFormatTag;
  WORD nChannels;
  DWORD nSamplesPerSec;
  DWORD nAvgBytesPerSec;
  WORD nBlockAlign;
  WORD wBitsPerSample;
  WORD cbSize;

}
alias tWAVEFORMATEX WAVEFORMATEX;
alias tWAVEFORMATEX* PWAVEFORMATEX;
alias tWAVEFORMATEX* NPWAVEFORMATEX;
alias tWAVEFORMATEX* LPWAVEFORMATEX;

// #endif /* _WAVEFORMATEX_ */
alias WAVEFORMATEX* LPCWAVEFORMATEX;

extern(Windows) export UINT waveOutGetNumDevs();

// #ifdef _WIN32

extern(Windows) export MMRESULT waveOutGetDevCapsA(UINT_PTR uDeviceID, LPWAVEOUTCAPSA pwoc, UINT cbwoc);
extern(Windows) export MMRESULT waveOutGetDevCapsW(UINT_PTR uDeviceID, LPWAVEOUTCAPSW pwoc, UINT cbwoc);
// #ifdef UNICODE
// #...
// #else
alias waveOutGetDevCapsA waveOutGetDevCaps;
// #endif // !UNICODE

// #else
// ...
// #endif

// #if (WINVER >= 0x0400)
extern(Windows) export MMRESULT waveOutGetVolume(HWAVEOUT hwo, LPDWORD pdwVolume);
extern(Windows) export MMRESULT waveOutSetVolume(HWAVEOUT hwo, DWORD dwVolume);
// #else
// ...
// #endif

// #ifdef _WIN32

extern(Windows) export MMRESULT waveOutGetErrorTextA(MMRESULT mmrError, LPSTR pszText, UINT cchText);
extern(Windows) export MMRESULT waveOutGetErrorTextW(MMRESULT mmrError, LPWSTR pszText, UINT cchText);
// #ifdef UNICODE
// #...
// #else
alias waveOutGetErrorTextA waveOutGetErrorText;
// #endif // !UNICODE

// #else
// ...
// #endif

extern(Windows) export MMRESULT waveOutOpen(LPHWAVEOUT phwo, UINT uDeviceID,
  LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);

extern(Windows) export MMRESULT waveOutClose(HWAVEOUT hwo);
extern(Windows) export MMRESULT waveOutPrepareHeader(HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh);
extern(Windows) export MMRESULT waveOutUnprepareHeader(HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh);
extern(Windows) export MMRESULT waveOutWrite(HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh);
extern(Windows) export MMRESULT waveOutPause(HWAVEOUT hwo);
extern(Windows) export MMRESULT waveOutRestart(HWAVEOUT hwo);
extern(Windows) export MMRESULT waveOutReset(HWAVEOUT hwo);
extern(Windows) export MMRESULT waveOutBreakLoop(HWAVEOUT hwo);
extern(Windows) export MMRESULT waveOutGetPosition(HWAVEOUT hwo, LPMMTIME pmmt, UINT cbmmt);
extern(Windows) export MMRESULT waveOutGetPitch(HWAVEOUT hwo, LPDWORD pdwPitch);
extern(Windows) export MMRESULT waveOutSetPitch(HWAVEOUT hwo, DWORD dwPitch);
extern(Windows) export MMRESULT waveOutGetPlaybackRate(HWAVEOUT hwo, LPDWORD pdwRate);
extern(Windows) export MMRESULT waveOutSetPlaybackRate(HWAVEOUT hwo, DWORD dwRate);
extern(Windows) export MMRESULT waveOutGetID(HWAVEOUT hwo, LPUINT puDeviceID);

// #if (WINVER >= 0x030a)
// #ifdef _WIN32
extern(Windows) export MMRESULT waveOutMessage(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
// #else
// ...
// #endif
// #endif /* ifdef WINVER >= 0x030a */

extern(Windows) export UINT waveInGetNumDevs();

// #ifdef _WIN32

extern(Windows) export MMRESULT waveInGetDevCapsA(UINT_PTR uDeviceID, LPWAVEINCAPSA pwic, UINT cbwic);
extern(Windows) export MMRESULT waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW pwic, UINT cbwic);
// #ifdef UNICODE
// #...
// #else
alias waveInGetDevCapsA waveInGetDevCaps;
// #endif // !UNICODE

// #else
// ...
// #endif

// #ifdef _WIN32

extern(Windows) export MMRESULT waveInGetErrorTextA(MMRESULT mmrError, LPSTR pszText, UINT cchText);
extern(Windows) export MMRESULT waveInGetErrorTextW(MMRESULT mmrError, LPWSTR pszText, UINT cchText);
// #ifdef UNICODE
// #...
// #else
alias waveInGetErrorTextA waveInGetErrorText;
// #endif // !UNICODE

// #else
// ...
// #endif

extern(Windows) export MMRESULT waveInOpen(LPHWAVEIN phwi, UINT uDeviceID,
  LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);

extern(Windows) export MMRESULT waveInClose(HWAVEIN hwi);
extern(Windows) export MMRESULT waveInPrepareHeader(HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
extern(Windows) export MMRESULT waveInUnprepareHeader(HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
extern(Windows) export MMRESULT waveInAddBuffer(HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
extern(Windows) export MMRESULT waveInStart(HWAVEIN hwi);
extern(Windows) export MMRESULT waveInStop(HWAVEIN hwi);
extern(Windows) export MMRESULT waveInReset(HWAVEIN hwi);
extern(Windows) export MMRESULT waveInGetPosition(HWAVEIN hwi, LPMMTIME pmmt, UINT cbmmt);
extern(Windows) export MMRESULT waveInGetID(HWAVEIN hwi, LPUINT puDeviceID);

// #if (WINVER >= 0x030a)
// #ifdef _WIN32
extern(Windows) export MMRESULT waveInMessage(HWAVEIN hwi, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
// #else
// ...
// #endif
// #endif /* ifdef WINVER >= 0x030a */

// #endif  /* ifndef MMNOWAVE */

// #ifndef MMNOMIDI

enum : uint { MIDIERR_UNPREPARED = MIDIERR_BASE + 0 }
enum : uint { MIDIERR_STILLPLAYING = MIDIERR_BASE + 1 }
enum : uint { MIDIERR_NOMAP = MIDIERR_BASE + 2 }
enum : uint { MIDIERR_NOTREADY = MIDIERR_BASE + 3 }
enum : uint { MIDIERR_NODEVICE = MIDIERR_BASE + 4 }
enum : uint { MIDIERR_INVALIDSETUP = MIDIERR_BASE + 5 }
enum : uint { MIDIERR_BADOPENMODE = MIDIERR_BASE + 6 }
enum : uint { MIDIERR_DONT_CONTINUE = MIDIERR_BASE + 7 }
enum : uint { MIDIERR_LASTERROR = MIDIERR_BASE + 7 }

alias void* HMIDI;
alias void* HMIDIIN;
alias void* HMIDIOUT;
alias void* HMIDISTRM;
alias HMIDI* LPHMIDI;
alias HMIDIIN* LPHMIDIIN;
alias HMIDIOUT* LPHMIDIOUT;
alias HMIDISTRM* LPHMIDISTRM;
// typedef DRVCALLBACK MIDICALLBACK;
alias LPDRVCALLBACK LPMIDICALLBACK;
enum : uint { MIDIPATCHSIZE = 128 }
alias WORD PATCHARRAY[MIDIPATCHSIZE];
alias WORD* LPPATCHARRAY;
alias WORD KEYARRAY[MIDIPATCHSIZE];
alias WORD* LPKEYARRAY;

alias MM_MIM_OPEN MIM_OPEN;
alias MM_MIM_CLOSE MIM_CLOSE;
alias MM_MIM_DATA MIM_DATA;
alias MM_MIM_LONGDATA MIM_LONGDATA;
alias MM_MIM_ERROR MIM_ERROR;
alias MM_MIM_LONGERROR MIM_LONGERROR;
alias MM_MOM_OPEN MOM_OPEN;
alias MM_MOM_CLOSE MOM_CLOSE;
alias MM_MOM_DONE MOM_DONE;

// #if(WINVER >= 0x0400)
alias MM_MIM_MOREDATA MIM_MOREDATA;
alias MM_MOM_POSITIONCB MOM_POSITIONCB;
// #endif /* WINVER >= 0x0400 */

enum : uint { MIDIMAPPER = cast(UINT)-1 }
enum : uint { MIDI_MAPPER = cast(UINT)-1 }

// #if(WINVER >= 0x0400)

enum : uint { MIDI_IO_STATUS = 0x00000020 }
// #endif /* WINVER >= 0x0400 */

enum : uint { MIDI_CACHE_ALL = 1 }
enum : uint { MIDI_CACHE_BESTFIT = 2 }
enum : uint { MIDI_CACHE_QUERY = 3 }
enum : uint { MIDI_UNCACHE = 4 }

// #ifdef _WIN32

struct tagMIDIOUTCAPSA {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  CHAR szPname[MAXPNAMELEN];
  WORD wTechnology;
  WORD wVoices;
  WORD wNotes;
  WORD wChannelMask;
  DWORD dwSupport;
}
alias tagMIDIOUTCAPSA MIDIOUTCAPSA;
alias tagMIDIOUTCAPSA* PMIDIOUTCAPSA;
alias tagMIDIOUTCAPSA* NPMIDIOUTCAPSA;
alias tagMIDIOUTCAPSA* LPMIDIOUTCAPSA;

struct tagMIDIOUTCAPSW {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  WCHAR szPname[MAXPNAMELEN];
  WORD wTechnology;
  WORD wVoices;
  WORD wNotes;
  WORD wChannelMask;
  DWORD dwSupport;
}
alias tagMIDIOUTCAPSW MIDIOUTCAPSW;
alias tagMIDIOUTCAPSW* PMIDIOUTCAPSW;
alias tagMIDIOUTCAPSW* NPMIDIOUTCAPSW;
alias tagMIDIOUTCAPSW* LPMIDIOUTCAPSW;

// #ifdef UNICODE
// ...
// #else
alias MIDIOUTCAPSA MIDIOUTCAPS;
alias PMIDIOUTCAPSA PMIDIOUTCAPS;
alias NPMIDIOUTCAPSA NPMIDIOUTCAPS;
alias LPMIDIOUTCAPSA LPMIDIOUTCAPS;
// #endif // UNICODE
struct tagMIDIOUTCAPS2A {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  CHAR szPname[MAXPNAMELEN];
  WORD wTechnology;
  WORD wVoices;
  WORD wNotes;
  WORD wChannelMask;
  DWORD dwSupport;
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagMIDIOUTCAPS2A MIDIOUTCAPS2A;
alias tagMIDIOUTCAPS2A* PMIDIOUTCAPS2A;
alias tagMIDIOUTCAPS2A* NPMIDIOUTCAPS2A;
alias tagMIDIOUTCAPS2A* LPMIDIOUTCAPS2A;

struct tagMIDIOUTCAPS2W {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  WCHAR szPname[MAXPNAMELEN];
  WORD wTechnology;
  WORD wVoices;
  WORD wNotes;
  WORD wChannelMask;
  DWORD dwSupport;
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagMIDIOUTCAPS2W MIDIOUTCAPS2W;
alias tagMIDIOUTCAPS2W* PMIDIOUTCAPS2W;
alias tagMIDIOUTCAPS2W* NPMIDIOUTCAPS2W;
alias tagMIDIOUTCAPS2W* LPMIDIOUTCAPS2W;

// #ifdef UNICODE
// ...
// #else
alias MIDIOUTCAPS2A MIDIOUTCAPS2;
alias PMIDIOUTCAPS2A PMIDIOUTCAPS2;
alias NPMIDIOUTCAPS2A NPMIDIOUTCAPS2;
alias LPMIDIOUTCAPS2A LPMIDIOUTCAPS2;
// #endif // UNICODE

// #else
// ...
// #endif

enum : uint { MOD_MIDIPORT = 1 }
enum : uint { MOD_SYNTH = 2 }
enum : uint { MOD_SQSYNTH = 3 }
enum : uint { MOD_FMSYNTH = 4 }
enum : uint { MOD_MAPPER = 5 }
enum : uint { MOD_WAVETABLE = 6 }
enum : uint { MOD_SWSYNTH = 7 }

enum : uint { MIDICAPS_VOLUME = 0x0001 }
enum : uint { MIDICAPS_LRVOLUME = 0x0002 }
enum : uint { MIDICAPS_CACHE = 0x0004 }
// #if(WINVER >= 0x0400)
enum : uint { MIDICAPS_STREAM = 0x0008 }
// #endif /* WINVER >= 0x0400 */

// #ifdef _WIN32

struct tagMIDIINCAPSA {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  CHAR szPname[MAXPNAMELEN];
// #if (WINVER >= 0x0400)
  DWORD dwSupport;
// #endif
}
alias tagMIDIINCAPSA MIDIINCAPSA;
alias tagMIDIINCAPSA* PMIDIINCAPSA;
alias tagMIDIINCAPSA* NPMIDIINCAPSA;
alias tagMIDIINCAPSA* LPMIDIINCAPSA;

struct tagMIDIINCAPSW {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  WCHAR szPname[MAXPNAMELEN];
// #if (WINVER >= 0x0400)
  DWORD dwSupport;
// #endif
}
alias tagMIDIINCAPSW MIDIINCAPSW;
alias tagMIDIINCAPSW* PMIDIINCAPSW;
alias tagMIDIINCAPSW* NPMIDIINCAPSW;
alias tagMIDIINCAPSW* LPMIDIINCAPSW;

// #ifdef UNICODE
// ...
// #else
alias MIDIINCAPSA MIDIINCAPS;
alias PMIDIINCAPSA PMIDIINCAPS;
alias NPMIDIINCAPSA NPMIDIINCAPS;
alias LPMIDIINCAPSA LPMIDIINCAPS;
// #endif // UNICODE
struct tagMIDIINCAPS2A {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  CHAR szPname[MAXPNAMELEN];
// #if (WINVER >= 0x0400)
  DWORD dwSupport;
// #endif
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagMIDIINCAPS2A MIDIINCAPS2A;
alias tagMIDIINCAPS2A* PMIDIINCAPS2A;
alias tagMIDIINCAPS2A* NPMIDIINCAPS2A;
alias tagMIDIINCAPS2A* LPMIDIINCAPS2A;

struct tagMIDIINCAPS2W {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  WCHAR szPname[MAXPNAMELEN];
// #if (WINVER >= 0x0400)
  DWORD dwSupport;
// #endif
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagMIDIINCAPS2W MIDIINCAPS2W;
alias tagMIDIINCAPS2W* PMIDIINCAPS2W;
alias tagMIDIINCAPS2W* NPMIDIINCAPS2W;
alias tagMIDIINCAPS2W* LPMIDIINCAPS2W;

// #ifdef UNICODE
// ...
// #else
alias MIDIINCAPS2A MIDIINCAPS2;
alias PMIDIINCAPS2A PMIDIINCAPS2;
alias NPMIDIINCAPS2A NPMIDIINCAPS2;
alias LPMIDIINCAPS2A LPMIDIINCAPS2;
// #endif // UNICODE

// #else
// ...
// #if (WINVER >= 0x0400)
// ...
// #endif
// ...
// #endif

struct midihdr_tag {
  LPSTR lpData;
  DWORD dwBufferLength;
  DWORD dwBytesRecorded;
  DWORD_PTR dwUser;
  DWORD dwFlags;
  midihdr_tag *lpNext;
  DWORD_PTR reserved;
// #if (WINVER >= 0x0400)
  DWORD dwOffset;
  DWORD_PTR dwReserved[8];
// #endif
}
alias midihdr_tag MIDIHDR;
alias midihdr_tag* PMIDIHDR;
alias midihdr_tag* NPMIDIHDR;
alias midihdr_tag* LPMIDIHDR;

// #if(WINVER >= 0x0400)
struct midievent_tag {
  DWORD dwDeltaTime;
  DWORD dwStreamID;
  DWORD dwEvent;
  DWORD dwParms[1];
}
alias midievent_tag MIDIEVENT;

struct midistrmbuffver_tag {
  DWORD dwVersion;
  DWORD dwMid;
  DWORD dwOEMVersion;
}
alias midistrmbuffver_tag MIDISTRMBUFFVER;

// #endif /* WINVER >= 0x0400 */

enum : uint { MHDR_DONE = 0x00000001 }
enum : uint { MHDR_PREPARED = 0x00000002 }
enum : uint { MHDR_INQUEUE = 0x00000004 }
enum : uint { MHDR_ISSTRM = 0x00000008 }
// #if(WINVER >= 0x0400)

enum : uint { MEVT_F_SHORT = 0x00000000 }
enum : uint { MEVT_F_LONG = 0x80000000 }
enum : uint { MEVT_F_CALLBACK = 0x40000000 }

// #define MEVT_EVENTTYPE(x) ((BYTE)(((x)>>24)&0xFF))
// #define MEVT_EVENTPARM(x) ((DWORD)((x)&0x00FFFFFFL))

enum : BYTE { MEVT_SHORTMSG = 0x00 }
enum : BYTE { MEVT_TEMPO = 0x01 }
enum : BYTE { MEVT_NOP = 0x02 }

enum : BYTE { MEVT_LONGMSG = 0x80 }
enum : BYTE { MEVT_COMMENT = 0x82 }
enum : BYTE { MEVT_VERSION = 0x84 }

enum { MIDISTRM_ERROR = -2 }

enum : uint { MIDIPROP_SET = 0x80000000 }
enum : uint { MIDIPROP_GET = 0x40000000 }

enum : uint { MIDIPROP_TIMEDIV = 0x00000001 }
enum : uint { MIDIPROP_TEMPO = 0x00000002 }

struct midiproptimediv_tag {
  DWORD cbStruct;
  DWORD dwTimeDiv;
}
alias midiproptimediv_tag MIDIPROPTIMEDIV;
alias midiproptimediv_tag* LPMIDIPROPTIMEDIV;

struct midiproptempo_tag {
  DWORD cbStruct;
  DWORD dwTempo;
}
alias midiproptempo_tag MIDIPROPTEMPO;
alias midiproptempo_tag* LPMIDIPROPTEMPO;

// #endif /* WINVER >= 0x0400 */

extern(Windows) export UINT midiOutGetNumDevs();
// #if(WINVER >= 0x0400)
extern(Windows) export MMRESULT midiStreamOpen(LPHMIDISTRM phms, LPUINT puDeviceID, DWORD cMidi, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
extern(Windows) export MMRESULT midiStreamClose(HMIDISTRM hms);

extern(Windows) export MMRESULT midiStreamProperty(HMIDISTRM hms, LPBYTE lppropdata, DWORD dwProperty);
extern(Windows) export MMRESULT midiStreamPosition(HMIDISTRM hms, LPMMTIME lpmmt, UINT cbmmt);

extern(Windows) export MMRESULT midiStreamOut(HMIDISTRM hms, LPMIDIHDR pmh, UINT cbmh);
extern(Windows) export MMRESULT midiStreamPause(HMIDISTRM hms);
extern(Windows) export MMRESULT midiStreamRestart(HMIDISTRM hms);
extern(Windows) export MMRESULT midiStreamStop(HMIDISTRM hms);

// #ifdef _WIN32
extern(Windows) export MMRESULT midiConnect(HMIDI hmi, HMIDIOUT hmo, LPVOID pReserved);
extern(Windows) export MMRESULT midiDisconnect(HMIDI hmi, HMIDIOUT hmo, LPVOID pReserved);
// #endif
// #endif /* WINVER >= 0x0400 */

// #ifdef _WIN32

extern(Windows) export MMRESULT midiOutGetDevCapsA(UINT_PTR uDeviceID, LPMIDIOUTCAPSA pmoc, UINT cbmoc);
extern(Windows) export MMRESULT midiOutGetDevCapsW(UINT_PTR uDeviceID, LPMIDIOUTCAPSW pmoc, UINT cbmoc);
// #ifdef UNICODE
// #...
// #else
alias midiOutGetDevCapsA midiOutGetDevCaps;
// #endif // !UNICODE

// #else
// ...
// #endif

// #if (WINVER >= 0x0400)
extern(Windows) export MMRESULT midiOutGetVolume(HMIDIOUT hmo, LPDWORD pdwVolume);
extern(Windows) export MMRESULT midiOutSetVolume(HMIDIOUT hmo, DWORD dwVolume);
// #else
// ...
// #endif

// #ifdef _WIN32

extern(Windows) export MMRESULT midiOutGetErrorTextA(MMRESULT mmrError, LPSTR pszText, UINT cchText);
extern(Windows) export MMRESULT midiOutGetErrorTextW(MMRESULT mmrError, LPWSTR pszText, UINT cchText);
// #ifdef UNICODE
// #...
// #else
alias midiOutGetErrorTextA midiOutGetErrorText;
// #endif // !UNICODE

// #else
// ...
// #endif

extern(Windows) export MMRESULT midiOutOpen(LPHMIDIOUT phmo, UINT uDeviceID,
  DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
extern(Windows) export MMRESULT midiOutClose(HMIDIOUT hmo);
extern(Windows) export MMRESULT midiOutPrepareHeader(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh);
extern(Windows) export MMRESULT midiOutUnprepareHeader(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh);
extern(Windows) export MMRESULT midiOutShortMsg(HMIDIOUT hmo, DWORD dwMsg);
extern(Windows) export MMRESULT midiOutLongMsg(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh);
extern(Windows) export MMRESULT midiOutReset(HMIDIOUT hmo);
extern(Windows) export MMRESULT midiOutCachePatches(HMIDIOUT hmo, UINT uBank, LPWORD pwpa, UINT fuCache);
extern(Windows) export MMRESULT midiOutCacheDrumPatches(HMIDIOUT hmo, UINT uPatch, LPWORD pwkya, UINT fuCache);
extern(Windows) export MMRESULT midiOutGetID(HMIDIOUT hmo, LPUINT puDeviceID);

// #if (WINVER >= 0x030a)
// #ifdef _WIN32
extern(Windows) export MMRESULT midiOutMessage(HMIDIOUT hmo, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
// #else
// ...
// #endif
// #endif /* ifdef WINVER >= 0x030a */

extern(Windows) export UINT midiInGetNumDevs();

// #ifdef _WIN32

extern(Windows) export MMRESULT midiInGetDevCapsA(UINT_PTR uDeviceID, LPMIDIINCAPSA pmic, UINT cbmic);
extern(Windows) export MMRESULT midiInGetDevCapsW(UINT_PTR uDeviceID, LPMIDIINCAPSW pmic, UINT cbmic);
// #ifdef UNICODE
// #...
// #else
alias midiInGetDevCapsA midiInGetDevCaps;
// #endif // !UNICODE
extern(Windows) export MMRESULT midiInGetErrorTextA(MMRESULT mmrError, LPSTR pszText, UINT cchText);
extern(Windows) export MMRESULT midiInGetErrorTextW(MMRESULT mmrError, LPWSTR pszText, UINT cchText);
// #ifdef UNICODE
// #...
// #else
alias midiInGetErrorTextA midiInGetErrorText;
// #endif // !UNICODE

// #else
// ...
// #endif

extern(Windows) export MMRESULT midiInOpen(LPHMIDIIN phmi, UINT uDeviceID,
  DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
extern(Windows) export MMRESULT midiInClose(HMIDIIN hmi);
extern(Windows) export MMRESULT midiInPrepareHeader(HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh);
extern(Windows) export MMRESULT midiInUnprepareHeader(HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh);
extern(Windows) export MMRESULT midiInAddBuffer(HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh);
extern(Windows) export MMRESULT midiInStart(HMIDIIN hmi);
extern(Windows) export MMRESULT midiInStop(HMIDIIN hmi);
extern(Windows) export MMRESULT midiInReset(HMIDIIN hmi);
extern(Windows) export MMRESULT midiInGetID(HMIDIIN hmi, LPUINT puDeviceID);

// #if (WINVER >= 0x030a)
// #ifdef _WIN32
extern(Windows) export MMRESULT midiInMessage(HMIDIIN hmi, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
// #else
// ...
// #endif
// #endif /* ifdef WINVER >= 0x030a */

// #endif  /* ifndef MMNOMIDI */

// #ifndef MMNOAUX

enum : uint { AUX_MAPPER = cast(UINT)-1 }

// #ifdef _WIN32

struct tagAUXCAPSA {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  CHAR szPname[MAXPNAMELEN];
  WORD wTechnology;
  WORD wReserved1;
  DWORD dwSupport;
}
alias tagAUXCAPSA AUXCAPSA;
alias tagAUXCAPSA* PAUXCAPSA;
alias tagAUXCAPSA* NPAUXCAPSA;
alias tagAUXCAPSA* LPAUXCAPSA;

struct tagAUXCAPSW {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  WCHAR szPname[MAXPNAMELEN];
  WORD wTechnology;
  WORD wReserved1;
  DWORD dwSupport;
}
alias tagAUXCAPSW AUXCAPSW;
alias tagAUXCAPSW* PAUXCAPSW;
alias tagAUXCAPSW* NPAUXCAPSW;
alias tagAUXCAPSW* LPAUXCAPSW;

// #ifdef UNICODE
// ...
// #else
alias AUXCAPSA AUXCAPS;
alias PAUXCAPSA PAUXCAPS;
alias NPAUXCAPSA NPAUXCAPS;
alias LPAUXCAPSA LPAUXCAPS;
// #endif // UNICODE
struct tagAUXCAPS2A {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  CHAR szPname[MAXPNAMELEN];
  WORD wTechnology;
  WORD wReserved1;
  DWORD dwSupport;
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagAUXCAPS2A AUXCAPS2A;
alias tagAUXCAPS2A* PAUXCAPS2A;
alias tagAUXCAPS2A* NPAUXCAPS2A;
alias tagAUXCAPS2A* LPAUXCAPS2A;

struct tagAUXCAPS2W {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  WCHAR szPname[MAXPNAMELEN];
  WORD wTechnology;
  WORD wReserved1;
  DWORD dwSupport;
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagAUXCAPS2W AUXCAPS2W;
alias tagAUXCAPS2W* PAUXCAPS2W;
alias tagAUXCAPS2W* NPAUXCAPS2W;
alias tagAUXCAPS2W* LPAUXCAPS2W;

// #ifdef UNICODE
// ...
// #else
alias AUXCAPS2A AUXCAPS2;
alias PAUXCAPS2A PAUXCAPS2;
alias NPAUXCAPS2A NPAUXCAPS2;
alias LPAUXCAPS2A LPAUXCAPS2;
// #endif // UNICODE

// #else
// ...
// #endif

enum : uint { AUXCAPS_CDAUDIO = 1 }
enum : uint { AUXCAPS_AUXIN = 2 }

enum : uint { AUXCAPS_VOLUME = 0x0001 }
enum : uint { AUXCAPS_LRVOLUME = 0x0002 }

extern(Windows) export UINT auxGetNumDevs();
// #ifdef _WIN32

extern(Windows) export MMRESULT auxGetDevCapsA(UINT_PTR uDeviceID, LPAUXCAPSA pac, UINT cbac);
extern(Windows) export MMRESULT auxGetDevCapsW(UINT_PTR uDeviceID, LPAUXCAPSW pac, UINT cbac);
// #ifdef UNICODE
// #...
// #else
alias auxGetDevCapsA auxGetDevCaps;
// #endif // !UNICODE

// #else
// ...
// #endif
extern(Windows) export MMRESULT auxSetVolume(UINT uDeviceID, DWORD dwVolume);
extern(Windows) export MMRESULT auxGetVolume(UINT uDeviceID, LPDWORD pdwVolume);

// #if (WINVER >= 0x030a)
// #ifdef _WIN32
extern(Windows) export MMRESULT auxOutMessage(UINT uDeviceID, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
// #else
// ...
// #endif
// #endif /* ifdef WINVER >= 0x030a */

// #endif  /* ifndef MMNOAUX */

// #ifndef MMNOMIXER

alias void* HMIXEROBJ;
alias HMIXEROBJ* LPHMIXEROBJ;

alias void* HMIXER;
alias HMIXER* LPHMIXER;

enum : uint { MIXER_SHORT_NAME_CHARS = 16 }
enum : uint { MIXER_LONG_NAME_CHARS = 64 }

enum : uint { MIXERR_INVALLINE = MIXERR_BASE + 0 }
enum : uint { MIXERR_INVALCONTROL = MIXERR_BASE + 1 }
enum : uint { MIXERR_INVALVALUE = MIXERR_BASE + 2 }
enum : uint { MIXERR_LASTERROR = MIXERR_BASE + 2 }

enum : uint { MIXER_OBJECTF_HANDLE = 0x80000000 }
enum : uint { MIXER_OBJECTF_MIXER = 0x00000000 }
enum : uint { MIXER_OBJECTF_HMIXER = MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIXER }
enum : uint { MIXER_OBJECTF_WAVEOUT = 0x10000000 }
enum : uint { MIXER_OBJECTF_HWAVEOUT = MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEOUT }
enum : uint { MIXER_OBJECTF_WAVEIN = 0x20000000 }
enum : uint { MIXER_OBJECTF_HWAVEIN = MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEIN }
enum : uint { MIXER_OBJECTF_MIDIOUT = 0x30000000 }
enum : uint { MIXER_OBJECTF_HMIDIOUT = MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIOUT }
enum : uint { MIXER_OBJECTF_MIDIIN = 0x40000000 }
enum : uint { MIXER_OBJECTF_HMIDIIN = MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIIN }
enum : uint { MIXER_OBJECTF_AUX = 0x50000000 }

extern(Windows) export UINT mixerGetNumDevs();

// #ifdef _WIN32

struct tagMIXERCAPSA {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  CHAR szPname[MAXPNAMELEN];
  DWORD fdwSupport;
  DWORD cDestinations;
}
alias tagMIXERCAPSA MIXERCAPSA;
alias tagMIXERCAPSA* PMIXERCAPSA;
alias tagMIXERCAPSA* LPMIXERCAPSA;

struct tagMIXERCAPSW {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  WCHAR szPname[MAXPNAMELEN];
  DWORD fdwSupport;
  DWORD cDestinations;
}
alias tagMIXERCAPSW MIXERCAPSW;
alias tagMIXERCAPSW* PMIXERCAPSW;
alias tagMIXERCAPSW* LPMIXERCAPSW;

// #ifdef UNICODE
// ...
// #else
alias MIXERCAPSA MIXERCAPS;
alias PMIXERCAPSA PMIXERCAPS;
alias LPMIXERCAPSA LPMIXERCAPS;
// #endif // UNICODE
struct tagMIXERCAPS2A {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  CHAR szPname[MAXPNAMELEN];
  DWORD fdwSupport;
  DWORD cDestinations;
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagMIXERCAPS2A MIXERCAPS2A;
alias tagMIXERCAPS2A* PMIXERCAPS2A;
alias tagMIXERCAPS2A* LPMIXERCAPS2A;

struct tagMIXERCAPS2W {
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  WCHAR szPname[MAXPNAMELEN];
  DWORD fdwSupport;
  DWORD cDestinations;
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagMIXERCAPS2W MIXERCAPS2W;
alias tagMIXERCAPS2W* PMIXERCAPS2W;
alias tagMIXERCAPS2W* LPMIXERCAPS2W;

// #ifdef UNICODE
// ...
// #else
alias MIXERCAPS2A MIXERCAPS2;
alias PMIXERCAPS2A PMIXERCAPS2;
alias LPMIXERCAPS2A LPMIXERCAPS2;
// #endif // UNICODE

// #else
// ...
// #endif

// #ifdef _WIN32

extern(Windows) export MMRESULT mixerGetDevCapsA(UINT_PTR uMxId, LPMIXERCAPSA pmxcaps, UINT cbmxcaps);
extern(Windows) export MMRESULT mixerGetDevCapsW(UINT_PTR uMxId, LPMIXERCAPSW pmxcaps, UINT cbmxcaps);
// #ifdef UNICODE
// #...
// #else
alias mixerGetDevCapsA mixerGetDevCaps;
// #endif // !UNICODE

// #else
// ...
// #endif

extern(Windows) export MMRESULT mixerOpen(LPHMIXER phmx, UINT uMxId, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);

extern(Windows) export MMRESULT mixerClose(HMIXER hmx);

extern(Windows) export DWORD mixerMessage(HMIXER hmx, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);

// #ifdef _WIN32

struct tagMIXERLINEA {
  DWORD cbStruct;
  DWORD dwDestination;
  DWORD dwSource;
  DWORD dwLineID;
  DWORD fdwLine;
  DWORD_PTR dwUser;
  DWORD dwComponentType;
  DWORD cChannels;
  DWORD cConnections;
  DWORD cControls;
  CHAR szShortName[MIXER_SHORT_NAME_CHARS];
  CHAR szName[MIXER_LONG_NAME_CHARS];
struct {
  DWORD dwType;
  DWORD dwDeviceID;
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  CHAR szPname[MAXPNAMELEN];
}

}
alias tagMIXERLINEA MIXERLINEA;
alias tagMIXERLINEA* PMIXERLINEA;
alias tagMIXERLINEA* LPMIXERLINEA;

struct tagMIXERLINEW {
  DWORD cbStruct;
  DWORD dwDestination;
  DWORD dwSource;
  DWORD dwLineID;
  DWORD fdwLine;
  DWORD_PTR dwUser;
  DWORD dwComponentType;
  DWORD cChannels;
  DWORD cConnections;
  DWORD cControls;
  WCHAR szShortName[MIXER_SHORT_NAME_CHARS];
  WCHAR szName[MIXER_LONG_NAME_CHARS];
struct {
  DWORD dwType;
  DWORD dwDeviceID;
  WORD wMid;
  WORD wPid;
  MMVERSION vDriverVersion;
  WCHAR szPname[MAXPNAMELEN];
}

}
alias tagMIXERLINEW MIXERLINEW;
alias tagMIXERLINEW* PMIXERLINEW;
alias tagMIXERLINEW* LPMIXERLINEW;

// #ifdef UNICODE
// ...
// #else
alias MIXERLINEA MIXERLINE;
alias PMIXERLINEA PMIXERLINE;
alias LPMIXERLINEA LPMIXERLINE;
// #endif // UNICODE

// #else
// ...
// #endif

enum : uint { MIXERLINE_LINEF_ACTIVE = 0x00000001 }
enum : uint { MIXERLINE_LINEF_DISCONNECTED = 0x00008000 }
enum : uint { MIXERLINE_LINEF_SOURCE = 0x80000000 }

enum : uint { MIXERLINE_COMPONENTTYPE_DST_FIRST = 0x00000000 }
enum : uint { MIXERLINE_COMPONENTTYPE_DST_UNDEFINED = MIXERLINE_COMPONENTTYPE_DST_FIRST + 0 }
enum : uint { MIXERLINE_COMPONENTTYPE_DST_DIGITAL = MIXERLINE_COMPONENTTYPE_DST_FIRST + 1 }
enum : uint { MIXERLINE_COMPONENTTYPE_DST_LINE = MIXERLINE_COMPONENTTYPE_DST_FIRST + 2 }
enum : uint { MIXERLINE_COMPONENTTYPE_DST_MONITOR = MIXERLINE_COMPONENTTYPE_DST_FIRST + 3 }
enum : uint { MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = MIXERLINE_COMPONENTTYPE_DST_FIRST + 4 }
enum : uint { MIXERLINE_COMPONENTTYPE_DST_HEADPHONES = MIXERLINE_COMPONENTTYPE_DST_FIRST + 5 }
enum : uint { MIXERLINE_COMPONENTTYPE_DST_TELEPHONE = MIXERLINE_COMPONENTTYPE_DST_FIRST + 6 }
enum : uint { MIXERLINE_COMPONENTTYPE_DST_WAVEIN = MIXERLINE_COMPONENTTYPE_DST_FIRST + 7 }
enum : uint { MIXERLINE_COMPONENTTYPE_DST_VOICEIN = MIXERLINE_COMPONENTTYPE_DST_FIRST + 8 }
enum : uint { MIXERLINE_COMPONENTTYPE_DST_LAST = MIXERLINE_COMPONENTTYPE_DST_FIRST + 8 }

enum : uint { MIXERLINE_COMPONENTTYPE_SRC_FIRST = 0x00001000 }
enum : uint { MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0 }
enum : uint { MIXERLINE_COMPONENTTYPE_SRC_DIGITAL = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1 }
enum : uint { MIXERLINE_COMPONENTTYPE_SRC_LINE = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2 }
enum : uint { MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3 }
enum : uint { MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 4 }
enum : uint { MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 5 }
enum : uint { MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 6 }
enum : uint { MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 7 }
enum : uint { MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 8 }
enum : uint { MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 9 }
enum : uint { MIXERLINE_COMPONENTTYPE_SRC_ANALOG = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10 }
enum : uint { MIXERLINE_COMPONENTTYPE_SRC_LAST = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10 }

enum : uint { MIXERLINE_TARGETTYPE_UNDEFINED = 0 }
enum : uint { MIXERLINE_TARGETTYPE_WAVEOUT = 1 }
enum : uint { MIXERLINE_TARGETTYPE_WAVEIN = 2 }
enum : uint { MIXERLINE_TARGETTYPE_MIDIOUT = 3 }
enum : uint { MIXERLINE_TARGETTYPE_MIDIIN = 4 }
enum : uint { MIXERLINE_TARGETTYPE_AUX = 5 }

// #ifdef _WIN32

extern(Windows) export MMRESULT mixerGetLineInfoA(HMIXEROBJ hmxobj, LPMIXERLINEA pmxl, DWORD fdwInfo);
extern(Windows) export MMRESULT mixerGetLineInfoW(HMIXEROBJ hmxobj, LPMIXERLINEW pmxl, DWORD fdwInfo);
// #ifdef UNICODE
// #...
// #else
alias mixerGetLineInfoA mixerGetLineInfo;
// #endif // !UNICODE

// #else
// ...
// #endif

enum : uint { MIXER_GETLINEINFOF_DESTINATION = 0x00000000 }
enum : uint { MIXER_GETLINEINFOF_SOURCE = 0x00000001 }
enum : uint { MIXER_GETLINEINFOF_LINEID = 0x00000002 }
enum : uint { MIXER_GETLINEINFOF_COMPONENTTYPE = 0x00000003 }
enum : uint { MIXER_GETLINEINFOF_TARGETTYPE = 0x00000004 }

enum : uint { MIXER_GETLINEINFOF_QUERYMASK = 0x0000000F }

extern(Windows) export MMRESULT mixerGetID(HMIXEROBJ hmxobj, UINT *puMxId, DWORD fdwId);

// #ifdef _WIN32

struct tagMIXERCONTROLA {
  DWORD cbStruct;
  DWORD dwControlID;
  DWORD dwControlType;
  DWORD fdwControl;
  DWORD cMultipleItems;
  CHAR szShortName[MIXER_SHORT_NAME_CHARS];
  CHAR szName[MIXER_LONG_NAME_CHARS];
union _0 {
struct {
  LONG lMinimum;
  LONG lMaximum;
}

struct {
  DWORD dwMinimum;
  DWORD dwMaximum;
}

  DWORD dwReserved[6];
}
_0 Bounds;

union _1 {
  DWORD cSteps;
  DWORD cbCustomData;
  DWORD dwReserved[6];
}
_1 Metrics;

}
alias tagMIXERCONTROLA MIXERCONTROLA;
alias tagMIXERCONTROLA* PMIXERCONTROLA;
alias tagMIXERCONTROLA* LPMIXERCONTROLA;

struct tagMIXERCONTROLW {
  DWORD cbStruct;
  DWORD dwControlID;
  DWORD dwControlType;
  DWORD fdwControl;
  DWORD cMultipleItems;
  WCHAR szShortName[MIXER_SHORT_NAME_CHARS];
  WCHAR szName[MIXER_LONG_NAME_CHARS];
union _2 {
struct {
  LONG lMinimum;
  LONG lMaximum;
}

struct {
  DWORD dwMinimum;
  DWORD dwMaximum;
}

  DWORD dwReserved[6];
}
_2 Bounds;

union _3 {
  DWORD cSteps;
  DWORD cbCustomData;
  DWORD dwReserved[6];
}
_3 Metrics;

}
alias tagMIXERCONTROLW MIXERCONTROLW;
alias tagMIXERCONTROLW* PMIXERCONTROLW;
alias tagMIXERCONTROLW* LPMIXERCONTROLW;

// #ifdef UNICODE
// ...
// #else
alias MIXERCONTROLA MIXERCONTROL;
alias PMIXERCONTROLA PMIXERCONTROL;
alias LPMIXERCONTROLA LPMIXERCONTROL;
// #endif // UNICODE

// #else
// ...
// #endif

enum : uint { MIXERCONTROL_CONTROLF_UNIFORM = 0x00000001 }
enum : uint { MIXERCONTROL_CONTROLF_MULTIPLE = 0x00000002 }
enum : uint { MIXERCONTROL_CONTROLF_DISABLED = 0x80000000 }

enum : uint { MIXERCONTROL_CT_CLASS_MASK = 0xF0000000 }
enum : uint { MIXERCONTROL_CT_CLASS_CUSTOM = 0x00000000 }
enum : uint { MIXERCONTROL_CT_CLASS_METER = 0x10000000 }
enum : uint { MIXERCONTROL_CT_CLASS_SWITCH = 0x20000000 }
enum : uint { MIXERCONTROL_CT_CLASS_NUMBER = 0x30000000 }
enum : uint { MIXERCONTROL_CT_CLASS_SLIDER = 0x40000000 }
enum : uint { MIXERCONTROL_CT_CLASS_FADER = 0x50000000 }
enum : uint { MIXERCONTROL_CT_CLASS_TIME = 0x60000000 }
enum : uint { MIXERCONTROL_CT_CLASS_LIST = 0x70000000 }

enum : uint { MIXERCONTROL_CT_SUBCLASS_MASK = 0x0F000000 }

enum : uint { MIXERCONTROL_CT_SC_SWITCH_BOOLEAN = 0x00000000 }
enum : uint { MIXERCONTROL_CT_SC_SWITCH_BUTTON = 0x01000000 }

enum : uint { MIXERCONTROL_CT_SC_METER_POLLED = 0x00000000 }

enum : uint { MIXERCONTROL_CT_SC_TIME_MICROSECS = 0x00000000 }
enum : uint { MIXERCONTROL_CT_SC_TIME_MILLISECS = 0x01000000 }

enum : uint { MIXERCONTROL_CT_SC_LIST_SINGLE = 0x00000000 }
enum : uint { MIXERCONTROL_CT_SC_LIST_MULTIPLE = 0x01000000 }

enum : uint { MIXERCONTROL_CT_UNITS_MASK = 0x00FF0000 }
enum : uint { MIXERCONTROL_CT_UNITS_CUSTOM = 0x00000000 }
enum : uint { MIXERCONTROL_CT_UNITS_BOOLEAN = 0x00010000 }
enum : uint { MIXERCONTROL_CT_UNITS_SIGNED = 0x00020000 }
enum : uint { MIXERCONTROL_CT_UNITS_UNSIGNED = 0x00030000 }
enum : uint { MIXERCONTROL_CT_UNITS_DECIBELS = 0x00040000 }
enum : uint { MIXERCONTROL_CT_UNITS_PERCENT = 0x00050000 }

enum : uint { MIXERCONTROL_CONTROLTYPE_CUSTOM = MIXERCONTROL_CT_CLASS_CUSTOM | MIXERCONTROL_CT_UNITS_CUSTOM }
enum : uint { MIXERCONTROL_CONTROLTYPE_BOOLEANMETER = MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_BOOLEAN }
enum : uint { MIXERCONTROL_CONTROLTYPE_SIGNEDMETER = MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_SIGNED }
enum : uint { MIXERCONTROL_CONTROLTYPE_PEAKMETER = MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1 }
enum : uint { MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER = MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_UNSIGNED }
enum : uint { MIXERCONTROL_CONTROLTYPE_BOOLEAN = MIXERCONTROL_CT_CLASS_SWITCH | MIXERCONTROL_CT_SC_SWITCH_BOOLEAN | MIXERCONTROL_CT_UNITS_BOOLEAN }
enum : uint { MIXERCONTROL_CONTROLTYPE_ONOFF = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 1 }
enum : uint { MIXERCONTROL_CONTROLTYPE_MUTE = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2 }
enum : uint { MIXERCONTROL_CONTROLTYPE_MONO = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 3 }
enum : uint { MIXERCONTROL_CONTROLTYPE_LOUDNESS = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 4 }
enum : uint { MIXERCONTROL_CONTROLTYPE_STEREOENH = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 5 }
enum : uint { MIXERCONTROL_CONTROLTYPE_BASS_BOOST = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 0x00002277 }
enum : uint { MIXERCONTROL_CONTROLTYPE_BUTTON = MIXERCONTROL_CT_CLASS_SWITCH | MIXERCONTROL_CT_SC_SWITCH_BUTTON | MIXERCONTROL_CT_UNITS_BOOLEAN }
enum : uint { MIXERCONTROL_CONTROLTYPE_DECIBELS = MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_DECIBELS }
enum : uint { MIXERCONTROL_CONTROLTYPE_SIGNED = MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_SIGNED }
enum : uint { MIXERCONTROL_CONTROLTYPE_UNSIGNED = MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_UNSIGNED }
enum : uint { MIXERCONTROL_CONTROLTYPE_PERCENT = MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_PERCENT }
enum : uint { MIXERCONTROL_CONTROLTYPE_SLIDER = MIXERCONTROL_CT_CLASS_SLIDER | MIXERCONTROL_CT_UNITS_SIGNED }
enum : uint { MIXERCONTROL_CONTROLTYPE_PAN = MIXERCONTROL_CONTROLTYPE_SLIDER + 1 }
enum : uint { MIXERCONTROL_CONTROLTYPE_QSOUNDPAN = MIXERCONTROL_CONTROLTYPE_SLIDER + 2 }
enum : uint { MIXERCONTROL_CONTROLTYPE_FADER = MIXERCONTROL_CT_CLASS_FADER | MIXERCONTROL_CT_UNITS_UNSIGNED }
enum : uint { MIXERCONTROL_CONTROLTYPE_VOLUME = MIXERCONTROL_CONTROLTYPE_FADER + 1 }
enum : uint { MIXERCONTROL_CONTROLTYPE_BASS = MIXERCONTROL_CONTROLTYPE_FADER + 2 }
enum : uint { MIXERCONTROL_CONTROLTYPE_TREBLE = MIXERCONTROL_CONTROLTYPE_FADER + 3 }
enum : uint { MIXERCONTROL_CONTROLTYPE_EQUALIZER = MIXERCONTROL_CONTROLTYPE_FADER + 4 }
enum : uint { MIXERCONTROL_CONTROLTYPE_SINGLESELECT = MIXERCONTROL_CT_CLASS_LIST | MIXERCONTROL_CT_SC_LIST_SINGLE | MIXERCONTROL_CT_UNITS_BOOLEAN }
enum : uint { MIXERCONTROL_CONTROLTYPE_MUX = MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1 }
enum : uint { MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT = MIXERCONTROL_CT_CLASS_LIST | MIXERCONTROL_CT_SC_LIST_MULTIPLE | MIXERCONTROL_CT_UNITS_BOOLEAN }
enum : uint { MIXERCONTROL_CONTROLTYPE_MIXER = MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT + 1 }
enum : uint { MIXERCONTROL_CONTROLTYPE_MICROTIME = MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MICROSECS | MIXERCONTROL_CT_UNITS_UNSIGNED }
enum : uint { MIXERCONTROL_CONTROLTYPE_MILLITIME = MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MILLISECS | MIXERCONTROL_CT_UNITS_UNSIGNED }

// #ifdef _WIN32

struct tagMIXERLINECONTROLSA {
  DWORD cbStruct;
  DWORD dwLineID;
union {
  DWORD dwControlID;
  DWORD dwControlType;
}

  DWORD cControls;
  DWORD cbmxctrl;
  LPMIXERCONTROLA pamxctrl;
}
alias tagMIXERLINECONTROLSA MIXERLINECONTROLSA;
alias tagMIXERLINECONTROLSA* PMIXERLINECONTROLSA;
alias tagMIXERLINECONTROLSA* LPMIXERLINECONTROLSA;

struct tagMIXERLINECONTROLSW {
  DWORD cbStruct;
  DWORD dwLineID;
union {
  DWORD dwControlID;
  DWORD dwControlType;
}

  DWORD cControls;
  DWORD cbmxctrl;
  LPMIXERCONTROLW pamxctrl;
}
alias tagMIXERLINECONTROLSW MIXERLINECONTROLSW;
alias tagMIXERLINECONTROLSW* PMIXERLINECONTROLSW;
alias tagMIXERLINECONTROLSW* LPMIXERLINECONTROLSW;

// #ifdef UNICODE
// ...
// #else
alias MIXERLINECONTROLSA MIXERLINECONTROLS;
alias PMIXERLINECONTROLSA PMIXERLINECONTROLS;
alias LPMIXERLINECONTROLSA LPMIXERLINECONTROLS;
// #endif // UNICODE

// #else
// ...
// #endif

// #ifdef _WIN32

extern(Windows) export MMRESULT mixerGetLineControlsA(HMIXEROBJ hmxobj, LPMIXERLINECONTROLSA pmxlc, DWORD fdwControls);
extern(Windows) export MMRESULT mixerGetLineControlsW(HMIXEROBJ hmxobj, LPMIXERLINECONTROLSW pmxlc, DWORD fdwControls);
// #ifdef UNICODE
// #...
// #else
alias mixerGetLineControlsA mixerGetLineControls;
// #endif // !UNICODE

// #else
// ...
// #endif

enum : uint { MIXER_GETLINECONTROLSF_ALL = 0x00000000 }
enum : uint { MIXER_GETLINECONTROLSF_ONEBYID = 0x00000001 }
enum : uint { MIXER_GETLINECONTROLSF_ONEBYTYPE = 0x00000002 }

enum : uint { MIXER_GETLINECONTROLSF_QUERYMASK = 0x0000000F }

struct tMIXERCONTROLDETAILS {
  DWORD cbStruct;
  DWORD dwControlID;
  DWORD cChannels;
union {
  HWND hwndOwner;
  DWORD cMultipleItems;
}

  DWORD cbDetails;
  LPVOID paDetails;
}
alias tMIXERCONTROLDETAILS MIXERCONTROLDETAILS;
alias tMIXERCONTROLDETAILS* PMIXERCONTROLDETAILS;
alias tMIXERCONTROLDETAILS* LPMIXERCONTROLDETAILS;

// #ifdef _WIN32

struct tagMIXERCONTROLDETAILS_LISTTEXTA {
  DWORD dwParam1;
  DWORD dwParam2;
  CHAR szName[MIXER_LONG_NAME_CHARS];
}
alias tagMIXERCONTROLDETAILS_LISTTEXTA MIXERCONTROLDETAILS_LISTTEXTA;
alias tagMIXERCONTROLDETAILS_LISTTEXTA* PMIXERCONTROLDETAILS_LISTTEXTA;
alias tagMIXERCONTROLDETAILS_LISTTEXTA* LPMIXERCONTROLDETAILS_LISTTEXTA;

struct tagMIXERCONTROLDETAILS_LISTTEXTW {
  DWORD dwParam1;
  DWORD dwParam2;
  WCHAR szName[MIXER_LONG_NAME_CHARS];
}
alias tagMIXERCONTROLDETAILS_LISTTEXTW MIXERCONTROLDETAILS_LISTTEXTW;
alias tagMIXERCONTROLDETAILS_LISTTEXTW* PMIXERCONTROLDETAILS_LISTTEXTW;
alias tagMIXERCONTROLDETAILS_LISTTEXTW* LPMIXERCONTROLDETAILS_LISTTEXTW;

// #ifdef UNICODE
// ...
// #else
alias MIXERCONTROLDETAILS_LISTTEXTA MIXERCONTROLDETAILS_LISTTEXT;
alias PMIXERCONTROLDETAILS_LISTTEXTA PMIXERCONTROLDETAILS_LISTTEXT;
alias LPMIXERCONTROLDETAILS_LISTTEXTA LPMIXERCONTROLDETAILS_LISTTEXT;
// #endif // UNICODE

// #else
// ...
// #endif

struct tMIXERCONTROLDETAILS_BOOLEAN {
  LONG fValue;
}
alias tMIXERCONTROLDETAILS_BOOLEAN MIXERCONTROLDETAILS_BOOLEAN;
alias tMIXERCONTROLDETAILS_BOOLEAN* PMIXERCONTROLDETAILS_BOOLEAN;
alias tMIXERCONTROLDETAILS_BOOLEAN* LPMIXERCONTROLDETAILS_BOOLEAN;

struct tMIXERCONTROLDETAILS_SIGNED {
  LONG lValue;
}
alias tMIXERCONTROLDETAILS_SIGNED MIXERCONTROLDETAILS_SIGNED;
alias tMIXERCONTROLDETAILS_SIGNED* PMIXERCONTROLDETAILS_SIGNED;
alias tMIXERCONTROLDETAILS_SIGNED* LPMIXERCONTROLDETAILS_SIGNED;

struct tMIXERCONTROLDETAILS_UNSIGNED {
  DWORD dwValue;
}
alias tMIXERCONTROLDETAILS_UNSIGNED MIXERCONTROLDETAILS_UNSIGNED;
alias tMIXERCONTROLDETAILS_UNSIGNED* PMIXERCONTROLDETAILS_UNSIGNED;
alias tMIXERCONTROLDETAILS_UNSIGNED* LPMIXERCONTROLDETAILS_UNSIGNED;

// #ifdef _WIN32

extern(Windows) export MMRESULT mixerGetControlDetailsA(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
extern(Windows) export MMRESULT mixerGetControlDetailsW(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
// #ifdef UNICODE
// #...
// #else
alias mixerGetControlDetailsA mixerGetControlDetails;
// #endif // !UNICODE

// #else
// ...
// #endif

enum : uint { MIXER_GETCONTROLDETAILSF_VALUE = 0x00000000 }
enum : uint { MIXER_GETCONTROLDETAILSF_LISTTEXT = 0x00000001 }

enum : uint { MIXER_GETCONTROLDETAILSF_QUERYMASK = 0x0000000F }

extern(Windows) export MMRESULT mixerSetControlDetails(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);

enum : uint { MIXER_SETCONTROLDETAILSF_VALUE = 0x00000000 }
enum : uint { MIXER_SETCONTROLDETAILSF_CUSTOM = 0x00000001 }

enum : uint { MIXER_SETCONTROLDETAILSF_QUERYMASK = 0x0000000F }

// #endif /* ifndef MMNOMIXER */

// #ifndef MMNOTIMER

enum : uint { TIMERR_NOERROR = 0 }
enum : uint { TIMERR_NOCANDO = TIMERR_BASE+1 }
enum : uint { TIMERR_STRUCT = TIMERR_BASE+33 }

// typedef void (CALLBACK TIMECALLBACK)(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2);

extern(Windows) alias void function(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) LPTIMECALLBACK;

enum : uint { TIME_ONESHOT = 0x0000 }
enum : uint { TIME_PERIODIC = 0x0001 }

// #ifdef _WIN32
enum : uint { TIME_CALLBACK_FUNCTION = 0x0000 }
enum : uint { TIME_CALLBACK_EVENT_SET = 0x0010 }
enum : uint { TIME_CALLBACK_EVENT_PULSE = 0x0020 }
// #endif

// #if WINVER >= 0x0501
enum : uint { TIME_KILL_SYNCHRONOUS = 0x0100 }

// #endif // WINVER >= 0x0501

struct timecaps_tag {
  UINT wPeriodMin;
  UINT wPeriodMax;
}
alias timecaps_tag TIMECAPS;
alias timecaps_tag* PTIMECAPS;
alias timecaps_tag* NPTIMECAPS;
alias timecaps_tag* LPTIMECAPS;

extern(Windows) export MMRESULT timeGetSystemTime(LPMMTIME pmmt, UINT cbmmt);
extern(Windows) export DWORD timeGetTime();
extern(Windows) export MMRESULT timeSetEvent(UINT uDelay, UINT uResolution,
  LPTIMECALLBACK fptc, DWORD_PTR dwUser, UINT fuEvent);
extern(Windows) export MMRESULT timeKillEvent(UINT uTimerID);
extern(Windows) export MMRESULT timeGetDevCaps(LPTIMECAPS ptc, UINT cbtc);
extern(Windows) export MMRESULT timeBeginPeriod(UINT uPeriod);
extern(Windows) export MMRESULT timeEndPeriod(UINT uPeriod);

// #endif  /* ifndef MMNOTIMER */

// #ifndef MMNOJOY

enum : uint { JOYERR_NOERROR = 0 }
enum : uint { JOYERR_PARMS = JOYERR_BASE+5 }
enum : uint { JOYERR_NOCANDO = JOYERR_BASE+6 }
enum : uint { JOYERR_UNPLUGGED = JOYERR_BASE+7 }

enum : uint { JOY_BUTTON1 = 0x0001 }
enum : uint { JOY_BUTTON2 = 0x0002 }
enum : uint { JOY_BUTTON3 = 0x0004 }
enum : uint { JOY_BUTTON4 = 0x0008 }
enum : uint { JOY_BUTTON1CHG = 0x0100 }
enum : uint { JOY_BUTTON2CHG = 0x0200 }
enum : uint { JOY_BUTTON3CHG = 0x0400 }
enum : uint { JOY_BUTTON4CHG = 0x0800 }

enum : uint { JOY_BUTTON5 = 0x00000010 }
enum : uint { JOY_BUTTON6 = 0x00000020 }
enum : uint { JOY_BUTTON7 = 0x00000040 }
enum : uint { JOY_BUTTON8 = 0x00000080 }
enum : uint { JOY_BUTTON9 = 0x00000100 }
enum : uint { JOY_BUTTON10 = 0x00000200 }
enum : uint { JOY_BUTTON11 = 0x00000400 }
enum : uint { JOY_BUTTON12 = 0x00000800 }
enum : uint { JOY_BUTTON13 = 0x00001000 }
enum : uint { JOY_BUTTON14 = 0x00002000 }
enum : uint { JOY_BUTTON15 = 0x00004000 }
enum : uint { JOY_BUTTON16 = 0x00008000 }
enum : uint { JOY_BUTTON17 = 0x00010000 }
enum : uint { JOY_BUTTON18 = 0x00020000 }
enum : uint { JOY_BUTTON19 = 0x00040000 }
enum : uint { JOY_BUTTON20 = 0x00080000 }
enum : uint { JOY_BUTTON21 = 0x00100000 }
enum : uint { JOY_BUTTON22 = 0x00200000 }
enum : uint { JOY_BUTTON23 = 0x00400000 }
enum : uint { JOY_BUTTON24 = 0x00800000 }
enum : uint { JOY_BUTTON25 = 0x01000000 }
enum : uint { JOY_BUTTON26 = 0x02000000 }
enum : uint { JOY_BUTTON27 = 0x04000000 }
enum : uint { JOY_BUTTON28 = 0x08000000 }
enum : uint { JOY_BUTTON29 = 0x10000000 }
enum : uint { JOY_BUTTON30 = 0x20000000 }
enum : uint { JOY_BUTTON31 = 0x40000000 }
enum : uint { JOY_BUTTON32 = 0x80000000 }

enum : WORD { JOY_POVCENTERED = cast(WORD)-1 }
enum : uint { JOY_POVFORWARD = 0 }
enum : uint { JOY_POVRIGHT = 9000 }
enum : uint { JOY_POVBACKWARD = 18000 }
enum : uint { JOY_POVLEFT = 27000 }

enum : uint { JOY_RETURNX = 0x00000001 }
enum : uint { JOY_RETURNY = 0x00000002 }
enum : uint { JOY_RETURNZ = 0x00000004 }
enum : uint { JOY_RETURNR = 0x00000008 }
enum : uint { JOY_RETURNU = 0x00000010 }
enum : uint { JOY_RETURNV = 0x00000020 }
enum : uint { JOY_RETURNPOV = 0x00000040 }
enum : uint { JOY_RETURNBUTTONS = 0x00000080 }
enum : uint { JOY_RETURNRAWDATA = 0x00000100 }
enum : uint { JOY_RETURNPOVCTS = 0x00000200 }
enum : uint { JOY_RETURNCENTERED = 0x00000400 }
enum : uint { JOY_USEDEADZONE = 0x00000800 }
enum : uint { JOY_RETURNALL = JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ | JOY_RETURNR | JOY_RETURNU | JOY_RETURNV | JOY_RETURNPOV | JOY_RETURNBUTTONS }
enum : uint { JOY_CAL_READALWAYS = 0x00010000 }
enum : uint { JOY_CAL_READXYONLY = 0x00020000 }
enum : uint { JOY_CAL_READ3 = 0x00040000 }
enum : uint { JOY_CAL_READ4 = 0x00080000 }
enum : uint { JOY_CAL_READXONLY = 0x00100000 }
enum : uint { JOY_CAL_READYONLY = 0x00200000 }
enum : uint { JOY_CAL_READ5 = 0x00400000 }
enum : uint { JOY_CAL_READ6 = 0x00800000 }
enum : uint { JOY_CAL_READZONLY = 0x01000000 }
enum : uint { JOY_CAL_READRONLY = 0x02000000 }
enum : uint { JOY_CAL_READUONLY = 0x04000000 }
enum : uint { JOY_CAL_READVONLY = 0x08000000 }

enum : uint { JOYSTICKID1 = 0 }
enum : uint { JOYSTICKID2 = 1 }

enum : uint { JOYCAPS_HASZ = 0x0001 }
enum : uint { JOYCAPS_HASR = 0x0002 }
enum : uint { JOYCAPS_HASU = 0x0004 }
enum : uint { JOYCAPS_HASV = 0x0008 }
enum : uint { JOYCAPS_HASPOV = 0x0010 }
enum : uint { JOYCAPS_POV4DIR = 0x0020 }
enum : uint { JOYCAPS_POVCTS = 0x0040 }

// #ifdef _WIN32

struct tagJOYCAPSA {
  WORD wMid;
  WORD wPid;
  CHAR szPname[MAXPNAMELEN];
  UINT wXmin;
  UINT wXmax;
  UINT wYmin;
  UINT wYmax;
  UINT wZmin;
  UINT wZmax;
  UINT wNumButtons;
  UINT wPeriodMin;
  UINT wPeriodMax;
// #if (WINVER >= 0x0400)
  UINT wRmin;
  UINT wRmax;
  UINT wUmin;
  UINT wUmax;
  UINT wVmin;
  UINT wVmax;
  UINT wCaps;
  UINT wMaxAxes;
  UINT wNumAxes;
  UINT wMaxButtons;
  CHAR szRegKey[MAXPNAMELEN];
  CHAR szOEMVxD[MAX_JOYSTICKOEMVXDNAME];
// #endif
}
alias tagJOYCAPSA JOYCAPSA;
alias tagJOYCAPSA* PJOYCAPSA;
alias tagJOYCAPSA* NPJOYCAPSA;
alias tagJOYCAPSA* LPJOYCAPSA;

struct tagJOYCAPSW {
  WORD wMid;
  WORD wPid;
  WCHAR szPname[MAXPNAMELEN];
  UINT wXmin;
  UINT wXmax;
  UINT wYmin;
  UINT wYmax;
  UINT wZmin;
  UINT wZmax;
  UINT wNumButtons;
  UINT wPeriodMin;
  UINT wPeriodMax;
// #if (WINVER >= 0x0400)
  UINT wRmin;
  UINT wRmax;
  UINT wUmin;
  UINT wUmax;
  UINT wVmin;
  UINT wVmax;
  UINT wCaps;
  UINT wMaxAxes;
  UINT wNumAxes;
  UINT wMaxButtons;
  WCHAR szRegKey[MAXPNAMELEN];
  WCHAR szOEMVxD[MAX_JOYSTICKOEMVXDNAME];
// #endif
}
alias tagJOYCAPSW JOYCAPSW;
alias tagJOYCAPSW* PJOYCAPSW;
alias tagJOYCAPSW* NPJOYCAPSW;
alias tagJOYCAPSW* LPJOYCAPSW;

// #ifdef UNICODE
// ...
// #else
alias JOYCAPSA JOYCAPS;
alias PJOYCAPSA PJOYCAPS;
alias NPJOYCAPSA NPJOYCAPS;
alias LPJOYCAPSA LPJOYCAPS;
// #endif // UNICODE
struct tagJOYCAPS2A {
  WORD wMid;
  WORD wPid;
  CHAR szPname[MAXPNAMELEN];
  UINT wXmin;
  UINT wXmax;
  UINT wYmin;
  UINT wYmax;
  UINT wZmin;
  UINT wZmax;
  UINT wNumButtons;
  UINT wPeriodMin;
  UINT wPeriodMax;
  UINT wRmin;
  UINT wRmax;
  UINT wUmin;
  UINT wUmax;
  UINT wVmin;
  UINT wVmax;
  UINT wCaps;
  UINT wMaxAxes;
  UINT wNumAxes;
  UINT wMaxButtons;
  CHAR szRegKey[MAXPNAMELEN];
  CHAR szOEMVxD[MAX_JOYSTICKOEMVXDNAME];
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagJOYCAPS2A JOYCAPS2A;
alias tagJOYCAPS2A* PJOYCAPS2A;
alias tagJOYCAPS2A* NPJOYCAPS2A;
alias tagJOYCAPS2A* LPJOYCAPS2A;

struct tagJOYCAPS2W {
  WORD wMid;
  WORD wPid;
  WCHAR szPname[MAXPNAMELEN];
  UINT wXmin;
  UINT wXmax;
  UINT wYmin;
  UINT wYmax;
  UINT wZmin;
  UINT wZmax;
  UINT wNumButtons;
  UINT wPeriodMin;
  UINT wPeriodMax;
  UINT wRmin;
  UINT wRmax;
  UINT wUmin;
  UINT wUmax;
  UINT wVmin;
  UINT wVmax;
  UINT wCaps;
  UINT wMaxAxes;
  UINT wNumAxes;
  UINT wMaxButtons;
  WCHAR szRegKey[MAXPNAMELEN];
  WCHAR szOEMVxD[MAX_JOYSTICKOEMVXDNAME];
  GUID ManufacturerGuid;
  GUID ProductGuid;
  GUID NameGuid;
}
alias tagJOYCAPS2W JOYCAPS2W;
alias tagJOYCAPS2W* PJOYCAPS2W;
alias tagJOYCAPS2W* NPJOYCAPS2W;
alias tagJOYCAPS2W* LPJOYCAPS2W;

// #ifdef UNICODE
// ...
// #else
alias JOYCAPS2A JOYCAPS2;
alias PJOYCAPS2A PJOYCAPS2;
alias NPJOYCAPS2A NPJOYCAPS2;
alias LPJOYCAPS2A LPJOYCAPS2;
// #endif // UNICODE

// #else
// ...
// #if (WINVER >= 0x0400)
// ...
// #endif
// ...
// #endif

struct joyinfo_tag {
  UINT wXpos;
  UINT wYpos;
  UINT wZpos;
  UINT wButtons;
}
alias joyinfo_tag JOYINFO;
alias joyinfo_tag* PJOYINFO;
alias joyinfo_tag* NPJOYINFO;
alias joyinfo_tag* LPJOYINFO;

// #if(WINVER >= 0x0400)
struct joyinfoex_tag {
  DWORD dwSize;
  DWORD dwFlags;
  DWORD dwXpos;
  DWORD dwYpos;
  DWORD dwZpos;
  DWORD dwRpos;
  DWORD dwUpos;
  DWORD dwVpos;
  DWORD dwButtons;
  DWORD dwButtonNumber;
  DWORD dwPOV;
  DWORD dwReserved1;
  DWORD dwReserved2;
}
alias joyinfoex_tag JOYINFOEX;
alias joyinfoex_tag* PJOYINFOEX;
alias joyinfoex_tag* NPJOYINFOEX;
alias joyinfoex_tag* LPJOYINFOEX;

// #endif /* WINVER >= 0x0400 */

extern(Windows) export UINT joyGetNumDevs();
// #ifdef _WIN32

extern(Windows) export MMRESULT joyGetDevCapsA(UINT_PTR uJoyID, LPJOYCAPSA pjc, UINT cbjc);
extern(Windows) export MMRESULT joyGetDevCapsW(UINT_PTR uJoyID, LPJOYCAPSW pjc, UINT cbjc);
// #ifdef UNICODE
// #...
// #else
alias joyGetDevCapsA joyGetDevCaps;
// #endif // !UNICODE

// #else
// ...
// #endif
extern(Windows) export MMRESULT joyGetPos(UINT uJoyID, LPJOYINFO pji);

// #if(WINVER >= 0x0400)
extern(Windows) export MMRESULT joyGetPosEx(UINT uJoyID, LPJOYINFOEX pji);
// #endif /* WINVER >= 0x0400 */

extern(Windows) export MMRESULT joyGetThreshold(UINT uJoyID, LPUINT puThreshold);
extern(Windows) export MMRESULT joyReleaseCapture(UINT uJoyID);
extern(Windows) export MMRESULT joySetCapture(HWND hwnd, UINT uJoyID, UINT uPeriod,
  BOOL fChanged);
extern(Windows) export MMRESULT joySetThreshold(UINT uJoyID, UINT uThreshold);

// #endif  /* ifndef MMNOJOY */

// #ifndef MMNOMMIO

enum : uint { MMIOERR_BASE = 256 }
enum : uint { MMIOERR_FILENOTFOUND = MMIOERR_BASE + 1 }
enum : uint { MMIOERR_OUTOFMEMORY = MMIOERR_BASE + 2 }
enum : uint { MMIOERR_CANNOTOPEN = MMIOERR_BASE + 3 }
enum : uint { MMIOERR_CANNOTCLOSE = MMIOERR_BASE + 4 }
enum : uint { MMIOERR_CANNOTREAD = MMIOERR_BASE + 5 }
enum : uint { MMIOERR_CANNOTWRITE = MMIOERR_BASE + 6 }
enum : uint { MMIOERR_CANNOTSEEK = MMIOERR_BASE + 7 }
enum : uint { MMIOERR_CANNOTEXPAND = MMIOERR_BASE + 8 }
enum : uint { MMIOERR_CHUNKNOTFOUND = MMIOERR_BASE + 9 }
enum : uint { MMIOERR_UNBUFFERED = MMIOERR_BASE + 10 }
enum : uint { MMIOERR_PATHNOTFOUND = MMIOERR_BASE + 11 }
enum : uint { MMIOERR_ACCESSDENIED = MMIOERR_BASE + 12 }
enum : uint { MMIOERR_SHARINGVIOLATION = MMIOERR_BASE + 13 }
enum : uint { MMIOERR_NETWORKERROR = MMIOERR_BASE + 14 }
enum : uint { MMIOERR_TOOMANYOPENFILES = MMIOERR_BASE + 15 }
enum : uint { MMIOERR_INVALIDFILE = MMIOERR_BASE + 16 }

const char CFSEPCHAR = '+';

alias DWORD FOURCC;
alias char* HPSTR;
alias void* HMMIO;
// typedef LRESULT (CALLBACK MMIOPROC)(LPSTR lpmmioinfo, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
extern(Windows) alias LRESULT function(LPSTR lpmmioinfo, UINT uMsg, LPARAM lParam1, LPARAM lParam2) LPMMIOPROC;

struct _MMIOINFO {

  DWORD dwFlags;
  FOURCC fccIOProc;
  LPMMIOPROC pIOProc;
  UINT wErrorRet;
  HTASK htask;

  LONG cchBuffer;
  HPSTR pchBuffer;
  HPSTR pchNext;
  HPSTR pchEndRead;
  HPSTR pchEndWrite;
  LONG lBufOffset;

  LONG lDiskOffset;
  DWORD adwInfo[3];

  DWORD dwReserved1;
  DWORD dwReserved2;
  HMMIO hmmio;
}
alias _MMIOINFO MMIOINFO;
alias _MMIOINFO* PMMIOINFO;
alias _MMIOINFO* NPMMIOINFO;
alias _MMIOINFO* LPMMIOINFO;

alias MMIOINFO* LPCMMIOINFO;

struct _MMCKINFO {
  FOURCC ckid;
  DWORD cksize;
  FOURCC fccType;
  DWORD dwDataOffset;
  DWORD dwFlags;
}
alias _MMCKINFO MMCKINFO;
alias _MMCKINFO* PMMCKINFO;
alias _MMCKINFO* NPMMCKINFO;
alias _MMCKINFO* LPMMCKINFO;

alias MMCKINFO* LPCMMCKINFO;

enum : uint { MMIO_RWMODE = 0x00000003 }
enum : uint { MMIO_SHAREMODE = 0x00000070 }

enum : uint { MMIO_CREATE = 0x00001000 }
enum : uint { MMIO_PARSE = 0x00000100 }
enum : uint { MMIO_DELETE = 0x00000200 }
enum : uint { MMIO_EXIST = 0x00004000 }
enum : uint { MMIO_ALLOCBUF = 0x00010000 }
enum : uint { MMIO_GETTEMP = 0x00020000 }

enum : uint { MMIO_DIRTY = 0x10000000 }

enum : uint { MMIO_READ = 0x00000000 }
enum : uint { MMIO_WRITE = 0x00000001 }
enum : uint { MMIO_READWRITE = 0x00000002 }

enum : uint { MMIO_COMPAT = 0x00000000 }
enum : uint { MMIO_EXCLUSIVE = 0x00000010 }
enum : uint { MMIO_DENYWRITE = 0x00000020 }
enum : uint { MMIO_DENYREAD = 0x00000030 }
enum : uint { MMIO_DENYNONE = 0x00000040 }

enum : uint { MMIO_FHOPEN = 0x0010 }
enum : uint { MMIO_EMPTYBUF = 0x0010 }
enum : uint { MMIO_TOUPPER = 0x0010 }
enum : uint { MMIO_INSTALLPROC = 0x00010000 }
enum : uint { MMIO_GLOBALPROC = 0x10000000 }
enum : uint { MMIO_REMOVEPROC = 0x00020000 }
enum : uint { MMIO_UNICODEPROC = 0x01000000 }
enum : uint { MMIO_FINDPROC = 0x00040000 }
enum : uint { MMIO_FINDCHUNK = 0x0010 }
enum : uint { MMIO_FINDRIFF = 0x0020 }
enum : uint { MMIO_FINDLIST = 0x0040 }
enum : uint { MMIO_CREATERIFF = 0x0020 }
enum : uint { MMIO_CREATELIST = 0x0040 }

alias MMIO_READ MMIOM_READ;
alias MMIO_WRITE MMIOM_WRITE;
enum : uint { MMIOM_SEEK = 2 }
enum : uint { MMIOM_OPEN = 3 }
enum : uint { MMIOM_CLOSE = 4 }
enum : uint { MMIOM_WRITEFLUSH = 5 }

// #if (WINVER >= 0x030a)
enum : uint { MMIOM_RENAME = 6 }
// #endif /* ifdef WINVER >= 0x030a */

enum : uint { MMIOM_USER = 0x8000 }

// #define FOURCC_RIFF mmioFOURCC('R', 'I', 'F', 'F')
// #define FOURCC_LIST mmioFOURCC('L', 'I', 'S', 'T')

// #define FOURCC_DOS mmioFOURCC('D', 'O', 'S', ' ')
// #define FOURCC_MEM mmioFOURCC('M', 'E', 'M', ' ')

// #ifndef SEEK_SET
enum : uint { SEEK_SET = 0 }
enum : uint { SEEK_CUR = 1 }
enum : uint { SEEK_END = 2 }
// #endif  /* ifndef SEEK_SET */

enum : uint { MMIO_DEFAULTBUFFER = 8192 }

// #define mmioFOURCC(ch0, ch1, ch2, ch3) MAKEFOURCC(ch0, ch1, ch2, ch3)

// #ifdef _WIN32

extern(Windows) export FOURCC mmioStringToFOURCCA(LPCSTR sz, UINT uFlags);
extern(Windows) export FOURCC mmioStringToFOURCCW(LPCWSTR sz, UINT uFlags);
// #ifdef UNICODE
// #...
// #else
alias mmioStringToFOURCCA mmioStringToFOURCC;
// #endif // !UNICODE
extern(Windows) export LPMMIOPROC mmioInstallIOProcA(FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
extern(Windows) export LPMMIOPROC mmioInstallIOProcW(FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
// #ifdef UNICODE
// #...
// #else
alias mmioInstallIOProcA mmioInstallIOProc;
// #endif // !UNICODE
extern(Windows) export HMMIO mmioOpenA(LPSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
extern(Windows) export HMMIO mmioOpenW(LPWSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
// #ifdef UNICODE
// #...
// #else
alias mmioOpenA mmioOpen;
// #endif // !UNICODE
extern(Windows) export MMRESULT mmioRenameA(LPCSTR pszFileName, LPCSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename);
extern(Windows) export MMRESULT mmioRenameW(LPCWSTR pszFileName, LPCWSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename);
// #ifdef UNICODE
// #...
// #else
alias mmioRenameA mmioRename;
// #endif // !UNICODE
// #else
// ...
// #if (WINVER >= 0x030a)
// ...
// #endif /* ifdef WINVER >= 0x030a */
// #endif

extern(Windows) export MMRESULT mmioClose(HMMIO hmmio, UINT fuClose);
extern(Windows) export LONG mmioRead(HMMIO hmmio, HPSTR pch, LONG cch);
extern(Windows) export LONG mmioWrite(HMMIO hmmio, char * pch, LONG cch);
extern(Windows) export LONG mmioSeek(HMMIO hmmio, LONG lOffset, int iOrigin);
extern(Windows) export MMRESULT mmioGetInfo(HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuInfo);
extern(Windows) export MMRESULT mmioSetInfo(HMMIO hmmio, LPCMMIOINFO pmmioinfo, UINT fuInfo);
extern(Windows) export MMRESULT mmioSetBuffer(HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer,
  UINT fuBuffer);
extern(Windows) export MMRESULT mmioFlush(HMMIO hmmio, UINT fuFlush);
extern(Windows) export MMRESULT mmioAdvance(HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuAdvance);
extern(Windows) export LRESULT mmioSendMessage(HMMIO hmmio, UINT uMsg,
  LPARAM lParam1, LPARAM lParam2);
extern(Windows) export MMRESULT mmioDescend(HMMIO hmmio, LPMMCKINFO pmmcki,
  MMCKINFO * pmmckiParent, UINT fuDescend);
extern(Windows) export MMRESULT mmioAscend(HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuAscend);
extern(Windows) export MMRESULT mmioCreateChunk(HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuCreate);

// #endif  /* ifndef MMNOMMIO */

// #ifndef MMNOMCI

// #ifndef _MCIERROR_              /* MCIERROR is defined in some post 3.1 apps */
// #define _MCIERROR_
alias DWORD MCIERROR;
// #endif

// #ifndef _MCIDEVICEID_           /* Same with MCIDEVICEID */
// #define _MCIDEVICEID_
alias UINT MCIDEVICEID;
// #endif

extern(Windows) alias UINT function(MCIDEVICEID mciId, DWORD dwYieldData) YIELDPROC;

// #ifdef _WIN32

extern(Windows) export MCIERROR mciSendCommandA(MCIDEVICEID mciId, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
extern(Windows) export MCIERROR mciSendCommandW(MCIDEVICEID mciId, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
// #ifdef UNICODE
// #...
// #else
alias mciSendCommandA mciSendCommand;
// #endif // !UNICODE
extern(Windows) export MCIERROR mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
extern(Windows) export MCIERROR mciSendStringW(LPCWSTR lpstrCommand, LPWSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
// #ifdef UNICODE
// #...
// #else
alias mciSendStringA mciSendString;
// #endif // !UNICODE
extern(Windows) export MCIDEVICEID mciGetDeviceIDA(LPCSTR pszDevice);
extern(Windows) export MCIDEVICEID mciGetDeviceIDW(LPCWSTR pszDevice);
// #ifdef UNICODE
// #...
// #else
alias mciGetDeviceIDA mciGetDeviceID;
// #endif // !UNICODE
extern(Windows) export MCIDEVICEID mciGetDeviceIDFromElementIDA(DWORD dwElementID, LPCSTR lpstrType );
extern(Windows) export MCIDEVICEID mciGetDeviceIDFromElementIDW(DWORD dwElementID, LPCWSTR lpstrType );
// #ifdef UNICODE
// #...
// #else
alias mciGetDeviceIDFromElementIDA mciGetDeviceIDFromElementID;
// #endif // !UNICODE
extern(Windows) export BOOL mciGetErrorStringA(MCIERROR mcierr, LPSTR pszText, UINT cchText);
extern(Windows) export BOOL mciGetErrorStringW(MCIERROR mcierr, LPWSTR pszText, UINT cchText);
// #ifdef UNICODE
// #...
// #else
alias mciGetErrorStringA mciGetErrorString;
// #endif // !UNICODE

// #else
// ...
// #endif

extern(Windows) export BOOL mciSetYieldProc(MCIDEVICEID mciId, YIELDPROC fpYieldProc,
  DWORD dwYieldData);

// #if (WINVER >= 0x030a)
extern(Windows) export HTASK mciGetCreatorTask(MCIDEVICEID mciId);
extern(Windows) export YIELDPROC mciGetYieldProc(MCIDEVICEID mciId, LPDWORD pdwYieldData);
// #endif /* ifdef WINVER >= 0x030a */

// #if (WINVER < 0x030a)
// ...
// #endif /* ifdef WINVER < 0x030a */

enum : uint { MCIERR_INVALID_DEVICE_ID = MCIERR_BASE + 1 }
enum : uint { MCIERR_UNRECOGNIZED_KEYWORD = MCIERR_BASE + 3 }
enum : uint { MCIERR_UNRECOGNIZED_COMMAND = MCIERR_BASE + 5 }
enum : uint { MCIERR_HARDWARE = MCIERR_BASE + 6 }
enum : uint { MCIERR_INVALID_DEVICE_NAME = MCIERR_BASE + 7 }
enum : uint { MCIERR_OUT_OF_MEMORY = MCIERR_BASE + 8 }
enum : uint { MCIERR_DEVICE_OPEN = MCIERR_BASE + 9 }
enum : uint { MCIERR_CANNOT_LOAD_DRIVER = MCIERR_BASE + 10 }
enum : uint { MCIERR_MISSING_COMMAND_STRING = MCIERR_BASE + 11 }
enum : uint { MCIERR_PARAM_OVERFLOW = MCIERR_BASE + 12 }
enum : uint { MCIERR_MISSING_STRING_ARGUMENT = MCIERR_BASE + 13 }
enum : uint { MCIERR_BAD_INTEGER = MCIERR_BASE + 14 }
enum : uint { MCIERR_PARSER_INTERNAL = MCIERR_BASE + 15 }
enum : uint { MCIERR_DRIVER_INTERNAL = MCIERR_BASE + 16 }
enum : uint { MCIERR_MISSING_PARAMETER = MCIERR_BASE + 17 }
enum : uint { MCIERR_UNSUPPORTED_FUNCTION = MCIERR_BASE + 18 }
enum : uint { MCIERR_FILE_NOT_FOUND = MCIERR_BASE + 19 }
enum : uint { MCIERR_DEVICE_NOT_READY = MCIERR_BASE + 20 }
enum : uint { MCIERR_INTERNAL = MCIERR_BASE + 21 }
enum : uint { MCIERR_DRIVER = MCIERR_BASE + 22 }
enum : uint { MCIERR_CANNOT_USE_ALL = MCIERR_BASE + 23 }
enum : uint { MCIERR_MULTIPLE = MCIERR_BASE + 24 }
enum : uint { MCIERR_EXTENSION_NOT_FOUND = MCIERR_BASE + 25 }
enum : uint { MCIERR_OUTOFRANGE = MCIERR_BASE + 26 }
enum : uint { MCIERR_FLAGS_NOT_COMPATIBLE = MCIERR_BASE + 28 }
enum : uint { MCIERR_FILE_NOT_SAVED = MCIERR_BASE + 30 }
enum : uint { MCIERR_DEVICE_TYPE_REQUIRED = MCIERR_BASE + 31 }
enum : uint { MCIERR_DEVICE_LOCKED = MCIERR_BASE + 32 }
enum : uint { MCIERR_DUPLICATE_ALIAS = MCIERR_BASE + 33 }
enum : uint { MCIERR_BAD_CONSTANT = MCIERR_BASE + 34 }
enum : uint { MCIERR_MUST_USE_SHAREABLE = MCIERR_BASE + 35 }
enum : uint { MCIERR_MISSING_DEVICE_NAME = MCIERR_BASE + 36 }
enum : uint { MCIERR_BAD_TIME_FORMAT = MCIERR_BASE + 37 }
enum : uint { MCIERR_NO_CLOSING_QUOTE = MCIERR_BASE + 38 }
enum : uint { MCIERR_DUPLICATE_FLAGS = MCIERR_BASE + 39 }
enum : uint { MCIERR_INVALID_FILE = MCIERR_BASE + 40 }
enum : uint { MCIERR_NULL_PARAMETER_BLOCK = MCIERR_BASE + 41 }
enum : uint { MCIERR_UNNAMED_RESOURCE = MCIERR_BASE + 42 }
enum : uint { MCIERR_NEW_REQUIRES_ALIAS = MCIERR_BASE + 43 }
enum : uint { MCIERR_NOTIFY_ON_AUTO_OPEN = MCIERR_BASE + 44 }
enum : uint { MCIERR_NO_ELEMENT_ALLOWED = MCIERR_BASE + 45 }
enum : uint { MCIERR_NONAPPLICABLE_FUNCTION = MCIERR_BASE + 46 }
enum : uint { MCIERR_ILLEGAL_FOR_AUTO_OPEN = MCIERR_BASE + 47 }
enum : uint { MCIERR_FILENAME_REQUIRED = MCIERR_BASE + 48 }
enum : uint { MCIERR_EXTRA_CHARACTERS = MCIERR_BASE + 49 }
enum : uint { MCIERR_DEVICE_NOT_INSTALLED = MCIERR_BASE + 50 }
enum : uint { MCIERR_GET_CD = MCIERR_BASE + 51 }
enum : uint { MCIERR_SET_CD = MCIERR_BASE + 52 }
enum : uint { MCIERR_SET_DRIVE = MCIERR_BASE + 53 }
enum : uint { MCIERR_DEVICE_LENGTH = MCIERR_BASE + 54 }
enum : uint { MCIERR_DEVICE_ORD_LENGTH = MCIERR_BASE + 55 }
enum : uint { MCIERR_NO_INTEGER = MCIERR_BASE + 56 }

enum : uint { MCIERR_WAVE_OUTPUTSINUSE = MCIERR_BASE + 64 }
enum : uint { MCIERR_WAVE_SETOUTPUTINUSE = MCIERR_BASE + 65 }
enum : uint { MCIERR_WAVE_INPUTSINUSE = MCIERR_BASE + 66 }
enum : uint { MCIERR_WAVE_SETINPUTINUSE = MCIERR_BASE + 67 }
enum : uint { MCIERR_WAVE_OUTPUTUNSPECIFIED = MCIERR_BASE + 68 }
enum : uint { MCIERR_WAVE_INPUTUNSPECIFIED = MCIERR_BASE + 69 }
enum : uint { MCIERR_WAVE_OUTPUTSUNSUITABLE = MCIERR_BASE + 70 }
enum : uint { MCIERR_WAVE_SETOUTPUTUNSUITABLE = MCIERR_BASE + 71 }
enum : uint { MCIERR_WAVE_INPUTSUNSUITABLE = MCIERR_BASE + 72 }
enum : uint { MCIERR_WAVE_SETINPUTUNSUITABLE = MCIERR_BASE + 73 }

enum : uint { MCIERR_SEQ_DIV_INCOMPATIBLE = MCIERR_BASE + 80 }
enum : uint { MCIERR_SEQ_PORT_INUSE = MCIERR_BASE + 81 }
enum : uint { MCIERR_SEQ_PORT_NONEXISTENT = MCIERR_BASE + 82 }
enum : uint { MCIERR_SEQ_PORT_MAPNODEVICE = MCIERR_BASE + 83 }
enum : uint { MCIERR_SEQ_PORT_MISCERROR = MCIERR_BASE + 84 }
enum : uint { MCIERR_SEQ_TIMER = MCIERR_BASE + 85 }
enum : uint { MCIERR_SEQ_PORTUNSPECIFIED = MCIERR_BASE + 86 }
enum : uint { MCIERR_SEQ_NOMIDIPRESENT = MCIERR_BASE + 87 }

enum : uint { MCIERR_NO_WINDOW = MCIERR_BASE + 90 }
enum : uint { MCIERR_CREATEWINDOW = MCIERR_BASE + 91 }
enum : uint { MCIERR_FILE_READ = MCIERR_BASE + 92 }
enum : uint { MCIERR_FILE_WRITE = MCIERR_BASE + 93 }

enum : uint { MCIERR_NO_IDENTITY = MCIERR_BASE + 94 }

enum : uint { MCIERR_CUSTOM_DRIVER_BASE = MCIERR_BASE + 256 }

alias DRV_MCI_FIRST MCI_FIRST;

enum : uint { MCI_OPEN = 0x0803 }
enum : uint { MCI_CLOSE = 0x0804 }
enum : uint { MCI_ESCAPE = 0x0805 }
enum : uint { MCI_PLAY = 0x0806 }
enum : uint { MCI_SEEK = 0x0807 }
enum : uint { MCI_STOP = 0x0808 }
enum : uint { MCI_PAUSE = 0x0809 }
enum : uint { MCI_INFO = 0x080A }
enum : uint { MCI_GETDEVCAPS = 0x080B }
enum : uint { MCI_SPIN = 0x080C }
enum : uint { MCI_SET = 0x080D }
enum : uint { MCI_STEP = 0x080E }
enum : uint { MCI_RECORD = 0x080F }
enum : uint { MCI_SYSINFO = 0x0810 }
enum : uint { MCI_BREAK = 0x0811 }
enum : uint { MCI_SAVE = 0x0813 }
enum : uint { MCI_STATUS = 0x0814 }
enum : uint { MCI_CUE = 0x0830 }
enum : uint { MCI_REALIZE = 0x0840 }
enum : uint { MCI_WINDOW = 0x0841 }
enum : uint { MCI_PUT = 0x0842 }
enum : uint { MCI_WHERE = 0x0843 }
enum : uint { MCI_FREEZE = 0x0844 }
enum : uint { MCI_UNFREEZE = 0x0845 }
enum : uint { MCI_LOAD = 0x0850 }
enum : uint { MCI_CUT = 0x0851 }
enum : uint { MCI_COPY = 0x0852 }
enum : uint { MCI_PASTE = 0x0853 }
enum : uint { MCI_UPDATE = 0x0854 }
enum : uint { MCI_RESUME = 0x0855 }
enum : uint { MCI_DELETE = 0x0856 }

enum : uint { MCI_USER_MESSAGES = DRV_MCI_FIRST + 0x400 }
enum : uint { MCI_LAST = 0x0FFF }

enum : uint { MCI_ALL_DEVICE_ID = cast(MCIDEVICEID)-1 }

enum : uint { MCI_DEVTYPE_VCR = 513 }
enum : uint { MCI_DEVTYPE_VIDEODISC = 514 }
enum : uint { MCI_DEVTYPE_OVERLAY = 515 }
enum : uint { MCI_DEVTYPE_CD_AUDIO = 516 }
enum : uint { MCI_DEVTYPE_DAT = 517 }
enum : uint { MCI_DEVTYPE_SCANNER = 518 }
enum : uint { MCI_DEVTYPE_ANIMATION = 519 }
enum : uint { MCI_DEVTYPE_DIGITAL_VIDEO = 520 }
enum : uint { MCI_DEVTYPE_OTHER = 521 }
enum : uint { MCI_DEVTYPE_WAVEFORM_AUDIO = 522 }
enum : uint { MCI_DEVTYPE_SEQUENCER = 523 }

alias MCI_DEVTYPE_VCR MCI_DEVTYPE_FIRST;
alias MCI_DEVTYPE_SEQUENCER MCI_DEVTYPE_LAST;

enum : uint { MCI_DEVTYPE_FIRST_USER = 0x1000 }

enum : uint { MCI_MODE_NOT_READY = MCI_STRING_OFFSET + 12 }
enum : uint { MCI_MODE_STOP = MCI_STRING_OFFSET + 13 }
enum : uint { MCI_MODE_PLAY = MCI_STRING_OFFSET + 14 }
enum : uint { MCI_MODE_RECORD = MCI_STRING_OFFSET + 15 }
enum : uint { MCI_MODE_SEEK = MCI_STRING_OFFSET + 16 }
enum : uint { MCI_MODE_PAUSE = MCI_STRING_OFFSET + 17 }
enum : uint { MCI_MODE_OPEN = MCI_STRING_OFFSET + 18 }

enum : uint { MCI_FORMAT_MILLISECONDS = 0 }
enum : uint { MCI_FORMAT_HMS = 1 }
enum : uint { MCI_FORMAT_MSF = 2 }
enum : uint { MCI_FORMAT_FRAMES = 3 }
enum : uint { MCI_FORMAT_SMPTE_24 = 4 }
enum : uint { MCI_FORMAT_SMPTE_25 = 5 }
enum : uint { MCI_FORMAT_SMPTE_30 = 6 }
enum : uint { MCI_FORMAT_SMPTE_30DROP = 7 }
enum : uint { MCI_FORMAT_BYTES = 8 }
enum : uint { MCI_FORMAT_SAMPLES = 9 }
enum : uint { MCI_FORMAT_TMSF = 10 }

// #define MCI_MSF_MINUTE(msf) ((BYTE)(msf))
// #define MCI_MSF_SECOND(msf) ((BYTE)(((WORD)(msf)) >> 8))
// #define MCI_MSF_FRAME(msf) ((BYTE)((msf)>>16))

// #define MCI_MAKE_MSF(m, s, f) ((DWORD)(((BYTE)(m) | ((WORD)(s)<<8)) | (((DWORD)(BYTE)(f))<<16)))

// #define MCI_TMSF_TRACK(tmsf) ((BYTE)(tmsf))
// #define MCI_TMSF_MINUTE(tmsf) ((BYTE)(((WORD)(tmsf)) >> 8))
// #define MCI_TMSF_SECOND(tmsf) ((BYTE)((tmsf)>>16))
// #define MCI_TMSF_FRAME(tmsf) ((BYTE)((tmsf)>>24))

// #define MCI_MAKE_TMSF(t, m, s, f) ((DWORD)(((BYTE)(t) | ((WORD)(m)<<8)) | (((DWORD)(BYTE)(s) | ((WORD)(f)<<8))<<16)))

// #define MCI_HMS_HOUR(hms) ((BYTE)(hms))
// #define MCI_HMS_MINUTE(hms) ((BYTE)(((WORD)(hms)) >> 8))
// #define MCI_HMS_SECOND(hms) ((BYTE)((hms)>>16))

// #define MCI_MAKE_HMS(h, m, s) ((DWORD)(((BYTE)(h) | ((WORD)(m)<<8)) | (((DWORD)(BYTE)(s))<<16)))

enum : uint { MCI_NOTIFY_SUCCESSFUL = 0x0001 }
enum : uint { MCI_NOTIFY_SUPERSEDED = 0x0002 }
enum : uint { MCI_NOTIFY_ABORTED = 0x0004 }
enum : uint { MCI_NOTIFY_FAILURE = 0x0008 }

enum : uint { MCI_NOTIFY = 0x00000001 }
enum : uint { MCI_WAIT = 0x00000002 }
enum : uint { MCI_FROM = 0x00000004 }
enum : uint { MCI_TO = 0x00000008 }
enum : uint { MCI_TRACK = 0x00000010 }

enum : uint { MCI_OPEN_SHAREABLE = 0x00000100 }
enum : uint { MCI_OPEN_ELEMENT = 0x00000200 }
enum : uint { MCI_OPEN_ALIAS = 0x00000400 }
enum : uint { MCI_OPEN_ELEMENT_ID = 0x00000800 }
enum : uint { MCI_OPEN_TYPE_ID = 0x00001000 }
enum : uint { MCI_OPEN_TYPE = 0x00002000 }

enum : uint { MCI_SEEK_TO_START = 0x00000100 }
enum : uint { MCI_SEEK_TO_END = 0x00000200 }

enum : uint { MCI_STATUS_ITEM = 0x00000100 }
enum : uint { MCI_STATUS_START = 0x00000200 }

enum : uint { MCI_STATUS_LENGTH = 0x00000001 }
enum : uint { MCI_STATUS_POSITION = 0x00000002 }
enum : uint { MCI_STATUS_NUMBER_OF_TRACKS = 0x00000003 }
enum : uint { MCI_STATUS_MODE = 0x00000004 }
enum : uint { MCI_STATUS_MEDIA_PRESENT = 0x00000005 }
enum : uint { MCI_STATUS_TIME_FORMAT = 0x00000006 }
enum : uint { MCI_STATUS_READY = 0x00000007 }
enum : uint { MCI_STATUS_CURRENT_TRACK = 0x00000008 }

enum : uint { MCI_INFO_PRODUCT = 0x00000100 }
enum : uint { MCI_INFO_FILE = 0x00000200 }
enum : uint { MCI_INFO_MEDIA_UPC = 0x00000400 }
enum : uint { MCI_INFO_MEDIA_IDENTITY = 0x00000800 }
enum : uint { MCI_INFO_NAME = 0x00001000 }
enum : uint { MCI_INFO_COPYRIGHT = 0x00002000 }

enum : uint { MCI_GETDEVCAPS_ITEM = 0x00000100 }

enum : uint { MCI_GETDEVCAPS_CAN_RECORD = 0x00000001 }
enum : uint { MCI_GETDEVCAPS_HAS_AUDIO = 0x00000002 }
enum : uint { MCI_GETDEVCAPS_HAS_VIDEO = 0x00000003 }
enum : uint { MCI_GETDEVCAPS_DEVICE_TYPE = 0x00000004 }
enum : uint { MCI_GETDEVCAPS_USES_FILES = 0x00000005 }
enum : uint { MCI_GETDEVCAPS_COMPOUND_DEVICE = 0x00000006 }
enum : uint { MCI_GETDEVCAPS_CAN_EJECT = 0x00000007 }
enum : uint { MCI_GETDEVCAPS_CAN_PLAY = 0x00000008 }
enum : uint { MCI_GETDEVCAPS_CAN_SAVE = 0x00000009 }

enum : uint { MCI_SYSINFO_QUANTITY = 0x00000100 }
enum : uint { MCI_SYSINFO_OPEN = 0x00000200 }
enum : uint { MCI_SYSINFO_NAME = 0x00000400 }
enum : uint { MCI_SYSINFO_INSTALLNAME = 0x00000800 }

enum : uint { MCI_SET_DOOR_OPEN = 0x00000100 }
enum : uint { MCI_SET_DOOR_CLOSED = 0x00000200 }
enum : uint { MCI_SET_TIME_FORMAT = 0x00000400 }
enum : uint { MCI_SET_AUDIO = 0x00000800 }
enum : uint { MCI_SET_VIDEO = 0x00001000 }
enum : uint { MCI_SET_ON = 0x00002000 }
enum : uint { MCI_SET_OFF = 0x00004000 }

enum : uint { MCI_SET_AUDIO_ALL = 0x00000000 }
enum : uint { MCI_SET_AUDIO_LEFT = 0x00000001 }
enum : uint { MCI_SET_AUDIO_RIGHT = 0x00000002 }

enum : uint { MCI_BREAK_KEY = 0x00000100 }
enum : uint { MCI_BREAK_HWND = 0x00000200 }
enum : uint { MCI_BREAK_OFF = 0x00000400 }

enum : uint { MCI_RECORD_INSERT = 0x00000100 }
enum : uint { MCI_RECORD_OVERWRITE = 0x00000200 }

enum : uint { MCI_SAVE_FILE = 0x00000100 }

enum : uint { MCI_LOAD_FILE = 0x00000100 }

struct tagMCI_GENERIC_PARMS {
  DWORD_PTR dwCallback;
}
alias tagMCI_GENERIC_PARMS MCI_GENERIC_PARMS;
alias tagMCI_GENERIC_PARMS* PMCI_GENERIC_PARMS;
alias tagMCI_GENERIC_PARMS* LPMCI_GENERIC_PARMS;

// #ifdef _WIN32

struct tagMCI_OPEN_PARMSA {
  DWORD_PTR dwCallback;
  MCIDEVICEID wDeviceID;
  LPCSTR lpstrDeviceType;
  LPCSTR lpstrElementName;
  LPCSTR lpstrAlias;
}
alias tagMCI_OPEN_PARMSA MCI_OPEN_PARMSA;
alias tagMCI_OPEN_PARMSA* PMCI_OPEN_PARMSA;
alias tagMCI_OPEN_PARMSA* LPMCI_OPEN_PARMSA;

struct tagMCI_OPEN_PARMSW {
  DWORD_PTR dwCallback;
  MCIDEVICEID wDeviceID;
  LPCWSTR lpstrDeviceType;
  LPCWSTR lpstrElementName;
  LPCWSTR lpstrAlias;
}
alias tagMCI_OPEN_PARMSW MCI_OPEN_PARMSW;
alias tagMCI_OPEN_PARMSW* PMCI_OPEN_PARMSW;
alias tagMCI_OPEN_PARMSW* LPMCI_OPEN_PARMSW;

// #ifdef UNICODE
// ...
// #else
alias MCI_OPEN_PARMSA MCI_OPEN_PARMS;
alias PMCI_OPEN_PARMSA PMCI_OPEN_PARMS;
alias LPMCI_OPEN_PARMSA LPMCI_OPEN_PARMS;
// #endif // UNICODE

// #else
// ...
// #endif

struct tagMCI_PLAY_PARMS {
  DWORD_PTR dwCallback;
  DWORD dwFrom;
  DWORD dwTo;
}
alias tagMCI_PLAY_PARMS MCI_PLAY_PARMS;
alias tagMCI_PLAY_PARMS* PMCI_PLAY_PARMS;
alias tagMCI_PLAY_PARMS* LPMCI_PLAY_PARMS;

struct tagMCI_SEEK_PARMS {
  DWORD_PTR dwCallback;
  DWORD dwTo;
}
alias tagMCI_SEEK_PARMS MCI_SEEK_PARMS;
alias tagMCI_SEEK_PARMS* PMCI_SEEK_PARMS;
alias tagMCI_SEEK_PARMS* LPMCI_SEEK_PARMS;

struct tagMCI_STATUS_PARMS {
  DWORD_PTR dwCallback;
  DWORD_PTR dwReturn;
  DWORD dwItem;
  DWORD dwTrack;
}
alias tagMCI_STATUS_PARMS MCI_STATUS_PARMS;
alias tagMCI_STATUS_PARMS* PMCI_STATUS_PARMS;
alias tagMCI_STATUS_PARMS* LPMCI_STATUS_PARMS;

// #ifdef _WIN32

struct tagMCI_INFO_PARMSA {
  DWORD_PTR dwCallback;
  LPSTR lpstrReturn;
  DWORD dwRetSize;
}
alias tagMCI_INFO_PARMSA MCI_INFO_PARMSA;
alias tagMCI_INFO_PARMSA* LPMCI_INFO_PARMSA;

struct tagMCI_INFO_PARMSW {
  DWORD_PTR dwCallback;
  LPWSTR lpstrReturn;
  DWORD dwRetSize;
}
alias tagMCI_INFO_PARMSW MCI_INFO_PARMSW;
alias tagMCI_INFO_PARMSW* LPMCI_INFO_PARMSW;

// #ifdef UNICODE
// ...
// #else
alias MCI_INFO_PARMSA MCI_INFO_PARMS;
alias LPMCI_INFO_PARMSA LPMCI_INFO_PARMS;
// #endif // UNICODE

// #else
// ...
// #endif

struct tagMCI_GETDEVCAPS_PARMS {
  DWORD_PTR dwCallback;
  DWORD dwReturn;
  DWORD dwItem;
}
alias tagMCI_GETDEVCAPS_PARMS MCI_GETDEVCAPS_PARMS;
alias tagMCI_GETDEVCAPS_PARMS* PMCI_GETDEVCAPS_PARMS;
alias tagMCI_GETDEVCAPS_PARMS* LPMCI_GETDEVCAPS_PARMS;

// #ifdef _WIN32

struct tagMCI_SYSINFO_PARMSA {
  DWORD_PTR dwCallback;
  LPSTR lpstrReturn;
  DWORD dwRetSize;
  DWORD dwNumber;
  UINT wDeviceType;
}
alias tagMCI_SYSINFO_PARMSA MCI_SYSINFO_PARMSA;
alias tagMCI_SYSINFO_PARMSA* PMCI_SYSINFO_PARMSA;
alias tagMCI_SYSINFO_PARMSA* LPMCI_SYSINFO_PARMSA;

struct tagMCI_SYSINFO_PARMSW {
  DWORD_PTR dwCallback;
  LPWSTR lpstrReturn;
  DWORD dwRetSize;
  DWORD dwNumber;
  UINT wDeviceType;
}
alias tagMCI_SYSINFO_PARMSW MCI_SYSINFO_PARMSW;
alias tagMCI_SYSINFO_PARMSW* PMCI_SYSINFO_PARMSW;
alias tagMCI_SYSINFO_PARMSW* LPMCI_SYSINFO_PARMSW;

// #ifdef UNICODE
// ...
// #else
alias MCI_SYSINFO_PARMSA MCI_SYSINFO_PARMS;
alias PMCI_SYSINFO_PARMSA PMCI_SYSINFO_PARMS;
alias LPMCI_SYSINFO_PARMSA LPMCI_SYSINFO_PARMS;
// #endif // UNICODE
// #else
// ...
// #endif

struct tagMCI_SET_PARMS {
  DWORD_PTR dwCallback;
  DWORD dwTimeFormat;
  DWORD dwAudio;
}
alias tagMCI_SET_PARMS MCI_SET_PARMS;
alias tagMCI_SET_PARMS* PMCI_SET_PARMS;
alias tagMCI_SET_PARMS* LPMCI_SET_PARMS;

struct tagMCI_BREAK_PARMS {
  DWORD_PTR dwCallback;
// #ifdef _WIN32
  int nVirtKey;
  HWND hwndBreak;
// #else
// ...
// #endif
}
alias tagMCI_BREAK_PARMS MCI_BREAK_PARMS;
alias tagMCI_BREAK_PARMS* PMCI_BREAK_PARMS;
alias tagMCI_BREAK_PARMS* LPMCI_BREAK_PARMS;

// #ifdef _WIN32

struct tagMCI_SAVE_PARMSA {
  DWORD_PTR dwCallback;
  LPCSTR lpfilename;
}
alias tagMCI_SAVE_PARMSA MCI_SAVE_PARMSA;
alias tagMCI_SAVE_PARMSA* PMCI_SAVE_PARMSA;
alias tagMCI_SAVE_PARMSA* LPMCI_SAVE_PARMSA;

struct tagMCI_SAVE_PARMSW {
  DWORD_PTR dwCallback;
  LPCWSTR lpfilename;
}
alias tagMCI_SAVE_PARMSW MCI_SAVE_PARMSW;
alias tagMCI_SAVE_PARMSW* PMCI_SAVE_PARMSW;
alias tagMCI_SAVE_PARMSW* LPMCI_SAVE_PARMSW;

// #ifdef UNICODE
// ...
// #else
alias MCI_SAVE_PARMSA MCI_SAVE_PARMS;
alias PMCI_SAVE_PARMSA PMCI_SAVE_PARMS;
alias LPMCI_SAVE_PARMSA LPMCI_SAVE_PARMS;
// #endif // UNICODE

// #else
// ...
// #endif

// #ifdef _WIN32

struct tagMCI_LOAD_PARMSA {
  DWORD_PTR dwCallback;
  LPCSTR lpfilename;
}
alias tagMCI_LOAD_PARMSA MCI_LOAD_PARMSA;
alias tagMCI_LOAD_PARMSA* PMCI_LOAD_PARMSA;
alias tagMCI_LOAD_PARMSA* LPMCI_LOAD_PARMSA;

struct tagMCI_LOAD_PARMSW {
  DWORD_PTR dwCallback;
  LPCWSTR lpfilename;
}
alias tagMCI_LOAD_PARMSW MCI_LOAD_PARMSW;
alias tagMCI_LOAD_PARMSW* PMCI_LOAD_PARMSW;
alias tagMCI_LOAD_PARMSW* LPMCI_LOAD_PARMSW;

// #ifdef UNICODE
// ...
// #else
alias MCI_LOAD_PARMSA MCI_LOAD_PARMS;
alias PMCI_LOAD_PARMSA PMCI_LOAD_PARMS;
alias LPMCI_LOAD_PARMSA LPMCI_LOAD_PARMS;
// #endif // UNICODE

// #else
// ...
// #endif

struct tagMCI_RECORD_PARMS {
  DWORD_PTR dwCallback;
  DWORD dwFrom;
  DWORD dwTo;
}
alias tagMCI_RECORD_PARMS MCI_RECORD_PARMS;
alias tagMCI_RECORD_PARMS* LPMCI_RECORD_PARMS;

enum : uint { MCI_VD_MODE_PARK = MCI_VD_OFFSET + 1 }

enum : uint { MCI_VD_MEDIA_CLV = MCI_VD_OFFSET + 2 }
enum : uint { MCI_VD_MEDIA_CAV = MCI_VD_OFFSET + 3 }
enum : uint { MCI_VD_MEDIA_OTHER = MCI_VD_OFFSET + 4 }

enum : uint { MCI_VD_FORMAT_TRACK = 0x4001 }

enum : uint { MCI_VD_PLAY_REVERSE = 0x00010000 }
enum : uint { MCI_VD_PLAY_FAST = 0x00020000 }
enum : uint { MCI_VD_PLAY_SPEED = 0x00040000 }
enum : uint { MCI_VD_PLAY_SCAN = 0x00080000 }
enum : uint { MCI_VD_PLAY_SLOW = 0x00100000 }

enum : uint { MCI_VD_SEEK_REVERSE = 0x00010000 }

enum : uint { MCI_VD_STATUS_SPEED = 0x00004002 }
enum : uint { MCI_VD_STATUS_FORWARD = 0x00004003 }
enum : uint { MCI_VD_STATUS_MEDIA_TYPE = 0x00004004 }
enum : uint { MCI_VD_STATUS_SIDE = 0x00004005 }
enum : uint { MCI_VD_STATUS_DISC_SIZE = 0x00004006 }

enum : uint { MCI_VD_GETDEVCAPS_CLV = 0x00010000 }
enum : uint { MCI_VD_GETDEVCAPS_CAV = 0x00020000 }

enum : uint { MCI_VD_SPIN_UP = 0x00010000 }
enum : uint { MCI_VD_SPIN_DOWN = 0x00020000 }

enum : uint { MCI_VD_GETDEVCAPS_CAN_REVERSE = 0x00004002 }
enum : uint { MCI_VD_GETDEVCAPS_FAST_RATE = 0x00004003 }
enum : uint { MCI_VD_GETDEVCAPS_SLOW_RATE = 0x00004004 }
enum : uint { MCI_VD_GETDEVCAPS_NORMAL_RATE = 0x00004005 }

enum : uint { MCI_VD_STEP_FRAMES = 0x00010000 }
enum : uint { MCI_VD_STEP_REVERSE = 0x00020000 }

enum : uint { MCI_VD_ESCAPE_STRING = 0x00000100 }

struct tagMCI_VD_PLAY_PARMS {
  DWORD_PTR dwCallback;
  DWORD dwFrom;
  DWORD dwTo;
  DWORD dwSpeed;
}
alias tagMCI_VD_PLAY_PARMS MCI_VD_PLAY_PARMS;
alias tagMCI_VD_PLAY_PARMS* PMCI_VD_PLAY_PARMS;
alias tagMCI_VD_PLAY_PARMS* LPMCI_VD_PLAY_PARMS;

struct tagMCI_VD_STEP_PARMS {
  DWORD_PTR dwCallback;
  DWORD dwFrames;
}
alias tagMCI_VD_STEP_PARMS MCI_VD_STEP_PARMS;
alias tagMCI_VD_STEP_PARMS* PMCI_VD_STEP_PARMS;
alias tagMCI_VD_STEP_PARMS* LPMCI_VD_STEP_PARMS;

// #ifdef _WIN32

struct tagMCI_VD_ESCAPE_PARMSA {
  DWORD_PTR dwCallback;
  LPCSTR lpstrCommand;
}
alias tagMCI_VD_ESCAPE_PARMSA MCI_VD_ESCAPE_PARMSA;
alias tagMCI_VD_ESCAPE_PARMSA* PMCI_VD_ESCAPE_PARMSA;
alias tagMCI_VD_ESCAPE_PARMSA* LPMCI_VD_ESCAPE_PARMSA;

struct tagMCI_VD_ESCAPE_PARMSW {
  DWORD_PTR dwCallback;
  LPCWSTR lpstrCommand;
}
alias tagMCI_VD_ESCAPE_PARMSW MCI_VD_ESCAPE_PARMSW;
alias tagMCI_VD_ESCAPE_PARMSW* PMCI_VD_ESCAPE_PARMSW;
alias tagMCI_VD_ESCAPE_PARMSW* LPMCI_VD_ESCAPE_PARMSW;

// #ifdef UNICODE
// ...
// #else
alias MCI_VD_ESCAPE_PARMSA MCI_VD_ESCAPE_PARMS;
alias PMCI_VD_ESCAPE_PARMSA PMCI_VD_ESCAPE_PARMS;
alias LPMCI_VD_ESCAPE_PARMSA LPMCI_VD_ESCAPE_PARMS;
// #endif // UNICODE

// #else
// ...
// #endif

enum : uint { MCI_CDA_STATUS_TYPE_TRACK = 0x00004001 }

enum : uint { MCI_CDA_TRACK_AUDIO = MCI_CD_OFFSET + 0 }
enum : uint { MCI_CDA_TRACK_OTHER = MCI_CD_OFFSET + 1 }

enum : uint { MCI_WAVE_PCM = MCI_WAVE_OFFSET + 0 }
enum : uint { MCI_WAVE_MAPPER = MCI_WAVE_OFFSET + 1 }

enum : uint { MCI_WAVE_OPEN_BUFFER = 0x00010000 }

enum : uint { MCI_WAVE_SET_FORMATTAG = 0x00010000 }
enum : uint { MCI_WAVE_SET_CHANNELS = 0x00020000 }
enum : uint { MCI_WAVE_SET_SAMPLESPERSEC = 0x00040000 }
enum : uint { MCI_WAVE_SET_AVGBYTESPERSEC = 0x00080000 }
enum : uint { MCI_WAVE_SET_BLOCKALIGN = 0x00100000 }
enum : uint { MCI_WAVE_SET_BITSPERSAMPLE = 0x00200000 }

enum : uint { MCI_WAVE_INPUT = 0x00400000 }
enum : uint { MCI_WAVE_OUTPUT = 0x00800000 }

enum : uint { MCI_WAVE_STATUS_FORMATTAG = 0x00004001 }
enum : uint { MCI_WAVE_STATUS_CHANNELS = 0x00004002 }
enum : uint { MCI_WAVE_STATUS_SAMPLESPERSEC = 0x00004003 }
enum : uint { MCI_WAVE_STATUS_AVGBYTESPERSEC = 0x00004004 }
enum : uint { MCI_WAVE_STATUS_BLOCKALIGN = 0x00004005 }
enum : uint { MCI_WAVE_STATUS_BITSPERSAMPLE = 0x00004006 }
enum : uint { MCI_WAVE_STATUS_LEVEL = 0x00004007 }

enum : uint { MCI_WAVE_SET_ANYINPUT = 0x04000000 }
enum : uint { MCI_WAVE_SET_ANYOUTPUT = 0x08000000 }

enum : uint { MCI_WAVE_GETDEVCAPS_INPUTS = 0x00004001 }
enum : uint { MCI_WAVE_GETDEVCAPS_OUTPUTS = 0x00004002 }

// #ifdef _WIN32

struct tagMCI_WAVE_OPEN_PARMSA {
  DWORD_PTR dwCallback;
  MCIDEVICEID wDeviceID;
  LPCSTR lpstrDeviceType;
  LPCSTR lpstrElementName;
  LPCSTR lpstrAlias;
  DWORD dwBufferSeconds;
}
alias tagMCI_WAVE_OPEN_PARMSA MCI_WAVE_OPEN_PARMSA;
alias tagMCI_WAVE_OPEN_PARMSA* PMCI_WAVE_OPEN_PARMSA;
alias tagMCI_WAVE_OPEN_PARMSA* LPMCI_WAVE_OPEN_PARMSA;

struct tagMCI_WAVE_OPEN_PARMSW {
  DWORD_PTR dwCallback;
  MCIDEVICEID wDeviceID;
  LPCWSTR lpstrDeviceType;
  LPCWSTR lpstrElementName;
  LPCWSTR lpstrAlias;
  DWORD dwBufferSeconds;
}
alias tagMCI_WAVE_OPEN_PARMSW MCI_WAVE_OPEN_PARMSW;
alias tagMCI_WAVE_OPEN_PARMSW* PMCI_WAVE_OPEN_PARMSW;
alias tagMCI_WAVE_OPEN_PARMSW* LPMCI_WAVE_OPEN_PARMSW;

// #ifdef UNICODE
// ...
// #else
alias MCI_WAVE_OPEN_PARMSA MCI_WAVE_OPEN_PARMS;
alias PMCI_WAVE_OPEN_PARMSA PMCI_WAVE_OPEN_PARMS;
alias LPMCI_WAVE_OPEN_PARMSA LPMCI_WAVE_OPEN_PARMS;
// #endif // UNICODE

// #else
// ...
// #endif

struct tagMCI_WAVE_DELETE_PARMS {
  DWORD_PTR dwCallback;
  DWORD dwFrom;
  DWORD dwTo;
}
alias tagMCI_WAVE_DELETE_PARMS MCI_WAVE_DELETE_PARMS;
alias tagMCI_WAVE_DELETE_PARMS* PMCI_WAVE_DELETE_PARMS;
alias tagMCI_WAVE_DELETE_PARMS* LPMCI_WAVE_DELETE_PARMS;

struct tagMCI_WAVE_SET_PARMS {
  DWORD_PTR dwCallback;
  DWORD dwTimeFormat;
  DWORD dwAudio;
// #ifdef _WIN32
  UINT wInput;
  UINT wOutput;
// #else
// ...
// #endif
  WORD wFormatTag;
  WORD wReserved2;
  WORD nChannels;
  WORD wReserved3;
  DWORD nSamplesPerSec;
  DWORD nAvgBytesPerSec;
  WORD nBlockAlign;
  WORD wReserved4;
  WORD wBitsPerSample;
  WORD wReserved5;
}
alias tagMCI_WAVE_SET_PARMS MCI_WAVE_SET_PARMS;
alias tagMCI_WAVE_SET_PARMS* PMCI_WAVE_SET_PARMS;
alias tagMCI_WAVE_SET_PARMS* LPMCI_WAVE_SET_PARMS;

enum : uint { MCI_SEQ_DIV_PPQN = 0 + MCI_SEQ_OFFSET }
enum : uint { MCI_SEQ_DIV_SMPTE_24 = 1 + MCI_SEQ_OFFSET }
enum : uint { MCI_SEQ_DIV_SMPTE_25 = 2 + MCI_SEQ_OFFSET }
enum : uint { MCI_SEQ_DIV_SMPTE_30DROP = 3 + MCI_SEQ_OFFSET }
enum : uint { MCI_SEQ_DIV_SMPTE_30 = 4 + MCI_SEQ_OFFSET }

enum : uint { MCI_SEQ_FORMAT_SONGPTR = 0x4001 }
enum : uint { MCI_SEQ_FILE = 0x4002 }
enum : uint { MCI_SEQ_MIDI = 0x4003 }
enum : uint { MCI_SEQ_SMPTE = 0x4004 }
enum : uint { MCI_SEQ_NONE = 65533 }
enum : uint { MCI_SEQ_MAPPER = 65535 }

enum : uint { MCI_SEQ_STATUS_TEMPO = 0x00004002 }
enum : uint { MCI_SEQ_STATUS_PORT = 0x00004003 }
enum : uint { MCI_SEQ_STATUS_SLAVE = 0x00004007 }
enum : uint { MCI_SEQ_STATUS_MASTER = 0x00004008 }
enum : uint { MCI_SEQ_STATUS_OFFSET = 0x00004009 }
enum : uint { MCI_SEQ_STATUS_DIVTYPE = 0x0000400A }
enum : uint { MCI_SEQ_STATUS_NAME = 0x0000400B }
enum : uint { MCI_SEQ_STATUS_COPYRIGHT = 0x0000400C }

enum : uint { MCI_SEQ_SET_TEMPO = 0x00010000 }
enum : uint { MCI_SEQ_SET_PORT = 0x00020000 }
enum : uint { MCI_SEQ_SET_SLAVE = 0x00040000 }
enum : uint { MCI_SEQ_SET_MASTER = 0x00080000 }
enum : uint { MCI_SEQ_SET_OFFSET = 0x01000000 }

struct tagMCI_SEQ_SET_PARMS {
  DWORD_PTR dwCallback;
  DWORD dwTimeFormat;
  DWORD dwAudio;
  DWORD dwTempo;
  DWORD dwPort;
  DWORD dwSlave;
  DWORD dwMaster;
  DWORD dwOffset;
}
alias tagMCI_SEQ_SET_PARMS MCI_SEQ_SET_PARMS;
alias tagMCI_SEQ_SET_PARMS* PMCI_SEQ_SET_PARMS;
alias tagMCI_SEQ_SET_PARMS* LPMCI_SEQ_SET_PARMS;

enum : uint { MCI_ANIM_OPEN_WS = 0x00010000 }
enum : uint { MCI_ANIM_OPEN_PARENT = 0x00020000 }
enum : uint { MCI_ANIM_OPEN_NOSTATIC = 0x00040000 }

enum : uint { MCI_ANIM_PLAY_SPEED = 0x00010000 }
enum : uint { MCI_ANIM_PLAY_REVERSE = 0x00020000 }
enum : uint { MCI_ANIM_PLAY_FAST = 0x00040000 }
enum : uint { MCI_ANIM_PLAY_SLOW = 0x00080000 }
enum : uint { MCI_ANIM_PLAY_SCAN = 0x00100000 }

enum : uint { MCI_ANIM_STEP_REVERSE = 0x00010000 }
enum : uint { MCI_ANIM_STEP_FRAMES = 0x00020000 }

enum : uint { MCI_ANIM_STATUS_SPEED = 0x00004001 }
enum : uint { MCI_ANIM_STATUS_FORWARD = 0x00004002 }
enum : uint { MCI_ANIM_STATUS_HWND = 0x00004003 }
enum : uint { MCI_ANIM_STATUS_HPAL = 0x00004004 }
enum : uint { MCI_ANIM_STATUS_STRETCH = 0x00004005 }

enum : uint { MCI_ANIM_INFO_TEXT = 0x00010000 }

enum : uint { MCI_ANIM_GETDEVCAPS_CAN_REVERSE = 0x00004001 }
enum : uint { MCI_ANIM_GETDEVCAPS_FAST_RATE = 0x00004002 }
enum : uint { MCI_ANIM_GETDEVCAPS_SLOW_RATE = 0x00004003 }
enum : uint { MCI_ANIM_GETDEVCAPS_NORMAL_RATE = 0x00004004 }
enum : uint { MCI_ANIM_GETDEVCAPS_PALETTES = 0x00004006 }
enum : uint { MCI_ANIM_GETDEVCAPS_CAN_STRETCH = 0x00004007 }
enum : uint { MCI_ANIM_GETDEVCAPS_MAX_WINDOWS = 0x00004008 }

enum : uint { MCI_ANIM_REALIZE_NORM = 0x00010000 }
enum : uint { MCI_ANIM_REALIZE_BKGD = 0x00020000 }

enum : uint { MCI_ANIM_WINDOW_HWND = 0x00010000 }
enum : uint { MCI_ANIM_WINDOW_STATE = 0x00040000 }
enum : uint { MCI_ANIM_WINDOW_TEXT = 0x00080000 }
enum : uint { MCI_ANIM_WINDOW_ENABLE_STRETCH = 0x00100000 }
enum : uint { MCI_ANIM_WINDOW_DISABLE_STRETCH = 0x00200000 }

enum : uint { MCI_ANIM_WINDOW_DEFAULT = 0x00000000 }

enum : uint { MCI_ANIM_RECT = 0x00010000 }
enum : uint { MCI_ANIM_PUT_SOURCE = 0x00020000 }
enum : uint { MCI_ANIM_PUT_DESTINATION = 0x00040000 }

enum : uint { MCI_ANIM_WHERE_SOURCE = 0x00020000 }
enum : uint { MCI_ANIM_WHERE_DESTINATION = 0x00040000 }

enum : uint { MCI_ANIM_UPDATE_HDC = 0x00020000 }

// #ifdef _WIN32

struct tagMCI_ANIM_OPEN_PARMSA {
  DWORD_PTR dwCallback;
  MCIDEVICEID wDeviceID;
  LPCSTR lpstrDeviceType;
  LPCSTR lpstrElementName;
  LPCSTR lpstrAlias;
  DWORD dwStyle;
  HWND hWndParent;
}
alias tagMCI_ANIM_OPEN_PARMSA MCI_ANIM_OPEN_PARMSA;
alias tagMCI_ANIM_OPEN_PARMSA* PMCI_ANIM_OPEN_PARMSA;
alias tagMCI_ANIM_OPEN_PARMSA* LPMCI_ANIM_OPEN_PARMSA;

struct tagMCI_ANIM_OPEN_PARMSW {
  DWORD_PTR dwCallback;
  MCIDEVICEID wDeviceID;
  LPCWSTR lpstrDeviceType;
  LPCWSTR lpstrElementName;
  LPCWSTR lpstrAlias;
  DWORD dwStyle;
  HWND hWndParent;
}
alias tagMCI_ANIM_OPEN_PARMSW MCI_ANIM_OPEN_PARMSW;
alias tagMCI_ANIM_OPEN_PARMSW* PMCI_ANIM_OPEN_PARMSW;
alias tagMCI_ANIM_OPEN_PARMSW* LPMCI_ANIM_OPEN_PARMSW;

// #ifdef UNICODE
// ...
// #else
alias MCI_ANIM_OPEN_PARMSA MCI_ANIM_OPEN_PARMS;
alias PMCI_ANIM_OPEN_PARMSA PMCI_ANIM_OPEN_PARMS;
alias LPMCI_ANIM_OPEN_PARMSA LPMCI_ANIM_OPEN_PARMS;
// #endif // UNICODE

// #else
// ...
// #endif

struct tagMCI_ANIM_PLAY_PARMS {
  DWORD_PTR dwCallback;
  DWORD dwFrom;
  DWORD dwTo;
  DWORD dwSpeed;
}
alias tagMCI_ANIM_PLAY_PARMS MCI_ANIM_PLAY_PARMS;
alias tagMCI_ANIM_PLAY_PARMS* PMCI_ANIM_PLAY_PARMS;
alias tagMCI_ANIM_PLAY_PARMS* LPMCI_ANIM_PLAY_PARMS;

struct tagMCI_ANIM_STEP_PARMS {
  DWORD_PTR dwCallback;
  DWORD dwFrames;
}
alias tagMCI_ANIM_STEP_PARMS MCI_ANIM_STEP_PARMS;
alias tagMCI_ANIM_STEP_PARMS* PMCI_ANIM_STEP_PARMS;
alias tagMCI_ANIM_STEP_PARMS* LPMCI_ANIM_STEP_PARMS;

// #ifdef _WIN32

struct tagMCI_ANIM_WINDOW_PARMSA {
  DWORD_PTR dwCallback;
  HWND hWnd;
  UINT nCmdShow;
  LPCSTR lpstrText;
}
alias tagMCI_ANIM_WINDOW_PARMSA MCI_ANIM_WINDOW_PARMSA;
alias tagMCI_ANIM_WINDOW_PARMSA* PMCI_ANIM_WINDOW_PARMSA;
alias tagMCI_ANIM_WINDOW_PARMSA* LPMCI_ANIM_WINDOW_PARMSA;

struct tagMCI_ANIM_WINDOW_PARMSW {
  DWORD_PTR dwCallback;
  HWND hWnd;
  UINT nCmdShow;
  LPCWSTR lpstrText;
}
alias tagMCI_ANIM_WINDOW_PARMSW MCI_ANIM_WINDOW_PARMSW;
alias tagMCI_ANIM_WINDOW_PARMSW* PMCI_ANIM_WINDOW_PARMSW;
alias tagMCI_ANIM_WINDOW_PARMSW* LPMCI_ANIM_WINDOW_PARMSW;

// #ifdef UNICODE
// ...
// #else
alias MCI_ANIM_WINDOW_PARMSA MCI_ANIM_WINDOW_PARMS;
alias PMCI_ANIM_WINDOW_PARMSA PMCI_ANIM_WINDOW_PARMS;
alias LPMCI_ANIM_WINDOW_PARMSA LPMCI_ANIM_WINDOW_PARMS;
// #endif // UNICODE

// #else
// ...
// #endif

struct tagMCI_ANIM_RECT_PARMS {
  DWORD_PTR dwCallback;
// #ifdef MCI_USE_OFFEXT
// ...
// #else   /* ifdef MCI_USE_OFFEXT */
  RECT rc;
// #endif  /* ifdef MCI_USE_OFFEXT */
}
alias tagMCI_ANIM_RECT_PARMS MCI_ANIM_RECT_PARMS;

alias MCI_ANIM_RECT_PARMS* PMCI_ANIM_RECT_PARMS;
alias MCI_ANIM_RECT_PARMS* LPMCI_ANIM_RECT_PARMS;

struct tagMCI_ANIM_UPDATE_PARMS {
  DWORD_PTR dwCallback;
  RECT rc;
  HDC hDC;
}
alias tagMCI_ANIM_UPDATE_PARMS MCI_ANIM_UPDATE_PARMS;
alias tagMCI_ANIM_UPDATE_PARMS* PMCI_ANIM_UPDATE_PARMS;
alias tagMCI_ANIM_UPDATE_PARMS* LPMCI_ANIM_UPDATE_PARMS;

enum : uint { MCI_OVLY_OPEN_WS = 0x00010000 }
enum : uint { MCI_OVLY_OPEN_PARENT = 0x00020000 }

enum : uint { MCI_OVLY_STATUS_HWND = 0x00004001 }
enum : uint { MCI_OVLY_STATUS_STRETCH = 0x00004002 }

enum : uint { MCI_OVLY_INFO_TEXT = 0x00010000 }

enum : uint { MCI_OVLY_GETDEVCAPS_CAN_STRETCH = 0x00004001 }
enum : uint { MCI_OVLY_GETDEVCAPS_CAN_FREEZE = 0x00004002 }
enum : uint { MCI_OVLY_GETDEVCAPS_MAX_WINDOWS = 0x00004003 }

enum : uint { MCI_OVLY_WINDOW_HWND = 0x00010000 }
enum : uint { MCI_OVLY_WINDOW_STATE = 0x00040000 }
enum : uint { MCI_OVLY_WINDOW_TEXT = 0x00080000 }
enum : uint { MCI_OVLY_WINDOW_ENABLE_STRETCH = 0x00100000 }
enum : uint { MCI_OVLY_WINDOW_DISABLE_STRETCH = 0x00200000 }

enum : uint { MCI_OVLY_WINDOW_DEFAULT = 0x00000000 }

enum : uint { MCI_OVLY_RECT = 0x00010000 }
enum : uint { MCI_OVLY_PUT_SOURCE = 0x00020000 }
enum : uint { MCI_OVLY_PUT_DESTINATION = 0x00040000 }
enum : uint { MCI_OVLY_PUT_FRAME = 0x00080000 }
enum : uint { MCI_OVLY_PUT_VIDEO = 0x00100000 }

enum : uint { MCI_OVLY_WHERE_SOURCE = 0x00020000 }
enum : uint { MCI_OVLY_WHERE_DESTINATION = 0x00040000 }
enum : uint { MCI_OVLY_WHERE_FRAME = 0x00080000 }
enum : uint { MCI_OVLY_WHERE_VIDEO = 0x00100000 }

// #ifdef _WIN32

struct tagMCI_OVLY_OPEN_PARMSA {
  DWORD_PTR dwCallback;
  MCIDEVICEID wDeviceID;
  LPCSTR lpstrDeviceType;
  LPCSTR lpstrElementName;
  LPCSTR lpstrAlias;
  DWORD dwStyle;
  HWND hWndParent;
}
alias tagMCI_OVLY_OPEN_PARMSA MCI_OVLY_OPEN_PARMSA;
alias tagMCI_OVLY_OPEN_PARMSA* PMCI_OVLY_OPEN_PARMSA;
alias tagMCI_OVLY_OPEN_PARMSA* LPMCI_OVLY_OPEN_PARMSA;

struct tagMCI_OVLY_OPEN_PARMSW {
  DWORD_PTR dwCallback;
  MCIDEVICEID wDeviceID;
  LPCWSTR lpstrDeviceType;
  LPCWSTR lpstrElementName;
  LPCWSTR lpstrAlias;
  DWORD dwStyle;
  HWND hWndParent;
}
alias tagMCI_OVLY_OPEN_PARMSW MCI_OVLY_OPEN_PARMSW;
alias tagMCI_OVLY_OPEN_PARMSW* PMCI_OVLY_OPEN_PARMSW;
alias tagMCI_OVLY_OPEN_PARMSW* LPMCI_OVLY_OPEN_PARMSW;

// #ifdef UNICODE
// ...
// #else
alias MCI_OVLY_OPEN_PARMSA MCI_OVLY_OPEN_PARMS;
alias PMCI_OVLY_OPEN_PARMSA PMCI_OVLY_OPEN_PARMS;
alias LPMCI_OVLY_OPEN_PARMSA LPMCI_OVLY_OPEN_PARMS;
// #endif // UNICODE

// #else
// ...
// #endif

// #ifdef _WIN32

struct tagMCI_OVLY_WINDOW_PARMSA {
  DWORD_PTR dwCallback;
  HWND hWnd;
  UINT nCmdShow;
  LPCSTR lpstrText;
}
alias tagMCI_OVLY_WINDOW_PARMSA MCI_OVLY_WINDOW_PARMSA;
alias tagMCI_OVLY_WINDOW_PARMSA* PMCI_OVLY_WINDOW_PARMSA;
alias tagMCI_OVLY_WINDOW_PARMSA* LPMCI_OVLY_WINDOW_PARMSA;

struct tagMCI_OVLY_WINDOW_PARMSW {
  DWORD_PTR dwCallback;
  HWND hWnd;
  UINT nCmdShow;
  LPCWSTR lpstrText;
}
alias tagMCI_OVLY_WINDOW_PARMSW MCI_OVLY_WINDOW_PARMSW;
alias tagMCI_OVLY_WINDOW_PARMSW* PMCI_OVLY_WINDOW_PARMSW;
alias tagMCI_OVLY_WINDOW_PARMSW* LPMCI_OVLY_WINDOW_PARMSW;

// #ifdef UNICODE
// ...
// #else
alias MCI_OVLY_WINDOW_PARMSA MCI_OVLY_WINDOW_PARMS;
alias PMCI_OVLY_WINDOW_PARMSA PMCI_OVLY_WINDOW_PARMS;
alias LPMCI_OVLY_WINDOW_PARMSA LPMCI_OVLY_WINDOW_PARMS;
// #endif // UNICODE
// #else
// ...
// #endif

struct tagMCI_OVLY_RECT_PARMS {
  DWORD_PTR dwCallback;
// #ifdef MCI_USE_OFFEXT
// ...
// #else   /* ifdef MCI_USE_OFFEXT */
  RECT rc;
// #endif  /* ifdef MCI_USE_OFFEXT */
}
alias tagMCI_OVLY_RECT_PARMS MCI_OVLY_RECT_PARMS;
alias tagMCI_OVLY_RECT_PARMS* PMCI_OVLY_RECT_PARMS;
alias tagMCI_OVLY_RECT_PARMS* LPMCI_OVLY_RECT_PARMS;

// #ifdef _WIN32

struct tagMCI_OVLY_SAVE_PARMSA {
  DWORD_PTR dwCallback;
  LPCSTR lpfilename;
  RECT rc;
}
alias tagMCI_OVLY_SAVE_PARMSA MCI_OVLY_SAVE_PARMSA;
alias tagMCI_OVLY_SAVE_PARMSA* PMCI_OVLY_SAVE_PARMSA;
alias tagMCI_OVLY_SAVE_PARMSA* LPMCI_OVLY_SAVE_PARMSA;

struct tagMCI_OVLY_SAVE_PARMSW {
  DWORD_PTR dwCallback;
  LPCWSTR lpfilename;
  RECT rc;
}
alias tagMCI_OVLY_SAVE_PARMSW MCI_OVLY_SAVE_PARMSW;
alias tagMCI_OVLY_SAVE_PARMSW* PMCI_OVLY_SAVE_PARMSW;
alias tagMCI_OVLY_SAVE_PARMSW* LPMCI_OVLY_SAVE_PARMSW;

// #ifdef UNICODE
// ...
// #else
alias MCI_OVLY_SAVE_PARMSA MCI_OVLY_SAVE_PARMS;
alias PMCI_OVLY_SAVE_PARMSA PMCI_OVLY_SAVE_PARMS;
alias LPMCI_OVLY_SAVE_PARMSA LPMCI_OVLY_SAVE_PARMS;
// #endif // UNICODE
// #else
// ...
// #endif

// #ifdef _WIN32

struct tagMCI_OVLY_LOAD_PARMSA {
  DWORD_PTR dwCallback;
  LPCSTR lpfilename;
  RECT rc;
}
alias tagMCI_OVLY_LOAD_PARMSA MCI_OVLY_LOAD_PARMSA;
alias tagMCI_OVLY_LOAD_PARMSA* PMCI_OVLY_LOAD_PARMSA;
alias tagMCI_OVLY_LOAD_PARMSA* LPMCI_OVLY_LOAD_PARMSA;

struct tagMCI_OVLY_LOAD_PARMSW {
  DWORD_PTR dwCallback;
  LPCWSTR lpfilename;
  RECT rc;
}
alias tagMCI_OVLY_LOAD_PARMSW MCI_OVLY_LOAD_PARMSW;
alias tagMCI_OVLY_LOAD_PARMSW* PMCI_OVLY_LOAD_PARMSW;
alias tagMCI_OVLY_LOAD_PARMSW* LPMCI_OVLY_LOAD_PARMSW;

// #ifdef UNICODE
// ...
// #else
alias MCI_OVLY_LOAD_PARMSA MCI_OVLY_LOAD_PARMS;
alias PMCI_OVLY_LOAD_PARMSA PMCI_OVLY_LOAD_PARMS;
alias LPMCI_OVLY_LOAD_PARMSA LPMCI_OVLY_LOAD_PARMS;
// #endif // UNICODE
// #else
// ...
// #endif

// #endif  /* ifndef MMNOMCI */

// #ifndef NEWTRANSPARENT
enum : uint { NEWTRANSPARENT = 3 }

enum : uint { QUERYROPSUPPORT = 40 }
// #endif  /* ifndef NEWTRANSPARENT */

enum : uint { SELECTDIB = 41 }
// #define DIBINDEX(n) MAKELONG((n),0x10FF)

// #ifndef SC_SCREENSAVE

enum : uint { SC_SCREENSAVE = 0xF140 }

// #endif  /* ifndef SC_SCREENSAVE */

// #ifdef __cplusplus
// }
// #endif  /* __cplusplus */

// #ifdef _WIN32
align:
// #else
// #ifndef RC_INVOKED
// #...
// #endif
// #endif

// #endif  /* _INC_MMSYSTEM */

