PageRenderTime 98ms CodeModel.GetById 31ms RepoModel.GetById 1ms app.codeStats 1ms

/binding/win32/mmsystem.d

http://github.com/wilkie/djehuty
D | 3905 lines | 2894 code | 594 blank | 417 comment | 69 complexity | c70baf485c6bd2c12e08c20d5c506953 MD5 | raw file
  1. /*
  2. * mmsystem.d
  3. *
  4. * This module binds MMSystem.h to D. The original copyright notice is
  5. * preserved below.
  6. *
  7. * Author: Dave Wilkinson
  8. * Originated: November 25th, 2009
  9. *
  10. */
  11. module binding.win32.mmsystem;
  12. import binding.win32.windef;
  13. import binding.win32.winnt;
  14. import binding.win32.winuser;
  15. extern(System):
  16. /*==========================================================================
  17. *
  18. * mmsystem.h -- Include file for Multimedia API's
  19. *
  20. * Version 4.00
  21. *
  22. * Copyright (C) 1992-1998 Microsoft Corporation. All Rights Reserved.
  23. *
  24. *--------------------------------------------------------------------------
  25. *
  26. * Define: Prevent inclusion of:
  27. * -------------- --------------------------------------------------------
  28. * MMNODRV Installable driver support
  29. * MMNOSOUND Sound support
  30. * MMNOWAVE Waveform support
  31. * MMNOMIDI MIDI support
  32. * MMNOAUX Auxiliary audio support
  33. * MMNOMIXER Mixer support
  34. * MMNOTIMER Timer support
  35. * MMNOJOY Joystick support
  36. * MMNOMCI MCI support
  37. * MMNOMMIO Multimedia file I/O support
  38. * MMNOMMSYSTEM General MMSYSTEM functions
  39. *
  40. *==========================================================================
  41. */
  42. /****************************************************************************
  43. General constants and data types
  44. ****************************************************************************/
  45. /* general constants */
  46. const auto MAXPNAMELEN = 32 ; /* max product name length (including NULL) */
  47. const auto MAXERRORLENGTH = 256 ; /* max error text length (including NULL) */
  48. const auto MAX_JOYSTICKOEMVXDNAME = 260 ; /* max oem vxd name length (including NULL) */
  49. /*
  50. * Microsoft Manufacturer and Product ID's (these have been moved to
  51. * MMREG.H for Windows 4.00 and above).
  52. */
  53. const auto MM_MIDI_MAPPER = 1 ; /* MIDI Mapper */
  54. const auto MM_WAVE_MAPPER = 2 ; /* Wave Mapper */
  55. const auto MM_SNDBLST_MIDIOUT = 3 ; /* Sound Blaster MIDI output port */
  56. const auto MM_SNDBLST_MIDIIN = 4 ; /* Sound Blaster MIDI input port */
  57. const auto MM_SNDBLST_SYNTH = 5 ; /* Sound Blaster internal synthesizer */
  58. const auto MM_SNDBLST_WAVEOUT = 6 ; /* Sound Blaster waveform output */
  59. const auto MM_SNDBLST_WAVEIN = 7 ; /* Sound Blaster waveform input */
  60. const auto MM_ADLIB = 9 ; /* Ad Lib-compatible synthesizer */
  61. const auto MM_MPU401_MIDIOUT = 10 ; /* MPU401-compatible MIDI output port */
  62. const auto MM_MPU401_MIDIIN = 11 ; /* MPU401-compatible MIDI input port */
  63. const auto MM_PC_JOYSTICK = 12 ; /* Joystick adapter */
  64. /* general data types */
  65. alias UINT MMVERSION; /* major (high byte), minor (low byte) */
  66. alias UINT VERSION; /* major (high byte), minor (low byte) */
  67. alias UINT MMRESULT; /* error return code, 0 means no error */
  68. /* call as if(err=xxxx(...)) Error(err); else */
  69. alias UINT *LPUINT;
  70. /* MMTIME data align(2) structure */
  71. align(2) struct MMTIME {
  72. UINT wType; /* indicates the contents of the align(2) union */
  73. align(2) union _inner_union {
  74. DWORD ms; /* milliseconds */
  75. DWORD sample; /* samples */
  76. DWORD cb; /* byte count */
  77. DWORD ticks; /* ticks in MIDI stream */
  78. /* SMPTE */
  79. align(2) struct _inner_struct {
  80. BYTE hour; /* hours */
  81. BYTE min; /* minutes */
  82. BYTE sec; /* seconds */
  83. BYTE frame; /* frames */
  84. BYTE fps; /* frames per second */
  85. BYTE dummy; /* pad */
  86. BYTE pad[2];
  87. }
  88. _inner_struct smpte;
  89. /* MIDI */
  90. align(2) struct _inner_struct2 {
  91. DWORD songptrpos; /* song pointer position */
  92. }
  93. _inner_struct2 midi;
  94. }
  95. _inner_union u;
  96. }
  97. alias MMTIME* PMMTIME;
  98. alias MMTIME *NPMMTIME;
  99. alias MMTIME* LPMMTIME;
  100. /* types for wType field in MMTIME align(2) struct */
  101. const auto TIME_MS = 0x0001 ; /* time in milliseconds */
  102. const auto TIME_SAMPLES = 0x0002 ; /* number of wave samples */
  103. const auto TIME_BYTES = 0x0004 ; /* current byte offset */
  104. const auto TIME_SMPTE = 0x0008 ; /* SMPTE time */
  105. const auto TIME_MIDI = 0x0010 ; /* MIDI time */
  106. const auto TIME_TICKS = 0x0020 ; /* Ticks within MIDI stream */
  107. /*
  108. *
  109. *
  110. */
  111. template MAKEFOURCC(char ch0, char ch1, char ch2, char ch3) {
  112. const auto MAKEFOURCC =
  113. (cast(DWORD)cast(BYTE)(ch0) | (cast(DWORD)cast(BYTE)(ch1) << 8) |
  114. (cast(DWORD)cast(BYTE)(ch2) << 16) | (cast(DWORD)cast(BYTE)(ch3) << 24 ));
  115. }
  116. /****************************************************************************
  117. Multimedia Extensions Window Messages
  118. ****************************************************************************/
  119. const auto MM_JOY1MOVE = 0x3A0 ; /* joystick */
  120. const auto MM_JOY2MOVE = 0x3A1;
  121. const auto MM_JOY1ZMOVE = 0x3A2;
  122. const auto MM_JOY2ZMOVE = 0x3A3;
  123. const auto MM_JOY1BUTTONDOWN = 0x3B5;
  124. const auto MM_JOY2BUTTONDOWN = 0x3B6;
  125. const auto MM_JOY1BUTTONUP = 0x3B7;
  126. const auto MM_JOY2BUTTONUP = 0x3B8;
  127. const auto MM_MCINOTIFY = 0x3B9 ; /* MCI */
  128. const auto MM_WOM_OPEN = 0x3BB ; /* waveform output */
  129. const auto MM_WOM_CLOSE = 0x3BC;
  130. const auto MM_WOM_DONE = 0x3BD;
  131. const auto MM_WIM_OPEN = 0x3BE ; /* waveform input */
  132. const auto MM_WIM_CLOSE = 0x3BF;
  133. const auto MM_WIM_DATA = 0x3C0;
  134. const auto MM_MIM_OPEN = 0x3C1 ; /* MIDI input */
  135. const auto MM_MIM_CLOSE = 0x3C2;
  136. const auto MM_MIM_DATA = 0x3C3;
  137. const auto MM_MIM_LONGDATA = 0x3C4;
  138. const auto MM_MIM_ERROR = 0x3C5;
  139. const auto MM_MIM_LONGERROR = 0x3C6;
  140. const auto MM_MOM_OPEN = 0x3C7 ; /* MIDI output */
  141. const auto MM_MOM_CLOSE = 0x3C8;
  142. const auto MM_MOM_DONE = 0x3C9;
  143. /* these are also in msvideo.h */
  144. const auto MM_DRVM_OPEN = 0x3D0; /* installable drivers */
  145. const auto MM_DRVM_CLOSE = 0x3D1;
  146. const auto MM_DRVM_DATA = 0x3D2;
  147. const auto MM_DRVM_ERROR = 0x3D3;
  148. /* these are used by msacm.h */
  149. const auto MM_STREAM_OPEN = 0x3D4;
  150. const auto MM_STREAM_CLOSE = 0x3D5;
  151. const auto MM_STREAM_DONE = 0x3D6;
  152. const auto MM_STREAM_ERROR = 0x3D7;
  153. const auto MM_MOM_POSITIONCB = 0x3CA ; /* Callback for MEVT_POSITIONCB */
  154. const auto MM_MCISIGNAL = 0x3CB;
  155. const auto MM_MIM_MOREDATA = 0x3CC ; /* MIM_DONE w/ pending events */
  156. const auto MM_MIXM_LINE_CHANGE = 0x3D0 ; /* mixer line change notify */
  157. const auto MM_MIXM_CONTROL_CHANGE = 0x3D1 ; /* mixer control change notify */
  158. /****************************************************************************
  159. String resource number bases (internal use)
  160. ****************************************************************************/
  161. const auto MMSYSERR_BASE = 0;
  162. const auto WAVERR_BASE = 32;
  163. const auto MIDIERR_BASE = 64;
  164. const auto TIMERR_BASE = 96;
  165. const auto JOYERR_BASE = 160;
  166. const auto MCIERR_BASE = 256;
  167. const auto MIXERR_BASE = 1024;
  168. const auto MCI_STRING_OFFSET = 512;
  169. const auto MCI_VD_OFFSET = 1024;
  170. const auto MCI_CD_OFFSET = 1088;
  171. const auto MCI_WAVE_OFFSET = 1152;
  172. const auto MCI_SEQ_OFFSET = 1216;
  173. /****************************************************************************
  174. General error return values
  175. ****************************************************************************/
  176. /* general error return values */
  177. const auto MMSYSERR_NOERROR = 0 ; /* no error */
  178. const auto MMSYSERR_ERROR = (MMSYSERR_BASE + 1) ; /* unspecified error */
  179. const auto MMSYSERR_BADDEVICEID = (MMSYSERR_BASE + 2) ; /* device ID out of range */
  180. const auto MMSYSERR_NOTENABLED = (MMSYSERR_BASE + 3) ; /* driver failed enable */
  181. const auto MMSYSERR_ALLOCATED = (MMSYSERR_BASE + 4) ; /* device already allocated */
  182. const auto MMSYSERR_INVALHANDLE = (MMSYSERR_BASE + 5) ; /* device handle is invalid */
  183. const auto MMSYSERR_NODRIVER = (MMSYSERR_BASE + 6) ; /* no device driver present */
  184. const auto MMSYSERR_NOMEM = (MMSYSERR_BASE + 7) ; /* memory allocation error */
  185. const auto MMSYSERR_NOTSUPPORTED = (MMSYSERR_BASE + 8) ; /* function isn't supported */
  186. const auto MMSYSERR_BADERRNUM = (MMSYSERR_BASE + 9) ; /* error value out of range */
  187. const auto MMSYSERR_INVALFLAG = (MMSYSERR_BASE + 10) ; /* invalid flag passed */
  188. const auto MMSYSERR_INVALPARAM = (MMSYSERR_BASE + 11) ; /* invalid parameter passed */
  189. const auto MMSYSERR_HANDLEBUSY = (MMSYSERR_BASE + 12) ; /* handle being used */
  190. /* simultaneously on another */
  191. /* thread (eg callback) */
  192. const auto MMSYSERR_INVALIDALIAS = (MMSYSERR_BASE + 13) ; /* specified alias not found */
  193. const auto MMSYSERR_BADDB = (MMSYSERR_BASE + 14) ; /* bad registry database */
  194. const auto MMSYSERR_KEYNOTFOUND = (MMSYSERR_BASE + 15) ; /* registry key not found */
  195. const auto MMSYSERR_READERROR = (MMSYSERR_BASE + 16) ; /* registry read error */
  196. const auto MMSYSERR_WRITEERROR = (MMSYSERR_BASE + 17) ; /* registry write error */
  197. const auto MMSYSERR_DELETEERROR = (MMSYSERR_BASE + 18) ; /* registry delete error */
  198. const auto MMSYSERR_VALNOTFOUND = (MMSYSERR_BASE + 19) ; /* registry value not found */
  199. const auto MMSYSERR_NODRIVERCB = (MMSYSERR_BASE + 20) ; /* driver does not call DriverCallback */
  200. const auto MMSYSERR_MOREDATA = (MMSYSERR_BASE + 21) ; /* more data to be returned */
  201. const auto MMSYSERR_LASTERROR = (MMSYSERR_BASE + 21) ; /* last error in range */
  202. alias HANDLE HDRVR;
  203. /****************************************************************************
  204. Installable driver support
  205. ****************************************************************************/
  206. version(MMNODRV) {
  207. }
  208. else {
  209. align(2) struct DRVCONFIGINFOEX {
  210. DWORD dwDCISize;
  211. LPCWSTR lpszDCISectionName;
  212. LPCWSTR lpszDCIAliasName;
  213. DWORD dnDevNode;
  214. }
  215. alias DRVCONFIGINFOEX* PDRVCONFIGINFOEX;
  216. alias DRVCONFIGINFOEX *NPDRVCONFIGINFOEX;
  217. alias DRVCONFIGINFOEX* LPDRVCONFIGINFOEX;
  218. /* Driver messages */
  219. const auto DRV_LOAD = 0x0001;
  220. const auto DRV_ENABLE = 0x0002;
  221. const auto DRV_OPEN = 0x0003;
  222. const auto DRV_CLOSE = 0x0004;
  223. const auto DRV_DISABLE = 0x0005;
  224. const auto DRV_FREE = 0x0006;
  225. const auto DRV_CONFIGURE = 0x0007;
  226. const auto DRV_QUERYCONFIGURE = 0x0008;
  227. const auto DRV_INSTALL = 0x0009;
  228. const auto DRV_REMOVE = 0x000A;
  229. const auto DRV_EXITSESSION = 0x000B;
  230. const auto DRV_POWER = 0x000F;
  231. const auto DRV_RESERVED = 0x0800;
  232. const auto DRV_USER = 0x4000;
  233. /* LPARAM of DRV_CONFIGURE message */
  234. align(2) struct DRVCONFIGINFO {
  235. DWORD dwDCISize;
  236. LPCWSTR lpszDCISectionName;
  237. LPCWSTR lpszDCIAliasName;
  238. }
  239. alias DRVCONFIGINFO* PDRVCONFIGINFO;
  240. alias DRVCONFIGINFO *NPDRVCONFIGINFO;
  241. alias DRVCONFIGINFO* LPDRVCONFIGINFO;
  242. /* Supported return values for DRV_CONFIGURE message */
  243. const auto DRVCNF_CANCEL = 0x0000;
  244. const auto DRVCNF_OK = 0x0001;
  245. const auto DRVCNF_RESTART = 0x0002;
  246. /* installable driver function prototypes */
  247. alias LRESULT function(DWORD_PTR, HDRVR, UINT, LPARAM, LPARAM) DRIVERPROC;
  248. LRESULT CloseDriver( HDRVR hDriver, LPARAM lParam1, LPARAM lParam2);
  249. HDRVR OpenDriver( LPCWSTR szDriverName, LPCWSTR szSectionName, LPARAM lParam2);
  250. LRESULT SendDriverMessage( HDRVR hDriver, UINT message, LPARAM lParam1, LPARAM lParam2);
  251. HMODULE DrvGetModuleHandle( HDRVR hDriver);
  252. HMODULE GetDriverModuleHandle( HDRVR hDriver);
  253. LRESULT DefDriverProc( DWORD_PTR dwDriverIdentifier, HDRVR hdrvr, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
  254. /* return values from DriverProc() function */
  255. const auto DRV_CANCEL = DRVCNF_CANCEL;
  256. const auto DRV_OK = DRVCNF_OK;
  257. const auto DRV_RESTART = DRVCNF_RESTART;
  258. const auto DRV_MCI_FIRST = DRV_RESERVED;
  259. const auto DRV_MCI_LAST = (DRV_RESERVED + 0xFFF);
  260. }
  261. /****************************************************************************
  262. Driver callback support
  263. ****************************************************************************/
  264. /* flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and */
  265. /* midiOutOpen() to specify the type of the dwCallback parameter. */
  266. const auto CALLBACK_TYPEMASK = 0x00070000 ; /* callback type mask */
  267. const auto CALLBACK_NULL = 0x00000000 ; /* no callback */
  268. const auto CALLBACK_WINDOW = 0x00010000 ; /* dwCallback is a HWND */
  269. const auto CALLBACK_TASK = 0x00020000 ; /* dwCallback is a HTASK */
  270. const auto CALLBACK_FUNCTION = 0x00030000 ; /* dwCallback is a FARPROC */
  271. const auto CALLBACK_THREAD = (CALLBACK_TASK); /* thread ID replaces 16 bit task */
  272. const auto CALLBACK_EVENT = 0x00050000 ; /* dwCallback is an EVENT Handle */
  273. alias void function(HDRVR hdrvr, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) DRVCALLBACK;
  274. alias DRVCALLBACK *LPDRVCALLBACK;
  275. alias DRVCALLBACK *PDRVCALLBACK;
  276. /****************************************************************************
  277. General MMSYSTEM support
  278. ****************************************************************************/
  279. version(MMNOMMSYSTEM) {
  280. }
  281. else {
  282. UINT mmsystemGetVersion();
  283. }
  284. /****************************************************************************
  285. Sound support
  286. ****************************************************************************/
  287. version(MMNOSOUND) {
  288. }
  289. else {
  290. BOOL sndPlaySoundA( LPCSTR pszSound, UINT fuSound);
  291. BOOL sndPlaySoundW( LPCWSTR pszSound, UINT fuSound);
  292. version(UNICODE) {
  293. alias sndPlaySoundW sndPlaySound;
  294. }
  295. else {
  296. alias sndPlaySoundA sndPlaySound;
  297. }
  298. /*
  299. * flag values for fuSound and fdwSound arguments on [snd]PlaySound
  300. */
  301. const auto SND_SYNC = 0x0000 ; /* play synchronously (default) */
  302. const auto SND_ASYNC = 0x0001 ; /* play asynchronously */
  303. const auto SND_NODEFAULT = 0x0002 ; /* silence (!default) if sound not found */
  304. const auto SND_MEMORY = 0x0004 ; /* pszSound points to a memory file */
  305. const auto SND_LOOP = 0x0008 ; /* loop the sound until next sndPlaySound */
  306. const auto SND_NOSTOP = 0x0010 ; /* don't stop any currently playing sound */
  307. const auto SND_NOWAIT = 0x00002000L ; /* don't wait if the driver is busy */
  308. const auto SND_ALIAS = 0x00010000L ; /* name is a registry alias */
  309. const auto SND_ALIAS_ID = 0x00110000L ; /* alias is a predefined ID */
  310. const auto SND_FILENAME = 0x00020000L ; /* name is file name */
  311. const auto SND_RESOURCE = 0x00040004L ; /* name is resource name or atom */
  312. const auto SND_PURGE = 0x0040 ; /* purge non-static events for task */
  313. const auto SND_APPLICATION = 0x0080 ; /* look for application specific association */
  314. const auto SND_SENTRY = 0x00080000L ; /* Generate a SoundSentry event with this sound */
  315. const auto SND_SYSTEM = 0x00200000L ; /* Treat this as a system sound */
  316. const auto SND_ALIAS_START = 0 ; /* alias base */
  317. template sndAlias(char ch0, char ch1) {
  318. const DWORD sndAlias = (SND_ALIAS_START + cast(DWORD)cast(BYTE)(ch0) | (cast(DWORD)cast(BYTE)(ch1) << 8));
  319. }
  320. const auto SND_ALIAS_SYSTEMASTERISK = sndAlias!('S', '*');
  321. const auto SND_ALIAS_SYSTEMQUESTION = sndAlias!('S', '?');
  322. const auto SND_ALIAS_SYSTEMHAND = sndAlias!('S', 'H');
  323. const auto SND_ALIAS_SYSTEMEXIT = sndAlias!('S', 'E');
  324. const auto SND_ALIAS_SYSTEMSTART = sndAlias!('S', 'S');
  325. const auto SND_ALIAS_SYSTEMWELCOME = sndAlias!('S', 'W');
  326. const auto SND_ALIAS_SYSTEMEXCLAMATION = sndAlias!('S', '!');
  327. const auto SND_ALIAS_SYSTEMDEFAULT = sndAlias!('S', 'D');
  328. BOOL PlaySoundA( LPCSTR pszSound, HMODULE hmod, DWORD fdwSound);
  329. BOOL PlaySoundW( LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound);
  330. version(UNICODE) {
  331. alias PlaySoundW PlaySound;
  332. }
  333. else {
  334. alias PlaySoundA PlaySound;
  335. }
  336. }
  337. /****************************************************************************
  338. Waveform audio support
  339. ****************************************************************************/
  340. version(MMNOWAVE) {
  341. }
  342. else {
  343. /* waveform audio error return values */
  344. const auto WAVERR_BADFORMAT = (WAVERR_BASE + 0) ; /* unsupported wave format */
  345. const auto WAVERR_STILLPLAYING = (WAVERR_BASE + 1) ; /* still something playing */
  346. const auto WAVERR_UNPREPARED = (WAVERR_BASE + 2) ; /* header not prepared */
  347. const auto WAVERR_SYNC = (WAVERR_BASE + 3) ; /* device is synchronous */
  348. const auto WAVERR_LASTERROR = (WAVERR_BASE + 3) ; /* last error in range */
  349. /* waveform audio data types */
  350. alias HANDLE HWAVE;
  351. alias HANDLE HWAVEIN;
  352. alias HANDLE HWAVEOUT;
  353. alias HWAVEIN *LPHWAVEIN;
  354. alias HWAVEOUT *LPHWAVEOUT;
  355. alias DRVCALLBACK WAVECALLBACK;
  356. alias WAVECALLBACK *LPWAVECALLBACK;
  357. /* wave callback messages */
  358. const auto WOM_OPEN = MM_WOM_OPEN;
  359. const auto WOM_CLOSE = MM_WOM_CLOSE;
  360. const auto WOM_DONE = MM_WOM_DONE;
  361. const auto WIM_OPEN = MM_WIM_OPEN;
  362. const auto WIM_CLOSE = MM_WIM_CLOSE;
  363. const auto WIM_DATA = MM_WIM_DATA;
  364. /* device ID for wave device mapper */
  365. const auto WAVE_MAPPER = (cast(UINT)-1);
  366. /* flags for dwFlags parameter in waveOutOpen() and waveInOpen() */
  367. const auto WAVE_FORMAT_QUERY = 0x0001;
  368. const auto WAVE_ALLOWSYNC = 0x0002;
  369. const auto WAVE_MAPPED = 0x0004;
  370. const auto WAVE_FORMAT_DIRECT = 0x0008;
  371. const auto WAVE_FORMAT_DIRECT_QUERY = (WAVE_FORMAT_QUERY | WAVE_FORMAT_DIRECT);
  372. /* wave data block header */
  373. align(2) struct WAVEHDR {
  374. ubyte* lpData; /* pointer to locked data buffer */
  375. DWORD dwBufferLength; /* length of data buffer */
  376. DWORD dwBytesRecorded; /* used for input only */
  377. DWORD_PTR dwUser; /* for client's use */
  378. DWORD dwFlags; /* assorted flags (see defines) */
  379. DWORD dwLoops; /* loop control counter */
  380. WAVEHDR* lpNext; /* reserved for driver */
  381. DWORD_PTR reserved; /* reserved for driver */
  382. }
  383. alias WAVEHDR* PWAVEHDR;
  384. alias WAVEHDR* NPWAVEHDR;
  385. alias WAVEHDR* LPWAVEHDR;
  386. /* flags for dwFlags field of WAVEHDR */
  387. const auto WHDR_DONE = 0x00000001 ; /* done bit */
  388. const auto WHDR_PREPARED = 0x00000002 ; /* set if this header has been prepared */
  389. const auto WHDR_BEGINLOOP = 0x00000004 ; /* loop start block */
  390. const auto WHDR_ENDLOOP = 0x00000008 ; /* loop end block */
  391. const auto WHDR_INQUEUE = 0x00000010 ; /* reserved for driver */
  392. /* waveform output device capabilities align(2) structure */
  393. align(2) struct WAVEOUTCAPSA {
  394. WORD wMid; /* manufacturer ID */
  395. WORD wPid; /* product ID */
  396. MMVERSION vDriverVersion; /* version of the driver */
  397. CHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  398. DWORD dwFormats; /* formats supported */
  399. WORD wChannels; /* number of sources supported */
  400. WORD wReserved1; /* packing */
  401. DWORD dwSupport; /* functionality supported by driver */
  402. }
  403. alias WAVEOUTCAPSA* PWAVEOUTCAPSA;
  404. alias WAVEOUTCAPSA* NPWAVEOUTCAPSA;
  405. alias WAVEOUTCAPSA* LPWAVEOUTCAPSA;
  406. align(2) struct WAVEOUTCAPSW {
  407. WORD wMid; /* manufacturer ID */
  408. WORD wPid; /* product ID */
  409. MMVERSION vDriverVersion; /* version of the driver */
  410. WCHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  411. DWORD dwFormats; /* formats supported */
  412. WORD wChannels; /* number of sources supported */
  413. WORD wReserved1; /* packing */
  414. DWORD dwSupport; /* functionality supported by driver */
  415. }
  416. alias WAVEOUTCAPSW* PWAVEOUTCAPSW;
  417. alias WAVEOUTCAPSW* NPWAVEOUTCAPSW;
  418. alias WAVEOUTCAPSW* LPWAVEOUTCAPSW;
  419. version(UNICODE) {
  420. alias WAVEOUTCAPSW WAVEOUTCAPS;
  421. alias PWAVEOUTCAPSW PWAVEOUTCAPS;
  422. alias NPWAVEOUTCAPSW NPWAVEOUTCAPS;
  423. alias LPWAVEOUTCAPSW LPWAVEOUTCAPS;
  424. }
  425. else {
  426. alias WAVEOUTCAPSA WAVEOUTCAPS;
  427. alias PWAVEOUTCAPSA PWAVEOUTCAPS;
  428. alias NPWAVEOUTCAPSA NPWAVEOUTCAPS;
  429. alias LPWAVEOUTCAPSA LPWAVEOUTCAPS;
  430. }
  431. align(2) struct WAVEOUTCAPS2A {
  432. WORD wMid; /* manufacturer ID */
  433. WORD wPid; /* product ID */
  434. MMVERSION vDriverVersion; /* version of the driver */
  435. CHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  436. DWORD dwFormats; /* formats supported */
  437. WORD wChannels; /* number of sources supported */
  438. WORD wReserved1; /* packing */
  439. DWORD dwSupport; /* functionality supported by driver */
  440. GUID ManufacturerGuid; /* for extensible MID mapping */
  441. GUID ProductGuid; /* for extensible PID mapping */
  442. GUID NameGuid; /* for name lookup in registry */
  443. }
  444. alias WAVEOUTCAPS2A* PWAVEOUTCAPS2A;
  445. alias WAVEOUTCAPS2A* NPWAVEOUTCAPS2A;
  446. alias WAVEOUTCAPS2A* LPWAVEOUTCAPS2A;
  447. align(2) struct WAVEOUTCAPS2W {
  448. WORD wMid; /* manufacturer ID */
  449. WORD wPid; /* product ID */
  450. MMVERSION vDriverVersion; /* version of the driver */
  451. WCHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  452. DWORD dwFormats; /* formats supported */
  453. WORD wChannels; /* number of sources supported */
  454. WORD wReserved1; /* packing */
  455. DWORD dwSupport; /* functionality supported by driver */
  456. GUID ManufacturerGuid; /* for extensible MID mapping */
  457. GUID ProductGuid; /* for extensible PID mapping */
  458. GUID NameGuid; /* for name lookup in registry */
  459. }
  460. alias WAVEOUTCAPS2W* PWAVEOUTCAPS2W;
  461. alias WAVEOUTCAPS2W* NPWAVEOUTCAPS2W;
  462. alias WAVEOUTCAPS2W* LPWAVEOUTCAPS2W;
  463. version(UNICODE) {
  464. alias WAVEOUTCAPS2W WAVEOUTCAPS2;
  465. alias PWAVEOUTCAPS2W PWAVEOUTCAPS2;
  466. alias NPWAVEOUTCAPS2W NPWAVEOUTCAPS2;
  467. alias LPWAVEOUTCAPS2W LPWAVEOUTCAPS2;
  468. }
  469. else {
  470. alias WAVEOUTCAPS2A WAVEOUTCAPS2;
  471. alias PWAVEOUTCAPS2A PWAVEOUTCAPS2;
  472. alias NPWAVEOUTCAPS2A NPWAVEOUTCAPS2;
  473. alias LPWAVEOUTCAPS2A LPWAVEOUTCAPS2;
  474. }
  475. /* flags for dwSupport field of WAVEOUTCAPS */
  476. const auto WAVECAPS_PITCH = 0x0001 ; /* supports pitch control */
  477. const auto WAVECAPS_PLAYBACKRATE = 0x0002 ; /* supports playback rate control */
  478. const auto WAVECAPS_VOLUME = 0x0004 ; /* supports volume control */
  479. const auto WAVECAPS_LRVOLUME = 0x0008 ; /* separate left-right volume control */
  480. const auto WAVECAPS_SYNC = 0x0010;
  481. const auto WAVECAPS_SAMPLEACCURATE = 0x0020;
  482. /* waveform input device capabilities align(2) structure */
  483. align(2) struct WAVEINCAPSA {
  484. WORD wMid; /* manufacturer ID */
  485. WORD wPid; /* product ID */
  486. MMVERSION vDriverVersion; /* version of the driver */
  487. CHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  488. DWORD dwFormats; /* formats supported */
  489. WORD wChannels; /* number of channels supported */
  490. WORD wReserved1; /* align(2) structure packing */
  491. }
  492. alias WAVEINCAPSA* PWAVEINCAPSA;
  493. alias WAVEINCAPSA* NPWAVEINCAPSA;
  494. alias WAVEINCAPSA* LPWAVEINCAPSA;
  495. align(2) struct WAVEINCAPSW {
  496. WORD wMid; /* manufacturer ID */
  497. WORD wPid; /* product ID */
  498. MMVERSION vDriverVersion; /* version of the driver */
  499. WCHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  500. DWORD dwFormats; /* formats supported */
  501. WORD wChannels; /* number of channels supported */
  502. WORD wReserved1; /* align(2) structure packing */
  503. }
  504. alias WAVEINCAPSW* PWAVEINCAPSW;
  505. alias WAVEINCAPSW* NPWAVEINCAPSW;
  506. alias WAVEINCAPSW* LPWAVEINCAPSW;
  507. version(UNICODE) {
  508. alias WAVEINCAPSW WAVEINCAPS;
  509. alias PWAVEINCAPSW PWAVEINCAPS;
  510. alias NPWAVEINCAPSW NPWAVEINCAPS;
  511. alias LPWAVEINCAPSW LPWAVEINCAPS;
  512. }
  513. else {
  514. alias WAVEINCAPSA WAVEINCAPS;
  515. alias PWAVEINCAPSA PWAVEINCAPS;
  516. alias NPWAVEINCAPSA NPWAVEINCAPS;
  517. alias LPWAVEINCAPSA LPWAVEINCAPS;
  518. }
  519. align(2) struct WAVEINCAPS2A {
  520. WORD wMid; /* manufacturer ID */
  521. WORD wPid; /* product ID */
  522. MMVERSION vDriverVersion; /* version of the driver */
  523. CHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  524. DWORD dwFormats; /* formats supported */
  525. WORD wChannels; /* number of channels supported */
  526. WORD wReserved1; /* align(2) structure packing */
  527. GUID ManufacturerGuid; /* for extensible MID mapping */
  528. GUID ProductGuid; /* for extensible PID mapping */
  529. GUID NameGuid; /* for name lookup in registry */
  530. }
  531. alias WAVEINCAPS2A* PWAVEINCAPS2A;
  532. alias WAVEINCAPS2A* NPWAVEINCAPS2A;
  533. alias WAVEINCAPS2A* LPWAVEINCAPS2A;
  534. align(2) struct WAVEINCAPS2W {
  535. WORD wMid; /* manufacturer ID */
  536. WORD wPid; /* product ID */
  537. MMVERSION vDriverVersion; /* version of the driver */
  538. WCHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  539. DWORD dwFormats; /* formats supported */
  540. WORD wChannels; /* number of channels supported */
  541. WORD wReserved1; /* align(2) structure packing */
  542. GUID ManufacturerGuid; /* for extensible MID mapping */
  543. GUID ProductGuid; /* for extensible PID mapping */
  544. GUID NameGuid; /* for name lookup in registry */
  545. }
  546. alias WAVEINCAPS2W* PWAVEINCAPS2W;
  547. alias WAVEINCAPS2W* NPWAVEINCAPS2W;
  548. alias WAVEINCAPS2W* LPWAVEINCAPS2W;
  549. version(UNICODE) {
  550. alias WAVEINCAPS2W WAVEINCAPS2;
  551. alias PWAVEINCAPS2W PWAVEINCAPS2;
  552. alias NPWAVEINCAPS2W NPWAVEINCAPS2;
  553. alias LPWAVEINCAPS2W LPWAVEINCAPS2;
  554. }
  555. else {
  556. alias WAVEINCAPS2A WAVEINCAPS2;
  557. alias PWAVEINCAPS2A PWAVEINCAPS2;
  558. alias NPWAVEINCAPS2A NPWAVEINCAPS2;
  559. alias LPWAVEINCAPS2A LPWAVEINCAPS2;
  560. }
  561. /* defines for dwFormat field of WAVEINCAPS and WAVEOUTCAPS */
  562. const auto WAVE_INVALIDFORMAT = 0x00000000 ; /* invalid format */
  563. const auto WAVE_FORMAT_1M08 = 0x00000001 ; /* 11.025 kHz, Mono, 8-bit */
  564. const auto WAVE_FORMAT_1S08 = 0x00000002 ; /* 11.025 kHz, Stereo, 8-bit */
  565. const auto WAVE_FORMAT_1M16 = 0x00000004 ; /* 11.025 kHz, Mono, 16-bit */
  566. const auto WAVE_FORMAT_1S16 = 0x00000008 ; /* 11.025 kHz, Stereo, 16-bit */
  567. const auto WAVE_FORMAT_2M08 = 0x00000010 ; /* 22.05 kHz, Mono, 8-bit */
  568. const auto WAVE_FORMAT_2S08 = 0x00000020 ; /* 22.05 kHz, Stereo, 8-bit */
  569. const auto WAVE_FORMAT_2M16 = 0x00000040 ; /* 22.05 kHz, Mono, 16-bit */
  570. const auto WAVE_FORMAT_2S16 = 0x00000080 ; /* 22.05 kHz, Stereo, 16-bit */
  571. const auto WAVE_FORMAT_4M08 = 0x00000100 ; /* 44.1 kHz, Mono, 8-bit */
  572. const auto WAVE_FORMAT_4S08 = 0x00000200 ; /* 44.1 kHz, Stereo, 8-bit */
  573. const auto WAVE_FORMAT_4M16 = 0x00000400 ; /* 44.1 kHz, Mono, 16-bit */
  574. const auto WAVE_FORMAT_4S16 = 0x00000800 ; /* 44.1 kHz, Stereo, 16-bit */
  575. const auto WAVE_FORMAT_44M08 = 0x00000100 ; /* 44.1 kHz, Mono, 8-bit */
  576. const auto WAVE_FORMAT_44S08 = 0x00000200 ; /* 44.1 kHz, Stereo, 8-bit */
  577. const auto WAVE_FORMAT_44M16 = 0x00000400 ; /* 44.1 kHz, Mono, 16-bit */
  578. const auto WAVE_FORMAT_44S16 = 0x00000800 ; /* 44.1 kHz, Stereo, 16-bit */
  579. const auto WAVE_FORMAT_48M08 = 0x00001000 ; /* 48 kHz, Mono, 8-bit */
  580. const auto WAVE_FORMAT_48S08 = 0x00002000 ; /* 48 kHz, Stereo, 8-bit */
  581. const auto WAVE_FORMAT_48M16 = 0x00004000 ; /* 48 kHz, Mono, 16-bit */
  582. const auto WAVE_FORMAT_48S16 = 0x00008000 ; /* 48 kHz, Stereo, 16-bit */
  583. const auto WAVE_FORMAT_96M08 = 0x00010000 ; /* 96 kHz, Mono, 8-bit */
  584. const auto WAVE_FORMAT_96S08 = 0x00020000 ; /* 96 kHz, Stereo, 8-bit */
  585. const auto WAVE_FORMAT_96M16 = 0x00040000 ; /* 96 kHz, Mono, 16-bit */
  586. const auto WAVE_FORMAT_96S16 = 0x00080000 ; /* 96 kHz, Stereo, 16-bit */
  587. /* OLD general waveform format align(2) structure (information common to all formats) */
  588. align(2) struct WAVEFORMAT {
  589. WORD wFormatTag; /* format type */
  590. WORD nChannels; /* number of channels (i.e. mono, stereo, etc.) */
  591. DWORD nSamplesPerSec; /* sample rate */
  592. DWORD nAvgBytesPerSec; /* for buffer estimation */
  593. WORD nBlockAlign; /* block size of data */
  594. }
  595. alias WAVEFORMAT* PWAVEFORMAT;
  596. alias WAVEFORMAT *NPWAVEFORMAT;
  597. alias WAVEFORMAT* LPWAVEFORMAT;
  598. /* flags for wFormatTag field of WAVEFORMAT */
  599. const auto WAVE_FORMAT_PCM = 1;
  600. /* specific waveform format align(2) structure for PCM data */
  601. align(2) struct PCMWAVEFORMAT {
  602. WAVEFORMAT wf;
  603. WORD wBitsPerSample;
  604. }
  605. alias PCMWAVEFORMAT* PPCMWAVEFORMAT;
  606. alias PCMWAVEFORMAT *NPPCMWAVEFORMAT;
  607. alias PCMWAVEFORMAT* LPPCMWAVEFORMAT;
  608. /*
  609. * extended waveform format align(2) structure used for all non-PCM formats. this
  610. * align(2) structure is common to all non-PCM formats.
  611. */
  612. align(2) struct WAVEFORMATEX {
  613. WORD wFormatTag; /* format type */
  614. WORD nChannels; /* number of channels (i.e. mono, stereo...) */
  615. DWORD nSamplesPerSec; /* sample rate */
  616. DWORD nAvgBytesPerSec; /* for buffer estimation */
  617. WORD nBlockAlign; /* block size of data */
  618. WORD wBitsPerSample; /* number of bits per sample of mono data */
  619. WORD cbSize; /* the count in bytes of the size of */
  620. /* extra information (after cbSize) */
  621. }
  622. alias WAVEFORMATEX* PWAVEFORMATEX;
  623. alias WAVEFORMATEX *NPWAVEFORMATEX;
  624. alias WAVEFORMATEX* LPWAVEFORMATEX;
  625. alias WAVEFORMATEX *LPCWAVEFORMATEX;
  626. /* waveform audio function prototypes */
  627. UINT waveOutGetNumDevs();
  628. MMRESULT waveOutGetDevCapsA( UINT_PTR uDeviceID, LPWAVEOUTCAPSA pwoc, UINT cbwoc);
  629. MMRESULT waveOutGetDevCapsW( UINT_PTR uDeviceID, LPWAVEOUTCAPSW pwoc, UINT cbwoc);
  630. version(UNICODE) {
  631. alias waveOutGetDevCapsW waveOutGetDevCaps;
  632. }
  633. else {
  634. alias waveOutGetDevCapsA waveOutGetDevCaps;
  635. }
  636. MMRESULT waveOutGetVolume( HWAVEOUT hwo, LPDWORD pdwVolume);
  637. MMRESULT waveOutSetVolume( HWAVEOUT hwo, DWORD dwVolume);
  638. MMRESULT waveOutGetErrorTextA( MMRESULT mmrError, LPSTR pszText, UINT cchText);
  639. MMRESULT waveOutGetErrorTextW( MMRESULT mmrError, LPWSTR pszText, UINT cchText);
  640. version(UNICODE) {
  641. alias waveOutGetErrorTextW waveOutGetErrorText;
  642. }
  643. else {
  644. alias waveOutGetErrorTextA waveOutGetErrorText;
  645. }
  646. MMRESULT waveOutOpen( LPHWAVEOUT phwo, UINT uDeviceID,
  647. LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
  648. MMRESULT waveOutClose( HWAVEOUT hwo);
  649. MMRESULT waveOutPrepareHeader( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh);
  650. MMRESULT waveOutUnprepareHeader( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh);
  651. MMRESULT waveOutWrite( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh);
  652. MMRESULT waveOutPause( HWAVEOUT hwo);
  653. MMRESULT waveOutRestart( HWAVEOUT hwo);
  654. MMRESULT waveOutReset( HWAVEOUT hwo);
  655. MMRESULT waveOutBreakLoop( HWAVEOUT hwo);
  656. MMRESULT waveOutGetPosition( HWAVEOUT hwo, LPMMTIME pmmt, UINT cbmmt);
  657. MMRESULT waveOutGetPitch( HWAVEOUT hwo, LPDWORD pdwPitch);
  658. MMRESULT waveOutSetPitch( HWAVEOUT hwo, DWORD dwPitch);
  659. MMRESULT waveOutGetPlaybackRate( HWAVEOUT hwo, LPDWORD pdwRate);
  660. MMRESULT waveOutSetPlaybackRate( HWAVEOUT hwo, DWORD dwRate);
  661. MMRESULT waveOutGetID( HWAVEOUT hwo, LPUINT puDeviceID);
  662. MMRESULT waveOutMessage( HWAVEOUT hwo, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
  663. UINT waveInGetNumDevs();
  664. MMRESULT waveInGetDevCapsA( UINT_PTR uDeviceID, LPWAVEINCAPSA pwic, UINT cbwic);
  665. MMRESULT waveInGetDevCapsW( UINT_PTR uDeviceID, LPWAVEINCAPSW pwic, UINT cbwic);
  666. version(UNICODE) {
  667. alias waveInGetDevCapsW waveInGetDevCaps;
  668. }
  669. else {
  670. alias waveInGetDevCapsA waveInGetDevCaps;
  671. }
  672. MMRESULT waveInGetErrorTextA(MMRESULT mmrError, LPSTR pszText, UINT cchText);
  673. MMRESULT waveInGetErrorTextW(MMRESULT mmrError, LPWSTR pszText, UINT cchText);
  674. version(UNICODE) {
  675. alias waveInGetErrorTextW waveInGetErrorText;
  676. }
  677. else {
  678. alias waveInGetErrorTextA waveInGetErrorText;
  679. }
  680. MMRESULT waveInOpen( LPHWAVEIN phwi, UINT uDeviceID,
  681. LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
  682. MMRESULT waveInClose( HWAVEIN hwi);
  683. MMRESULT waveInPrepareHeader( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
  684. MMRESULT waveInUnprepareHeader( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
  685. MMRESULT waveInAddBuffer( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
  686. MMRESULT waveInStart( HWAVEIN hwi);
  687. MMRESULT waveInStop( HWAVEIN hwi);
  688. MMRESULT waveInReset( HWAVEIN hwi);
  689. MMRESULT waveInGetPosition( HWAVEIN hwi, LPMMTIME pmmt, UINT cbmmt);
  690. MMRESULT waveInGetID( HWAVEIN hwi, LPUINT puDeviceID);
  691. MMRESULT waveInMessage( HWAVEIN hwi, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
  692. }
  693. /****************************************************************************
  694. MIDI audio support
  695. ****************************************************************************/
  696. version(MMNOMIDI) {
  697. }
  698. else {
  699. /* MIDI error return values */
  700. const auto MIDIERR_UNPREPARED = (MIDIERR_BASE + 0) ; /* header not prepared */
  701. const auto MIDIERR_STILLPLAYING = (MIDIERR_BASE + 1) ; /* still something playing */
  702. const auto MIDIERR_NOMAP = (MIDIERR_BASE + 2) ; /* no configured instruments */
  703. const auto MIDIERR_NOTREADY = (MIDIERR_BASE + 3) ; /* hardware is still busy */
  704. const auto MIDIERR_NODEVICE = (MIDIERR_BASE + 4) ; /* port no longer connected */
  705. const auto MIDIERR_INVALIDSETUP = (MIDIERR_BASE + 5) ; /* invalid MIF */
  706. const auto MIDIERR_BADOPENMODE = (MIDIERR_BASE + 6) ; /* operation unsupported w/ open mode */
  707. const auto MIDIERR_DONT_CONTINUE = (MIDIERR_BASE + 7) ; /* thru device 'eating' a message */
  708. const auto MIDIERR_LASTERROR = (MIDIERR_BASE + 7) ; /* last error in range */
  709. /* MIDI audio data types */
  710. alias HANDLE HMIDI;
  711. alias HANDLE HMIDIIN;
  712. alias HANDLE HMIDIOUT;
  713. alias HANDLE HMIDISTRM;
  714. alias HMIDI *LPHMIDI;
  715. alias HMIDIIN *LPHMIDIIN;
  716. alias HMIDIOUT *LPHMIDIOUT;
  717. alias HMIDISTRM *LPHMIDISTRM;
  718. alias DRVCALLBACK MIDICALLBACK;
  719. alias MIDICALLBACK *LPMIDICALLBACK;
  720. const auto MIDIPATCHSIZE = 128;
  721. alias WORD[MIDIPATCHSIZE] PATCHARRAY;
  722. alias WORD *LPPATCHARRAY;
  723. alias WORD[MIDIPATCHSIZE] KEYARRAY;
  724. alias WORD *LPKEYARRAY;
  725. /* MIDI callback messages */
  726. const auto MIM_OPEN = MM_MIM_OPEN;
  727. const auto MIM_CLOSE = MM_MIM_CLOSE;
  728. const auto MIM_DATA = MM_MIM_DATA;
  729. const auto MIM_LONGDATA = MM_MIM_LONGDATA;
  730. const auto MIM_ERROR = MM_MIM_ERROR;
  731. const auto MIM_LONGERROR = MM_MIM_LONGERROR;
  732. const auto MOM_OPEN = MM_MOM_OPEN;
  733. const auto MOM_CLOSE = MM_MOM_CLOSE;
  734. const auto MOM_DONE = MM_MOM_DONE;
  735. const auto MIM_MOREDATA = MM_MIM_MOREDATA;
  736. const auto MOM_POSITIONCB = MM_MOM_POSITIONCB;
  737. /* device ID for MIDI mapper */
  738. const auto MIDIMAPPER = (cast(UINT)-1);
  739. const auto MIDI_MAPPER = (cast(UINT)-1);
  740. /* flags for dwFlags parm of midiInOpen() */
  741. const auto MIDI_IO_STATUS = 0x00000020L;
  742. /* flags for wFlags parm of midiOutCachePatches(), midiOutCacheDrumPatches() */
  743. const auto MIDI_CACHE_ALL = 1;
  744. const auto MIDI_CACHE_BESTFIT = 2;
  745. const auto MIDI_CACHE_QUERY = 3;
  746. const auto MIDI_UNCACHE = 4;
  747. /* MIDI output device capabilities align(2) structure */
  748. align(2) struct MIDIOUTCAPSA {
  749. WORD wMid; /* manufacturer ID */
  750. WORD wPid; /* product ID */
  751. MMVERSION vDriverVersion; /* version of the driver */
  752. CHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  753. WORD wTechnology; /* type of device */
  754. WORD wVoices; /* # of voices (internal synth only) */
  755. WORD wNotes; /* max # of notes (internal synth only) */
  756. WORD wChannelMask; /* channels used (internal synth only) */
  757. DWORD dwSupport; /* functionality supported by driver */
  758. }
  759. alias MIDIOUTCAPSA* PMIDIOUTCAPSA;
  760. alias MIDIOUTCAPSA* NPMIDIOUTCAPSA;
  761. alias MIDIOUTCAPSA* LPMIDIOUTCAPSA;
  762. align(2) struct MIDIOUTCAPSW {
  763. WORD wMid; /* manufacturer ID */
  764. WORD wPid; /* product ID */
  765. MMVERSION vDriverVersion; /* version of the driver */
  766. WCHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  767. WORD wTechnology; /* type of device */
  768. WORD wVoices; /* # of voices (internal synth only) */
  769. WORD wNotes; /* max # of notes (internal synth only) */
  770. WORD wChannelMask; /* channels used (internal synth only) */
  771. DWORD dwSupport; /* functionality supported by driver */
  772. }
  773. alias MIDIOUTCAPSW* PMIDIOUTCAPSW;
  774. alias MIDIOUTCAPSW* NPMIDIOUTCAPSW;
  775. alias MIDIOUTCAPSW* LPMIDIOUTCAPSW;
  776. version(UNICODE) {
  777. alias MIDIOUTCAPSW MIDIOUTCAPS;
  778. alias PMIDIOUTCAPSW PMIDIOUTCAPS;
  779. alias NPMIDIOUTCAPSW NPMIDIOUTCAPS;
  780. alias LPMIDIOUTCAPSW LPMIDIOUTCAPS;
  781. }
  782. else {
  783. alias MIDIOUTCAPSA MIDIOUTCAPS;
  784. alias PMIDIOUTCAPSA PMIDIOUTCAPS;
  785. alias NPMIDIOUTCAPSA NPMIDIOUTCAPS;
  786. alias LPMIDIOUTCAPSA LPMIDIOUTCAPS;
  787. }
  788. align(2) struct MIDIOUTCAPS2A {
  789. WORD wMid; /* manufacturer ID */
  790. WORD wPid; /* product ID */
  791. MMVERSION vDriverVersion; /* version of the driver */
  792. CHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  793. WORD wTechnology; /* type of device */
  794. WORD wVoices; /* # of voices (internal synth only) */
  795. WORD wNotes; /* max # of notes (internal synth only) */
  796. WORD wChannelMask; /* channels used (internal synth only) */
  797. DWORD dwSupport; /* functionality supported by driver */
  798. GUID ManufacturerGuid; /* for extensible MID mapping */
  799. GUID ProductGuid; /* for extensible PID mapping */
  800. GUID NameGuid; /* for name lookup in registry */
  801. }
  802. alias MIDIOUTCAPS2A* PMIDIOUTCAPS2A;
  803. alias MIDIOUTCAPS2A* NPMIDIOUTCAPS2A;
  804. alias MIDIOUTCAPS2A* LPMIDIOUTCAPS2A;
  805. align(2) struct MIDIOUTCAPS2W {
  806. WORD wMid; /* manufacturer ID */
  807. WORD wPid; /* product ID */
  808. MMVERSION vDriverVersion; /* version of the driver */
  809. WCHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  810. WORD wTechnology; /* type of device */
  811. WORD wVoices; /* # of voices (internal synth only) */
  812. WORD wNotes; /* max # of notes (internal synth only) */
  813. WORD wChannelMask; /* channels used (internal synth only) */
  814. DWORD dwSupport; /* functionality supported by driver */
  815. GUID ManufacturerGuid; /* for extensible MID mapping */
  816. GUID ProductGuid; /* for extensible PID mapping */
  817. GUID NameGuid; /* for name lookup in registry */
  818. }
  819. alias MIDIOUTCAPS2W* PMIDIOUTCAPS2W;
  820. alias MIDIOUTCAPS2W* NPMIDIOUTCAPS2W;
  821. alias MIDIOUTCAPS2W* LPMIDIOUTCAPS2W;
  822. version(UNICODE) {
  823. alias MIDIOUTCAPS2W MIDIOUTCAPS2;
  824. alias PMIDIOUTCAPS2W PMIDIOUTCAPS2;
  825. alias NPMIDIOUTCAPS2W NPMIDIOUTCAPS2;
  826. alias LPMIDIOUTCAPS2W LPMIDIOUTCAPS2;
  827. }
  828. else {
  829. alias MIDIOUTCAPS2A MIDIOUTCAPS2;
  830. alias PMIDIOUTCAPS2A PMIDIOUTCAPS2;
  831. alias NPMIDIOUTCAPS2A NPMIDIOUTCAPS2;
  832. alias LPMIDIOUTCAPS2A LPMIDIOUTCAPS2;
  833. }
  834. /* flags for wTechnology field of MIDIOUTCAPS align(2) structure */
  835. const auto MOD_MIDIPORT = 1 ; /* output port */
  836. const auto MOD_SYNTH = 2 ; /* generic internal synth */
  837. const auto MOD_SQSYNTH = 3 ; /* square wave internal synth */
  838. const auto MOD_FMSYNTH = 4 ; /* FM internal synth */
  839. const auto MOD_MAPPER = 5 ; /* MIDI mapper */
  840. const auto MOD_WAVETABLE = 6 ; /* hardware wavetable synth */
  841. const auto MOD_SWSYNTH = 7 ; /* software synth */
  842. /* flags for dwSupport field of MIDIOUTCAPS align(2) structure */
  843. const auto MIDICAPS_VOLUME = 0x0001 ; /* supports volume control */
  844. const auto MIDICAPS_LRVOLUME = 0x0002 ; /* separate left-right volume control */
  845. const auto MIDICAPS_CACHE = 0x0004;
  846. const auto MIDICAPS_STREAM = 0x0008 ; /* driver supports midiStreamOut directly */
  847. /* MIDI input device capabilities align(2) structure */
  848. align(2) struct MIDIINCAPSA {
  849. WORD wMid; /* manufacturer ID */
  850. WORD wPid; /* product ID */
  851. MMVERSION vDriverVersion; /* version of the driver */
  852. CHAR szPname[MAXPNAMELEN]; /* product name (NULL terminated string) */
  853. DWORD dwSupport; /* functionality supported by driver */
  854. }
  855. alias MIDIINCAPSA* PMIDIINCAPSA;
  856. alias MIDIINCAPSA* NPMIDIINCAPSA;
  857. alias MIDIINCAPSA* LPMIDIINCAPSA;
  858. align(2) struct MIDIINCAPSW {
  859. WORD wMid; /* manufacturer ID */
  860. WORD wPid; /* product ID */
  861. MMVERSION vDriverVersion; /* version of the driver */
  862. WCHAR szPname[MAXPNAMELEN]; /* product name (NULL terminated string) */
  863. DWORD dwSupport; /* functionality supported by driver */
  864. }
  865. alias MIDIINCAPSW* PMIDIINCAPSW;
  866. alias MIDIINCAPSW* NPMIDIINCAPSW;
  867. alias MIDIINCAPSW* LPMIDIINCAPSW;
  868. version(UNICODE) {
  869. alias MIDIINCAPSW MIDIINCAPS;
  870. alias PMIDIINCAPSW PMIDIINCAPS;
  871. alias NPMIDIINCAPSW NPMIDIINCAPS;
  872. alias LPMIDIINCAPSW LPMIDIINCAPS;
  873. }
  874. else {
  875. alias MIDIINCAPSA MIDIINCAPS;
  876. alias PMIDIINCAPSA PMIDIINCAPS;
  877. alias NPMIDIINCAPSA NPMIDIINCAPS;
  878. alias LPMIDIINCAPSA LPMIDIINCAPS;
  879. }
  880. align(2) struct MIDIINCAPS2A {
  881. WORD wMid; /* manufacturer ID */
  882. WORD wPid; /* product ID */
  883. MMVERSION vDriverVersion; /* version of the driver */
  884. CHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  885. DWORD dwSupport; /* functionality supported by driver */
  886. GUID ManufacturerGuid; /* for extensible MID mapping */
  887. GUID ProductGuid; /* for extensible PID mapping */
  888. GUID NameGuid; /* for name lookup in registry */
  889. }
  890. alias MIDIINCAPS2A* PMIDIINCAPS2A;
  891. alias MIDIINCAPS2A* NPMIDIINCAPS2A;
  892. alias MIDIINCAPS2A* LPMIDIINCAPS2A;
  893. align(2) struct MIDIINCAPS2W {
  894. WORD wMid; /* manufacturer ID */
  895. WORD wPid; /* product ID */
  896. MMVERSION vDriverVersion; /* version of the driver */
  897. WCHAR[MAXPNAMELEN] szPname; /* product name (NULL terminated string) */
  898. DWORD dwSupport; /* functionality supported by driver */
  899. GUID ManufacturerGuid; /* for extensible MID mapping */
  900. GUID ProductGuid; /* for extensible PID mapping */
  901. GUID NameGuid; /* for name lookup in registry */
  902. }
  903. alias MIDIINCAPS2W* PMIDIINCAPS2W;
  904. alias MIDIINCAPS2W* NPMIDIINCAPS2W;
  905. alias MIDIINCAPS2W* LPMIDIINCAPS2W;
  906. version(UNICODE) {
  907. alias MIDIINCAPS2W MIDIINCAPS2;
  908. alias PMIDIINCAPS2W PMIDIINCAPS2;
  909. alias NPMIDIINCAPS2W NPMIDIINCAPS2;
  910. alias LPMIDIINCAPS2W LPMIDIINCAPS2;
  911. }
  912. else {
  913. alias MIDIINCAPS2A MIDIINCAPS2;
  914. alias PMIDIINCAPS2A PMIDIINCAPS2;
  915. alias NPMIDIINCAPS2A NPMIDIINCAPS2;
  916. alias LPMIDIINCAPS2A LPMIDIINCAPS2;
  917. }
  918. /* MIDI data block header */
  919. align(2) struct MIDIHDR {
  920. LPSTR lpData; /* pointer to locked data block */
  921. DWORD dwBufferLength; /* length of data in data block */
  922. DWORD dwBytesRecorded; /* used for input only */
  923. DWORD_PTR dwUser; /* for client's use */
  924. DWORD dwFlags; /* assorted flags (see defines) */
  925. MIDIHDR* lpNext; /* reserved for driver */
  926. DWORD_PTR reserved; /* reserved for driver */
  927. DWORD dwOffset; /* Callback offset into buffer */
  928. DWORD_PTR[8] dwReserved; /* Reserved for MMSYSTEM */
  929. }
  930. alias MIDIHDR* PMIDIHDR;
  931. alias MIDIHDR *NPMIDIHDR;
  932. alias MIDIHDR* LPMIDIHDR;
  933. align(2) struct MIDIEVENT {
  934. DWORD dwDeltaTime; /* Ticks since last event */
  935. DWORD dwStreamID; /* Reserved; must be zero */
  936. DWORD dwEvent; /* Event type and parameters */
  937. DWORD[1] dwParms; /* Parameters if this is a long event */
  938. }
  939. align(2) struct MIDISTRMBUFFVER {
  940. DWORD dwVersion; /* Stream buffer format version */
  941. DWORD dwMid; /* Manufacturer ID as defined in MMREG.H */
  942. DWORD dwOEMVersion; /* Manufacturer version for custom ext */
  943. }
  944. /* flags for dwFlags field of MIDIHDR align(2) structure */
  945. const auto MHDR_DONE = 0x00000001 ; /* done bit */
  946. const auto MHDR_PREPARED = 0x00000002 ; /* set if header prepared */
  947. const auto MHDR_INQUEUE = 0x00000004 ; /* reserved for driver */
  948. const auto MHDR_ISSTRM = 0x00000008 ; /* Buffer is stream buffer */
  949. /* */
  950. /* Type codes which go in the high byte of the event DWORD of a stream buffer */
  951. /* */
  952. /* Type codes 00-7F contain parameters within the low 24 bits */
  953. /* Type codes 80-FF contain a length of their parameter in the low 24 */
  954. /* bits, followed by their parameter data in the buffer. The event */
  955. /* DWORD contains the exact byte length; the parm data itself must be */
  956. /* padded to be an even multiple of 4 bytes long. */
  957. /* */
  958. const auto MEVT_F_SHORT = 0x00000000L;
  959. const auto MEVT_F_LONG = 0x80000000L;
  960. const auto MEVT_F_CALLBACK = 0x40000000L;
  961. template MEVT_EVENTTYPE(DWORD x) {
  962. const auto MEVT_EVENTTYPE = (cast(BYTE)(((x)>>24)&0xFF));
  963. }
  964. template MEVT_EVENTPARM(DWORD x) {
  965. const auto MEVT_EVENTPARM = (cast(DWORD)((x)&0x00FFFFFFL));
  966. }
  967. const auto MEVT_SHORTMSG = (cast(BYTE)0x00) ; /* parm = shortmsg for midiOutShortMsg */
  968. const auto MEVT_TEMPO = (cast(BYTE)0x01) ; /* parm = new tempo in microsec/qn */
  969. const auto MEVT_NOP = (cast(BYTE)0x02) ; /* parm = unused; does nothing */
  970. /* 0x04-0x7F reserved */
  971. const auto MEVT_LONGMSG = (cast(BYTE)0x80) ; /* parm = bytes to send verbatim */
  972. const auto MEVT_COMMENT = (cast(BYTE)0x82) ; /* parm = comment data */
  973. const auto MEVT_VERSION = (cast(BYTE)0x84) ; /* parm = MIDISTRMBUFFVER align(2) struct */
  974. /* 0x81-0xFF reserved */
  975. const auto MIDISTRM_ERROR = (-2);
  976. /* */
  977. /* Structures and defines for midiStreamProperty */
  978. /* */
  979. const auto MIDIPROP_SET = 0x80000000L;
  980. const auto MIDIPROP_GET = 0x40000000L;
  981. /* These are intentionally both non-zero so the app cannot accidentally */
  982. /* leave the operation off and happen to appear to work due to default */
  983. /* action. */
  984. const auto MIDIPROP_TIMEDIV = 0x00000001L;
  985. const auto MIDIPROP_TEMPO = 0x00000002L;
  986. align(2) struct MIDIPROPTIMEDIV {
  987. DWORD cbStruct;
  988. DWORD dwTimeDiv;
  989. }
  990. alias MIDIPROPTIMEDIV* LPMIDIPROPTIMEDIV;
  991. align(2) struct MIDIPROPTEMPO {
  992. DWORD cbStruct;
  993. DWORD dwTempo;
  994. }
  995. alias MIDIPROPTEMPO* LPMIDIPROPTEMPO;
  996. /* MIDI function prototypes */
  997. UINT midiOutGetNumDevs();
  998. MMRESULT midiStreamOpen( LPHMIDISTRM phms, LPUINT puDeviceID, DWORD cMidi, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
  999. MMRESULT midiStreamClose( HMIDISTRM hms);
  1000. MMRESULT midiStreamProperty( HMIDISTRM hms, LPBYTE lppropdata, DWORD dwProperty);
  1001. MMRESULT midiStreamPosition( HMIDISTRM hms, LPMMTIME lpmmt, UINT cbmmt);
  1002. MMRESULT midiStreamOut( HMIDISTRM hms, LPMIDIHDR pmh, UINT cbmh);
  1003. MMRESULT midiStreamPause( HMIDISTRM hms);
  1004. MMRESULT midiStreamRestart( HMIDISTRM hms);
  1005. MMRESULT midiStreamStop( HMIDISTRM hms);
  1006. MMRESULT midiConnect( HMIDI hmi, HMIDIOUT hmo, LPVOID pReserved);
  1007. MMRESULT midiDisconnect( HMIDI hmi, HMIDIOUT hmo, LPVOID pReserved);
  1008. MMRESULT midiOutGetDevCapsA( UINT_PTR uDeviceID, LPMIDIOUTCAPSA pmoc, UINT cbmoc);
  1009. MMRESULT midiOutGetDevCapsW( UINT_PTR uDeviceID, LPMIDIOUTCAPSW pmoc, UINT cbmoc);
  1010. version(UNICODE) {
  1011. alias midiOutGetDevCapsW midiOutGetDevCaps;
  1012. }
  1013. else {
  1014. alias midiOutGetDevCapsA midiOutGetDevCaps;
  1015. }
  1016. MMRESULT midiOutGetVolume( HMIDIOUT hmo, LPDWORD pdwVolume);
  1017. MMRESULT midiOutSetVolume( HMIDIOUT hmo, DWORD dwVolume);
  1018. MMRESULT midiOutGetErrorTextA( MMRESULT mmrError, LPSTR pszText, UINT cchText);
  1019. MMRESULT midiOutGetErrorTextW( MMRESULT mmrError, LPWSTR pszText, UINT cchText);
  1020. version(UNICODE) {
  1021. alias midiOutGetErrorTextW midiOutGetErrorText;
  1022. }
  1023. else {
  1024. alias midiOutGetErrorTextA midiOutGetErrorText;
  1025. }
  1026. MMRESULT midiOutOpen( LPHMIDIOUT phmo, UINT uDeviceID,
  1027. DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
  1028. MMRESULT midiOutClose( HMIDIOUT hmo);
  1029. MMRESULT midiOutPrepareHeader( HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh);
  1030. MMRESULT midiOutUnprepareHeader(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh);
  1031. MMRESULT midiOutShortMsg( HMIDIOUT hmo, DWORD dwMsg);
  1032. MMRESULT midiOutLongMsg(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh);
  1033. MMRESULT midiOutReset( HMIDIOUT hmo);
  1034. MMRESULT midiOutCachePatches( HMIDIOUT hmo, UINT uBank, LPWORD pwpa, UINT fuCache);
  1035. MMRESULT midiOutCacheDrumPatches( HMIDIOUT hmo, UINT uPatch, LPWORD pwkya, UINT fuCache);
  1036. MMRESULT midiOutGetID( HMIDIOUT hmo, LPUINT puDeviceID);
  1037. MMRESULT midiOutMessage( HMIDIOUT hmo, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
  1038. UINT midiInGetNumDevs();
  1039. MMRESULT midiInGetDevCapsA( UINT_PTR uDeviceID, LPMIDIINCAPSA pmic, UINT cbmic);
  1040. MMRESULT midiInGetDevCapsW( UINT_PTR uDeviceID, LPMIDIINCAPSW pmic, UINT cbmic);
  1041. version(UNICODE) {
  1042. alias midiInGetDevCapsW midiInGetDevCaps;
  1043. }
  1044. else {
  1045. alias midiInGetDevCapsA midiInGetDevCaps;
  1046. }
  1047. MMRESULT midiInGetErrorTextA( MMRESULT mmrError, LPSTR pszText, UINT cchText);
  1048. MMRESULT midiInGetErrorTextW( MMRESULT mmrError, LPWSTR pszText, UINT cchText);
  1049. version(UNICODE) {
  1050. alias midiInGetErrorTextW midiInGetErrorText;
  1051. }
  1052. else {
  1053. alias midiInGetErrorTextA midiInGetErrorText;
  1054. }
  1055. MMRESULT midiInOpen( LPHMIDIIN phmi, UINT uDeviceID,
  1056. DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
  1057. MMRESULT midiInClose( HMIDIIN hmi);
  1058. MMRESULT midiInPrepareHeader( HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh);
  1059. MMRESULT midiInUnprepareHeader( HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh);
  1060. MMRESULT midiInAddBuffer( HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh);
  1061. MMRESULT midiInStart( HMIDIIN hmi);
  1062. MMRESULT midiInStop( HMIDIIN hmi);
  1063. MMRESULT midiInReset( HMIDIIN hmi);
  1064. MMRESULT midiInGetID( HMIDIIN hmi, LPUINT puDeviceID);
  1065. MMRESULT midiInMessage( HMIDIIN hmi, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
  1066. }
  1067. /****************************************************************************
  1068. Auxiliary audio support
  1069. ****************************************************************************/
  1070. version(MMNOAUX) {
  1071. }
  1072. else {
  1073. /* device ID for aux device mapper */
  1074. const auto AUX_MAPPER = (cast(UINT)-1);
  1075. /* Auxiliary audio device capabilities align(2) structure */
  1076. align(2) struct AUXCAPSA {
  1077. WORD wMid; /* manufacturer ID */
  1078. WORD wPid; /* product ID */
  1079. MMVERSION vDriverVersion; /* version of the driver */
  1080. CHAR[MAXPNAMELEN] szPname;/* product name (NULL terminated string) */
  1081. WORD wTechnology; /* type of device */
  1082. WORD wReserved1; /* padding */
  1083. DWORD dwSupport; /* functionality supported by driver */
  1084. }
  1085. alias AUXCAPSA* PAUXCAPSA;
  1086. alias AUXCAPSA* NPAUXCAPSA;
  1087. alias AUXCAPSA* LPAUXCAPSA;
  1088. align(2) struct AUXCAPSW {
  1089. WORD wMid; /* manufacturer ID */
  1090. WORD wPid; /* product ID */
  1091. MMVERSION vDriverVersion; /* version of the driver */
  1092. WCHAR[MAXPNAMELEN] szPname;/* product name (NULL terminated string) */
  1093. WORD wTechnology; /* type of device */
  1094. WORD wReserved1; /* padding */
  1095. DWORD dwSupport; /* functionality supported by driver */
  1096. }
  1097. alias AUXCAPSW* PAUXCAPSW;
  1098. alias AUXCAPSW* NPAUXCAPSW;
  1099. alias AUXCAPSW* LPAUXCAPSW;
  1100. version(UNICODE) {
  1101. alias AUXCAPSW AUXCAPS;
  1102. alias PAUXCAPSW PAUXCAPS;
  1103. alias NPAUXCAPSW NPAUXCAPS;
  1104. alias LPAUXCAPSW LPAUXCAPS;
  1105. }
  1106. else {
  1107. alias AUXCAPSA AUXCAPS;
  1108. alias PAUXCAPSA PAUXCAPS;
  1109. alias NPAUXCAPSA NPAUXCAPS;
  1110. alias LPAUXCAPSA LPAUXCAPS;
  1111. }
  1112. align(2) struct AUXCAPS2A {
  1113. WORD wMid; /* manufacturer ID */
  1114. WORD wPid; /* product ID */
  1115. MMVERSION vDriverVersion; /* version of the driver */
  1116. CHAR[MAXPNAMELEN] szPname;/* product name (NULL terminated string) */
  1117. WORD wTechnology; /* type of device */
  1118. WORD wReserved1; /* padding */
  1119. DWORD dwSupport; /* functionality supported by driver */
  1120. GUID ManufacturerGuid; /* for extensible MID mapping */
  1121. GUID ProductGuid; /* for extensible PID mapping */
  1122. GUID NameGuid; /* for name lookup in registry */
  1123. }
  1124. alias AUXCAPS2A* PAUXCAPS2A;
  1125. alias AUXCAPS2A* NPAUXCAPS2A;
  1126. alias AUXCAPS2A* LPAUXCAPS2A;
  1127. align(2) struct AUXCAPS2W {
  1128. WORD wMid; /* manufacturer ID */
  1129. WORD wPid; /* product ID */
  1130. MMVERSION vDriverVersion; /* version of the driver */
  1131. WCHAR[MAXPNAMELEN] szPname;/* product name (NULL terminated string) */
  1132. WORD wTechnology; /* type of device */
  1133. WORD wReserved1; /* padding */
  1134. DWORD dwSupport; /* functionality supported by driver */
  1135. GUID ManufacturerGuid; /* for extensible MID mapping */
  1136. GUID ProductGuid; /* for extensible PID mapping */
  1137. GUID NameGuid; /* for name lookup in registry */
  1138. }
  1139. alias AUXCAPS2W* PAUXCAPS2W;
  1140. alias AUXCAPS2W* NPAUXCAPS2W;
  1141. alias AUXCAPS2W* LPAUXCAPS2W;
  1142. version(UNICODE) {
  1143. alias AUXCAPS2W AUXCAPS2;
  1144. alias PAUXCAPS2W PAUXCAPS2;
  1145. alias NPAUXCAPS2W NPAUXCAPS2;
  1146. alias LPAUXCAPS2W LPAUXCAPS2;
  1147. }
  1148. else {
  1149. alias AUXCAPS2A AUXCAPS2;
  1150. alias PAUXCAPS2A PAUXCAPS2;
  1151. alias NPAUXCAPS2A NPAUXCAPS2;
  1152. alias LPAUXCAPS2A LPAUXCAPS2;
  1153. }
  1154. /* flags for wTechnology field in AUXCAPS align(2) structure */
  1155. const auto AUXCAPS_CDAUDIO = 1 ; /* audio from internal CD-ROM drive */
  1156. const auto AUXCAPS_AUXIN = 2 ; /* audio from auxiliary input jacks */
  1157. /* flags for dwSupport field in AUXCAPS align(2) structure */
  1158. const auto AUXCAPS_VOLUME = 0x0001 ; /* supports volume control */
  1159. const auto AUXCAPS_LRVOLUME = 0x0002 ; /* separate left-right volume control */
  1160. /* auxiliary audio function prototypes */
  1161. UINT auxGetNumDevs();
  1162. MMRESULT auxGetDevCapsA( UINT_PTR uDeviceID, LPAUXCAPSA pac, UINT cbac);
  1163. MMRESULT auxGetDevCapsW( UINT_PTR uDeviceID, LPAUXCAPSW pac, UINT cbac);
  1164. version(UNICODE) {
  1165. alias auxGetDevCapsW auxGetDevCaps;
  1166. }
  1167. else {
  1168. alias auxGetDevCapsA auxGetDevCaps;
  1169. }
  1170. MMRESULT auxSetVolume( UINT uDeviceID, DWORD dwVolume);
  1171. MMRESULT auxGetVolume( UINT uDeviceID, LPDWORD pdwVolume);
  1172. MMRESULT auxOutMessage( UINT uDeviceID, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
  1173. }
  1174. /****************************************************************************
  1175. Mixer Support
  1176. ****************************************************************************/
  1177. version(MMNOMIXER) {
  1178. }
  1179. else {
  1180. alias HANDLE HMIXEROBJ;
  1181. alias HMIXEROBJ *LPHMIXEROBJ;
  1182. alias HANDLE HMIXER;
  1183. alias HMIXER *LPHMIXER;
  1184. const auto MIXER_SHORT_NAME_CHARS = 16;
  1185. const auto MIXER_LONG_NAME_CHARS = 64;
  1186. /* */
  1187. /* MMRESULT error return values specific to the mixer API */
  1188. /* */
  1189. /* */
  1190. const auto MIXERR_INVALLINE = (MIXERR_BASE + 0);
  1191. const auto MIXERR_INVALCONTROL = (MIXERR_BASE + 1);
  1192. const auto MIXERR_INVALVALUE = (MIXERR_BASE + 2);
  1193. const auto MIXERR_LASTERROR = (MIXERR_BASE + 2);
  1194. const auto MIXER_OBJECTF_HANDLE = 0x80000000L;
  1195. const auto MIXER_OBJECTF_MIXER = 0x00000000L;
  1196. const auto MIXER_OBJECTF_HMIXER = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIXER);
  1197. const auto MIXER_OBJECTF_WAVEOUT = 0x10000000L;
  1198. const auto MIXER_OBJECTF_HWAVEOUT = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEOUT);
  1199. const auto MIXER_OBJECTF_WAVEIN = 0x20000000L;
  1200. const auto MIXER_OBJECTF_HWAVEIN = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEIN);
  1201. const auto MIXER_OBJECTF_MIDIOUT = 0x30000000L;
  1202. const auto MIXER_OBJECTF_HMIDIOUT = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIOUT);
  1203. const auto MIXER_OBJECTF_MIDIIN = 0x40000000L;
  1204. const auto MIXER_OBJECTF_HMIDIIN = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIIN);
  1205. const auto MIXER_OBJECTF_AUX = 0x50000000L;
  1206. UINT mixerGetNumDevs();
  1207. align(2) struct MIXERCAPSA {
  1208. WORD wMid; /* manufacturer id */
  1209. WORD wPid; /* product id */
  1210. MMVERSION vDriverVersion; /* version of the driver */
  1211. CHAR[MAXPNAMELEN] szPname; /* product name */
  1212. DWORD fdwSupport; /* misc. support bits */
  1213. DWORD cDestinations; /* count of destinations */
  1214. }
  1215. alias MIXERCAPSA* PMIXERCAPSA;
  1216. alias MIXERCAPSA* LPMIXERCAPSA;
  1217. align(2) struct MIXERCAPSW {
  1218. WORD wMid; /* manufacturer id */
  1219. WORD wPid; /* product id */
  1220. MMVERSION vDriverVersion; /* version of the driver */
  1221. WCHAR[MAXPNAMELEN] szPname; /* product name */
  1222. DWORD fdwSupport; /* misc. support bits */
  1223. DWORD cDestinations; /* count of destinations */
  1224. }
  1225. alias MIXERCAPSW* PMIXERCAPSW;
  1226. alias MIXERCAPSW* LPMIXERCAPSW;
  1227. version(UNICODE) {
  1228. alias MIXERCAPSW MIXERCAPS;
  1229. alias PMIXERCAPSW PMIXERCAPS;
  1230. alias LPMIXERCAPSW LPMIXERCAPS;
  1231. }
  1232. else {
  1233. alias MIXERCAPSA MIXERCAPS;
  1234. alias PMIXERCAPSA PMIXERCAPS;
  1235. alias LPMIXERCAPSA LPMIXERCAPS;
  1236. }
  1237. align(2) struct MIXERCAPS2A {
  1238. WORD wMid; /* manufacturer id */
  1239. WORD wPid; /* product id */
  1240. MMVERSION vDriverVersion; /* version of the driver */
  1241. CHAR[MAXPNAMELEN] szPname; /* product name */
  1242. DWORD fdwSupport; /* misc. support bits */
  1243. DWORD cDestinations; /* count of destinations */
  1244. GUID ManufacturerGuid; /* for extensible MID mapping */
  1245. GUID ProductGuid; /* for extensible PID mapping */
  1246. GUID NameGuid; /* for name lookup in registry */
  1247. }
  1248. alias MIXERCAPS2A* PMIXERCAPS2A;
  1249. alias MIXERCAPS2A* LPMIXERCAPS2A;
  1250. align(2) struct MIXERCAPS2W {
  1251. WORD wMid; /* manufacturer id */
  1252. WORD wPid; /* product id */
  1253. MMVERSION vDriverVersion; /* version of the driver */
  1254. WCHAR[MAXPNAMELEN] szPname; /* product name */
  1255. DWORD fdwSupport; /* misc. support bits */
  1256. DWORD cDestinations; /* count of destinations */
  1257. GUID ManufacturerGuid; /* for extensible MID mapping */
  1258. GUID ProductGuid; /* for extensible PID mapping */
  1259. GUID NameGuid; /* for name lookup in registry */
  1260. }
  1261. alias MIXERCAPS2W* PMIXERCAPS2W;
  1262. alias MIXERCAPS2W* LPMIXERCAPS2W;
  1263. version(UNICODE) {
  1264. alias MIXERCAPS2W MIXERCAPS2;
  1265. alias PMIXERCAPS2W PMIXERCAPS2;
  1266. alias LPMIXERCAPS2W LPMIXERCAPS2;
  1267. }
  1268. else {
  1269. alias MIXERCAPS2A MIXERCAPS2;
  1270. alias PMIXERCAPS2A PMIXERCAPS2;
  1271. alias LPMIXERCAPS2A LPMIXERCAPS2;
  1272. }
  1273. MMRESULT mixerGetDevCapsA( UINT_PTR uMxId, LPMIXERCAPSA pmxcaps, UINT cbmxcaps);
  1274. MMRESULT mixerGetDevCapsW( UINT_PTR uMxId, LPMIXERCAPSW pmxcaps, UINT cbmxcaps);
  1275. version(UNICODE) {
  1276. alias mixerGetDevCapsW mixerGetDevCaps;
  1277. }
  1278. else {
  1279. alias mixerGetDevCapsA mixerGetDevCaps;
  1280. }
  1281. MMRESULT mixerOpen( LPHMIXER phmx, UINT uMxId, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
  1282. MMRESULT mixerClose( HMIXER hmx);
  1283. DWORD mixerMessage( HMIXER hmx, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
  1284. align(2) struct MIXERLINEA {
  1285. DWORD cbStruct; /* size of MIXERLINE align(2) structure */
  1286. DWORD dwDestination; /* zero based destination index */
  1287. DWORD dwSource; /* zero based source index (if source) */
  1288. DWORD dwLineID; /* unique line id for mixer device */
  1289. DWORD fdwLine; /* state/information about line */
  1290. DWORD_PTR dwUser; /* driver specific information */
  1291. DWORD dwComponentType; /* component type line connects to */
  1292. DWORD cChannels; /* number of channels line supports */
  1293. DWORD cConnections; /* number of connections [possible] */
  1294. DWORD cControls; /* number of controls at this line */
  1295. CHAR[MIXER_SHORT_NAME_CHARS] szShortName;
  1296. CHAR[MIXER_LONG_NAME_CHARS] szName;
  1297. align(2) struct _inner_struct {
  1298. DWORD dwType; /* MIXERLINE_TARGETTYPE_xxxx */
  1299. DWORD dwDeviceID; /* target device ID of device type */
  1300. WORD wMid; /* of target device */
  1301. WORD wPid; /* " */
  1302. MMVERSION vDriverVersion; /* " */
  1303. CHAR[MAXPNAMELEN] szPname; /* " */
  1304. }
  1305. _inner_struct Target;
  1306. }
  1307. alias MIXERLINEA* PMIXERLINEA;
  1308. alias MIXERLINEA* LPMIXERLINEA;
  1309. align(2) struct MIXERLINEW {
  1310. DWORD cbStruct; /* size of MIXERLINE align(2) structure */
  1311. DWORD dwDestination; /* zero based destination index */
  1312. DWORD dwSource; /* zero based source index (if source) */
  1313. DWORD dwLineID; /* unique line id for mixer device */
  1314. DWORD fdwLine; /* state/information about line */
  1315. DWORD_PTR dwUser; /* driver specific information */
  1316. DWORD dwComponentType; /* component type line connects to */
  1317. DWORD cChannels; /* number of channels line supports */
  1318. DWORD cConnections; /* number of connections [possible] */
  1319. DWORD cControls; /* number of controls at this line */
  1320. WCHAR[MIXER_SHORT_NAME_CHARS] szShortName;
  1321. WCHAR[MIXER_LONG_NAME_CHARS] szName;
  1322. align(2) struct _inner_struct {
  1323. DWORD dwType; /* MIXERLINE_TARGETTYPE_xxxx */
  1324. DWORD dwDeviceID; /* target device ID of device type */
  1325. WORD wMid; /* of target device */
  1326. WORD wPid; /* " */
  1327. MMVERSION vDriverVersion; /* " */
  1328. WCHAR[MAXPNAMELEN] szPname; /* " */
  1329. }
  1330. _inner_struct Target;
  1331. }
  1332. alias MIXERLINEW* PMIXERLINEW;
  1333. alias MIXERLINEW* LPMIXERLINEW;
  1334. version(UNICODE) {
  1335. alias MIXERLINEW MIXERLINE;
  1336. alias PMIXERLINEW PMIXERLINE;
  1337. alias LPMIXERLINEW LPMIXERLINE;
  1338. }
  1339. else {
  1340. alias MIXERLINEA MIXERLINE;
  1341. alias PMIXERLINEA PMIXERLINE;
  1342. alias LPMIXERLINEA LPMIXERLINE;
  1343. }
  1344. /* */
  1345. /* MIXERLINE.fdwLine */
  1346. /* */
  1347. /* */
  1348. const auto MIXERLINE_LINEF_ACTIVE = 0x00000001L;
  1349. const auto MIXERLINE_LINEF_DISCONNECTED = 0x00008000L;
  1350. const auto MIXERLINE_LINEF_SOURCE = 0x80000000L;
  1351. /* */
  1352. /* MIXERLINE.dwComponentType */
  1353. /* */
  1354. /* component types for destinations and sources */
  1355. /* */
  1356. /* */
  1357. const auto MIXERLINE_COMPONENTTYPE_DST_FIRST = 0x00000000L;
  1358. const auto MIXERLINE_COMPONENTTYPE_DST_UNDEFINED = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 0);
  1359. const auto MIXERLINE_COMPONENTTYPE_DST_DIGITAL = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 1);
  1360. const auto MIXERLINE_COMPONENTTYPE_DST_LINE = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 2);
  1361. const auto MIXERLINE_COMPONENTTYPE_DST_MONITOR = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 3);
  1362. const auto MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 4);
  1363. const auto MIXERLINE_COMPONENTTYPE_DST_HEADPHONES = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 5);
  1364. const auto MIXERLINE_COMPONENTTYPE_DST_TELEPHONE = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 6);
  1365. const auto MIXERLINE_COMPONENTTYPE_DST_WAVEIN = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 7);
  1366. const auto MIXERLINE_COMPONENTTYPE_DST_VOICEIN = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8);
  1367. const auto MIXERLINE_COMPONENTTYPE_DST_LAST = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8);
  1368. const auto MIXERLINE_COMPONENTTYPE_SRC_FIRST = 0x00001000L;
  1369. const auto MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0);
  1370. const auto MIXERLINE_COMPONENTTYPE_SRC_DIGITAL = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1);
  1371. const auto MIXERLINE_COMPONENTTYPE_SRC_LINE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2);
  1372. const auto MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3);
  1373. const auto MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 4);
  1374. const auto MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 5);
  1375. const auto MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 6);
  1376. const auto MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 7);
  1377. const auto MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 8);
  1378. const auto MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 9);
  1379. const auto MIXERLINE_COMPONENTTYPE_SRC_ANALOG = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10);
  1380. const auto MIXERLINE_COMPONENTTYPE_SRC_LAST = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10);
  1381. /* */
  1382. /* MIXERLINE.Target.dwType */
  1383. /* */
  1384. /* */
  1385. const auto MIXERLINE_TARGETTYPE_UNDEFINED = 0;
  1386. const auto MIXERLINE_TARGETTYPE_WAVEOUT = 1;
  1387. const auto MIXERLINE_TARGETTYPE_WAVEIN = 2;
  1388. const auto MIXERLINE_TARGETTYPE_MIDIOUT = 3;
  1389. const auto MIXERLINE_TARGETTYPE_MIDIIN = 4;
  1390. const auto MIXERLINE_TARGETTYPE_AUX = 5;
  1391. MMRESULT mixerGetLineInfoA( HMIXEROBJ hmxobj, LPMIXERLINEA pmxl, DWORD fdwInfo);
  1392. MMRESULT mixerGetLineInfoW( HMIXEROBJ hmxobj, LPMIXERLINEW pmxl, DWORD fdwInfo);
  1393. version(UNICODE) {
  1394. alias mixerGetLineInfoW mixerGetLineInfo;
  1395. }
  1396. else {
  1397. alias mixerGetLineInfoA mixerGetLineInfo;
  1398. }
  1399. const auto MIXER_GETLINEINFOF_DESTINATION = 0x00000000L;
  1400. const auto MIXER_GETLINEINFOF_SOURCE = 0x00000001L;
  1401. const auto MIXER_GETLINEINFOF_LINEID = 0x00000002L;
  1402. const auto MIXER_GETLINEINFOF_COMPONENTTYPE = 0x00000003L;
  1403. const auto MIXER_GETLINEINFOF_TARGETTYPE = 0x00000004L;
  1404. const auto MIXER_GETLINEINFOF_QUERYMASK = 0x0000000FL;
  1405. MMRESULT mixerGetID( HMIXEROBJ hmxobj, UINT *puMxId, DWORD fdwId);
  1406. /* */
  1407. /* MIXERCONTROL */
  1408. /* */
  1409. /* */
  1410. align(2) struct MIXERCONTROLA {
  1411. DWORD cbStruct; /* size in bytes of MIXERCONTROL */
  1412. DWORD dwControlID; /* unique control id for mixer device */
  1413. DWORD dwControlType; /* MIXERCONTROL_CONTROLTYPE_xxx */
  1414. DWORD fdwControl; /* MIXERCONTROL_CONTROLF_xxx */
  1415. DWORD cMultipleItems; /* if MIXERCONTROL_CONTROLF_MULTIPLE set */
  1416. CHAR[MIXER_SHORT_NAME_CHARS] szShortName;
  1417. CHAR[MIXER_LONG_NAME_CHARS] szName;
  1418. align(2) union _inner_union {
  1419. align(2) struct _inner_struct {
  1420. LONG lMinimum; /* signed minimum for this control */
  1421. LONG lMaximum; /* signed maximum for this control */
  1422. }
  1423. _inner_struct Signed;
  1424. align(2) struct _inner_struct2 {
  1425. DWORD dwMinimum; /* unsigned minimum for this control */
  1426. DWORD dwMaximum; /* unsigned maximum for this control */
  1427. }
  1428. _inner_struct2 Unsigned;
  1429. DWORD dwReserved[6];
  1430. }
  1431. _inner_union Bounds;
  1432. align(2) union _inner_union2 {
  1433. DWORD cSteps; /* # of steps between min & max */
  1434. DWORD cbCustomData; /* size in bytes of custom data */
  1435. DWORD[6] dwReserved; /* !!! needed? we have cbStruct.... */
  1436. }
  1437. _inner_union2 Metrics;
  1438. }
  1439. alias MIXERCONTROLA* PMIXERCONTROLA;
  1440. alias MIXERCONTROLA* LPMIXERCONTROLA;
  1441. align(2) struct MIXERCONTROLW {
  1442. DWORD cbStruct; /* size in bytes of MIXERCONTROL */
  1443. DWORD dwControlID; /* unique control id for mixer device */
  1444. DWORD dwControlType; /* MIXERCONTROL_CONTROLTYPE_xxx */
  1445. DWORD fdwControl; /* MIXERCONTROL_CONTROLF_xxx */
  1446. DWORD cMultipleItems; /* if MIXERCONTROL_CONTROLF_MULTIPLE set */
  1447. WCHAR szShortName[MIXER_SHORT_NAME_CHARS];
  1448. WCHAR szName[MIXER_LONG_NAME_CHARS];
  1449. align(2) union _inner_union {
  1450. align(2) struct _inner_struct {
  1451. LONG lMinimum; /* signed minimum for this control */
  1452. LONG lMaximum; /* signed maximum for this control */
  1453. }
  1454. _inner_struct Signed;
  1455. align(2) struct _inner_struct2 {
  1456. DWORD dwMinimum; /* unsigned minimum for this control */
  1457. DWORD dwMaximum; /* unsigned maximum for this control */
  1458. }
  1459. _inner_struct2 Unsigned;
  1460. DWORD[6] dwReserved;
  1461. }
  1462. _inner_union Bounds;
  1463. align(2) union _inner_union2 {
  1464. DWORD cSteps; /* # of steps between min & max */
  1465. DWORD cbCustomData; /* size in bytes of custom data */
  1466. DWORD[6] dwReserved; /* !!! needed? we have cbStruct.... */
  1467. }
  1468. _inner_union2 Metrics;
  1469. }
  1470. alias MIXERCONTROLW* PMIXERCONTROLW;
  1471. alias MIXERCONTROLW* LPMIXERCONTROLW;
  1472. version(UNICODE) {
  1473. alias MIXERCONTROLW MIXERCONTROL;
  1474. alias PMIXERCONTROLW PMIXERCONTROL;
  1475. alias LPMIXERCONTROLW LPMIXERCONTROL;
  1476. }
  1477. else {
  1478. alias MIXERCONTROLA MIXERCONTROL;
  1479. alias PMIXERCONTROLA PMIXERCONTROL;
  1480. alias LPMIXERCONTROLA LPMIXERCONTROL;
  1481. }
  1482. /* */
  1483. /* MIXERCONTROL.fdwControl */
  1484. /* */
  1485. /* */
  1486. const auto MIXERCONTROL_CONTROLF_UNIFORM = 0x00000001L;
  1487. const auto MIXERCONTROL_CONTROLF_MULTIPLE = 0x00000002L;
  1488. const auto MIXERCONTROL_CONTROLF_DISABLED = 0x80000000L;
  1489. /* */
  1490. /* MIXERCONTROL_CONTROLTYPE_xxx building block defines */
  1491. /* */
  1492. /* */
  1493. const auto MIXERCONTROL_CT_CLASS_MASK = 0xF0000000L;
  1494. const auto MIXERCONTROL_CT_CLASS_CUSTOM = 0x00000000L;
  1495. const auto MIXERCONTROL_CT_CLASS_METER = 0x10000000L;
  1496. const auto MIXERCONTROL_CT_CLASS_SWITCH = 0x20000000L;
  1497. const auto MIXERCONTROL_CT_CLASS_NUMBER = 0x30000000L;
  1498. const auto MIXERCONTROL_CT_CLASS_SLIDER = 0x40000000L;
  1499. const auto MIXERCONTROL_CT_CLASS_FADER = 0x50000000L;
  1500. const auto MIXERCONTROL_CT_CLASS_TIME = 0x60000000L;
  1501. const auto MIXERCONTROL_CT_CLASS_LIST = 0x70000000L;
  1502. const auto MIXERCONTROL_CT_SUBCLASS_MASK = 0x0F000000L;
  1503. const auto MIXERCONTROL_CT_SC_SWITCH_BOOLEAN = 0x00000000L;
  1504. const auto MIXERCONTROL_CT_SC_SWITCH_BUTTON = 0x01000000L;
  1505. const auto MIXERCONTROL_CT_SC_METER_POLLED = 0x00000000L;
  1506. const auto MIXERCONTROL_CT_SC_TIME_MICROSECS = 0x00000000L;
  1507. const auto MIXERCONTROL_CT_SC_TIME_MILLISECS = 0x01000000L;
  1508. const auto MIXERCONTROL_CT_SC_LIST_SINGLE = 0x00000000L;
  1509. const auto MIXERCONTROL_CT_SC_LIST_MULTIPLE = 0x01000000L;
  1510. const auto MIXERCONTROL_CT_UNITS_MASK = 0x00FF0000L;
  1511. const auto MIXERCONTROL_CT_UNITS_CUSTOM = 0x00000000L;
  1512. const auto MIXERCONTROL_CT_UNITS_BOOLEAN = 0x00010000L;
  1513. const auto MIXERCONTROL_CT_UNITS_SIGNED = 0x00020000L;
  1514. const auto MIXERCONTROL_CT_UNITS_UNSIGNED = 0x00030000L;
  1515. const auto MIXERCONTROL_CT_UNITS_DECIBELS = 0x00040000L ; /* in 10ths */
  1516. const auto MIXERCONTROL_CT_UNITS_PERCENT = 0x00050000L ; /* in 10ths */
  1517. /* */
  1518. /* Commonly used control types for specifying MIXERCONTROL.dwControlType */
  1519. /* */
  1520. const auto MIXERCONTROL_CONTROLTYPE_CUSTOM = (MIXERCONTROL_CT_CLASS_CUSTOM | MIXERCONTROL_CT_UNITS_CUSTOM);
  1521. const auto MIXERCONTROL_CONTROLTYPE_BOOLEANMETER = (MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_BOOLEAN);
  1522. const auto MIXERCONTROL_CONTROLTYPE_SIGNEDMETER = (MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_SIGNED);
  1523. const auto MIXERCONTROL_CONTROLTYPE_PEAKMETER = (MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1);
  1524. const auto MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER = (MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_UNSIGNED);
  1525. const auto MIXERCONTROL_CONTROLTYPE_BOOLEAN = (MIXERCONTROL_CT_CLASS_SWITCH | MIXERCONTROL_CT_SC_SWITCH_BOOLEAN | MIXERCONTROL_CT_UNITS_BOOLEAN);
  1526. const auto MIXERCONTROL_CONTROLTYPE_ONOFF = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 1);
  1527. const auto MIXERCONTROL_CONTROLTYPE_MUTE = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2);
  1528. const auto MIXERCONTROL_CONTROLTYPE_MONO = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 3);
  1529. const auto MIXERCONTROL_CONTROLTYPE_LOUDNESS = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 4);
  1530. const auto MIXERCONTROL_CONTROLTYPE_STEREOENH = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 5);
  1531. const auto MIXERCONTROL_CONTROLTYPE_BASS_BOOST = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 0x00002277);
  1532. const auto MIXERCONTROL_CONTROLTYPE_BUTTON = (MIXERCONTROL_CT_CLASS_SWITCH | MIXERCONTROL_CT_SC_SWITCH_BUTTON | MIXERCONTROL_CT_UNITS_BOOLEAN);
  1533. const auto MIXERCONTROL_CONTROLTYPE_DECIBELS = (MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_DECIBELS);
  1534. const auto MIXERCONTROL_CONTROLTYPE_SIGNED = (MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_SIGNED);
  1535. const auto MIXERCONTROL_CONTROLTYPE_UNSIGNED = (MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_UNSIGNED);
  1536. const auto MIXERCONTROL_CONTROLTYPE_PERCENT = (MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_PERCENT);
  1537. const auto MIXERCONTROL_CONTROLTYPE_SLIDER = (MIXERCONTROL_CT_CLASS_SLIDER | MIXERCONTROL_CT_UNITS_SIGNED);
  1538. const auto MIXERCONTROL_CONTROLTYPE_PAN = (MIXERCONTROL_CONTROLTYPE_SLIDER + 1);
  1539. const auto MIXERCONTROL_CONTROLTYPE_QSOUNDPAN = (MIXERCONTROL_CONTROLTYPE_SLIDER + 2);
  1540. const auto MIXERCONTROL_CONTROLTYPE_FADER = (MIXERCONTROL_CT_CLASS_FADER | MIXERCONTROL_CT_UNITS_UNSIGNED);
  1541. const auto MIXERCONTROL_CONTROLTYPE_VOLUME = (MIXERCONTROL_CONTROLTYPE_FADER + 1);
  1542. const auto MIXERCONTROL_CONTROLTYPE_BASS = (MIXERCONTROL_CONTROLTYPE_FADER + 2);
  1543. const auto MIXERCONTROL_CONTROLTYPE_TREBLE = (MIXERCONTROL_CONTROLTYPE_FADER + 3);
  1544. const auto MIXERCONTROL_CONTROLTYPE_EQUALIZER = (MIXERCONTROL_CONTROLTYPE_FADER + 4);
  1545. const auto MIXERCONTROL_CONTROLTYPE_SINGLESELECT = (MIXERCONTROL_CT_CLASS_LIST | MIXERCONTROL_CT_SC_LIST_SINGLE | MIXERCONTROL_CT_UNITS_BOOLEAN);
  1546. const auto MIXERCONTROL_CONTROLTYPE_MUX = (MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1);
  1547. const auto MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT = (MIXERCONTROL_CT_CLASS_LIST | MIXERCONTROL_CT_SC_LIST_MULTIPLE | MIXERCONTROL_CT_UNITS_BOOLEAN);
  1548. const auto MIXERCONTROL_CONTROLTYPE_MIXER = (MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT + 1);
  1549. const auto MIXERCONTROL_CONTROLTYPE_MICROTIME = (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MICROSECS | MIXERCONTROL_CT_UNITS_UNSIGNED);
  1550. const auto MIXERCONTROL_CONTROLTYPE_MILLITIME = (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MILLISECS | MIXERCONTROL_CT_UNITS_UNSIGNED);
  1551. /* */
  1552. /* MIXERLINECONTROLS */
  1553. /* */
  1554. align(2) struct MIXERLINECONTROLSA {
  1555. DWORD cbStruct; /* size in bytes of MIXERLINECONTROLS */
  1556. DWORD dwLineID; /* line id (from MIXERLINE.dwLineID) */
  1557. align(2) union _inner_union {
  1558. DWORD dwControlID; /* MIXER_GETLINECONTROLSF_ONEBYID */
  1559. DWORD dwControlType; /* MIXER_GETLINECONTROLSF_ONEBYTYPE */
  1560. }
  1561. _inner_union fields;
  1562. DWORD cControls; /* count of controls pmxctrl points to */
  1563. DWORD cbmxctrl; /* size in bytes of _one_ MIXERCONTROL */
  1564. LPMIXERCONTROLA pamxctrl; /* pointer to first MIXERCONTROL array */
  1565. }
  1566. alias MIXERLINECONTROLSA* PMIXERLINECONTROLSA;
  1567. alias MIXERLINECONTROLSA* LPMIXERLINECONTROLSA;
  1568. align(2) struct MIXERLINECONTROLSW {
  1569. DWORD cbStruct; /* size in bytes of MIXERLINECONTROLS */
  1570. DWORD dwLineID; /* line id (from MIXERLINE.dwLineID) */
  1571. align(2) union _inner_union {
  1572. DWORD dwControlID; /* MIXER_GETLINECONTROLSF_ONEBYID */
  1573. DWORD dwControlType; /* MIXER_GETLINECONTROLSF_ONEBYTYPE */
  1574. }
  1575. _inner_union fields;
  1576. DWORD cControls; /* count of controls pmxctrl points to */
  1577. DWORD cbmxctrl; /* size in bytes of _one_ MIXERCONTROL */
  1578. LPMIXERCONTROLW pamxctrl; /* pointer to first MIXERCONTROL array */
  1579. }
  1580. alias MIXERLINECONTROLSW* PMIXERLINECONTROLSW;
  1581. alias MIXERLINECONTROLSW* LPMIXERLINECONTROLSW;
  1582. version(UNICODE) {
  1583. alias MIXERLINECONTROLSW MIXERLINECONTROLS;
  1584. alias PMIXERLINECONTROLSW PMIXERLINECONTROLS;
  1585. alias LPMIXERLINECONTROLSW LPMIXERLINECONTROLS;
  1586. }
  1587. else {
  1588. alias MIXERLINECONTROLSA MIXERLINECONTROLS;
  1589. alias PMIXERLINECONTROLSA PMIXERLINECONTROLS;
  1590. alias LPMIXERLINECONTROLSA LPMIXERLINECONTROLS;
  1591. }
  1592. /* */
  1593. /* */
  1594. /* */
  1595. MMRESULT mixerGetLineControlsA( HMIXEROBJ hmxobj, LPMIXERLINECONTROLSA pmxlc, DWORD fdwControls);
  1596. MMRESULT mixerGetLineControlsW( HMIXEROBJ hmxobj, LPMIXERLINECONTROLSW pmxlc, DWORD fdwControls);
  1597. version(UNICODE) {
  1598. alias mixerGetLineControlsW mixerGetLineControls;
  1599. }
  1600. else {
  1601. alias mixerGetLineControlsA mixerGetLineControls;
  1602. }
  1603. const auto MIXER_GETLINECONTROLSF_ALL = 0x00000000L;
  1604. const auto MIXER_GETLINECONTROLSF_ONEBYID = 0x00000001L;
  1605. const auto MIXER_GETLINECONTROLSF_ONEBYTYPE = 0x00000002L;
  1606. const auto MIXER_GETLINECONTROLSF_QUERYMASK = 0x0000000FL;
  1607. align(2) struct MIXERCONTROLDETAILS {
  1608. DWORD cbStruct; /* size in bytes of MIXERCONTROLDETAILS */
  1609. DWORD dwControlID; /* control id to get/set details on */
  1610. DWORD cChannels; /* number of channels in paDetails array */
  1611. align(2) union _inner_union {
  1612. HWND hwndOwner; /* for MIXER_SETCONTROLDETAILSF_CUSTOM */
  1613. DWORD cMultipleItems; /* if _MULTIPLE, the number of items per channel */
  1614. }
  1615. _inner_union fields;
  1616. DWORD cbDetails; /* size of _one_ details_XX align(2) struct */
  1617. LPVOID paDetails; /* pointer to array of details_XX align(2) structs */
  1618. }
  1619. alias MIXERCONTROLDETAILS* PMIXERCONTROLDETAILS;
  1620. alias MIXERCONTROLDETAILS* LPMIXERCONTROLDETAILS;
  1621. /* */
  1622. /* MIXER_GETCONTROLDETAILSF_LISTTEXT */
  1623. /* */
  1624. /* */
  1625. align(2) struct MIXERCONTROLDETAILS_LISTTEXTA {
  1626. DWORD dwParam1;
  1627. DWORD dwParam2;
  1628. CHAR[MIXER_LONG_NAME_CHARS] szName;
  1629. }
  1630. alias MIXERCONTROLDETAILS_LISTTEXTA* PMIXERCONTROLDETAILS_LISTTEXTA;
  1631. alias MIXERCONTROLDETAILS_LISTTEXTA* LPMIXERCONTROLDETAILS_LISTTEXTA;
  1632. align(2) struct MIXERCONTROLDETAILS_LISTTEXTW {
  1633. DWORD dwParam1;
  1634. DWORD dwParam2;
  1635. WCHAR[MIXER_LONG_NAME_CHARS] szName;
  1636. }
  1637. alias MIXERCONTROLDETAILS_LISTTEXTW* PMIXERCONTROLDETAILS_LISTTEXTW;
  1638. alias MIXERCONTROLDETAILS_LISTTEXTW* LPMIXERCONTROLDETAILS_LISTTEXTW;
  1639. version(UNICODE) {
  1640. alias MIXERCONTROLDETAILS_LISTTEXTW MIXERCONTROLDETAILS_LISTTEXT;
  1641. alias PMIXERCONTROLDETAILS_LISTTEXTW PMIXERCONTROLDETAILS_LISTTEXT;
  1642. alias LPMIXERCONTROLDETAILS_LISTTEXTW LPMIXERCONTROLDETAILS_LISTTEXT;
  1643. }
  1644. else {
  1645. alias MIXERCONTROLDETAILS_LISTTEXTA MIXERCONTROLDETAILS_LISTTEXT;
  1646. alias PMIXERCONTROLDETAILS_LISTTEXTA PMIXERCONTROLDETAILS_LISTTEXT;
  1647. alias LPMIXERCONTROLDETAILS_LISTTEXTA LPMIXERCONTROLDETAILS_LISTTEXT;
  1648. }
  1649. /* */
  1650. /* MIXER_GETCONTROLDETAILSF_VALUE */
  1651. /* */
  1652. /* */
  1653. align(2) struct MIXERCONTROLDETAILS_BOOLEAN {
  1654. LONG fValue;
  1655. }
  1656. alias MIXERCONTROLDETAILS_BOOLEAN* PMIXERCONTROLDETAILS_BOOLEAN;
  1657. alias MIXERCONTROLDETAILS_BOOLEAN* LPMIXERCONTROLDETAILS_BOOLEAN;
  1658. align(2) struct MIXERCONTROLDETAILS_SIGNED {
  1659. LONG lValue;
  1660. }
  1661. alias MIXERCONTROLDETAILS_SIGNED* PMIXERCONTROLDETAILS_SIGNED;
  1662. alias MIXERCONTROLDETAILS_SIGNED* LPMIXERCONTROLDETAILS_SIGNED;
  1663. align(2) struct MIXERCONTROLDETAILS_UNSIGNED {
  1664. DWORD dwValue;
  1665. }
  1666. alias MIXERCONTROLDETAILS_UNSIGNED* PMIXERCONTROLDETAILS_UNSIGNED;
  1667. alias MIXERCONTROLDETAILS_UNSIGNED* LPMIXERCONTROLDETAILS_UNSIGNED;
  1668. MMRESULT mixerGetControlDetailsA( HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
  1669. MMRESULT mixerGetControlDetailsW( HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
  1670. version(UNICODE) {
  1671. alias mixerGetControlDetailsW mixerGetControlDetails;
  1672. }
  1673. else {
  1674. alias mixerGetControlDetailsA mixerGetControlDetails;
  1675. }
  1676. const auto MIXER_GETCONTROLDETAILSF_VALUE = 0x00000000L;
  1677. const auto MIXER_GETCONTROLDETAILSF_LISTTEXT = 0x00000001L;
  1678. const auto MIXER_GETCONTROLDETAILSF_QUERYMASK = 0x0000000FL;
  1679. MMRESULT mixerSetControlDetails( HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
  1680. const auto MIXER_SETCONTROLDETAILSF_VALUE = 0x00000000L;
  1681. const auto MIXER_SETCONTROLDETAILSF_CUSTOM = 0x00000001L;
  1682. const auto MIXER_SETCONTROLDETAILSF_QUERYMASK = 0x0000000FL;
  1683. }
  1684. /****************************************************************************
  1685. Timer support
  1686. ****************************************************************************/
  1687. version(MMNOTIMER) {
  1688. }
  1689. else {
  1690. /* timer error return values */
  1691. const auto TIMERR_NOERROR = (0) ; /* no error */
  1692. const auto TIMERR_NOCANDO = (TIMERR_BASE+1) ; /* request not completed */
  1693. const auto TIMERR_STRUCT = (TIMERR_BASE+33) ; /* time align(2) struct size */
  1694. /* timer data types */
  1695. alias void function(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) TIMECALLBACK;
  1696. alias TIMECALLBACK *LPTIMECALLBACK;
  1697. /* flags for fuEvent parameter of timeSetEvent() function */
  1698. const auto TIME_ONESHOT = 0x0000 ; /* program timer for single event */
  1699. const auto TIME_PERIODIC = 0x0001 ; /* program for continuous periodic event */
  1700. const auto TIME_CALLBACK_FUNCTION = 0x0000 ; /* callback is function */
  1701. const auto TIME_CALLBACK_EVENT_SET = 0x0010 ; /* callback is event - use SetEvent */
  1702. const auto TIME_CALLBACK_EVENT_PULSE = 0x0020 ; /* callback is event - use PulseEvent */
  1703. const auto TIME_KILL_SYNCHRONOUS = 0x0100 ; /* This flag prevents the event from occurring */
  1704. /* after the user calls timeKillEvent() to */
  1705. /* destroy it. */
  1706. /* timer device capabilities data align(2) structure */
  1707. align(2) struct TIMECAPS {
  1708. UINT wPeriodMin; /* minimum period supported */
  1709. UINT wPeriodMax; /* maximum period supported */
  1710. }
  1711. alias TIMECAPS* PTIMECAPS;
  1712. alias TIMECAPS *NPTIMECAPS;
  1713. alias TIMECAPS* LPTIMECAPS;
  1714. /* timer function prototypes */
  1715. MMRESULT timeGetSystemTime( LPMMTIME pmmt, UINT cbmmt);
  1716. DWORD timeGetTime();
  1717. MMRESULT timeSetEvent( UINT uDelay, UINT uResolution,
  1718. LPTIMECALLBACK fptc, DWORD_PTR dwUser, UINT fuEvent);
  1719. MMRESULT timeKillEvent( UINT uTimerID);
  1720. MMRESULT timeGetDevCaps( LPTIMECAPS ptc, UINT cbtc);
  1721. MMRESULT timeBeginPeriod( UINT uPeriod);
  1722. MMRESULT timeEndPeriod( UINT uPeriod);
  1723. }
  1724. /****************************************************************************
  1725. Joystick support
  1726. ****************************************************************************/
  1727. version(MMNOJOY) {
  1728. }
  1729. else {
  1730. /* joystick error return values */
  1731. const auto JOYERR_NOERROR = (0) ; /* no error */
  1732. const auto JOYERR_PARMS = (JOYERR_BASE+5) ; /* bad parameters */
  1733. const auto JOYERR_NOCANDO = (JOYERR_BASE+6) ; /* request not completed */
  1734. const auto JOYERR_UNPLUGGED = (JOYERR_BASE+7) ; /* joystick is unplugged */
  1735. /* constants used with JOYINFO and JOYINFOEX align(2) structures and MM_JOY* messages */
  1736. const auto JOY_BUTTON1 = 0x0001;
  1737. const auto JOY_BUTTON2 = 0x0002;
  1738. const auto JOY_BUTTON3 = 0x0004;
  1739. const auto JOY_BUTTON4 = 0x0008;
  1740. const auto JOY_BUTTON1CHG = 0x0100;
  1741. const auto JOY_BUTTON2CHG = 0x0200;
  1742. const auto JOY_BUTTON3CHG = 0x0400;
  1743. const auto JOY_BUTTON4CHG = 0x0800;
  1744. /* constants used with JOYINFOEX */
  1745. const auto JOY_BUTTON5 = 0x00000010;
  1746. const auto JOY_BUTTON6 = 0x00000020;
  1747. const auto JOY_BUTTON7 = 0x00000040;
  1748. const auto JOY_BUTTON8 = 0x00000080;
  1749. const auto JOY_BUTTON9 = 0x00000100;
  1750. const auto JOY_BUTTON10 = 0x00000200;
  1751. const auto JOY_BUTTON11 = 0x00000400;
  1752. const auto JOY_BUTTON12 = 0x00000800;
  1753. const auto JOY_BUTTON13 = 0x00001000;
  1754. const auto JOY_BUTTON14 = 0x00002000;
  1755. const auto JOY_BUTTON15 = 0x00004000;
  1756. const auto JOY_BUTTON16 = 0x00008000;
  1757. const auto JOY_BUTTON17 = 0x00010000;
  1758. const auto JOY_BUTTON18 = 0x00020000;
  1759. const auto JOY_BUTTON19 = 0x00040000;
  1760. const auto JOY_BUTTON20 = 0x00080000;
  1761. const auto JOY_BUTTON21 = 0x00100000;
  1762. const auto JOY_BUTTON22 = 0x00200000;
  1763. const auto JOY_BUTTON23 = 0x00400000;
  1764. const auto JOY_BUTTON24 = 0x00800000;
  1765. const auto JOY_BUTTON25 = 0x01000000;
  1766. const auto JOY_BUTTON26 = 0x02000000;
  1767. const auto JOY_BUTTON27 = 0x04000000;
  1768. const auto JOY_BUTTON28 = 0x08000000;
  1769. const auto JOY_BUTTON29 = 0x10000000;
  1770. const auto JOY_BUTTON30 = 0x20000000;
  1771. const auto JOY_BUTTON31 = 0x40000000;
  1772. const auto JOY_BUTTON32 = 0x80000000;
  1773. /* constants used with JOYINFOEX align(2) structure */
  1774. const auto JOY_POVCENTERED = cast(WORD) -1;
  1775. const auto JOY_POVFORWARD = 0;
  1776. const auto JOY_POVRIGHT = 9000;
  1777. const auto JOY_POVBACKWARD = 18000;
  1778. const auto JOY_POVLEFT = 27000;
  1779. const auto JOY_RETURNX = 0x00000001;
  1780. const auto JOY_RETURNY = 0x00000002;
  1781. const auto JOY_RETURNZ = 0x00000004;
  1782. const auto JOY_RETURNR = 0x00000008;
  1783. const auto JOY_RETURNU = 0x00000010 ; /* axis 5 */
  1784. const auto JOY_RETURNV = 0x00000020 ; /* axis 6 */
  1785. const auto JOY_RETURNPOV = 0x00000040;
  1786. const auto JOY_RETURNBUTTONS = 0x00000080;
  1787. const auto JOY_RETURNRAWDATA = 0x00000100;
  1788. const auto JOY_RETURNPOVCTS = 0x00000200;
  1789. const auto JOY_RETURNCENTERED = 0x00000400;
  1790. const auto JOY_USEDEADZONE = 0x00000800;
  1791. const auto JOY_RETURNALL = (JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ |
  1792. JOY_RETURNR | JOY_RETURNU | JOY_RETURNV |
  1793. JOY_RETURNPOV | JOY_RETURNBUTTONS);
  1794. const auto JOY_CAL_READALWAYS = 0x00010000;
  1795. const auto JOY_CAL_READXYONLY = 0x00020000;
  1796. const auto JOY_CAL_READ3 = 0x00040000;
  1797. const auto JOY_CAL_READ4 = 0x00080000;
  1798. const auto JOY_CAL_READXONLY = 0x00100000;
  1799. const auto JOY_CAL_READYONLY = 0x00200000;
  1800. const auto JOY_CAL_READ5 = 0x00400000;
  1801. const auto JOY_CAL_READ6 = 0x00800000;
  1802. const auto JOY_CAL_READZONLY = 0x01000000;
  1803. const auto JOY_CAL_READRONLY = 0x02000000;
  1804. const auto JOY_CAL_READUONLY = 0x04000000;
  1805. const auto JOY_CAL_READVONLY = 0x08000000;
  1806. /* joystick ID constants */
  1807. const auto JOYSTICKID1 = 0;
  1808. const auto JOYSTICKID2 = 1;
  1809. /* joystick driver capabilites */
  1810. const auto JOYCAPS_HASZ = 0x0001;
  1811. const auto JOYCAPS_HASR = 0x0002;
  1812. const auto JOYCAPS_HASU = 0x0004;
  1813. const auto JOYCAPS_HASV = 0x0008;
  1814. const auto JOYCAPS_HASPOV = 0x0010;
  1815. const auto JOYCAPS_POV4DIR = 0x0020;
  1816. const auto JOYCAPS_POVCTS = 0x0040;
  1817. /* joystick device capabilities data align(2) structure */
  1818. align(2) struct JOYCAPSA {
  1819. WORD wMid; /* manufacturer ID */
  1820. WORD wPid; /* product ID */
  1821. CHAR[MAXPNAMELEN] szPname;/* product name (NULL terminated string) */
  1822. UINT wXmin; /* minimum x position value */
  1823. UINT wXmax; /* maximum x position value */
  1824. UINT wYmin; /* minimum y position value */
  1825. UINT wYmax; /* maximum y position value */
  1826. UINT wZmin; /* minimum z position value */
  1827. UINT wZmax; /* maximum z position value */
  1828. UINT wNumButtons; /* number of buttons */
  1829. UINT wPeriodMin; /* minimum message period when captured */
  1830. UINT wPeriodMax; /* maximum message period when captured */
  1831. UINT wRmin; /* minimum r position value */
  1832. UINT wRmax; /* maximum r position value */
  1833. UINT wUmin; /* minimum u (5th axis) position value */
  1834. UINT wUmax; /* maximum u (5th axis) position value */
  1835. UINT wVmin; /* minimum v (6th axis) position value */
  1836. UINT wVmax; /* maximum v (6th axis) position value */
  1837. UINT wCaps; /* joystick capabilites */
  1838. UINT wMaxAxes; /* maximum number of axes supported */
  1839. UINT wNumAxes; /* number of axes in use */
  1840. UINT wMaxButtons; /* maximum number of buttons supported */
  1841. CHAR[MAXPNAMELEN] szRegKey;/* registry key */
  1842. CHAR[MAX_JOYSTICKOEMVXDNAME] szOEMVxD; /* OEM VxD in use */
  1843. }
  1844. alias JOYCAPSA* PJOYCAPSA;
  1845. alias JOYCAPSA* NPJOYCAPSA;
  1846. alias JOYCAPSA* LPJOYCAPSA;
  1847. align(2) struct JOYCAPSW {
  1848. WORD wMid; /* manufacturer ID */
  1849. WORD wPid; /* product ID */
  1850. WCHAR[MAXPNAMELEN] szPname;/* product name (NULL terminated string) */
  1851. UINT wXmin; /* minimum x position value */
  1852. UINT wXmax; /* maximum x position value */
  1853. UINT wYmin; /* minimum y position value */
  1854. UINT wYmax; /* maximum y position value */
  1855. UINT wZmin; /* minimum z position value */
  1856. UINT wZmax; /* maximum z position value */
  1857. UINT wNumButtons; /* number of buttons */
  1858. UINT wPeriodMin; /* minimum message period when captured */
  1859. UINT wPeriodMax; /* maximum message period when captured */
  1860. UINT wRmin; /* minimum r position value */
  1861. UINT wRmax; /* maximum r position value */
  1862. UINT wUmin; /* minimum u (5th axis) position value */
  1863. UINT wUmax; /* maximum u (5th axis) position value */
  1864. UINT wVmin; /* minimum v (6th axis) position value */
  1865. UINT wVmax; /* maximum v (6th axis) position value */
  1866. UINT wCaps; /* joystick capabilites */
  1867. UINT wMaxAxes; /* maximum number of axes supported */
  1868. UINT wNumAxes; /* number of axes in use */
  1869. UINT wMaxButtons; /* maximum number of buttons supported */
  1870. WCHAR[MAXPNAMELEN] szRegKey;/* registry key */
  1871. WCHAR[MAX_JOYSTICKOEMVXDNAME] szOEMVxD; /* OEM VxD in use */
  1872. }
  1873. alias JOYCAPSW* PJOYCAPSW;
  1874. alias JOYCAPSW* NPJOYCAPSW;
  1875. alias JOYCAPSW* LPJOYCAPSW;
  1876. version(UNICODE) {
  1877. alias JOYCAPSW JOYCAPS;
  1878. alias PJOYCAPSW PJOYCAPS;
  1879. alias NPJOYCAPSW NPJOYCAPS;
  1880. alias LPJOYCAPSW LPJOYCAPS;
  1881. }
  1882. else {
  1883. alias JOYCAPSA JOYCAPS;
  1884. alias PJOYCAPSA PJOYCAPS;
  1885. alias NPJOYCAPSA NPJOYCAPS;
  1886. alias LPJOYCAPSA LPJOYCAPS;
  1887. }
  1888. align(2) struct JOYCAPS2A {
  1889. WORD wMid; /* manufacturer ID */
  1890. WORD wPid; /* product ID */
  1891. CHAR[MAXPNAMELEN] szPname;/* product name (NULL terminated string) */
  1892. UINT wXmin; /* minimum x position value */
  1893. UINT wXmax; /* maximum x position value */
  1894. UINT wYmin; /* minimum y position value */
  1895. UINT wYmax; /* maximum y position value */
  1896. UINT wZmin; /* minimum z position value */
  1897. UINT wZmax; /* maximum z position value */
  1898. UINT wNumButtons; /* number of buttons */
  1899. UINT wPeriodMin; /* minimum message period when captured */
  1900. UINT wPeriodMax; /* maximum message period when captured */
  1901. UINT wRmin; /* minimum r position value */
  1902. UINT wRmax; /* maximum r position value */
  1903. UINT wUmin; /* minimum u (5th axis) position value */
  1904. UINT wUmax; /* maximum u (5th axis) position value */
  1905. UINT wVmin; /* minimum v (6th axis) position value */
  1906. UINT wVmax; /* maximum v (6th axis) position value */
  1907. UINT wCaps; /* joystick capabilites */
  1908. UINT wMaxAxes; /* maximum number of axes supported */
  1909. UINT wNumAxes; /* number of axes in use */
  1910. UINT wMaxButtons; /* maximum number of buttons supported */
  1911. CHAR[MAXPNAMELEN] szRegKey;/* registry key */
  1912. CHAR[MAX_JOYSTICKOEMVXDNAME] szOEMVxD; /* OEM VxD in use */
  1913. GUID ManufacturerGuid; /* for extensible MID mapping */
  1914. GUID ProductGuid; /* for extensible PID mapping */
  1915. GUID NameGuid; /* for name lookup in registry */
  1916. }
  1917. alias JOYCAPS2A* PJOYCAPS2A;
  1918. alias JOYCAPS2A* NPJOYCAPS2A;
  1919. alias JOYCAPS2A* LPJOYCAPS2A;
  1920. align(2) struct JOYCAPS2W {
  1921. WORD wMid; /* manufacturer ID */
  1922. WORD wPid; /* product ID */
  1923. WCHAR[MAXPNAMELEN] szPname;/* product name (NULL terminated string) */
  1924. UINT wXmin; /* minimum x position value */
  1925. UINT wXmax; /* maximum x position value */
  1926. UINT wYmin; /* minimum y position value */
  1927. UINT wYmax; /* maximum y position value */
  1928. UINT wZmin; /* minimum z position value */
  1929. UINT wZmax; /* maximum z position value */
  1930. UINT wNumButtons; /* number of buttons */
  1931. UINT wPeriodMin; /* minimum message period when captured */
  1932. UINT wPeriodMax; /* maximum message period when captured */
  1933. UINT wRmin; /* minimum r position value */
  1934. UINT wRmax; /* maximum r position value */
  1935. UINT wUmin; /* minimum u (5th axis) position value */
  1936. UINT wUmax; /* maximum u (5th axis) position value */
  1937. UINT wVmin; /* minimum v (6th axis) position value */
  1938. UINT wVmax; /* maximum v (6th axis) position value */
  1939. UINT wCaps; /* joystick capabilites */
  1940. UINT wMaxAxes; /* maximum number of axes supported */
  1941. UINT wNumAxes; /* number of axes in use */
  1942. UINT wMaxButtons; /* maximum number of buttons supported */
  1943. WCHAR[MAXPNAMELEN] szRegKey;/* registry key */
  1944. WCHAR[MAX_JOYSTICKOEMVXDNAME] szOEMVxD; /* OEM VxD in use */
  1945. GUID ManufacturerGuid; /* for extensible MID mapping */
  1946. GUID ProductGuid; /* for extensible PID mapping */
  1947. GUID NameGuid; /* for name lookup in registry */
  1948. }
  1949. alias JOYCAPS2W* PJOYCAPS2W;
  1950. alias JOYCAPS2W* NPJOYCAPS2W;
  1951. alias JOYCAPS2W* LPJOYCAPS2W;
  1952. version(UNICODE) {
  1953. alias JOYCAPS2W JOYCAPS2;
  1954. alias PJOYCAPS2W PJOYCAPS2;
  1955. alias NPJOYCAPS2W NPJOYCAPS2;
  1956. alias LPJOYCAPS2W LPJOYCAPS2;
  1957. }
  1958. else {
  1959. alias JOYCAPS2A JOYCAPS2;
  1960. alias PJOYCAPS2A PJOYCAPS2;
  1961. alias NPJOYCAPS2A NPJOYCAPS2;
  1962. alias LPJOYCAPS2A LPJOYCAPS2;
  1963. }
  1964. /* joystick information data align(2) structure */
  1965. align(2) struct JOYINFO {
  1966. UINT wXpos; /* x position */
  1967. UINT wYpos; /* y position */
  1968. UINT wZpos; /* z position */
  1969. UINT wButtons; /* button states */
  1970. }
  1971. alias JOYINFO* PJOYINFO;
  1972. alias JOYINFO *NPJOYINFO;
  1973. alias JOYINFO* LPJOYINFO;
  1974. align(2) struct JOYINFOEX {
  1975. DWORD dwSize; /* size of align(2) structure */
  1976. DWORD dwFlags; /* flags to indicate what to return */
  1977. DWORD dwXpos; /* x position */
  1978. DWORD dwYpos; /* y position */
  1979. DWORD dwZpos; /* z position */
  1980. DWORD dwRpos; /* rudder/4th axis position */
  1981. DWORD dwUpos; /* 5th axis position */
  1982. DWORD dwVpos; /* 6th axis position */
  1983. DWORD dwButtons; /* button states */
  1984. DWORD dwButtonNumber; /* current button number pressed */
  1985. DWORD dwPOV; /* point of view state */
  1986. DWORD dwReserved1; /* reserved for communication between winmm & driver */
  1987. DWORD dwReserved2; /* reserved for future expansion */
  1988. }
  1989. alias JOYINFOEX* PJOYINFOEX;
  1990. alias JOYINFOEX *NPJOYINFOEX;
  1991. alias JOYINFOEX* LPJOYINFOEX;
  1992. /* joystick function prototypes */
  1993. UINT joyGetNumDevs();
  1994. MMRESULT joyGetDevCapsA( UINT_PTR uJoyID, LPJOYCAPSA pjc, UINT cbjc);
  1995. MMRESULT joyGetDevCapsW( UINT_PTR uJoyID, LPJOYCAPSW pjc, UINT cbjc);
  1996. version(UNICODE) {
  1997. alias joyGetDevCapsW joyGetDevCaps;
  1998. }
  1999. else {
  2000. alias joyGetDevCapsA joyGetDevCaps;
  2001. }
  2002. MMRESULT joyGetPosEx( UINT uJoyID, LPJOYINFOEX pji);
  2003. MMRESULT joyGetThreshold( UINT uJoyID, LPUINT puThreshold);
  2004. MMRESULT joyReleaseCapture( UINT uJoyID);
  2005. MMRESULT joySetCapture( HWND hwnd, UINT uJoyID, UINT uPeriod,
  2006. BOOL fChanged);
  2007. MMRESULT joySetThreshold( UINT uJoyID, UINT uThreshold);
  2008. }
  2009. /****************************************************************************
  2010. Multimedia File I/O support
  2011. ****************************************************************************/
  2012. version(MMNOMMIO) {
  2013. }
  2014. else {
  2015. /* MMIO error return values */
  2016. const auto MMIOERR_BASE = 256;
  2017. const auto MMIOERR_FILENOTFOUND = (MMIOERR_BASE + 1) ; /* file not found */
  2018. const auto MMIOERR_OUTOFMEMORY = (MMIOERR_BASE + 2) ; /* out of memory */
  2019. const auto MMIOERR_CANNOTOPEN = (MMIOERR_BASE + 3) ; /* cannot open */
  2020. const auto MMIOERR_CANNOTCLOSE = (MMIOERR_BASE + 4) ; /* cannot close */
  2021. const auto MMIOERR_CANNOTREAD = (MMIOERR_BASE + 5) ; /* cannot read */
  2022. const auto MMIOERR_CANNOTWRITE = (MMIOERR_BASE + 6) ; /* cannot write */
  2023. const auto MMIOERR_CANNOTSEEK = (MMIOERR_BASE + 7) ; /* cannot seek */
  2024. const auto MMIOERR_CANNOTEXPAND = (MMIOERR_BASE + 8) ; /* cannot expand file */
  2025. const auto MMIOERR_CHUNKNOTFOUND = (MMIOERR_BASE + 9) ; /* chunk not found */
  2026. const auto MMIOERR_UNBUFFERED = (MMIOERR_BASE + 10) ; /* */
  2027. const auto MMIOERR_PATHNOTFOUND = (MMIOERR_BASE + 11) ; /* path incorrect */
  2028. const auto MMIOERR_ACCESSDENIED = (MMIOERR_BASE + 12) ; /* file was protected */
  2029. const auto MMIOERR_SHARINGVIOLATION = (MMIOERR_BASE + 13) ; /* file in use */
  2030. const auto MMIOERR_NETWORKERROR = (MMIOERR_BASE + 14) ; /* network not responding */
  2031. const auto MMIOERR_TOOMANYOPENFILES = (MMIOERR_BASE + 15) ; /* no more file handles */
  2032. const auto MMIOERR_INVALIDFILE = (MMIOERR_BASE + 16) ; /* default error file error */
  2033. /* MMIO constants */
  2034. const auto CFSEPCHAR = '+' ; /* compound file name separator char. */
  2035. /* MMIO data types */
  2036. alias DWORD FOURCC; /* a four character code */
  2037. alias char* HPSTR; /* a huge version of LPSTR */
  2038. alias HANDLE HMMIO; /* a handle to an open file */
  2039. alias LRESULT function(LPSTR lpmmioinfo, UINT uMsg,
  2040. LPARAM lParam1, LPARAM lParam2) MMIOPROC;
  2041. alias MMIOPROC *LPMMIOPROC;
  2042. /* general MMIO information data align(2) structure */
  2043. align(2) struct MMIOINFO {
  2044. /* general fields */
  2045. DWORD dwFlags; /* general status flags */
  2046. FOURCC fccIOProc; /* pointer to I/O procedure */
  2047. LPMMIOPROC pIOProc; /* pointer to I/O procedure */
  2048. UINT wErrorRet; /* place for error to be returned */
  2049. HTASK htask; /* alternate local task */
  2050. /* fields maintained by MMIO functions during buffered I/O */
  2051. LONG cchBuffer; /* size of I/O buffer (or 0L) */
  2052. HPSTR pchBuffer; /* start of I/O buffer (or NULL) */
  2053. HPSTR pchNext; /* pointer to next byte to read/write */
  2054. HPSTR pchEndRead; /* pointer to last valid byte to read */
  2055. HPSTR pchEndWrite; /* pointer to last byte to write */
  2056. LONG lBufOffset; /* disk offset of start of buffer */
  2057. /* fields maintained by I/O procedure */
  2058. LONG lDiskOffset; /* disk offset of next read or write */
  2059. DWORD[3] adwInfo; /* data specific to type of MMIOPROC */
  2060. /* other fields maintained by MMIO */
  2061. DWORD dwReserved1; /* reserved for MMIO use */
  2062. DWORD dwReserved2; /* reserved for MMIO use */
  2063. HMMIO hmmio; /* handle to open file */
  2064. }
  2065. alias MMIOINFO* PMMIOINFO;
  2066. alias MMIOINFO *NPMMIOINFO;
  2067. alias MMIOINFO* LPMMIOINFO;
  2068. alias MMIOINFO *LPCMMIOINFO;
  2069. /* RIFF chunk information data align(2) structure */
  2070. align(2) struct MMCKINFO {
  2071. FOURCC ckid; /* chunk ID */
  2072. DWORD cksize; /* chunk size */
  2073. FOURCC fccType; /* form type or list type */
  2074. DWORD dwDataOffset; /* offset of data portion of chunk */
  2075. DWORD dwFlags; /* flags used by MMIO functions */
  2076. }
  2077. alias MMCKINFO* PMMCKINFO;
  2078. alias MMCKINFO *NPMMCKINFO;
  2079. alias MMCKINFO* LPMMCKINFO;
  2080. alias MMCKINFO *LPCMMCKINFO;
  2081. /* bit field masks */
  2082. const auto MMIO_RWMODE = 0x00000003 ; /* open file for reading/writing/both */
  2083. const auto MMIO_SHAREMODE = 0x00000070 ; /* file sharing mode number */
  2084. /* constants for dwFlags field of MMIOINFO */
  2085. const auto MMIO_CREATE = 0x00001000 ; /* create new file (or truncate file) */
  2086. const auto MMIO_PARSE = 0x00000100 ; /* parse new file returning path */
  2087. const auto MMIO_DELETE = 0x00000200 ; /* create new file (or truncate file) */
  2088. const auto MMIO_EXIST = 0x00004000 ; /* checks for existence of file */
  2089. const auto MMIO_ALLOCBUF = 0x00010000 ; /* mmioOpen() should allocate a buffer */
  2090. const auto MMIO_GETTEMP = 0x00020000 ; /* mmioOpen() should retrieve temp name */
  2091. const auto MMIO_DIRTY = 0x10000000 ; /* I/O buffer is dirty */
  2092. /* read/write mode numbers (bit field MMIO_RWMODE) */
  2093. const auto MMIO_READ = 0x00000000 ; /* open file for reading only */
  2094. const auto MMIO_WRITE = 0x00000001 ; /* open file for writing only */
  2095. const auto MMIO_READWRITE = 0x00000002 ; /* open file for reading and writing */
  2096. /* share mode numbers (bit field MMIO_SHAREMODE) */
  2097. const auto MMIO_COMPAT = 0x00000000 ; /* compatibility mode */
  2098. const auto MMIO_EXCLUSIVE = 0x00000010 ; /* exclusive-access mode */
  2099. const auto MMIO_DENYWRITE = 0x00000020 ; /* deny writing to other processes */
  2100. const auto MMIO_DENYREAD = 0x00000030 ; /* deny reading to other processes */
  2101. const auto MMIO_DENYNONE = 0x00000040 ; /* deny nothing to other processes */
  2102. /* various MMIO flags */
  2103. const auto MMIO_FHOPEN = 0x0010 ; /* mmioClose: keep file handle open */
  2104. const auto MMIO_EMPTYBUF = 0x0010 ; /* mmioFlush: empty the I/O buffer */
  2105. const auto MMIO_TOUPPER = 0x0010 ; /* mmioStringToFOURCC: to u-case */
  2106. const auto MMIO_INSTALLPROC = 0x00010000 ; /* mmioInstallIOProc: install MMIOProc */
  2107. const auto MMIO_GLOBALPROC = 0x10000000 ; /* mmioInstallIOProc: install globally */
  2108. const auto MMIO_REMOVEPROC = 0x00020000 ; /* mmioInstallIOProc: remove MMIOProc */
  2109. const auto MMIO_UNICODEPROC = 0x01000000 ; /* mmioInstallIOProc: Unicode MMIOProc */
  2110. const auto MMIO_FINDPROC = 0x00040000 ; /* mmioInstallIOProc: find an MMIOProc */
  2111. const auto MMIO_FINDCHUNK = 0x0010 ; /* mmioDescend: find a chunk by ID */
  2112. const auto MMIO_FINDRIFF = 0x0020 ; /* mmioDescend: find a LIST chunk */
  2113. const auto MMIO_FINDLIST = 0x0040 ; /* mmioDescend: find a RIFF chunk */
  2114. const auto MMIO_CREATERIFF = 0x0020 ; /* mmioCreateChunk: make a LIST chunk */
  2115. const auto MMIO_CREATELIST = 0x0040 ; /* mmioCreateChunk: make a RIFF chunk */
  2116. /* message numbers for MMIOPROC I/O procedure functions */
  2117. const auto MMIOM_READ = MMIO_READ ; /* read */
  2118. const auto MMIOM_WRITE = MMIO_WRITE ; /* write */
  2119. const auto MMIOM_SEEK = 2 ; /* seek to a new position in file */
  2120. const auto MMIOM_OPEN = 3 ; /* open file */
  2121. const auto MMIOM_CLOSE = 4 ; /* close file */
  2122. const auto MMIOM_WRITEFLUSH = 5 ; /* write and flush */
  2123. const auto MMIOM_RENAME = 6 ; /* rename specified file */
  2124. const auto MMIOM_USER = 0x8000 ; /* beginning of user-defined messages */
  2125. /* MMIO macros */
  2126. template mmioFOURCC(char ch0, char ch1, char ch2, char ch3) {
  2127. const auto mmioFOURCC = MAKEFOURCC!(ch0,ch1,ch2,ch3);
  2128. }
  2129. /* standard four character codes */
  2130. const auto FOURCC_RIFF = mmioFOURCC!('R', 'I', 'F', 'F');
  2131. const auto FOURCC_LIST = mmioFOURCC!('L', 'I', 'S', 'T');
  2132. /* four character codes used to identify standard built-in I/O procedures */
  2133. const auto FOURCC_DOS = mmioFOURCC!('D', 'O', 'S', ' ');
  2134. const auto FOURCC_MEM = mmioFOURCC!('M', 'E', 'M', ' ');
  2135. /* flags for mmioSeek() */
  2136. const auto SEEK_SET = 0 ; /* seek to an absolute position */
  2137. const auto SEEK_CUR = 1 ; /* seek relative to current position */
  2138. const auto SEEK_END = 2 ; /* seek relative to end of file */
  2139. /* other constants */
  2140. const auto MMIO_DEFAULTBUFFER = 8192 ; /* default buffer size */
  2141. /* MMIO function prototypes */
  2142. FOURCC mmioStringToFOURCCA( LPCSTR sz, UINT uFlags);
  2143. FOURCC mmioStringToFOURCCW( LPCWSTR sz, UINT uFlags);
  2144. version(UNICODE) {
  2145. alias mmioStringToFOURCCW mmioStringToFOURCC;
  2146. }
  2147. else {
  2148. alias mmioStringToFOURCCA mmioStringToFOURCC;
  2149. }
  2150. LPMMIOPROC mmioInstallIOProcA( FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
  2151. LPMMIOPROC mmioInstallIOProcW( FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
  2152. version(UNICODE) {
  2153. alias mmioInstallIOProcW mmioInstallIOProc;
  2154. }
  2155. else {
  2156. alias mmioInstallIOProcA mmioInstallIOProc;
  2157. }
  2158. HMMIO mmioOpenA( LPSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
  2159. HMMIO mmioOpenW( LPWSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
  2160. version(UNICODE) {
  2161. alias mmioOpenW mmioOpen;
  2162. }
  2163. else {
  2164. alias mmioOpenA mmioOpen;
  2165. }
  2166. MMRESULT mmioRenameA( LPCSTR pszFileName, LPCSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename);
  2167. MMRESULT mmioRenameW( LPCWSTR pszFileName, LPCWSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename);
  2168. version(UNICODE) {
  2169. alias mmioRenameW mmioRename;
  2170. }
  2171. else {
  2172. alias mmioRenameA mmioRename;
  2173. }
  2174. MMRESULT mmioClose( HMMIO hmmio, UINT fuClose);
  2175. LONG mmioRead( HMMIO hmmio, HPSTR pch, LONG cch);
  2176. LONG mmioWrite( HMMIO hmmio, char* pch, LONG cch);
  2177. LONG mmioSeek( HMMIO hmmio, LONG lOffset, int iOrigin);
  2178. MMRESULT mmioGetInfo( HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuInfo);
  2179. MMRESULT mmioSetInfo( HMMIO hmmio, LPCMMIOINFO pmmioinfo, UINT fuInfo);
  2180. MMRESULT mmioSetBuffer( HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer,
  2181. UINT fuBuffer);
  2182. MMRESULT mmioFlush( HMMIO hmmio, UINT fuFlush);
  2183. MMRESULT mmioAdvance( HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuAdvance);
  2184. LRESULT mmioSendMessage( HMMIO hmmio, UINT uMsg,
  2185. LPARAM lParam1, LPARAM lParam2);
  2186. MMRESULT mmioDescend( HMMIO hmmio, LPMMCKINFO pmmcki,
  2187. MMCKINFO* pmmckiParent, UINT fuDescend);
  2188. MMRESULT mmioAscend( HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuAscend);
  2189. MMRESULT mmioCreateChunk(HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuCreate);
  2190. }
  2191. /****************************************************************************
  2192. MCI support
  2193. ****************************************************************************/
  2194. version(MMNOMCI) {
  2195. }
  2196. else {
  2197. alias DWORD MCIERROR; /* error return code, 0 means no error */
  2198. alias UINT MCIDEVICEID; /* MCI device ID type */
  2199. alias UINT function(MCIDEVICEID mciId, DWORD dwYieldData) YIELDPROC;
  2200. /* MCI function prototypes */
  2201. MCIERROR mciSendCommandA( MCIDEVICEID mciId, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
  2202. MCIERROR mciSendCommandW( MCIDEVICEID mciId, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
  2203. version(UNICODE) {
  2204. alias mciSendCommandW mciSendCommand;
  2205. }
  2206. else {
  2207. alias mciSendCommandA mciSendCommand;
  2208. }
  2209. MCIERROR mciSendStringA( LPCSTR lpstrCommand, LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
  2210. MCIERROR mciSendStringW( LPCWSTR lpstrCommand, LPWSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
  2211. version(UNICODE) {
  2212. alias mciSendStringW mciSendString;
  2213. }
  2214. else {
  2215. alias mciSendStringA mciSendString;
  2216. }
  2217. MCIDEVICEID mciGetDeviceIDA( LPCSTR pszDevice);
  2218. MCIDEVICEID mciGetDeviceIDW( LPCWSTR pszDevice);
  2219. version(UNICODE) {
  2220. alias mciGetDeviceIDW mciGetDeviceID;
  2221. }
  2222. else {
  2223. alias mciGetDeviceIDA mciGetDeviceID;
  2224. }
  2225. MCIDEVICEID mciGetDeviceIDFromElementIDA( DWORD dwElementID, LPCSTR lpstrType );
  2226. MCIDEVICEID mciGetDeviceIDFromElementIDW( DWORD dwElementID, LPCWSTR lpstrType );
  2227. version(UNICODE) {
  2228. alias mciGetDeviceIDFromElementIDW mciGetDeviceIDFromElementID;
  2229. }
  2230. else {
  2231. alias mciGetDeviceIDFromElementIDA mciGetDeviceIDFromElementID;
  2232. }
  2233. BOOL mciGetErrorStringA( MCIERROR mcierr, LPSTR pszText, UINT cchText);
  2234. BOOL mciGetErrorStringW( MCIERROR mcierr, LPWSTR pszText, UINT cchText);
  2235. version(UNICODE) {
  2236. alias mciGetErrorStringW mciGetErrorString;
  2237. }
  2238. else {
  2239. alias mciGetErrorStringA mciGetErrorString;
  2240. }
  2241. BOOL mciSetYieldProc( MCIDEVICEID mciId, YIELDPROC fpYieldProc,
  2242. DWORD dwYieldData);
  2243. HTASK mciGetCreatorTask( MCIDEVICEID mciId);
  2244. YIELDPROC mciGetYieldProc( MCIDEVICEID mciId, LPDWORD pdwYieldData);
  2245. BOOL mciExecute(LPCSTR pszCommand);
  2246. /* MCI error return values */
  2247. const auto MCIERR_INVALID_DEVICE_ID = (MCIERR_BASE + 1);
  2248. const auto MCIERR_UNRECOGNIZED_KEYWORD = (MCIERR_BASE + 3);
  2249. const auto MCIERR_UNRECOGNIZED_COMMAND = (MCIERR_BASE + 5);
  2250. const auto MCIERR_HARDWARE = (MCIERR_BASE + 6);
  2251. const auto MCIERR_INVALID_DEVICE_NAME = (MCIERR_BASE + 7);
  2252. const auto MCIERR_OUT_OF_MEMORY = (MCIERR_BASE + 8);
  2253. const auto MCIERR_DEVICE_OPEN = (MCIERR_BASE + 9);
  2254. const auto MCIERR_CANNOT_LOAD_DRIVER = (MCIERR_BASE + 10);
  2255. const auto MCIERR_MISSING_COMMAND_STRING = (MCIERR_BASE + 11);
  2256. const auto MCIERR_PARAM_OVERFLOW = (MCIERR_BASE + 12);
  2257. const auto MCIERR_MISSING_STRING_ARGUMENT = (MCIERR_BASE + 13);
  2258. const auto MCIERR_BAD_INTEGER = (MCIERR_BASE + 14);
  2259. const auto MCIERR_PARSER_INTERNAL = (MCIERR_BASE + 15);
  2260. const auto MCIERR_DRIVER_INTERNAL = (MCIERR_BASE + 16);
  2261. const auto MCIERR_MISSING_PARAMETER = (MCIERR_BASE + 17);
  2262. const auto MCIERR_UNSUPPORTED_FUNCTION = (MCIERR_BASE + 18);
  2263. const auto MCIERR_FILE_NOT_FOUND = (MCIERR_BASE + 19);
  2264. const auto MCIERR_DEVICE_NOT_READY = (MCIERR_BASE + 20);
  2265. const auto MCIERR_INTERNAL = (MCIERR_BASE + 21);
  2266. const auto MCIERR_DRIVER = (MCIERR_BASE + 22);
  2267. const auto MCIERR_CANNOT_USE_ALL = (MCIERR_BASE + 23);
  2268. const auto MCIERR_MULTIPLE = (MCIERR_BASE + 24);
  2269. const auto MCIERR_EXTENSION_NOT_FOUND = (MCIERR_BASE + 25);
  2270. const auto MCIERR_OUTOFRANGE = (MCIERR_BASE + 26);
  2271. const auto MCIERR_FLAGS_NOT_COMPATIBLE = (MCIERR_BASE + 28);
  2272. const auto MCIERR_FILE_NOT_SAVED = (MCIERR_BASE + 30);
  2273. const auto MCIERR_DEVICE_TYPE_REQUIRED = (MCIERR_BASE + 31);
  2274. const auto MCIERR_DEVICE_LOCKED = (MCIERR_BASE + 32);
  2275. const auto MCIERR_DUPLICATE_ALIAS = (MCIERR_BASE + 33);
  2276. const auto MCIERR_BAD_CONSTANT = (MCIERR_BASE + 34);
  2277. const auto MCIERR_MUST_USE_SHAREABLE = (MCIERR_BASE + 35);
  2278. const auto MCIERR_MISSING_DEVICE_NAME = (MCIERR_BASE + 36);
  2279. const auto MCIERR_BAD_TIME_FORMAT = (MCIERR_BASE + 37);
  2280. const auto MCIERR_NO_CLOSING_QUOTE = (MCIERR_BASE + 38);
  2281. const auto MCIERR_DUPLICATE_FLAGS = (MCIERR_BASE + 39);
  2282. const auto MCIERR_INVALID_FILE = (MCIERR_BASE + 40);
  2283. const auto MCIERR_NULL_PARAMETER_BLOCK = (MCIERR_BASE + 41);
  2284. const auto MCIERR_UNNAMED_RESOURCE = (MCIERR_BASE + 42);
  2285. const auto MCIERR_NEW_REQUIRES_ALIAS = (MCIERR_BASE + 43);
  2286. const auto MCIERR_NOTIFY_ON_AUTO_OPEN = (MCIERR_BASE + 44);
  2287. const auto MCIERR_NO_ELEMENT_ALLOWED = (MCIERR_BASE + 45);
  2288. const auto MCIERR_NONAPPLICABLE_FUNCTION = (MCIERR_BASE + 46);
  2289. const auto MCIERR_ILLEGAL_FOR_AUTO_OPEN = (MCIERR_BASE + 47);
  2290. const auto MCIERR_FILENAME_REQUIRED = (MCIERR_BASE + 48);
  2291. const auto MCIERR_EXTRA_CHARACTERS = (MCIERR_BASE + 49);
  2292. const auto MCIERR_DEVICE_NOT_INSTALLED = (MCIERR_BASE + 50);
  2293. const auto MCIERR_GET_CD = (MCIERR_BASE + 51);
  2294. const auto MCIERR_SET_CD = (MCIERR_BASE + 52);
  2295. const auto MCIERR_SET_DRIVE = (MCIERR_BASE + 53);
  2296. const auto MCIERR_DEVICE_LENGTH = (MCIERR_BASE + 54);
  2297. const auto MCIERR_DEVICE_ORD_LENGTH = (MCIERR_BASE + 55);
  2298. const auto MCIERR_NO_INTEGER = (MCIERR_BASE + 56);
  2299. const auto MCIERR_WAVE_OUTPUTSINUSE = (MCIERR_BASE + 64);
  2300. const auto MCIERR_WAVE_SETOUTPUTINUSE = (MCIERR_BASE + 65);
  2301. const auto MCIERR_WAVE_INPUTSINUSE = (MCIERR_BASE + 66);
  2302. const auto MCIERR_WAVE_SETINPUTINUSE = (MCIERR_BASE + 67);
  2303. const auto MCIERR_WAVE_OUTPUTUNSPECIFIED = (MCIERR_BASE + 68);
  2304. const auto MCIERR_WAVE_INPUTUNSPECIFIED = (MCIERR_BASE + 69);
  2305. const auto MCIERR_WAVE_OUTPUTSUNSUITABLE = (MCIERR_BASE + 70);
  2306. const auto MCIERR_WAVE_SETOUTPUTUNSUITABLE = (MCIERR_BASE + 71);
  2307. const auto MCIERR_WAVE_INPUTSUNSUITABLE = (MCIERR_BASE + 72);
  2308. const auto MCIERR_WAVE_SETINPUTUNSUITABLE = (MCIERR_BASE + 73);
  2309. const auto MCIERR_SEQ_DIV_INCOMPATIBLE = (MCIERR_BASE + 80);
  2310. const auto MCIERR_SEQ_PORT_INUSE = (MCIERR_BASE + 81);
  2311. const auto MCIERR_SEQ_PORT_NONEXISTENT = (MCIERR_BASE + 82);
  2312. const auto MCIERR_SEQ_PORT_MAPNODEVICE = (MCIERR_BASE + 83);
  2313. const auto MCIERR_SEQ_PORT_MISCERROR = (MCIERR_BASE + 84);
  2314. const auto MCIERR_SEQ_TIMER = (MCIERR_BASE + 85);
  2315. const auto MCIERR_SEQ_PORTUNSPECIFIED = (MCIERR_BASE + 86);
  2316. const auto MCIERR_SEQ_NOMIDIPRESENT = (MCIERR_BASE + 87);
  2317. const auto MCIERR_NO_WINDOW = (MCIERR_BASE + 90);
  2318. const auto MCIERR_CREATEWINDOW = (MCIERR_BASE + 91);
  2319. const auto MCIERR_FILE_READ = (MCIERR_BASE + 92);
  2320. const auto MCIERR_FILE_WRITE = (MCIERR_BASE + 93);
  2321. const auto MCIERR_NO_IDENTITY = (MCIERR_BASE + 94);
  2322. /* all custom device driver errors must be >= than this value */
  2323. const auto MCIERR_CUSTOM_DRIVER_BASE = (MCIERR_BASE + 256);
  2324. const auto MCI_FIRST = DRV_MCI_FIRST ; /* 0x0800 */
  2325. /* MCI command message identifiers */
  2326. const auto MCI_OPEN = 0x0803;
  2327. const auto MCI_CLOSE = 0x0804;
  2328. const auto MCI_ESCAPE = 0x0805;
  2329. const auto MCI_PLAY = 0x0806;
  2330. const auto MCI_SEEK = 0x0807;
  2331. const auto MCI_STOP = 0x0808;
  2332. const auto MCI_PAUSE = 0x0809;
  2333. const auto MCI_INFO = 0x080A;
  2334. const auto MCI_GETDEVCAPS = 0x080B;
  2335. const auto MCI_SPIN = 0x080C;
  2336. const auto MCI_SET = 0x080D;
  2337. const auto MCI_STEP = 0x080E;
  2338. const auto MCI_RECORD = 0x080F;
  2339. const auto MCI_SYSINFO = 0x0810;
  2340. const auto MCI_BREAK = 0x0811;
  2341. const auto MCI_SAVE = 0x0813;
  2342. const auto MCI_STATUS = 0x0814;
  2343. const auto MCI_CUE = 0x0830;
  2344. const auto MCI_REALIZE = 0x0840;
  2345. const auto MCI_WINDOW = 0x0841;
  2346. const auto MCI_PUT = 0x0842;
  2347. const auto MCI_WHERE = 0x0843;
  2348. const auto MCI_FREEZE = 0x0844;
  2349. const auto MCI_UNFREEZE = 0x0845;
  2350. const auto MCI_LOAD = 0x0850;
  2351. const auto MCI_CUT = 0x0851;
  2352. const auto MCI_COPY = 0x0852;
  2353. const auto MCI_PASTE = 0x0853;
  2354. const auto MCI_UPDATE = 0x0854;
  2355. const auto MCI_RESUME = 0x0855;
  2356. const auto MCI_DELETE = 0x0856;
  2357. /* all custom MCI command messages must be >= than this value */
  2358. const auto MCI_USER_MESSAGES = (DRV_MCI_FIRST + 0x400);
  2359. const auto MCI_LAST = 0x0FFF;
  2360. /* device ID for "all devices" */
  2361. const auto MCI_ALL_DEVICE_ID = (cast(MCIDEVICEID)-1);
  2362. /* constants for predefined MCI device types */
  2363. const auto MCI_DEVTYPE_VCR = 513 ; /* (MCI_STRING_OFFSET + 1) */
  2364. const auto MCI_DEVTYPE_VIDEODISC = 514 ; /* (MCI_STRING_OFFSET + 2) */
  2365. const auto MCI_DEVTYPE_OVERLAY = 515 ; /* (MCI_STRING_OFFSET + 3) */
  2366. const auto MCI_DEVTYPE_CD_AUDIO = 516 ; /* (MCI_STRING_OFFSET + 4) */
  2367. const auto MCI_DEVTYPE_DAT = 517 ; /* (MCI_STRING_OFFSET + 5) */
  2368. const auto MCI_DEVTYPE_SCANNER = 518 ; /* (MCI_STRING_OFFSET + 6) */
  2369. const auto MCI_DEVTYPE_ANIMATION = 519 ; /* (MCI_STRING_OFFSET + 7) */
  2370. const auto MCI_DEVTYPE_DIGITAL_VIDEO = 520 ; /* (MCI_STRING_OFFSET + 8) */
  2371. const auto MCI_DEVTYPE_OTHER = 521 ; /* (MCI_STRING_OFFSET + 9) */
  2372. const auto MCI_DEVTYPE_WAVEFORM_AUDIO = 522 ; /* (MCI_STRING_OFFSET + 10) */
  2373. const auto MCI_DEVTYPE_SEQUENCER = 523 ; /* (MCI_STRING_OFFSET + 11) */
  2374. const auto MCI_DEVTYPE_FIRST = MCI_DEVTYPE_VCR;
  2375. const auto MCI_DEVTYPE_LAST = MCI_DEVTYPE_SEQUENCER;
  2376. const auto MCI_DEVTYPE_FIRST_USER = 0x1000;
  2377. /* return values for 'status mode' command */
  2378. const auto MCI_MODE_NOT_READY = (MCI_STRING_OFFSET + 12);
  2379. const auto MCI_MODE_STOP = (MCI_STRING_OFFSET + 13);
  2380. const auto MCI_MODE_PLAY = (MCI_STRING_OFFSET + 14);
  2381. const auto MCI_MODE_RECORD = (MCI_STRING_OFFSET + 15);
  2382. const auto MCI_MODE_SEEK = (MCI_STRING_OFFSET + 16);
  2383. const auto MCI_MODE_PAUSE = (MCI_STRING_OFFSET + 17);
  2384. const auto MCI_MODE_OPEN = (MCI_STRING_OFFSET + 18);
  2385. /* constants used in 'set time format' and 'status time format' commands */
  2386. const auto MCI_FORMAT_MILLISECONDS = 0;
  2387. const auto MCI_FORMAT_HMS = 1;
  2388. const auto MCI_FORMAT_MSF = 2;
  2389. const auto MCI_FORMAT_FRAMES = 3;
  2390. const auto MCI_FORMAT_SMPTE_24 = 4;
  2391. const auto MCI_FORMAT_SMPTE_25 = 5;
  2392. const auto MCI_FORMAT_SMPTE_30 = 6;
  2393. const auto MCI_FORMAT_SMPTE_30DROP = 7;
  2394. const auto MCI_FORMAT_BYTES = 8;
  2395. const auto MCI_FORMAT_SAMPLES = 9;
  2396. const auto MCI_FORMAT_TMSF = 10;
  2397. /* MCI time format conversion macros */
  2398. template MCI_MSF_MINUTE(T) {
  2399. BYTE MCI_MSF_MINUTE(T msf) {
  2400. return cast(BYTE)(msf);
  2401. }
  2402. }
  2403. template MCI_MSF_SECOND(T) {
  2404. BYTE MCI_MSF_SECOND(T msf) {
  2405. return (cast(BYTE)((cast(WORD)(msf)) >> 8));
  2406. }
  2407. }
  2408. template MCI_MSF_FRAME(T) {
  2409. BYTE MCI_MSF_FRAME(T msf) {
  2410. return (cast(BYTE)(msf >> 16));
  2411. }
  2412. }
  2413. template MCI_MAKE_MSF(T, R, S) {
  2414. DWORD MCI_MAKE_MSF(T m, R s, S f) {
  2415. return (cast(DWORD)((cast(BYTE)(m) |
  2416. (cast(WORD)(s)<<8)) |
  2417. ((cast(DWORD)cast(BYTE)(f))<<16)));
  2418. }
  2419. }
  2420. template MCI_TMSF_TRACK(T) {
  2421. BYTE MCI_TMSF_TRACK(T tmsf) {
  2422. return cast(BYTE)tmsf;
  2423. }
  2424. }
  2425. template MCI_TMSF_MINUTE(T) {
  2426. BYTE MCI_TMSF_MINUTE(T tmsf) {
  2427. return (cast(BYTE)((cast(WORD)(tmsf)) >> 8));
  2428. }
  2429. }
  2430. template MCI_TMSF_SECOND(T) {
  2431. BYTE MCI_TMSF_SECOND(T tmsf) {
  2432. return (cast(BYTE)(tmsf >> 16));
  2433. }
  2434. }
  2435. template MCI_TMSF_FRAME(T) {
  2436. BYTE MCI_TMSF_FRAME(T tmsf) {
  2437. return (cast(BYTE)(tmsf >> 24));
  2438. }
  2439. }
  2440. template MCI_MAKE_TMSF(T, R, S, Q) {
  2441. DWORD MCI_MAKE_TMSF(T t, R m, S s, Q f) {
  2442. return (cast(DWORD)((cast(BYTE)(t) |
  2443. (cast(WORD)(m)<<8)) |
  2444. ((cast(DWORD)cast(BYTE)(s) |
  2445. (cast(WORD)(f)<<8))<<16)));
  2446. }
  2447. }
  2448. template MCI_HMS_HOUR(T) {
  2449. BYTE MCI_HMS_HOUR(T tmsf) {
  2450. return cast(BYTE)hms;
  2451. }
  2452. }
  2453. template MCI_HMS_MINUTE(T) {
  2454. BYTE MCI_HMS_MINUTE(T hms) {
  2455. return (cast(BYTE)((cast(WORD)(tmsf)) >> 8));
  2456. }
  2457. }
  2458. template MCI_HMS_SECOND(T) {
  2459. BYTE MCI_HMS_SECOND(T hms) {
  2460. return (cast(BYTE)(tmsf >> 16));
  2461. }
  2462. }
  2463. template MCI_MAKE_HMS(T, R, S) {
  2464. DWORD MCI_MAKE_HMS(T h, R m, S s) {
  2465. return MCI_MAKE_MSF(h,m,s);
  2466. }
  2467. }
  2468. /* flags for wParam of MM_MCINOTIFY message */
  2469. const auto MCI_NOTIFY_SUCCESSFUL = 0x0001;
  2470. const auto MCI_NOTIFY_SUPERSEDED = 0x0002;
  2471. const auto MCI_NOTIFY_ABORTED = 0x0004;
  2472. const auto MCI_NOTIFY_FAILURE = 0x0008;
  2473. /* common flags for dwFlags parameter of MCI command messages */
  2474. const auto MCI_NOTIFY = 0x00000001L;
  2475. const auto MCI_WAIT = 0x00000002L;
  2476. const auto MCI_FROM = 0x00000004L;
  2477. const auto MCI_TO = 0x00000008L;
  2478. const auto MCI_TRACK = 0x00000010L;
  2479. /* flags for dwFlags parameter of MCI_OPEN command message */
  2480. const auto MCI_OPEN_SHAREABLE = 0x00000100L;
  2481. const auto MCI_OPEN_ELEMENT = 0x00000200L;
  2482. const auto MCI_OPEN_ALIAS = 0x00000400L;
  2483. const auto MCI_OPEN_ELEMENT_ID = 0x00000800L;
  2484. const auto MCI_OPEN_TYPE_ID = 0x00001000L;
  2485. const auto MCI_OPEN_TYPE = 0x00002000L;
  2486. /* flags for dwFlags parameter of MCI_SEEK command message */
  2487. const auto MCI_SEEK_TO_START = 0x00000100L;
  2488. const auto MCI_SEEK_TO_END = 0x00000200L;
  2489. /* flags for dwFlags parameter of MCI_STATUS command message */
  2490. const auto MCI_STATUS_ITEM = 0x00000100L;
  2491. const auto MCI_STATUS_START = 0x00000200L;
  2492. /* flags for dwItem field of the MCI_STATUS_PARMS parameter block */
  2493. const auto MCI_STATUS_LENGTH = 0x00000001L;
  2494. const auto MCI_STATUS_POSITION = 0x00000002L;
  2495. const auto MCI_STATUS_NUMBER_OF_TRACKS = 0x00000003L;
  2496. const auto MCI_STATUS_MODE = 0x00000004L;
  2497. const auto MCI_STATUS_MEDIA_PRESENT = 0x00000005L;
  2498. const auto MCI_STATUS_TIME_FORMAT = 0x00000006L;
  2499. const auto MCI_STATUS_READY = 0x00000007L;
  2500. const auto MCI_STATUS_CURRENT_TRACK = 0x00000008L;
  2501. /* flags for dwFlags parameter of MCI_INFO command message */
  2502. const auto MCI_INFO_PRODUCT = 0x00000100L;
  2503. const auto MCI_INFO_FILE = 0x00000200L;
  2504. const auto MCI_INFO_MEDIA_UPC = 0x00000400L;
  2505. const auto MCI_INFO_MEDIA_IDENTITY = 0x00000800L;
  2506. const auto MCI_INFO_NAME = 0x00001000L;
  2507. const auto MCI_INFO_COPYRIGHT = 0x00002000L;
  2508. /* flags for dwFlags parameter of MCI_GETDEVCAPS command message */
  2509. const auto MCI_GETDEVCAPS_ITEM = 0x00000100L;
  2510. /* flags for dwItem field of the MCI_GETDEVCAPS_PARMS parameter block */
  2511. const auto MCI_GETDEVCAPS_CAN_RECORD = 0x00000001L;
  2512. const auto MCI_GETDEVCAPS_HAS_AUDIO = 0x00000002L;
  2513. const auto MCI_GETDEVCAPS_HAS_VIDEO = 0x00000003L;
  2514. const auto MCI_GETDEVCAPS_DEVICE_TYPE = 0x00000004L;
  2515. const auto MCI_GETDEVCAPS_USES_FILES = 0x00000005L;
  2516. const auto MCI_GETDEVCAPS_COMPOUND_DEVICE = 0x00000006L;
  2517. const auto MCI_GETDEVCAPS_CAN_EJECT = 0x00000007L;
  2518. const auto MCI_GETDEVCAPS_CAN_PLAY = 0x00000008L;
  2519. const auto MCI_GETDEVCAPS_CAN_SAVE = 0x00000009L;
  2520. /* flags for dwFlags parameter of MCI_SYSINFO command message */
  2521. const auto MCI_SYSINFO_QUANTITY = 0x00000100L;
  2522. const auto MCI_SYSINFO_OPEN = 0x00000200L;
  2523. const auto MCI_SYSINFO_NAME = 0x00000400L;
  2524. const auto MCI_SYSINFO_INSTALLNAME = 0x00000800L;
  2525. /* flags for dwFlags parameter of MCI_SET command message */
  2526. const auto MCI_SET_DOOR_OPEN = 0x00000100L;
  2527. const auto MCI_SET_DOOR_CLOSED = 0x00000200L;
  2528. const auto MCI_SET_TIME_FORMAT = 0x00000400L;
  2529. const auto MCI_SET_AUDIO = 0x00000800L;
  2530. const auto MCI_SET_VIDEO = 0x00001000L;
  2531. const auto MCI_SET_ON = 0x00002000L;
  2532. const auto MCI_SET_OFF = 0x00004000L;
  2533. /* flags for dwAudio field of MCI_SET_PARMS or MCI_SEQ_SET_PARMS */
  2534. const auto MCI_SET_AUDIO_ALL = 0x00000000L;
  2535. const auto MCI_SET_AUDIO_LEFT = 0x00000001L;
  2536. const auto MCI_SET_AUDIO_RIGHT = 0x00000002L;
  2537. /* flags for dwFlags parameter of MCI_BREAK command message */
  2538. const auto MCI_BREAK_KEY = 0x00000100L;
  2539. const auto MCI_BREAK_HWND = 0x00000200L;
  2540. const auto MCI_BREAK_OFF = 0x00000400L;
  2541. /* flags for dwFlags parameter of MCI_RECORD command message */
  2542. const auto MCI_RECORD_INSERT = 0x00000100L;
  2543. const auto MCI_RECORD_OVERWRITE = 0x00000200L;
  2544. /* flags for dwFlags parameter of MCI_SAVE command message */
  2545. const auto MCI_SAVE_FILE = 0x00000100L;
  2546. /* flags for dwFlags parameter of MCI_LOAD command message */
  2547. const auto MCI_LOAD_FILE = 0x00000100L;
  2548. /* generic parameter block for MCI command messages with no special parameters */
  2549. align(2) struct MCI_GENERIC_PARMS {
  2550. DWORD_PTR dwCallback;
  2551. }
  2552. alias MCI_GENERIC_PARMS* PMCI_GENERIC_PARMS;
  2553. alias MCI_GENERIC_PARMS* LPMCI_GENERIC_PARMS;
  2554. /* parameter block for MCI_OPEN command message */
  2555. align(2) struct MCI_OPEN_PARMSA {
  2556. DWORD_PTR dwCallback;
  2557. MCIDEVICEID wDeviceID;
  2558. LPCSTR lpstrDeviceType;
  2559. LPCSTR lpstrElementName;
  2560. LPCSTR lpstrAlias;
  2561. }
  2562. alias MCI_OPEN_PARMSA* PMCI_OPEN_PARMSA;
  2563. alias MCI_OPEN_PARMSA* LPMCI_OPEN_PARMSA;
  2564. align(2) struct MCI_OPEN_PARMSW {
  2565. DWORD_PTR dwCallback;
  2566. MCIDEVICEID wDeviceID;
  2567. LPCWSTR lpstrDeviceType;
  2568. LPCWSTR lpstrElementName;
  2569. LPCWSTR lpstrAlias;
  2570. }
  2571. alias MCI_OPEN_PARMSW* PMCI_OPEN_PARMSW;
  2572. alias MCI_OPEN_PARMSW* LPMCI_OPEN_PARMSW;
  2573. version(UNICODE) {
  2574. alias MCI_OPEN_PARMSW MCI_OPEN_PARMS;
  2575. alias PMCI_OPEN_PARMSW PMCI_OPEN_PARMS;
  2576. alias LPMCI_OPEN_PARMSW LPMCI_OPEN_PARMS;
  2577. }
  2578. else {
  2579. alias MCI_OPEN_PARMSA MCI_OPEN_PARMS;
  2580. alias PMCI_OPEN_PARMSA PMCI_OPEN_PARMS;
  2581. alias LPMCI_OPEN_PARMSA LPMCI_OPEN_PARMS;
  2582. }
  2583. /* parameter block for MCI_PLAY command message */
  2584. align(2) struct MCI_PLAY_PARMS {
  2585. DWORD_PTR dwCallback;
  2586. DWORD dwFrom;
  2587. DWORD dwTo;
  2588. }
  2589. alias MCI_PLAY_PARMS* PMCI_PLAY_PARMS;
  2590. alias MCI_PLAY_PARMS* LPMCI_PLAY_PARMS;
  2591. /* parameter block for MCI_SEEK command message */
  2592. align(2) struct MCI_SEEK_PARMS {
  2593. DWORD_PTR dwCallback;
  2594. DWORD dwTo;
  2595. }
  2596. alias MCI_SEEK_PARMS* PMCI_SEEK_PARMS;
  2597. alias MCI_SEEK_PARMS* LPMCI_SEEK_PARMS;
  2598. /* parameter block for MCI_STATUS command message */
  2599. align(2) struct MCI_STATUS_PARMS {
  2600. DWORD_PTR dwCallback;
  2601. DWORD_PTR dwReturn;
  2602. DWORD dwItem;
  2603. DWORD dwTrack;
  2604. }
  2605. alias MCI_STATUS_PARMS* PMCI_STATUS_PARMS;
  2606. alias MCI_STATUS_PARMS* LPMCI_STATUS_PARMS;
  2607. /* parameter block for MCI_INFO command message */
  2608. align(2) struct MCI_INFO_PARMSA {
  2609. DWORD_PTR dwCallback;
  2610. LPSTR lpstrReturn;
  2611. DWORD dwRetSize;
  2612. }
  2613. alias MCI_INFO_PARMSA* LPMCI_INFO_PARMSA;
  2614. align(2) struct MCI_INFO_PARMSW {
  2615. DWORD_PTR dwCallback;
  2616. LPWSTR lpstrReturn;
  2617. DWORD dwRetSize;
  2618. }
  2619. alias MCI_INFO_PARMSW* LPMCI_INFO_PARMSW;
  2620. version(UNICODE) {
  2621. alias MCI_INFO_PARMSW MCI_INFO_PARMS;
  2622. alias LPMCI_INFO_PARMSW LPMCI_INFO_PARMS;
  2623. }
  2624. else {
  2625. alias MCI_INFO_PARMSA MCI_INFO_PARMS;
  2626. alias LPMCI_INFO_PARMSA LPMCI_INFO_PARMS;
  2627. }
  2628. /* parameter block for MCI_GETDEVCAPS command message */
  2629. align(2) struct MCI_GETDEVCAPS_PARMS {
  2630. DWORD_PTR dwCallback;
  2631. DWORD dwReturn;
  2632. DWORD dwItem;
  2633. }
  2634. alias MCI_GETDEVCAPS_PARMS* PMCI_GETDEVCAPS_PARMS;
  2635. alias MCI_GETDEVCAPS_PARMS* LPMCI_GETDEVCAPS_PARMS;
  2636. /* parameter block for MCI_SYSINFO command message */
  2637. align(2) struct MCI_SYSINFO_PARMSA {
  2638. DWORD_PTR dwCallback;
  2639. LPSTR lpstrReturn;
  2640. DWORD dwRetSize;
  2641. DWORD dwNumber;
  2642. UINT wDeviceType;
  2643. }
  2644. alias MCI_SYSINFO_PARMSA* PMCI_SYSINFO_PARMSA;
  2645. alias MCI_SYSINFO_PARMSA* LPMCI_SYSINFO_PARMSA;
  2646. align(2) struct MCI_SYSINFO_PARMSW {
  2647. DWORD_PTR dwCallback;
  2648. LPWSTR lpstrReturn;
  2649. DWORD dwRetSize;
  2650. DWORD dwNumber;
  2651. UINT wDeviceType;
  2652. }
  2653. alias MCI_SYSINFO_PARMSW* PMCI_SYSINFO_PARMSW;
  2654. alias MCI_SYSINFO_PARMSW* LPMCI_SYSINFO_PARMSW;
  2655. version(UNICODE) {
  2656. alias MCI_SYSINFO_PARMSW MCI_SYSINFO_PARMS;
  2657. alias PMCI_SYSINFO_PARMSW PMCI_SYSINFO_PARMS;
  2658. alias LPMCI_SYSINFO_PARMSW LPMCI_SYSINFO_PARMS;
  2659. }
  2660. else {
  2661. alias MCI_SYSINFO_PARMSA MCI_SYSINFO_PARMS;
  2662. alias PMCI_SYSINFO_PARMSA PMCI_SYSINFO_PARMS;
  2663. alias LPMCI_SYSINFO_PARMSA LPMCI_SYSINFO_PARMS;
  2664. }
  2665. /* parameter block for MCI_SET command message */
  2666. align(2) struct MCI_SET_PARMS {
  2667. DWORD_PTR dwCallback;
  2668. DWORD dwTimeFormat;
  2669. DWORD dwAudio;
  2670. }
  2671. alias MCI_SET_PARMS* PMCI_SET_PARMS;
  2672. alias MCI_SET_PARMS* LPMCI_SET_PARMS;
  2673. /* parameter block for MCI_BREAK command message */
  2674. align(2) struct MCI_BREAK_PARMS {
  2675. DWORD_PTR dwCallback;
  2676. int nVirtKey;
  2677. HWND hwndBreak;
  2678. }
  2679. alias MCI_BREAK_PARMS* PMCI_BREAK_PARMS;
  2680. alias MCI_BREAK_PARMS* LPMCI_BREAK_PARMS;
  2681. /* parameter block for MCI_SAVE command message */
  2682. align(2) struct MCI_SAVE_PARMSA {
  2683. DWORD_PTR dwCallback;
  2684. LPCSTR lpfilename;
  2685. }
  2686. alias MCI_SAVE_PARMSA* PMCI_SAVE_PARMSA;
  2687. alias MCI_SAVE_PARMSA* LPMCI_SAVE_PARMSA;
  2688. align(2) struct MCI_SAVE_PARMSW {
  2689. DWORD_PTR dwCallback;
  2690. LPCWSTR lpfilename;
  2691. }
  2692. alias MCI_SAVE_PARMSW* PMCI_SAVE_PARMSW;
  2693. alias MCI_SAVE_PARMSW* LPMCI_SAVE_PARMSW;
  2694. version(UNICODE) {
  2695. alias MCI_SAVE_PARMSW MCI_SAVE_PARMS;
  2696. alias PMCI_SAVE_PARMSW PMCI_SAVE_PARMS;
  2697. alias LPMCI_SAVE_PARMSW LPMCI_SAVE_PARMS;
  2698. }
  2699. else {
  2700. alias MCI_SAVE_PARMSA MCI_SAVE_PARMS;
  2701. alias PMCI_SAVE_PARMSA PMCI_SAVE_PARMS;
  2702. alias LPMCI_SAVE_PARMSA LPMCI_SAVE_PARMS;
  2703. }
  2704. /* parameter block for MCI_LOAD command message */
  2705. align(2) struct MCI_LOAD_PARMSA {
  2706. DWORD_PTR dwCallback;
  2707. LPCSTR lpfilename;
  2708. }
  2709. alias MCI_LOAD_PARMSA* PMCI_LOAD_PARMSA;
  2710. alias MCI_LOAD_PARMSA* LPMCI_LOAD_PARMSA;
  2711. align(2) struct MCI_LOAD_PARMSW {
  2712. DWORD_PTR dwCallback;
  2713. LPCWSTR lpfilename;
  2714. }
  2715. alias MCI_LOAD_PARMSW* PMCI_LOAD_PARMSW;
  2716. alias MCI_LOAD_PARMSW* LPMCI_LOAD_PARMSW;
  2717. version(UNICODE) {
  2718. alias MCI_LOAD_PARMSW MCI_LOAD_PARMS;
  2719. alias PMCI_LOAD_PARMSW PMCI_LOAD_PARMS;
  2720. alias LPMCI_LOAD_PARMSW LPMCI_LOAD_PARMS;
  2721. }
  2722. else {
  2723. alias MCI_LOAD_PARMSA MCI_LOAD_PARMS;
  2724. alias PMCI_LOAD_PARMSA PMCI_LOAD_PARMS;
  2725. alias LPMCI_LOAD_PARMSA LPMCI_LOAD_PARMS;
  2726. }
  2727. /* parameter block for MCI_RECORD command message */
  2728. align(2) struct MCI_RECORD_PARMS {
  2729. DWORD_PTR dwCallback;
  2730. DWORD dwFrom;
  2731. DWORD dwTo;
  2732. }
  2733. alias MCI_RECORD_PARMS* LPMCI_RECORD_PARMS;
  2734. /* MCI extensions for videodisc devices */
  2735. /* flag for dwReturn field of MCI_STATUS_PARMS */
  2736. /* MCI_STATUS command, (dwItem == MCI_STATUS_MODE) */
  2737. const auto MCI_VD_MODE_PARK = (MCI_VD_OFFSET + 1);
  2738. /* flag for dwReturn field of MCI_STATUS_PARMS */
  2739. /* MCI_STATUS command, (dwItem == MCI_VD_STATUS_MEDIA_TYPE) */
  2740. const auto MCI_VD_MEDIA_CLV = (MCI_VD_OFFSET + 2);
  2741. const auto MCI_VD_MEDIA_CAV = (MCI_VD_OFFSET + 3);
  2742. const auto MCI_VD_MEDIA_OTHER = (MCI_VD_OFFSET + 4);
  2743. const auto MCI_VD_FORMAT_TRACK = 0x4001;
  2744. /* flags for dwFlags parameter of MCI_PLAY command message */
  2745. const auto MCI_VD_PLAY_REVERSE = 0x00010000L;
  2746. const auto MCI_VD_PLAY_FAST = 0x00020000L;
  2747. const auto MCI_VD_PLAY_SPEED = 0x00040000L;
  2748. const auto MCI_VD_PLAY_SCAN = 0x00080000L;
  2749. const auto MCI_VD_PLAY_SLOW = 0x00100000L;
  2750. /* flag for dwFlags parameter of MCI_SEEK command message */
  2751. const auto MCI_VD_SEEK_REVERSE = 0x00010000L;
  2752. /* flags for dwItem field of MCI_STATUS_PARMS parameter block */
  2753. const auto MCI_VD_STATUS_SPEED = 0x00004002L;
  2754. const auto MCI_VD_STATUS_FORWARD = 0x00004003L;
  2755. const auto MCI_VD_STATUS_MEDIA_TYPE = 0x00004004L;
  2756. const auto MCI_VD_STATUS_SIDE = 0x00004005L;
  2757. const auto MCI_VD_STATUS_DISC_SIZE = 0x00004006L;
  2758. /* flags for dwFlags parameter of MCI_GETDEVCAPS command message */
  2759. const auto MCI_VD_GETDEVCAPS_CLV = 0x00010000L;
  2760. const auto MCI_VD_GETDEVCAPS_CAV = 0x00020000L;
  2761. const auto MCI_VD_SPIN_UP = 0x00010000L;
  2762. const auto MCI_VD_SPIN_DOWN = 0x00020000L;
  2763. /* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
  2764. const auto MCI_VD_GETDEVCAPS_CAN_REVERSE = 0x00004002L;
  2765. const auto MCI_VD_GETDEVCAPS_FAST_RATE = 0x00004003L;
  2766. const auto MCI_VD_GETDEVCAPS_SLOW_RATE = 0x00004004L;
  2767. const auto MCI_VD_GETDEVCAPS_NORMAL_RATE = 0x00004005L;
  2768. /* flags for the dwFlags parameter of MCI_STEP command message */
  2769. const auto MCI_VD_STEP_FRAMES = 0x00010000L;
  2770. const auto MCI_VD_STEP_REVERSE = 0x00020000L;
  2771. /* flag for the MCI_ESCAPE command message */
  2772. const auto MCI_VD_ESCAPE_STRING = 0x00000100L;
  2773. /* parameter block for MCI_PLAY command message */
  2774. align(2) struct MCI_VD_PLAY_PARMS {
  2775. DWORD_PTR dwCallback;
  2776. DWORD dwFrom;
  2777. DWORD dwTo;
  2778. DWORD dwSpeed;
  2779. }
  2780. alias MCI_VD_PLAY_PARMS* PMCI_VD_PLAY_PARMS;
  2781. alias MCI_VD_PLAY_PARMS* LPMCI_VD_PLAY_PARMS;
  2782. /* parameter block for MCI_STEP command message */
  2783. align(2) struct MCI_VD_STEP_PARMS {
  2784. DWORD_PTR dwCallback;
  2785. DWORD dwFrames;
  2786. }
  2787. alias MCI_VD_STEP_PARMS* PMCI_VD_STEP_PARMS;
  2788. alias MCI_VD_STEP_PARMS* LPMCI_VD_STEP_PARMS;
  2789. /* parameter block for MCI_ESCAPE command message */
  2790. align(2) struct MCI_VD_ESCAPE_PARMSA {
  2791. DWORD_PTR dwCallback;
  2792. LPCSTR lpstrCommand;
  2793. }
  2794. alias MCI_VD_ESCAPE_PARMSA* PMCI_VD_ESCAPE_PARMSA;
  2795. alias MCI_VD_ESCAPE_PARMSA* LPMCI_VD_ESCAPE_PARMSA;
  2796. align(2) struct MCI_VD_ESCAPE_PARMSW {
  2797. DWORD_PTR dwCallback;
  2798. LPCWSTR lpstrCommand;
  2799. }
  2800. alias MCI_VD_ESCAPE_PARMSW* PMCI_VD_ESCAPE_PARMSW;
  2801. alias MCI_VD_ESCAPE_PARMSW* LPMCI_VD_ESCAPE_PARMSW;
  2802. version(UNICODE) {
  2803. alias MCI_VD_ESCAPE_PARMSW MCI_VD_ESCAPE_PARMS;
  2804. alias PMCI_VD_ESCAPE_PARMSW PMCI_VD_ESCAPE_PARMS;
  2805. alias LPMCI_VD_ESCAPE_PARMSW LPMCI_VD_ESCAPE_PARMS;
  2806. }
  2807. else {
  2808. alias MCI_VD_ESCAPE_PARMSA MCI_VD_ESCAPE_PARMS;
  2809. alias PMCI_VD_ESCAPE_PARMSA PMCI_VD_ESCAPE_PARMS;
  2810. alias LPMCI_VD_ESCAPE_PARMSA LPMCI_VD_ESCAPE_PARMS;
  2811. }
  2812. /* MCI extensions for CD audio devices */
  2813. /* flags for the dwItem field of the MCI_STATUS_PARMS parameter block */
  2814. const auto MCI_CDA_STATUS_TYPE_TRACK = 0x00004001L;
  2815. /* flags for the dwReturn field of MCI_STATUS_PARMS parameter block */
  2816. /* MCI_STATUS command, (dwItem == MCI_CDA_STATUS_TYPE_TRACK) */
  2817. const auto MCI_CDA_TRACK_AUDIO = (MCI_CD_OFFSET + 0);
  2818. const auto MCI_CDA_TRACK_OTHER = (MCI_CD_OFFSET + 1);
  2819. /* MCI extensions for waveform audio devices */
  2820. const auto MCI_WAVE_PCM = (MCI_WAVE_OFFSET + 0);
  2821. const auto MCI_WAVE_MAPPER = (MCI_WAVE_OFFSET + 1);
  2822. /* flags for the dwFlags parameter of MCI_OPEN command message */
  2823. const auto MCI_WAVE_OPEN_BUFFER = 0x00010000L;
  2824. /* flags for the dwFlags parameter of MCI_SET command message */
  2825. const auto MCI_WAVE_SET_FORMATTAG = 0x00010000L;
  2826. const auto MCI_WAVE_SET_CHANNELS = 0x00020000L;
  2827. const auto MCI_WAVE_SET_SAMPLESPERSEC = 0x00040000L;
  2828. const auto MCI_WAVE_SET_AVGBYTESPERSEC = 0x00080000L;
  2829. const auto MCI_WAVE_SET_BLOCKALIGN = 0x00100000L;
  2830. const auto MCI_WAVE_SET_BITSPERSAMPLE = 0x00200000L;
  2831. /* flags for the dwFlags parameter of MCI_STATUS, MCI_SET command messages */
  2832. const auto MCI_WAVE_INPUT = 0x00400000L;
  2833. const auto MCI_WAVE_OUTPUT = 0x00800000L;
  2834. /* flags for the dwItem field of MCI_STATUS_PARMS parameter block */
  2835. const auto MCI_WAVE_STATUS_FORMATTAG = 0x00004001L;
  2836. const auto MCI_WAVE_STATUS_CHANNELS = 0x00004002L;
  2837. const auto MCI_WAVE_STATUS_SAMPLESPERSEC = 0x00004003L;
  2838. const auto MCI_WAVE_STATUS_AVGBYTESPERSEC = 0x00004004L;
  2839. const auto MCI_WAVE_STATUS_BLOCKALIGN = 0x00004005L;
  2840. const auto MCI_WAVE_STATUS_BITSPERSAMPLE = 0x00004006L;
  2841. const auto MCI_WAVE_STATUS_LEVEL = 0x00004007L;
  2842. /* flags for the dwFlags parameter of MCI_SET command message */
  2843. const auto MCI_WAVE_SET_ANYINPUT = 0x04000000L;
  2844. const auto MCI_WAVE_SET_ANYOUTPUT = 0x08000000L;
  2845. /* flags for the dwFlags parameter of MCI_GETDEVCAPS command message */
  2846. const auto MCI_WAVE_GETDEVCAPS_INPUTS = 0x00004001L;
  2847. const auto MCI_WAVE_GETDEVCAPS_OUTPUTS = 0x00004002L;
  2848. /* parameter block for MCI_OPEN command message */
  2849. align(2) struct MCI_WAVE_OPEN_PARMSA {
  2850. DWORD_PTR dwCallback;
  2851. MCIDEVICEID wDeviceID;
  2852. LPCSTR lpstrDeviceType;
  2853. LPCSTR lpstrElementName;
  2854. LPCSTR lpstrAlias;
  2855. DWORD dwBufferSeconds;
  2856. }
  2857. alias MCI_WAVE_OPEN_PARMSA* PMCI_WAVE_OPEN_PARMSA;
  2858. alias MCI_WAVE_OPEN_PARMSA* LPMCI_WAVE_OPEN_PARMSA;
  2859. align(2) struct MCI_WAVE_OPEN_PARMSW {
  2860. DWORD_PTR dwCallback;
  2861. MCIDEVICEID wDeviceID;
  2862. LPCWSTR lpstrDeviceType;
  2863. LPCWSTR lpstrElementName;
  2864. LPCWSTR lpstrAlias;
  2865. DWORD dwBufferSeconds;
  2866. }
  2867. alias MCI_WAVE_OPEN_PARMSW* PMCI_WAVE_OPEN_PARMSW;
  2868. alias MCI_WAVE_OPEN_PARMSW* LPMCI_WAVE_OPEN_PARMSW;
  2869. version(UNICODE) {
  2870. alias MCI_WAVE_OPEN_PARMSW MCI_WAVE_OPEN_PARMS;
  2871. alias PMCI_WAVE_OPEN_PARMSW PMCI_WAVE_OPEN_PARMS;
  2872. alias LPMCI_WAVE_OPEN_PARMSW LPMCI_WAVE_OPEN_PARMS;
  2873. }
  2874. else {
  2875. alias MCI_WAVE_OPEN_PARMSA MCI_WAVE_OPEN_PARMS;
  2876. alias PMCI_WAVE_OPEN_PARMSA PMCI_WAVE_OPEN_PARMS;
  2877. alias LPMCI_WAVE_OPEN_PARMSA LPMCI_WAVE_OPEN_PARMS;
  2878. }
  2879. /* parameter block for MCI_DELETE command message */
  2880. align(2) struct MCI_WAVE_DELETE_PARMS {
  2881. DWORD_PTR dwCallback;
  2882. DWORD dwFrom;
  2883. DWORD dwTo;
  2884. }
  2885. alias MCI_WAVE_DELETE_PARMS* PMCI_WAVE_DELETE_PARMS;
  2886. alias MCI_WAVE_DELETE_PARMS* LPMCI_WAVE_DELETE_PARMS;
  2887. /* parameter block for MCI_SET command message */
  2888. align(2) struct MCI_WAVE_SET_PARMS {
  2889. DWORD_PTR dwCallback;
  2890. DWORD dwTimeFormat;
  2891. DWORD dwAudio;
  2892. UINT wInput;
  2893. UINT wOutput;
  2894. WORD wFormatTag;
  2895. WORD wReserved2;
  2896. WORD nChannels;
  2897. WORD wReserved3;
  2898. DWORD nSamplesPerSec;
  2899. DWORD nAvgBytesPerSec;
  2900. WORD nBlockAlign;
  2901. WORD wReserved4;
  2902. WORD wBitsPerSample;
  2903. WORD wReserved5;
  2904. }
  2905. alias MCI_WAVE_SET_PARMS* PMCI_WAVE_SET_PARMS;
  2906. alias MCI_WAVE_SET_PARMS* LPMCI_WAVE_SET_PARMS;
  2907. /* MCI extensions for MIDI sequencer devices */
  2908. /* flags for the dwReturn field of MCI_STATUS_PARMS parameter block */
  2909. /* MCI_STATUS command, (dwItem == MCI_SEQ_STATUS_DIVTYPE) */
  2910. const auto MCI_SEQ_DIV_PPQN = (0 + MCI_SEQ_OFFSET);
  2911. const auto MCI_SEQ_DIV_SMPTE_24 = (1 + MCI_SEQ_OFFSET);
  2912. const auto MCI_SEQ_DIV_SMPTE_25 = (2 + MCI_SEQ_OFFSET);
  2913. const auto MCI_SEQ_DIV_SMPTE_30DROP = (3 + MCI_SEQ_OFFSET);
  2914. const auto MCI_SEQ_DIV_SMPTE_30 = (4 + MCI_SEQ_OFFSET);
  2915. /* flags for the dwMaster field of MCI_SEQ_SET_PARMS parameter block */
  2916. /* MCI_SET command, (dwFlags == MCI_SEQ_SET_MASTER) */
  2917. const auto MCI_SEQ_FORMAT_SONGPTR = 0x4001;
  2918. const auto MCI_SEQ_FILE = 0x4002;
  2919. const auto MCI_SEQ_MIDI = 0x4003;
  2920. const auto MCI_SEQ_SMPTE = 0x4004;
  2921. const auto MCI_SEQ_NONE = 65533;
  2922. const auto MCI_SEQ_MAPPER = 65535;
  2923. /* flags for the dwItem field of MCI_STATUS_PARMS parameter block */
  2924. const auto MCI_SEQ_STATUS_TEMPO = 0x00004002;
  2925. const auto MCI_SEQ_STATUS_PORT = 0x00004003;
  2926. const auto MCI_SEQ_STATUS_SLAVE = 0x00004007;
  2927. const auto MCI_SEQ_STATUS_MASTER = 0x00004008;
  2928. const auto MCI_SEQ_STATUS_OFFSET = 0x00004009;
  2929. const auto MCI_SEQ_STATUS_DIVTYPE = 0x0000400A;
  2930. const auto MCI_SEQ_STATUS_NAME = 0x0000400B;
  2931. const auto MCI_SEQ_STATUS_COPYRIGHT = 0x0000400C;
  2932. /* flags for the dwFlags parameter of MCI_SET command message */
  2933. const auto MCI_SEQ_SET_TEMPO = 0x00010000L;
  2934. const auto MCI_SEQ_SET_PORT = 0x00020000L;
  2935. const auto MCI_SEQ_SET_SLAVE = 0x00040000L;
  2936. const auto MCI_SEQ_SET_MASTER = 0x00080000L;
  2937. const auto MCI_SEQ_SET_OFFSET = 0x01000000L;
  2938. /* parameter block for MCI_SET command message */
  2939. align(2) struct MCI_SEQ_SET_PARMS {
  2940. DWORD_PTR dwCallback;
  2941. DWORD dwTimeFormat;
  2942. DWORD dwAudio;
  2943. DWORD dwTempo;
  2944. DWORD dwPort;
  2945. DWORD dwSlave;
  2946. DWORD dwMaster;
  2947. DWORD dwOffset;
  2948. }
  2949. alias MCI_SEQ_SET_PARMS* PMCI_SEQ_SET_PARMS;
  2950. alias MCI_SEQ_SET_PARMS* LPMCI_SEQ_SET_PARMS;
  2951. /* MCI extensions for animation devices */
  2952. /* flags for dwFlags parameter of MCI_OPEN command message */
  2953. const auto MCI_ANIM_OPEN_WS = 0x00010000L;
  2954. const auto MCI_ANIM_OPEN_PARENT = 0x00020000L;
  2955. const auto MCI_ANIM_OPEN_NOSTATIC = 0x00040000L;
  2956. /* flags for dwFlags parameter of MCI_PLAY command message */
  2957. const auto MCI_ANIM_PLAY_SPEED = 0x00010000L;
  2958. const auto MCI_ANIM_PLAY_REVERSE = 0x00020000L;
  2959. const auto MCI_ANIM_PLAY_FAST = 0x00040000L;
  2960. const auto MCI_ANIM_PLAY_SLOW = 0x00080000L;
  2961. const auto MCI_ANIM_PLAY_SCAN = 0x00100000L;
  2962. /* flags for dwFlags parameter of MCI_STEP command message */
  2963. const auto MCI_ANIM_STEP_REVERSE = 0x00010000L;
  2964. const auto MCI_ANIM_STEP_FRAMES = 0x00020000L;
  2965. /* flags for dwItem field of MCI_STATUS_PARMS parameter block */
  2966. const auto MCI_ANIM_STATUS_SPEED = 0x00004001L;
  2967. const auto MCI_ANIM_STATUS_FORWARD = 0x00004002L;
  2968. const auto MCI_ANIM_STATUS_HWND = 0x00004003L;
  2969. const auto MCI_ANIM_STATUS_HPAL = 0x00004004L;
  2970. const auto MCI_ANIM_STATUS_STRETCH = 0x00004005L;
  2971. /* flags for the dwFlags parameter of MCI_INFO command message */
  2972. const auto MCI_ANIM_INFO_TEXT = 0x00010000L;
  2973. /* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
  2974. const auto MCI_ANIM_GETDEVCAPS_CAN_REVERSE = 0x00004001L;
  2975. const auto MCI_ANIM_GETDEVCAPS_FAST_RATE = 0x00004002L;
  2976. const auto MCI_ANIM_GETDEVCAPS_SLOW_RATE = 0x00004003L;
  2977. const auto MCI_ANIM_GETDEVCAPS_NORMAL_RATE = 0x00004004L;
  2978. const auto MCI_ANIM_GETDEVCAPS_PALETTES = 0x00004006L;
  2979. const auto MCI_ANIM_GETDEVCAPS_CAN_STRETCH = 0x00004007L;
  2980. const auto MCI_ANIM_GETDEVCAPS_MAX_WINDOWS = 0x00004008L;
  2981. /* flags for the MCI_REALIZE command message */
  2982. const auto MCI_ANIM_REALIZE_NORM = 0x00010000L;
  2983. const auto MCI_ANIM_REALIZE_BKGD = 0x00020000L;
  2984. /* flags for dwFlags parameter of MCI_WINDOW command message */
  2985. const auto MCI_ANIM_WINDOW_HWND = 0x00010000L;
  2986. const auto MCI_ANIM_WINDOW_STATE = 0x00040000L;
  2987. const auto MCI_ANIM_WINDOW_TEXT = 0x00080000L;
  2988. const auto MCI_ANIM_WINDOW_ENABLE_STRETCH = 0x00100000L;
  2989. const auto MCI_ANIM_WINDOW_DISABLE_STRETCH = 0x00200000L;
  2990. /* flags for hWnd field of MCI_ANIM_WINDOW_PARMS parameter block */
  2991. /* MCI_WINDOW command message, (dwFlags == MCI_ANIM_WINDOW_HWND) */
  2992. const auto MCI_ANIM_WINDOW_DEFAULT = 0x00000000L;
  2993. /* flags for dwFlags parameter of MCI_PUT command message */
  2994. const auto MCI_ANIM_RECT = 0x00010000L;
  2995. const auto MCI_ANIM_PUT_SOURCE = 0x00020000L;
  2996. const auto MCI_ANIM_PUT_DESTINATION = 0x00040000L;
  2997. /* flags for dwFlags parameter of MCI_WHERE command message */
  2998. const auto MCI_ANIM_WHERE_SOURCE = 0x00020000L;
  2999. const auto MCI_ANIM_WHERE_DESTINATION = 0x00040000L;
  3000. /* flags for dwFlags parameter of MCI_UPDATE command message */
  3001. const auto MCI_ANIM_UPDATE_HDC = 0x00020000L;
  3002. /* parameter block for MCI_OPEN command message */
  3003. align(2) struct MCI_ANIM_OPEN_PARMSA {
  3004. DWORD_PTR dwCallback;
  3005. MCIDEVICEID wDeviceID;
  3006. LPCSTR lpstrDeviceType;
  3007. LPCSTR lpstrElementName;
  3008. LPCSTR lpstrAlias;
  3009. DWORD dwStyle;
  3010. HWND hWndParent;
  3011. }
  3012. alias MCI_ANIM_OPEN_PARMSA* PMCI_ANIM_OPEN_PARMSA;
  3013. alias MCI_ANIM_OPEN_PARMSA* LPMCI_ANIM_OPEN_PARMSA;
  3014. align(2) struct MCI_ANIM_OPEN_PARMSW {
  3015. DWORD_PTR dwCallback;
  3016. MCIDEVICEID wDeviceID;
  3017. LPCWSTR lpstrDeviceType;
  3018. LPCWSTR lpstrElementName;
  3019. LPCWSTR lpstrAlias;
  3020. DWORD dwStyle;
  3021. HWND hWndParent;
  3022. }
  3023. alias MCI_ANIM_OPEN_PARMSW* PMCI_ANIM_OPEN_PARMSW;
  3024. alias MCI_ANIM_OPEN_PARMSW* LPMCI_ANIM_OPEN_PARMSW;
  3025. version(UNICODE) {
  3026. alias MCI_ANIM_OPEN_PARMSW MCI_ANIM_OPEN_PARMS;
  3027. alias PMCI_ANIM_OPEN_PARMSW PMCI_ANIM_OPEN_PARMS;
  3028. alias LPMCI_ANIM_OPEN_PARMSW LPMCI_ANIM_OPEN_PARMS;
  3029. }
  3030. else {
  3031. alias MCI_ANIM_OPEN_PARMSA MCI_ANIM_OPEN_PARMS;
  3032. alias PMCI_ANIM_OPEN_PARMSA PMCI_ANIM_OPEN_PARMS;
  3033. alias LPMCI_ANIM_OPEN_PARMSA LPMCI_ANIM_OPEN_PARMS;
  3034. }
  3035. /* parameter block for MCI_PLAY command message */
  3036. align(2) struct MCI_ANIM_PLAY_PARMS {
  3037. DWORD_PTR dwCallback;
  3038. DWORD dwFrom;
  3039. DWORD dwTo;
  3040. DWORD dwSpeed;
  3041. }
  3042. alias MCI_ANIM_PLAY_PARMS* PMCI_ANIM_PLAY_PARMS;
  3043. alias MCI_ANIM_PLAY_PARMS* LPMCI_ANIM_PLAY_PARMS;
  3044. /* parameter block for MCI_STEP command message */
  3045. align(2) struct MCI_ANIM_STEP_PARMS {
  3046. DWORD_PTR dwCallback;
  3047. DWORD dwFrames;
  3048. }
  3049. alias MCI_ANIM_STEP_PARMS* PMCI_ANIM_STEP_PARMS;
  3050. alias MCI_ANIM_STEP_PARMS* LPMCI_ANIM_STEP_PARMS;
  3051. /* parameter block for MCI_WINDOW command message */
  3052. align(2) struct MCI_ANIM_WINDOW_PARMSA {
  3053. DWORD_PTR dwCallback;
  3054. HWND hWnd;
  3055. UINT nCmdShow;
  3056. LPCSTR lpstrText;
  3057. }
  3058. alias MCI_ANIM_WINDOW_PARMSA* PMCI_ANIM_WINDOW_PARMSA;
  3059. alias MCI_ANIM_WINDOW_PARMSA* LPMCI_ANIM_WINDOW_PARMSA;
  3060. align(2) struct MCI_ANIM_WINDOW_PARMSW {
  3061. DWORD_PTR dwCallback;
  3062. HWND hWnd;
  3063. UINT nCmdShow;
  3064. LPCWSTR lpstrText;
  3065. }
  3066. alias MCI_ANIM_WINDOW_PARMSW* PMCI_ANIM_WINDOW_PARMSW;
  3067. alias MCI_ANIM_WINDOW_PARMSW* LPMCI_ANIM_WINDOW_PARMSW;
  3068. version(UNICODE) {
  3069. alias MCI_ANIM_WINDOW_PARMSW MCI_ANIM_WINDOW_PARMS;
  3070. alias PMCI_ANIM_WINDOW_PARMSW PMCI_ANIM_WINDOW_PARMS;
  3071. alias LPMCI_ANIM_WINDOW_PARMSW LPMCI_ANIM_WINDOW_PARMS;
  3072. }
  3073. else {
  3074. alias MCI_ANIM_WINDOW_PARMSA MCI_ANIM_WINDOW_PARMS;
  3075. alias PMCI_ANIM_WINDOW_PARMSA PMCI_ANIM_WINDOW_PARMS;
  3076. alias LPMCI_ANIM_WINDOW_PARMSA LPMCI_ANIM_WINDOW_PARMS;
  3077. }
  3078. /* parameter block for MCI_PUT, MCI_UPDATE, MCI_WHERE command messages */
  3079. align(2) struct MCI_ANIM_RECT_PARMS {
  3080. DWORD_PTR dwCallback;
  3081. version(MCI_USE_OFFEXT) {
  3082. POINT ptOffset;
  3083. POINT ptExtent;
  3084. }
  3085. else { /* !MCI_USE_OFFEXT */
  3086. RECT rc;
  3087. }
  3088. }
  3089. alias MCI_ANIM_RECT_PARMS * PMCI_ANIM_RECT_PARMS;
  3090. alias MCI_ANIM_RECT_PARMS * LPMCI_ANIM_RECT_PARMS;
  3091. /* parameter block for MCI_UPDATE PARMS */
  3092. align(2) struct MCI_ANIM_UPDATE_PARMS {
  3093. DWORD_PTR dwCallback;
  3094. RECT rc;
  3095. HDC hDC;
  3096. }
  3097. alias MCI_ANIM_UPDATE_PARMS* PMCI_ANIM_UPDATE_PARMS;
  3098. alias MCI_ANIM_UPDATE_PARMS* LPMCI_ANIM_UPDATE_PARMS;
  3099. /* MCI extensions for video overlay devices */
  3100. /* flags for dwFlags parameter of MCI_OPEN command message */
  3101. const auto MCI_OVLY_OPEN_WS = 0x00010000L;
  3102. const auto MCI_OVLY_OPEN_PARENT = 0x00020000L;
  3103. /* flags for dwFlags parameter of MCI_STATUS command message */
  3104. const auto MCI_OVLY_STATUS_HWND = 0x00004001L;
  3105. const auto MCI_OVLY_STATUS_STRETCH = 0x00004002L;
  3106. /* flags for dwFlags parameter of MCI_INFO command message */
  3107. const auto MCI_OVLY_INFO_TEXT = 0x00010000L;
  3108. /* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
  3109. const auto MCI_OVLY_GETDEVCAPS_CAN_STRETCH = 0x00004001L;
  3110. const auto MCI_OVLY_GETDEVCAPS_CAN_FREEZE = 0x00004002L;
  3111. const auto MCI_OVLY_GETDEVCAPS_MAX_WINDOWS = 0x00004003L;
  3112. /* flags for dwFlags parameter of MCI_WINDOW command message */
  3113. const auto MCI_OVLY_WINDOW_HWND = 0x00010000L;
  3114. const auto MCI_OVLY_WINDOW_STATE = 0x00040000L;
  3115. const auto MCI_OVLY_WINDOW_TEXT = 0x00080000L;
  3116. const auto MCI_OVLY_WINDOW_ENABLE_STRETCH = 0x00100000L;
  3117. const auto MCI_OVLY_WINDOW_DISABLE_STRETCH = 0x00200000L;
  3118. /* flags for hWnd parameter of MCI_OVLY_WINDOW_PARMS parameter block */
  3119. const auto MCI_OVLY_WINDOW_DEFAULT = 0x00000000L;
  3120. /* flags for dwFlags parameter of MCI_PUT command message */
  3121. const auto MCI_OVLY_RECT = 0x00010000L;
  3122. const auto MCI_OVLY_PUT_SOURCE = 0x00020000L;
  3123. const auto MCI_OVLY_PUT_DESTINATION = 0x00040000L;
  3124. const auto MCI_OVLY_PUT_FRAME = 0x00080000L;
  3125. const auto MCI_OVLY_PUT_VIDEO = 0x00100000L;
  3126. /* flags for dwFlags parameter of MCI_WHERE command message */
  3127. const auto MCI_OVLY_WHERE_SOURCE = 0x00020000L;
  3128. const auto MCI_OVLY_WHERE_DESTINATION = 0x00040000L;
  3129. const auto MCI_OVLY_WHERE_FRAME = 0x00080000L;
  3130. const auto MCI_OVLY_WHERE_VIDEO = 0x00100000L;
  3131. /* parameter block for MCI_OPEN command message */
  3132. align(2) struct MCI_OVLY_OPEN_PARMSA {
  3133. DWORD_PTR dwCallback;
  3134. MCIDEVICEID wDeviceID;
  3135. LPCSTR lpstrDeviceType;
  3136. LPCSTR lpstrElementName;
  3137. LPCSTR lpstrAlias;
  3138. DWORD dwStyle;
  3139. HWND hWndParent;
  3140. }
  3141. alias MCI_OVLY_OPEN_PARMSA* PMCI_OVLY_OPEN_PARMSA;
  3142. alias MCI_OVLY_OPEN_PARMSA* LPMCI_OVLY_OPEN_PARMSA;
  3143. align(2) struct MCI_OVLY_OPEN_PARMSW {
  3144. DWORD_PTR dwCallback;
  3145. MCIDEVICEID wDeviceID;
  3146. LPCWSTR lpstrDeviceType;
  3147. LPCWSTR lpstrElementName;
  3148. LPCWSTR lpstrAlias;
  3149. DWORD dwStyle;
  3150. HWND hWndParent;
  3151. }
  3152. alias MCI_OVLY_OPEN_PARMSW* PMCI_OVLY_OPEN_PARMSW;
  3153. alias MCI_OVLY_OPEN_PARMSW* LPMCI_OVLY_OPEN_PARMSW;
  3154. version(UNICODE) {
  3155. alias MCI_OVLY_OPEN_PARMSW MCI_OVLY_OPEN_PARMS;
  3156. alias PMCI_OVLY_OPEN_PARMSW PMCI_OVLY_OPEN_PARMS;
  3157. alias LPMCI_OVLY_OPEN_PARMSW LPMCI_OVLY_OPEN_PARMS;
  3158. }
  3159. else {
  3160. alias MCI_OVLY_OPEN_PARMSA MCI_OVLY_OPEN_PARMS;
  3161. alias PMCI_OVLY_OPEN_PARMSA PMCI_OVLY_OPEN_PARMS;
  3162. alias LPMCI_OVLY_OPEN_PARMSA LPMCI_OVLY_OPEN_PARMS;
  3163. }
  3164. /* parameter block for MCI_WINDOW command message */
  3165. align(2) struct MCI_OVLY_WINDOW_PARMSA {
  3166. DWORD_PTR dwCallback;
  3167. HWND hWnd;
  3168. UINT nCmdShow;
  3169. LPCSTR lpstrText;
  3170. }
  3171. alias MCI_OVLY_WINDOW_PARMSA* PMCI_OVLY_WINDOW_PARMSA;
  3172. alias MCI_OVLY_WINDOW_PARMSA* LPMCI_OVLY_WINDOW_PARMSA;
  3173. align(2) struct MCI_OVLY_WINDOW_PARMSW {
  3174. DWORD_PTR dwCallback;
  3175. HWND hWnd;
  3176. UINT nCmdShow;
  3177. LPCWSTR lpstrText;
  3178. }
  3179. alias MCI_OVLY_WINDOW_PARMSW* PMCI_OVLY_WINDOW_PARMSW;
  3180. alias MCI_OVLY_WINDOW_PARMSW* LPMCI_OVLY_WINDOW_PARMSW;
  3181. version(UNICODE) {
  3182. alias MCI_OVLY_WINDOW_PARMSW MCI_OVLY_WINDOW_PARMS;
  3183. alias PMCI_OVLY_WINDOW_PARMSW PMCI_OVLY_WINDOW_PARMS;
  3184. alias LPMCI_OVLY_WINDOW_PARMSW LPMCI_OVLY_WINDOW_PARMS;
  3185. }
  3186. else {
  3187. alias MCI_OVLY_WINDOW_PARMSA MCI_OVLY_WINDOW_PARMS;
  3188. alias PMCI_OVLY_WINDOW_PARMSA PMCI_OVLY_WINDOW_PARMS;
  3189. alias LPMCI_OVLY_WINDOW_PARMSA LPMCI_OVLY_WINDOW_PARMS;
  3190. }
  3191. /* parameter block for MCI_PUT, MCI_UPDATE, and MCI_WHERE command messages */
  3192. align(2) struct MCI_OVLY_RECT_PARMS {
  3193. DWORD_PTR dwCallback;
  3194. version(MCI_USE_OFFEXT) {
  3195. POINT ptOffset;
  3196. POINT ptExtent;
  3197. }
  3198. else { /* !MCI_USE_OFFEXT */
  3199. RECT rc;
  3200. }
  3201. }
  3202. alias MCI_OVLY_RECT_PARMS* PMCI_OVLY_RECT_PARMS;
  3203. alias MCI_OVLY_RECT_PARMS* LPMCI_OVLY_RECT_PARMS;
  3204. /* parameter block for MCI_SAVE command message */
  3205. align(2) struct MCI_OVLY_SAVE_PARMSA {
  3206. DWORD_PTR dwCallback;
  3207. LPCSTR lpfilename;
  3208. RECT rc;
  3209. }
  3210. alias MCI_OVLY_SAVE_PARMSA* PMCI_OVLY_SAVE_PARMSA;
  3211. alias MCI_OVLY_SAVE_PARMSA* LPMCI_OVLY_SAVE_PARMSA;
  3212. align(2) struct MCI_OVLY_SAVE_PARMSW {
  3213. DWORD_PTR dwCallback;
  3214. LPCWSTR lpfilename;
  3215. RECT rc;
  3216. }
  3217. alias MCI_OVLY_SAVE_PARMSW* PMCI_OVLY_SAVE_PARMSW;
  3218. alias MCI_OVLY_SAVE_PARMSW* LPMCI_OVLY_SAVE_PARMSW;
  3219. version(UNICODE) {
  3220. alias MCI_OVLY_SAVE_PARMSW MCI_OVLY_SAVE_PARMS;
  3221. alias PMCI_OVLY_SAVE_PARMSW PMCI_OVLY_SAVE_PARMS;
  3222. alias LPMCI_OVLY_SAVE_PARMSW LPMCI_OVLY_SAVE_PARMS;
  3223. }
  3224. else {
  3225. alias MCI_OVLY_SAVE_PARMSA MCI_OVLY_SAVE_PARMS;
  3226. alias PMCI_OVLY_SAVE_PARMSA PMCI_OVLY_SAVE_PARMS;
  3227. alias LPMCI_OVLY_SAVE_PARMSA LPMCI_OVLY_SAVE_PARMS;
  3228. }
  3229. /* parameter block for MCI_LOAD command message */
  3230. align(2) struct MCI_OVLY_LOAD_PARMSA {
  3231. DWORD_PTR dwCallback;
  3232. LPCSTR lpfilename;
  3233. RECT rc;
  3234. }
  3235. alias MCI_OVLY_LOAD_PARMSA* PMCI_OVLY_LOAD_PARMSA;
  3236. alias MCI_OVLY_LOAD_PARMSA* LPMCI_OVLY_LOAD_PARMSA;
  3237. align(2) struct MCI_OVLY_LOAD_PARMSW {
  3238. DWORD_PTR dwCallback;
  3239. LPCWSTR lpfilename;
  3240. RECT rc;
  3241. }
  3242. alias MCI_OVLY_LOAD_PARMSW* PMCI_OVLY_LOAD_PARMSW;
  3243. alias MCI_OVLY_LOAD_PARMSW* LPMCI_OVLY_LOAD_PARMSW;
  3244. version(UNICODE) {
  3245. alias MCI_OVLY_LOAD_PARMSW MCI_OVLY_LOAD_PARMS;
  3246. alias PMCI_OVLY_LOAD_PARMSW PMCI_OVLY_LOAD_PARMS;
  3247. alias LPMCI_OVLY_LOAD_PARMSW LPMCI_OVLY_LOAD_PARMS;
  3248. }
  3249. else {
  3250. alias MCI_OVLY_LOAD_PARMSA MCI_OVLY_LOAD_PARMS;
  3251. alias PMCI_OVLY_LOAD_PARMSA PMCI_OVLY_LOAD_PARMS;
  3252. alias LPMCI_OVLY_LOAD_PARMSA LPMCI_OVLY_LOAD_PARMS;
  3253. }
  3254. }
  3255. /****************************************************************************
  3256. DISPLAY Driver extensions
  3257. ****************************************************************************/
  3258. const auto NEWTRANSPARENT = 3; /* use with SetBkMode() */
  3259. const auto QUERYROPSUPPORT = 40; /* use to determine ROP support */
  3260. /****************************************************************************
  3261. DIB Driver extensions
  3262. ****************************************************************************/
  3263. const auto SELECTDIB = 41 ; /* DIB.DRV select dib escape */
  3264. //const auto DIBINDEX(n) = MAKELONG((n),0x10FF);
  3265. /****************************************************************************
  3266. ScreenSaver support
  3267. The current application will receive a syscommand of SC_SCREENSAVE just
  3268. before the screen saver is invoked. If the app wishes to prevent a
  3269. screen save, return non-zero value, otherwise call DefWindowProc().
  3270. ****************************************************************************/
  3271. // already defined elsewhere
  3272. //const auto SC_SCREENSAVE = 0xF140;