mmsystem.pp 83 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2008 Free Pascal development team.
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. ********************************************************************** }
  10. //
  11. // Module Name:mmsystem.h -- Include file for Multimedia API's
  12. //
  13. // * If defined, the following flags inhibit inclusion
  14. // * of the indicated items:
  15. // *
  16. // * MMNOSOUND Sound support
  17. // * MMNOWAVE Waveform support
  18. // * MMNOMCI MCI API
  19. // * MMNOMMIO file I/O
  20. // *
  21. // *
  22. //
  23. // Microsoft Windows Mobile 6.0 for PocketPC SDK.
  24. //
  25. {$IFNDEF FPC_DOTTEDUNITS}
  26. unit mmsystem;
  27. {$ENDIF FPC_DOTTEDUNITS}
  28. {$CALLING cdecl}
  29. {$ifdef FPC_OS_UNICODE}
  30. {$define UNICODE}
  31. {$endif}
  32. interface
  33. {$IFDEF FPC_DOTTEDUNITS}
  34. uses WinApi.Windows, WinceAPI.Mmreg;
  35. {$ELSE FPC_DOTTEDUNITS}
  36. uses Windows, mmreg;
  37. {$ENDIF FPC_DOTTEDUNITS}
  38. {$PACKRECORDS 1} // #include "pshpack1.h" // Assume byte packing throughout
  39. {$DEFINE MMNOMIDI} // No midi audio support.
  40. {$IFDEF WIN32}
  41. {$DEFINE _WIN32}
  42. {$ENDIF WIN32}
  43. {****************************************************************************
  44. General constants and data types
  45. ****************************************************************************}
  46. //* general constants */
  47. const
  48. MAXPNAMELEN = 32; // max product name length (including NULL)
  49. MAXERRORLENGTH = 128; // max error text length (including final NULL)
  50. {*
  51. * Microsoft Manufacturer and Product ID's
  52. *
  53. Used with wMid and wPid fields in WAVEOUTCAPS, WAVEINCAPS,
  54. MIDIOUTCAPS, MIDIINCAPS, AUXCAPS, JOYCAPS structures.
  55. *}
  56. {*
  57. * (these have been moved to
  58. * MMREG.H for Windows 4.00 and above).
  59. *}
  60. //* manufacturer IDs *
  61. const
  62. MM_MICROSOFT = 1; // Microsoft Corporation
  63. //* general data types */
  64. type
  65. MMVERSION = UINT; // major (high byte), minor (low byte)
  66. MMRESULT = UINT; // error return code, 0 means no error
  67. // call as if(err=xxxx(...)) Error(err); else
  68. LPUINT = ^UINT;
  69. //* MMTIME data structure */
  70. type
  71. mmtime_tag = record
  72. wType:UINT; //* indicates the contents of the union */
  73. case UINT of
  74. 0: (ms:DWORD); //* milliseconds */
  75. 1: (sample:DWORD); //* samples */
  76. 2: (cb:DWORD); //* byte count */
  77. 3: (ticks:DWORD); //* ticks in MIDI stream */
  78. 4: (smpte:record
  79. hour:byte; //* hours */
  80. min:byte; //* minutes */
  81. sec:byte; //* seconds */
  82. frame:byte; //* frames */
  83. fps:byte; //* frames per second */
  84. dummy:byte; //* pad */
  85. {$IFDEF _WIN32}
  86. pad:array[0..1] of byte;
  87. {$ENDIF _WIN32}
  88. end);
  89. 5: (midi:record
  90. songptrpos:DWORD; //* song pointer position */
  91. end);
  92. end;
  93. MMTIME = mmtime_tag;
  94. PMMTIME = ^mmtime_tag;
  95. NPMMTIME = ^mmtime_tag;
  96. LPMMTIME = ^mmtime_tag;
  97. //* types for wType field in MMTIME struct */
  98. const
  99. TIME_MS = $0001; //* time in milliseconds */
  100. TIME_SAMPLES = $0002; //* number of wave samples */
  101. TIME_BYTES = $0004; //* current byte offset */
  102. TIME_SMPTE = $0008; //* SMPTE time */
  103. TIME_MIDI = $0010; //* MIDI time */
  104. TIME_TICKS = $0020; //* Ticks within MIDI stream */
  105. { Was declared as
  106. MAKEFOURCC(ch0, ch1, ch2, ch3) \
  107. ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
  108. ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
  109. mmioFOURCC(ch0, ch1, ch2, ch3) MAKEFOURCC(ch0, ch1, ch2, ch3)
  110. }
  111. function MAKEFOURCC(ch0:AnsiChar; ch1:AnsiChar; ch2:AnsiChar; ch3:AnsiChar):FOURCC;
  112. function mmioFOURCC(ch0:AnsiChar; ch1:AnsiChar; ch2:AnsiChar; ch3:AnsiChar):FOURCC;
  113. {****************************************************************************
  114. Multimedia Extensions Window Messages
  115. ****************************************************************************}
  116. const
  117. MM_MCINOTIFY = $3B9; //* MCI */
  118. MM_WOM_OPEN = $3BB; //* waveform output */
  119. MM_WOM_CLOSE = $3BC;
  120. MM_WOM_DONE = $3BD;
  121. MM_WOM_ATTENUATED = $3D8; //* gain class support - stream attenuated */
  122. MM_WIM_OPEN = $3BE; //* waveform input */
  123. MM_WIM_CLOSE = $3BF;
  124. MM_WIM_DATA = $3C0;
  125. MM_MIM_OPEN = $3C1; //* MIDI input */
  126. MM_MIM_CLOSE = $3C2;
  127. MM_MIM_DATA = $3C3;
  128. MM_MIM_LONGDATA = $3C4;
  129. MM_MIM_ERROR = $3C5;
  130. MM_MIM_LONGERROR = $3C6;
  131. MM_MOM_OPEN = $3C7; //* MIDI output */
  132. MM_MOM_CLOSE = $3C8;
  133. MM_MOM_DONE = $3C9;
  134. //* these are also in msvideo.h */
  135. MM_DRVM_OPEN = $3D0; //* installable drivers */
  136. MM_DRVM_CLOSE = $3D1;
  137. MM_DRVM_DATA = $3D2;
  138. MM_DRVM_ERROR = $3D3;
  139. MM_MCISYSTEM_STRING = $3CA; //* internal */
  140. //* these are used by msacm.h */
  141. MM_STREAM_OPEN = $3D4;
  142. MM_STREAM_CLOSE = $3D5;
  143. MM_STREAM_DONE = $3D6;
  144. MM_STREAM_ERROR = $3D7;
  145. MM_MOM_POSITIONCB = $3CA; //* Callback for MEVT_POSITIONCB */
  146. MM_MCISIGNAL = $3CB;
  147. MM_MIM_MOREDATA = $3CC; //* MIM_DONE w/ pending events */
  148. MM_MIXM_LINE_CHANGE = $3D0; //* mixer line change notify */
  149. MM_MIXM_CONTROL_CHANGE = $3D1; //* mixer control change notify */
  150. {****************************************************************************
  151. String resource number bases (internal use)
  152. ****************************************************************************}
  153. const
  154. MMSYSERR_BASE = 0;
  155. WAVERR_BASE = 32;
  156. MIDIERR_BASE = 64;
  157. TIMERR_BASE = 96;
  158. MCIERR_BASE = 256;
  159. MIXERR_BASE = 1024;
  160. MCI_STRING_OFFSET = 512;
  161. MCI_VD_OFFSET = 1024;
  162. MCI_CD_OFFSET = 1088;
  163. MCI_WAVE_OFFSET = 1152;
  164. MCI_SEQ_OFFSET = 1216;
  165. {****************************************************************************
  166. General error return values
  167. ****************************************************************************}
  168. const
  169. //* general error return values */
  170. MMSYSERR_NOERROR = 0; //* no error */
  171. MMSYSERR_ERROR = MMSYSERR_BASE + 1; //* unspecified error */
  172. MMSYSERR_BADDEVICEID = MMSYSERR_BASE + 2; //* device ID out of range */
  173. MMSYSERR_NOTENABLED = MMSYSERR_BASE + 3; //* driver failed enable */
  174. MMSYSERR_ALLOCATED = MMSYSERR_BASE + 4; //* device already allocated */
  175. MMSYSERR_INVALHANDLE = MMSYSERR_BASE + 5; //* device handle is invalid */
  176. MMSYSERR_NODRIVER = MMSYSERR_BASE + 6; //* no device driver present */
  177. MMSYSERR_NOMEM = MMSYSERR_BASE + 7; //* memory allocation error */
  178. MMSYSERR_NOTSUPPORTED = MMSYSERR_BASE + 8; //* function isn't supported */
  179. MMSYSERR_BADERRNUM = MMSYSERR_BASE + 9; //* error value out of range */
  180. MMSYSERR_INVALFLAG = MMSYSERR_BASE + 10; //* invalid flag passed */
  181. MMSYSERR_INVALPARAM = MMSYSERR_BASE + 11; //* invalid parameter passed */
  182. MMSYSERR_HANDLEBUSY = MMSYSERR_BASE + 12; //* handle being used */
  183. //* simultaneously on another */
  184. //* thread (eg callback) */
  185. MMSYSERR_INVALIDALIAS = MMSYSERR_BASE + 13; //* specified alias not found */
  186. MMSYSERR_BADDB = MMSYSERR_BASE + 14; //* bad registry database */
  187. MMSYSERR_KEYNOTFOUND = MMSYSERR_BASE + 15; //* registry key not found */
  188. MMSYSERR_READERROR = MMSYSERR_BASE + 16; //* registry read error */
  189. MMSYSERR_WRITEERROR = MMSYSERR_BASE + 17; //* registry write error */
  190. MMSYSERR_DELETEERROR = MMSYSERR_BASE + 18; //* registry delete error */
  191. MMSYSERR_VALNOTFOUND = MMSYSERR_BASE + 19; //* registry value not found */
  192. MMSYSERR_NODRIVERCB = MMSYSERR_BASE + 20; //* driver does not call DriverCallback */
  193. MMSYSERR_LASTERROR = MMSYSERR_BASE + 20; //* last error in range */
  194. type
  195. HDRVR = HANDLE;
  196. {$IFNDEF MMNODRV}
  197. //
  198. // Installable driver support was left out.
  199. //
  200. {$ENDIF MMNODRV}
  201. {****************************************************************************
  202. Driver callback support
  203. ****************************************************************************}
  204. //* flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and */
  205. //* midiOutOpen() to specify the type of the dwCallback parameter. */
  206. const
  207. CALLBACK_TYPEMASK = $00070000; //* callback type mask */
  208. CALLBACK_NULL = $00000000; //* no callback */
  209. CALLBACK_WINDOW = $00010000; //* dwCallback is a HWND */
  210. CALLBACK_TASK = $00020000; //* dwCallback is a HTASK */
  211. CALLBACK_FUNCTION = $00030000; //* dwCallback is a FARPROC */
  212. CALLBACK_THREAD = CALLBACK_TASK;//* thread ID replaces 16 bit task */
  213. CALLBACK_EVENT = $00050000; //* dwCallback is an EVENT Handle */
  214. CALLBACK_MSGQUEUE = $00060000; //* dwCallback is HANDLE returned by CreateMsgQueue or OpenMsgQueue (new in Windows CE 5.0) */
  215. type
  216. DRVCALLBACK = procedure(_hdrvr:HANDLE; uMsg:UINT; dwUser:DWORD; dw1:DWORD; dw2:DWORD); cdecl;
  217. LPDRVCALLBACK = DRVCALLBACK;
  218. PDRVCALLBACK = DRVCALLBACK;
  219. {* CALLBACK_MSGQUEUE - client process sets up a MsgQueuue that receives WAVEMSG structures.
  220. * Note that structure fields are identical to arguments to a callback function
  221. * but we put the message field first to allow for multi-functional message queues.
  222. *}
  223. type
  224. _tag_WAVEMSG = record
  225. uMsg:UINT; // WOM_OPEN, WIM_OPEN, WOM_DONE, WIM_DATA, etc.
  226. hWav:HANDLE; // stream handle returned by waveInOpen or waveOutOpen
  227. dwInstance:DWORD; // value of dwInstance argument passed into waveInOpen or waveOutOpen
  228. dwParam1:DWORD; // completed WAVEHDR for WIM_DATA, WOM_DONE, reserved elsewhere
  229. dwParam2:DWORD; // reserved
  230. end;
  231. WAVEMSG = _tag_WAVEMSG;
  232. PWAVEMSG = ^_tag_WAVEMSG;
  233. {$IFNDEF MMNOSOUND}
  234. function sndPlaySoundW(lpszSoundName:LPCWSTR; fuSound:UINT):BOOL; external KernelDLL name 'sndPlaySoundW'; // index 266
  235. {$IFDEF UNICODE}
  236. function sndPlaySound(lpszSoundName:LPCWSTR; fuSound:UINT):BOOL; external KernelDLL name 'sndPlaySoundW'; // index 266
  237. {$ELSE} // UNICODE
  238. //#define sndPlaySound sndPlaySoundA
  239. {$ENDIF} // UNICODE
  240. function PlaySoundW(pszSound:LPCWSTR; hmod:HMODULE; fdwSound:DWORD):BOOL; external KernelDLL name 'PlaySoundW'; // index 267
  241. {$IFDEF UNICODE}
  242. function PlaySound(pszSound:LPCWSTR; hmod:HMODULE; fdwSound:DWORD):BOOL; external KernelDLL name 'PlaySoundW'; // index 267
  243. {$ELSE} // UNICODE
  244. //#define PlaySound PlaySoundA
  245. {$ENDIF} // UNICODE
  246. {*
  247. * flag values for fuSound arguments on [snd]PlaySound
  248. * or dwFlags for PlaySound
  249. *}
  250. //* sndAlias creates the alias identifier */
  251. const
  252. SND_ALIAS_START = 0; // ??? must be > 4096 to keep strings in same section of resource file
  253. function sndAlias(ch0:AnsiChar; ch1:AnsiChar):DWORD;
  254. const
  255. SND_ALIAS_SYSTEMASTERISK = SND_ALIAS_START+
  256. (DWORD(AnsiChar('S')) or
  257. DWORD(AnsiChar('*')));
  258. SND_ALIAS_SYSTEMQUESTION = SND_ALIAS_START+
  259. (DWORD(AnsiChar('S')) or
  260. DWORD(AnsiChar('?')));
  261. SND_ALIAS_SYSTEMHAND = SND_ALIAS_START+
  262. (DWORD(AnsiChar('S')) or
  263. DWORD(AnsiChar('H')));
  264. SND_ALIAS_SYSTEMEXIT = SND_ALIAS_START+
  265. (DWORD(AnsiChar('S')) or
  266. DWORD(AnsiChar('E')));
  267. SND_ALIAS_SYSTEMSTART = SND_ALIAS_START+
  268. (DWORD(AnsiChar('S')) or
  269. DWORD(AnsiChar('S')));
  270. SND_ALIAS_SYSTEMWELCOME = SND_ALIAS_START+
  271. (DWORD(AnsiChar('S')) or
  272. DWORD(AnsiChar('W')));
  273. SND_ALIAS_SYSTEMEXCLAMATION = SND_ALIAS_START+
  274. (DWORD(AnsiChar('S')) or
  275. DWORD(AnsiChar('!')));
  276. SND_ALIAS_SYSTEMDEFAULT = SND_ALIAS_START+
  277. (DWORD(AnsiChar('S')) or
  278. DWORD(AnsiChar('D')));
  279. SND_ALIAS = $00010000; // name is a WIN.INI [sounds] entry
  280. SND_FILENAME = $00020000; // name is a file name
  281. SND_RESOURCE = $00040004; // name is a resource name or atom
  282. SND_SYNC = $00000000; // play synchronously (default)
  283. SND_ASYNC = $00000001; // play asynchronously
  284. SND_NODEFAULT = $00000002; // silence not default, if sound not found
  285. SND_MEMORY = $00000004; // lpszSoundName points to a memory file
  286. SND_LOOP = $00000008; // loop the sound until next sndPlaySound
  287. SND_NOSTOP = $00000010; // don't stop any currently playing sound
  288. SND_NOWAIT = $00002000; // don't wait if the driver is busy
  289. SND_VALIDFLAGS = $0017201F; // Set of valid flag bits. Anything outside
  290. // this range will raise an error
  291. SND_RESERVED = $FF000000; // In particular these flags are reserved
  292. SND_TYPE_MASK = $00170007;
  293. SND_ALIAS_ID = $00110000; // name is a WIN.INI [sounds] entry identifier
  294. {$ENDIF} // MMNOSOUND
  295. {$IFNDEF MMNOWAVE}
  296. {****************************************************************************
  297. Waveform audio support
  298. ****************************************************************************}
  299. const
  300. //* waveform audio error return values */
  301. WAVERR_BADFORMAT = WAVERR_BASE + 0; // unsupported wave format
  302. WAVERR_STILLPLAYING = WAVERR_BASE + 1; // still something playing
  303. WAVERR_UNPREPARED = WAVERR_BASE + 2; // header not prepared
  304. WAVERR_SYNC = WAVERR_BASE + 3; // device is synchronous
  305. WAVERR_LASTERROR = WAVERR_BASE + 3; // last error in range
  306. //* waveform audio data types */
  307. type
  308. HWAVE = HANDLE;
  309. HWAVEIN = HANDLE;
  310. LPHWAVEIN = ^HWAVEIN;
  311. HWAVEOUT = HANDLE;
  312. LPHWAVEOUT = ^HWAVEOUT;
  313. WAVECALLBACK = DRVCALLBACK;
  314. LPWAVECALLBACK = WAVECALLBACK;
  315. const
  316. //* wave callback messages */
  317. WOM_OPEN = MM_WOM_OPEN;
  318. WOM_CLOSE = MM_WOM_CLOSE;
  319. WOM_DONE = MM_WOM_DONE;
  320. WIM_OPEN = MM_WIM_OPEN;
  321. WIM_CLOSE = MM_WIM_CLOSE;
  322. WIM_DATA = MM_WIM_DATA;
  323. //* device ID for wave device mapper */
  324. const
  325. WAVE_MAPPER = DWORD(-1);
  326. //* flags for dwFlags parameter in waveOutOpen() and waveInOpen() */
  327. const
  328. WAVE_FORMAT_QUERY = $00000001;
  329. WAVE_ALLOWSYNC = $00000002;
  330. WAVE_MAPPED = $00000004;
  331. WAVE_FORMAT_DIRECT = $00000008;
  332. WAVE_FORMAT_DIRECT_QUERY = WAVE_FORMAT_QUERY or WAVE_FORMAT_DIRECT;
  333. WAVE_NOMIXER = $00000080; //* Windows CE only - bypass software mixer */
  334. // Switch to DWORD packing for WAVEHDR
  335. // Warning: This assumes that the start of headers is DWORD aligned, which is a change from previous implementations.
  336. {$PACKRECORDS 4}// #include "pshpack4.h"
  337. //* wave data block header */
  338. type
  339. LPWAVEHDR = ^wavehdr_tag;
  340. wavehdr_tag = record
  341. lpData:LPSTR; //* pointer to locked data buffer */
  342. dwBufferLength:DWORD; //* length of data buffer */
  343. dwBytesRecorded:DWORD; //* used for input only */
  344. dwUser:DWORD; //* for client's use */
  345. dwFlags:DWORD; //* assorted flags (see defines) */
  346. dwLoops:DWORD; //* loop control counter */
  347. lpNext:LPWAVEHDR; //* reserved for driver */
  348. reserved:DWORD; //* reserved for driver */
  349. end;
  350. WAVEHDR = wavehdr_tag;
  351. PWAVEHDR = ^wavehdr_tag;
  352. NPWAVEHDR = ^wavehdr_tag;
  353. // Switch back to previous packing
  354. {$PACKRECORDS 1}// #include "poppack.h"
  355. //* flags for dwFlags field of WAVEHDR */
  356. const
  357. WHDR_DONE = $00000001; //* done bit */
  358. WHDR_PREPARED = $00000002; //* set if this header has been prepared */
  359. WHDR_BEGINLOOP = $00000004; //* loop start block */
  360. WHDR_ENDLOOP = $00000008; //* loop end block */
  361. WHDR_INQUEUE = $00000010; //* reserved for driver */
  362. //* waveform output device capabilities structure */
  363. type
  364. tagWAVEOUTCAPS = record
  365. wMid:word; //* manufacturer ID */
  366. wPid:word; //* product ID */
  367. vDriverVersion:MMVERSION; //* version of the driver */
  368. szPname:array[0..MAXPNAMELEN-1] of TCHAR; //* product name (NULL terminated string) */
  369. dwFormats:DWORD; //* formats supported */
  370. wChannels:word; //* number of sources supported */
  371. wReserved1:word; //* packing */
  372. dwSupport:DWORD; //* functionality supported by driver */
  373. end;
  374. WAVEOUTCAPS = tagWAVEOUTCAPS;
  375. PWAVEOUTCAPS = ^tagWAVEOUTCAPS;
  376. NPWAVEOUTCAPS = ^tagWAVEOUTCAPS;
  377. LPWAVEOUTCAPS = ^tagWAVEOUTCAPS;
  378. //* flags for dwSupport field of WAVEOUTCAPS */
  379. const
  380. WAVECAPS_PITCH = $0001; //* supports pitch control */
  381. WAVECAPS_PLAYBACKRATE = $0002; //* supports playback rate control */
  382. WAVECAPS_VOLUME = $0004; //* supports volume control */
  383. WAVECAPS_LRVOLUME = $0008; //* separate left-right volume control */
  384. // WAVECAPS_SYNC = $0010; //* Windows CE only supports asynchronous audio devices */
  385. WAVECAPS_SAMPLEACCURATE = $0020;
  386. WAVECAPS_DIRECTSOUND = $0040;
  387. //* waveform input device capabilities structure */
  388. type
  389. tagWAVEINCAPS = record
  390. wMid:word; //* manufacturer ID */
  391. wPid:word; //* product ID */
  392. vDriverVersion:MMVERSION; //* version of the driver */
  393. szPname:array[0..MAXPNAMELEN-1] of TCHAR; //* product name (NULL terminated string) */
  394. dwFormats:DWORD; //* formats supported */
  395. wChannels:word; //* number of channels supported */
  396. wReserved1:word; //* structure packing */
  397. end;
  398. WAVEINCAPS = tagWAVEINCAPS;
  399. PWAVEINCAPS = ^tagWAVEINCAPS;
  400. NPWAVEINCAPS = ^tagWAVEINCAPS;
  401. LPWAVEINCAPS = ^tagWAVEINCAPS;
  402. //* defines for dwFormat field of WAVEINCAPS and WAVEOUTCAPS */
  403. const
  404. WAVE_INVALIDFORMAT = $00000000; //* invalid format */
  405. WAVE_FORMAT_1M08 = $00000001; //* 11.025 kHz, Mono, 8-bit */
  406. WAVE_FORMAT_1S08 = $00000002; //* 11.025 kHz, Stereo, 8-bit */
  407. WAVE_FORMAT_1M16 = $00000004; //* 11.025 kHz, Mono, 16-bit */
  408. WAVE_FORMAT_1S16 = $00000008; //* 11.025 kHz, Stereo, 16-bit */
  409. WAVE_FORMAT_2M08 = $00000010; //* 22.05 kHz, Mono, 8-bit */
  410. WAVE_FORMAT_2S08 = $00000020; //* 22.05 kHz, Stereo, 8-bit */
  411. WAVE_FORMAT_2M16 = $00000040; //* 22.05 kHz, Mono, 16-bit */
  412. WAVE_FORMAT_2S16 = $00000080; //* 22.05 kHz, Stereo, 16-bit */
  413. WAVE_FORMAT_4M08 = $00000100; //* 44.1 kHz, Mono, 8-bit */
  414. WAVE_FORMAT_4S08 = $00000200; //* 44.1 kHz, Stereo, 8-bit */
  415. WAVE_FORMAT_4M16 = $00000400; //* 44.1 kHz, Mono, 16-bit */
  416. WAVE_FORMAT_4S16 = $00000800; //* 44.1 kHz, Stereo, 16-bit */
  417. //* property information for audio gain classes */
  418. //* audio gain class property sets */
  419. const
  420. MM_PROPSET_GAINCLASS_CLASS:GUID = '{E7E569A5-8498-43FE-8075-33D1FDAB15EF}';
  421. MM_PROPSET_GAINCLASS_STREAM:GUID = '{40E953AE-EE3E-493A-93EE-DA3E30764390}';
  422. (*
  423. #define MM_PROPSET_GAINCLASS_CLASS \
  424. { 0xe7e569a5, 0x8498, 0x43fe, { 0x80, 0x75, 0x33, 0xd1, 0xfd, 0xab, 0x15, 0xef } }
  425. #define MM_PROPSET_GAINCLASS_STREAM \
  426. { 0x40e953ae, 0xee3e, 0x493a, { 0x93, 0xee, 0xda, 0x3e, 0x30, 0x76, 0x43, 0x90 } }
  427. *)
  428. const
  429. //* MM_PROPSET_GAINCLASS_CLASS property IDs */
  430. MM_PROP_GAINCLASS_CLASS = 1;
  431. //* MM_PROPSET_GAINCLASS_STREAM property IDs */
  432. MM_PROP_GAINCLASS_STREAM = 1;
  433. //* structure to describe audio gain classes */
  434. type
  435. tagAUDIOGAINCLASS = record
  436. dwPriority:DWORD;
  437. dwRelativeGain:DWORD;
  438. end;
  439. AUDIOGAINCLASS = tagAUDIOGAINCLASS;
  440. PAUDIOGAINCLASS = ^tagAUDIOGAINCLASS;
  441. CPAUDIOGAINCLASS = ^AUDIOGAINCLASS;
  442. //* values for AUDIOGAINCLASS.dwPriority */
  443. const
  444. WAGC_PRIORITY_CRITICAL = 6;
  445. WAGC_PRIORITY_HIGH = 4;
  446. WAGC_PRIORITY_NORMAL = 2;
  447. //* wave stream properties structure */
  448. type
  449. tagSTREAMPROPS = record
  450. dwClassID:DWORD;
  451. dwFlags:DWORD;
  452. end;
  453. STREAMPROPS = tagSTREAMPROPS;
  454. PSTREAMPROPS = ^tagSTREAMPROPS;
  455. CPSTREAMPROPS = ^STREAMPROPS;
  456. //* flag definitions for STREAMPROPS.dwFlags */
  457. const
  458. SPSFL_NOTIFY_GAIN_CHANGE = $00000001; //* callback gets MM_WOM_ATTENUATED messages */
  459. SPSFL_EXCLUDE = $00000002; //* stream does not participate in gain-class operations */
  460. //* values for STREAMPROPS.dwClassid */
  461. const
  462. WAGC_CLASS_DEFAULT = 0;
  463. WAGC_CLASS_NORMAL = 1;
  464. WAGC_CLASS_AUDIO_ALERT = 2;
  465. WAGC_CLASS_SPEECH_ALERT = 3;
  466. WAGC_CLASS_SPEECH_NOTIFICATION = 4;
  467. WAGC_CLASS_AUDIO_NOTIFICATION = 5;
  468. WAGC_CLASS_FORCE_MUTE = 6;
  469. //* classes 7-15 are reserved for future use */
  470. WAGC_CLASS_MAX = 15; //* class ID's larger than this are illegal */
  471. //* Discontinuity detection property set */
  472. MM_PROPSET_DISCONTINUITY:GUID = '{B4389733-868E-4D06-B008-9A6FC8CE852E}';
  473. {
  474. #define MM_PROPSET_DISCONTINUITY \
  475. { 0xb4389733, 0x868e, 0x4d06, { 0xb0, 0x8, 0x9a, 0x6f, 0xc8, 0xce, 0x85, 0x2e } }
  476. }
  477. //* MM_PROPSET_DISCONTINUITY property IDs */
  478. MM_PROP_DISCONTINUITY = 1;
  479. //* bit values for MM_PROP_DISCONTINUITY parameter */
  480. WDSC_APP = 1;
  481. WDSC_SWMIXER = 2;
  482. WDSC_DRIVER = 4;
  483. //* structure to receive discontinuity information */
  484. type
  485. tagAUDIODISCONTINUITY = record
  486. dwMask:DWORD; // bitmask shows which values were set (see WDSC_* values above)
  487. dwApp:DWORD; // # discontinuities detected at the application level
  488. dwSwMixer:DWORD; // # discontinuities detected at the software mixer level
  489. dwDriver:DWORD; // # discontinuities detected at the driver level
  490. end;
  491. AUDIODISCONTINUITY = tagAUDIODISCONTINUITY;
  492. PAUDIODISCONTINUITY = ^tagAUDIODISCONTINUITY;
  493. //* waveform audio function prototypes */
  494. function waveOutGetNumDevs:UINT; external KernelDLL name 'waveOutGetNumDevs'; // index 268
  495. function waveOutGetDevCaps(uDeviceID:UINT; pwoc:LPWAVEOUTCAPS; cbwoc:UINT):MMRESULT; external KernelDLL name 'waveOutGetDevCaps'; // index 269
  496. function waveOutGetVolume(hwo:HWAVEOUT; pdwVolume:LPDWORD):MMRESULT; external KernelDLL name 'waveOutGetVolume'; // index 26A
  497. function waveOutSetVolume(hwo:HWAVEOUT; dwVolume:DWORD):MMRESULT; external KernelDLL name 'waveOutSetVolume'; // index 26B
  498. function waveOutGetErrorText(mmrError:MMRESULT; pszText:PTSTR; cchText:UINT):MMRESULT; external KernelDLL name 'waveOutGetErrorText'; // index 26C
  499. function waveOutClose(hwo:HWAVEOUT):MMRESULT; external KernelDLL name 'waveOutClose'; // index 26D
  500. function waveOutPrepareHeader(hwo:HWAVEOUT; pwh:LPWAVEHDR; cbwh:UINT):MMRESULT; external KernelDLL name 'waveOutPrepareHeader'; // index 26E
  501. function waveOutUnprepareHeader(hwo:HWAVEOUT; pwh:LPWAVEHDR; cbwh:UINT):MMRESULT; external KernelDLL name 'waveOutUnprepareHeader'; // index 26F
  502. function waveOutWrite(hwo:HWAVEOUT; pwh:LPWAVEHDR; cbwh:UINT):MMRESULT; external KernelDLL name 'waveOutWrite'; // index 270
  503. function waveOutPause(hwo:HWAVEOUT):MMRESULT; external KernelDLL name 'waveOutPause'; // index 271
  504. function waveOutRestart(hwo:HWAVEOUT):MMRESULT; external KernelDLL name 'waveOutRestart'; // index 272
  505. function waveOutReset(hwo:HWAVEOUT):MMRESULT; external KernelDLL name 'waveOutReset'; // index 273
  506. function waveOutBreakLoop(hwo:HWAVEOUT):MMRESULT; external KernelDLL name 'waveOutBreakLoop'; // index 274
  507. function waveOutGetPosition(hwo:HWAVEOUT; pmmt:LPMMTIME; cbmmt:UINT):MMRESULT; external KernelDLL name 'waveOutGetPosition'; // index 275
  508. function waveOutGetPitch(hwo:HWAVEOUT; pdwPitch:LPDWORD):MMRESULT; external KernelDLL name 'waveOutGetPitch'; // index 276
  509. function waveOutSetPitch(hwo:HWAVEOUT; dwPitch:DWORD):MMRESULT; external KernelDLL name 'waveOutSetPitch'; // index 277
  510. function waveOutGetPlaybackRate(hwo:HWAVEOUT; pdwRate:LPDWORD):MMRESULT; external KernelDLL name 'waveOutGetPlaybackRate'; // index 278
  511. function waveOutSetPlaybackRate(hwo:HWAVEOUT; dwRate:DWORD):MMRESULT; external KernelDLL name 'waveOutSetPlaybackRate'; // index 279
  512. function waveOutGetID(hwo:HWAVEOUT; puDeviceID:LPUINT):MMRESULT; external KernelDLL name 'waveOutGetID'; // index 27A
  513. function waveOutMessage(hwo:HWAVEOUT; uMsg:UINT; dw1:DWORD; dw2:DWORD):MMRESULT; external KernelDLL name 'waveOutMessage'; // index 27B
  514. function waveOutOpen(Phwo:LPHWAVEOUT;
  515. uDeviceID:UINT;
  516. pwfx:LPCWAVEFORMATEX;
  517. dwCallback:DWORD;
  518. dwInstance:DWORD;
  519. fdwOpen:DWORD):MMRESULT; external KernelDLL name 'waveOutOpen'; // index 27C
  520. function waveOutGetProperty(uDeviceID:UINT;
  521. pPropSetId:PGUID;
  522. ulPropId:ULONG;
  523. pvPropParams:LPVOID;
  524. cbPropParams:ULONG;
  525. pvPropData:LPVOID;
  526. cbPropData:ULONG;
  527. pcbReturn:PULONG):MMRESULT; external KernelDLL name 'waveOutGetProperty'; // index ?
  528. function waveOutSetProperty(uDeviceID:UINT;
  529. pPropSetId:PGUID;
  530. ulPropId:ULONG;
  531. pvPropParams:LPVOID;
  532. cbPropParams:ULONG;
  533. pvPropData:LPVOID;
  534. cbPropData:ULONG):MMRESULT; external KernelDLL name 'waveOutSetProperty'; // index ?
  535. function waveInGetNumDevs:UINT; external KernelDLL name 'waveInGetNumDevs'; // index 27D
  536. function waveInGetDevCaps(uDeviceID:UINT; pwic:LPWAVEINCAPS; cbwic:UINT):MMRESULT; external KernelDLL name 'waveInGetDevCaps'; // index 27E
  537. function waveInGetErrorText(mmrError:MMRESULT; pszText:LPTSTR; cchText:UINT):MMRESULT; external KernelDLL name 'waveInGetErrorText'; // index 27F
  538. function waveInClose(hwi:HWAVEIN):MMRESULT; external KernelDLL name 'waveInClose'; // index 280
  539. function waveInPrepareHeader(hwi:HWAVEIN; pwh:LPWAVEHDR; cbwh:UINT):MMRESULT; external KernelDLL name 'waveInPrepareHeader'; // index 281
  540. function waveInUnprepareHeader(hwi:HWAVEIN; pwh:LPWAVEHDR; cbwh:UINT):MMRESULT; external KernelDLL name 'waveInUnprepareHeader'; // index 282
  541. function waveInAddBuffer(hwi:HWAVEIN; pwh:LPWAVEHDR; cbwh:UINT):MMRESULT; external KernelDLL name 'waveInAddBuffer'; // index 283
  542. function waveInStart(hwi:HWAVEIN):MMRESULT; external KernelDLL name 'waveInStart'; // index 284
  543. function waveInStop(hwi:HWAVEIN):MMRESULT; external KernelDLL name 'waveInStop'; // index 285
  544. function waveInReset(hwi:HWAVEIN):MMRESULT; external KernelDLL name 'waveInReset'; // index 286
  545. function waveInGetPosition(hwi:HWAVEIN; pmmt:LPMMTIME; cbmmt:UINT):MMRESULT; external KernelDLL name 'waveInGetPosition'; // index 287
  546. function waveInGetID(hwi:HWAVEIN; puDeviceID:LPUINT):MMRESULT; external KernelDLL name 'waveInGetID'; // index 288
  547. function waveInMessage(hwi:HWAVEIN; uMsg:UINT; dw1:DWORD; dw2:DWORD):MMRESULT; external KernelDLL name 'waveInMessage'; // index 289
  548. function waveInOpen(phwi:LPHWAVEIN;
  549. uDeviceID:UINT;
  550. pwfx:LPCWAVEFORMATEX;
  551. dwCallback:DWORD;
  552. dwInstance:DWORD;
  553. fdwOpen:DWORD):MMRESULT; external KernelDLL name 'waveInOpen'; // index 28A
  554. function waveInGetProperty(uDeviceID:UINT;
  555. pPropSetId:PGUID;
  556. ulPropId:ULONG;
  557. pvPropParams:LPVOID;
  558. cbPropParams:ULONG;
  559. pvPropData:LPVOID;
  560. cbPropData:ULONG;
  561. pcbReturn:PULONG):MMRESULT; external KernelDLL name 'waveInGetProperty'; // index ?
  562. function waveInSetProperty(uDeviceID:UINT;
  563. pPropSetId:PGUID;
  564. ulPropId:ULONG;
  565. pvPropParams:LPVOID;
  566. cbPropParams:ULONG;
  567. pvPropData:LPVOID;
  568. cbPropData:ULONG):MMRESULT; external KernelDLL name 'waveInSetProperty'; // index ?
  569. {$ENDIF} // MMNOWAVE
  570. {$IFNDEF MMNOMIDI}
  571. {****************************************************************************
  572. MIDI audio support
  573. ****************************************************************************}
  574. const
  575. //* MIDI error return values */
  576. MIDIERR_UNPREPARED = MIDIERR_BASE + 0; //* header not prepared */
  577. MIDIERR_STILLPLAYING = MIDIERR_BASE + 1; //* still something playing */
  578. MIDIERR_NOMAP = MIDIERR_BASE + 2; //* no configured instruments */
  579. MIDIERR_NOTREADY = MIDIERR_BASE + 3; //* hardware is still busy */
  580. MIDIERR_NODEVICE = MIDIERR_BASE + 4; //* port no longer connected */
  581. MIDIERR_INVALIDSETUP = MIDIERR_BASE + 5; //* invalid MIF */
  582. MIDIERR_BADOPENMODE = MIDIERR_BASE + 6; //* operation unsupported w/ open mode */
  583. MIDIERR_DONT_CONTINUE = MIDIERR_BASE + 7; //* thru device 'eating' a message */
  584. MIDIERR_LASTERROR = MIDIERR_BASE + 7; //* last error in range */
  585. //* MIDI audio data types */
  586. type
  587. HMIDI = HANDLE;
  588. HMIDIIN = HANDLE;
  589. HMIDIOUT = HANDLE;
  590. HMIDISTRM = HANDLE;
  591. LPHMIDI = ^HMIDI;
  592. LPHMIDIIN = ^HMIDIIN;
  593. LPHMIDIOUT = ^HMIDIOUT;
  594. LPHMIDISTRM = ^HMIDISTRM;
  595. MIDICALLBACK = DRVCALLBACK;
  596. LPMIDICALLBACK = MIDICALLBACK;
  597. const
  598. MIDIPATCHSIZE = 128;
  599. type
  600. PATCHARRAY = array[0..MIDIPATCHSIZE-1] of word;
  601. LPPATCHARRAY = ^PATCHARRAY;
  602. KEYARRAY = array[0..MIDIPATCHSIZE-1] of word;
  603. LPKEYARRAY = ^KEYARRAY;
  604. //* MIDI callback messages */
  605. const
  606. MIM_OPEN = MM_MIM_OPEN;
  607. MIM_CLOSE = MM_MIM_CLOSE;
  608. MIM_DATA = MM_MIM_DATA;
  609. MIM_LONGDATA = MM_MIM_LONGDATA;
  610. MIM_ERROR = MM_MIM_ERROR;
  611. MIM_LONGERROR = MM_MIM_LONGERROR;
  612. MOM_OPEN = MM_MOM_OPEN;
  613. MOM_CLOSE = MM_MOM_CLOSE;
  614. MOM_DONE = MM_MOM_DONE;
  615. MIM_MOREDATA = MM_MIM_MOREDATA;
  616. MOM_POSITIONCB = MM_MOM_POSITIONCB;
  617. //* device ID for MIDI mapper */
  618. const
  619. MIDIMAPPER = UINT(-1);
  620. MIDI_MAPPER = UINT(-1);
  621. //* flags for dwFlags parm of midiInOpen() */
  622. const
  623. MIDI_IO_STATUS = $00000020;
  624. MIDI_IO_CONTROL = $00000008; //* Internal */
  625. MIDI_IO_INPUT = $00000010; //*future*/ /* Internal */
  626. MIDI_IO_OWNED = $00004000; //* Internal */
  627. MIDI_IO_SHARED = $00008000; //* Internal */
  628. MIDI_I_VALID = $C027; //* Internal */
  629. MIDI_O_VALID = $C00E; //* Internal */
  630. //* flags for wFlags parm of midiOutCachePatches(), midiOutCacheDrumPatches() */
  631. MIDI_CACHE_ALL = 1;
  632. MIDI_CACHE_BESTFIT = 2;
  633. MIDI_CACHE_QUERY = 3;
  634. MIDI_UNCACHE = 4;
  635. MIDI_CACHE_VALID = MIDI_CACHE_ALL or MIDI_CACHE_BESTFIT or MIDI_CACHE_QUERY or MIDI_UNCACHE; //* Internal */
  636. //* MIDI output device capabilities structure */
  637. {$IFDEF _WIN32}
  638. type
  639. tagMIDIOUTCAPSA = record
  640. wMid:word; //* manufacturer ID */
  641. wPid:word; //* product ID */
  642. vDriverVersion:MMVERSION; //* version of the driver */
  643. szPname:array[0..MAXPNAMELEN-1] of AnsiChar; //* product name (NULL terminated string) */
  644. wTechnology:word; //* type of device */
  645. wVoices:word; //* # of voices (internal synth only) */
  646. wNotes:word; //* max # of notes (internal synth only) */
  647. wChannelMask:word; //* channels used (internal synth only) */
  648. dwSupport:DWORD; //* functionality supported by driver */
  649. end;
  650. MIDIOUTCAPSA = tagMIDIOUTCAPSA;
  651. PMIDIOUTCAPSA = ^tagMIDIOUTCAPSA;
  652. NPMIDIOUTCAPSA = ^tagMIDIOUTCAPSA;
  653. LPMIDIOUTCAPSA = ^tagMIDIOUTCAPSA;
  654. type
  655. tagMIDIOUTCAPSW = record
  656. wMid:word; //* manufacturer ID */
  657. wPid:word; //* product ID */
  658. vDriverVersion:MMVERSION; //* version of the driver */
  659. szPname:array[0..MAXPNAMELEN-1] of WCHAR; //* product name (NULL terminated string) */
  660. wTechnology:word; //* type of device */
  661. wVoices:word; //* # of voices (internal synth only) */
  662. wNotes:word; //* max # of notes (internal synth only) */
  663. wChannelMask:word; //* channels used (internal synth only) */
  664. dwSupport:DWORD; //* functionality supported by driver */
  665. end;
  666. MIDIOUTCAPSW = tagMIDIOUTCAPSW;
  667. PMIDIOUTCAPSW = ^tagMIDIOUTCAPSW;
  668. NPMIDIOUTCAPSW = ^tagMIDIOUTCAPSW;
  669. LPMIDIOUTCAPSW = ^tagMIDIOUTCAPSW;
  670. {$IFDEF UNICODE}
  671. MIDIOUTCAPS = MIDIOUTCAPSW;
  672. PMIDIOUTCAPS = PMIDIOUTCAPSW;
  673. NPMIDIOUTCAPS = NPMIDIOUTCAPSW;
  674. LPMIDIOUTCAPS = LPMIDIOUTCAPSW;
  675. {$ELSE} // UNICODE
  676. MIDIOUTCAPS = MIDIOUTCAPSA;
  677. PMIDIOUTCAPS = PMIDIOUTCAPSA;
  678. NPMIDIOUTCAPS = NPMIDIOUTCAPSA;
  679. LPMIDIOUTCAPS = LPMIDIOUTCAPSA;
  680. {$ENDIF} // UNICODE
  681. {$ELSE} // _WIN32
  682. type
  683. midioutcaps_tag = record
  684. wMid:word; //* manufacturer ID */
  685. wPid:word; //* product ID */
  686. vDriverVersion:MMVERSION; //* version of the driver */
  687. szPname:array[0..MAXPNAMELEN-1] of AnsiChar; //* product name (NULL terminated string) */
  688. wTechnology:word; //* type of device */
  689. wVoices:word; //* # of voices (internal synth only) */
  690. wNotes:word; //* max # of notes (internal synth only) */
  691. wChannelMask:word; //* channels used (internal synth only) */
  692. dwSupport:DWORD; //* functionality supported by driver */
  693. end;
  694. MIDIOUTCAPS = midioutcaps_tag;
  695. PMIDIOUTCAPS = ^midioutcaps_tag;
  696. NPMIDIOUTCAPS = ^midioutcaps_tag;
  697. LPMIDIOUTCAPS = ^midioutcaps_tag;
  698. {$ENDIF} // _WIN32
  699. const
  700. //* flags for wTechnology field of MIDIOUTCAPS structure */
  701. MOD_MIDIPORT = 1; //* output port */
  702. MOD_SYNTH = 2; //* generic internal synth */
  703. MOD_SQSYNTH = 3; //* square wave internal synth */
  704. MOD_FMSYNTH = 4; //* FM internal synth */
  705. MOD_MAPPER = 5; //* MIDI mapper */
  706. //* flags for dwSupport field of MIDIOUTCAPS structure */
  707. MIDICAPS_VOLUME = $0001; //* supports volume control */
  708. MIDICAPS_LRVOLUME = $0002; //* separate left-right volume control */
  709. MIDICAPS_CACHE = $0004;
  710. MIDICAPS_STREAM = $0008; //* driver supports midiStreamOut directly */
  711. //* MIDI input device capabilities structure */
  712. {$IFDEF _WIN32}
  713. type
  714. tagMIDIINCAPSA = record
  715. wMid:word; //* manufacturer ID */
  716. wPid:word; //* product ID */
  717. vDriverVersion:MMVERSION; //* version of the driver */
  718. szPname:array[0..MAXPNAMELEN-1] of AnsiChar; //* product name (NULL terminated string) */
  719. //#if (WINVER >= 0x0400)
  720. dwSupport:DWORD; //* functionality supported by driver */
  721. //#endif
  722. end;
  723. MIDIINCAPSA = tagMIDIINCAPSA;
  724. PMIDIINCAPSA = ^tagMIDIINCAPSA;
  725. NPMIDIINCAPSA = ^tagMIDIINCAPSA;
  726. LPMIDIINCAPSA = ^tagMIDIINCAPSA;
  727. type
  728. tagMIDIINCAPSW = record
  729. wMid:word; //* manufacturer ID */
  730. wPid:word; //* product ID */
  731. vDriverVersion:MMVERSION; //* version of the driver */
  732. szPname:array[0..MAXPNAMELEN-1] of WCHAR; //* product name (NULL terminated string) */
  733. //#if (WINVER >= 0x0400)
  734. dwSupport:DWORD; //* functionality supported by driver */
  735. //#endif
  736. end;
  737. MIDIINCAPSW = tagMIDIINCAPSW;
  738. PMIDIINCAPSW = ^tagMIDIINCAPSW;
  739. NPMIDIINCAPSW = ^tagMIDIINCAPSW;
  740. LPMIDIINCAPSW = ^tagMIDIINCAPSW;
  741. {$IFDEF UNICODE}
  742. MIDIINCAPS = MIDIINCAPSW;
  743. PMIDIINCAPS = PMIDIINCAPSW;
  744. NPMIDIINCAPS = NPMIDIINCAPSW;
  745. LPMIDIINCAPS = LPMIDIINCAPSW;
  746. {$ELSE} // UNICODE
  747. MIDIINCAPS = MIDIINCAPSA;
  748. PMIDIINCAPS = PMIDIINCAPSA;
  749. NPMIDIINCAPS = NPMIDIINCAPSA;
  750. LPMIDIINCAPS = LPMIDIINCAPSA;
  751. {$ENDIF} // UNICODE
  752. {$ELSE} // _WIN32
  753. type
  754. midiincaps_tag = record
  755. wMid:word; //* manufacturer ID */
  756. wPid:word; //* product ID */
  757. vDriverVersion:MMVERSION; //* version of the driver */
  758. szPname:array[0..MAXPNAMELEN-1] of AnsiChar; //* product name (NULL terminated string) */
  759. //#if (WINVER >= 0x0400)
  760. dwSupport:DWORD; //* functionality supported by driver */
  761. //#endif
  762. end;
  763. MIDIINCAPS = midiincaps_tag;
  764. PMIDIINCAPS = ^midiincaps_tag;
  765. NPMIDIINCAPS = ^midiincaps_tag;
  766. LPMIDIINCAPS = ^midiincaps_tag;
  767. {$ENDIF} // _WIN32
  768. //* MIDI data block header */
  769. type
  770. LPMIDIHDR = ^midihdr_tag;
  771. midihdr_tag = record
  772. lpData:LPSTR; //* pointer to locked data block */
  773. dwBufferLength:DWORD; //* length of data in data block */
  774. dwBytesRecorded:DWORD; //* used for input only */
  775. dwUser:DWORD; //* for client's use */
  776. dwFlags:DWORD; //* assorted flags (see defines) */
  777. lpNext:LPMIDIHDR; //* reserved for driver */
  778. reserved:DWORD; //* reserved for driver */
  779. //#if (WINVER >= 0x0400)
  780. dwOffset:DWORD; //* Callback offset into buffer */
  781. dwReserved:array[0..7] of DWORD; //* Reserved for MMSYSTEM */
  782. //#endif
  783. end;
  784. MIDIHDR = midihdr_tag;
  785. PMIDIHDR = ^midihdr_tag;
  786. NPMIDIHDR = ^midihdr_tag;
  787. type
  788. midievent_tag = record
  789. dwDeltaTime:DWORD; //* Ticks since last event */
  790. dwStreamID:DWORD; //* Reserved; must be zero */
  791. dwEvent:DWORD; //* Event type and parameters */
  792. dwParms:array[0..0] of DWORD; //* Parameters if this is a long event */
  793. end;
  794. MIDIEVENT = midievent_tag;
  795. type
  796. midistrmbuffver_tag = record
  797. dwVersion:DWORD; //* Stream buffer format version */
  798. dwMid:DWORD; //* Manufacturer ID as defined in MMREG.H */
  799. dwOEMVersion:DWORD; //* Manufacturer version for custom ext */
  800. end;
  801. MIDISTRMBUFFVER = midistrmbuffver_tag;
  802. const
  803. //* flags for dwFlags field of MIDIHDR structure */
  804. MHDR_DONE = $00000001; //* done bit */
  805. MHDR_PREPARED = $00000002; //* set if header prepared */
  806. MHDR_INQUEUE = $00000004; //* reserved for driver */
  807. MHDR_ISSTRM = $00000008; //* Buffer is stream buffer */
  808. MHDR_SENDING = $00000020; //* Internal */
  809. MHDR_MAPPED = $00001000; //* thunked header */ /* Internal */
  810. MHDR_SHADOWHDR = $00002000; //* MIDIHDR is 16-bit shadow */ /* Internal */
  811. MHDR_VALID = $e000302F; //* valid flags */ /* Internal */
  812. MHDR_SAVE = $e0003000; //* Save these flags */ /* Internal */
  813. //* past driver calls */ /* Internal */
  814. //* Dreamcast-only flags for tonebank support */
  815. MHDR_WRITEABLE = $e0000000;
  816. MHDR_GENERALMIDI = $80000000; //* Indicates a tonebank that is to be used */
  817. //* by General MIDI stream ports */
  818. MHDR_GMDRUM = $40000000; //* In combination with GENERALMIDI, indicates */
  819. //* a GM drum tonebank. By itself, indicates an */
  820. //* "alternate" GM drum tonebank */
  821. MHDR_MAPPINGTABLE = $20000000; //* Indicates that this MIDIHDR is for a */
  822. //* program mapping table rather than an actual */
  823. //* tonebank */
  824. //* */
  825. //* Type codes which go in the high byte of the event DWORD of a stream buffer */
  826. //* */
  827. //* Type codes 00-7F contain parameters within the low 24 bits */
  828. //* Type codes 80-FF contain a length of their parameter in the low 24 */
  829. //* bits, followed by their parameter data in the buffer. The event */
  830. //* DWORD contains the exact byte length; the parm data itself must be */
  831. //* padded to be an even multiple of 4 bytes long. */
  832. //* */
  833. const
  834. MEVT_F_SHORT = $00000000;
  835. MEVT_F_LONG = $80000000;
  836. MEVT_F_CALLBACK = $40000000;
  837. MEVT_SHORTMSG = byte($00); //* parm = shortmsg for midiOutShortMsg */
  838. MEVT_TEMPO = byte($01); //* parm = new tempo in microsec/qn */
  839. MEVT_NOP = byte($02); //* parm = unused; does nothing */
  840. function MEVT_EVENTTYPE(x:DWORD):byte;
  841. function MEVT_EVENTPARM(x:DWORD):DWORD;
  842. //* 0x04-0x7F reserved */
  843. const
  844. MEVT_LONGMSG = byte($80); //* parm = bytes to send verbatim */
  845. MEVT_COMMENT = byte($82); //* parm = comment data */
  846. MEVT_VERSION = byte($84); //* parm = MIDISTRMBUFFVER struct */
  847. //* 0x81-0xFF reserved */
  848. MIDISTRM_ERROR = -2;
  849. //* */
  850. //* Structures and defines for midiStreamProperty */
  851. //* */
  852. MIDIPROP_SET = $80000000;
  853. MIDIPROP_GET = $40000000;
  854. //* These are intentionally both non-zero so the app cannot accidentally */
  855. //* leave the operation off and happen to appear to work due to default */
  856. //* action. */
  857. function MIDIPROP_PROPERTY(mp:DWORD):DWORD;
  858. const
  859. MIDIPROP_TIMEDIV = 00000001;
  860. MIDIPROP_TEMPO = 00000002;
  861. MIDIPROP_SMF = 00000003;
  862. MIDIPROP_BUFFERED = 00000004;
  863. MIDIPROP_LOOPING = 00000005;
  864. MIDIPROP_GENERALMIDI = 00000006;
  865. //* Some useful defines to help with Standard MIDI File Format stuff */
  866. SMF_TIMEDIV_QUARTERNOTE = 0;
  867. SMF_TIMEDIV_SECONDS = 1;
  868. function SMF_TIMEDIV(format:DWORD; division:DWORD):DWORD;
  869. function SMF_TIMEDIV_SMPTE(smpte:DWORD; division:DWORD):DWORD;
  870. function SMF_TIMEDIV_ISSMPTE(dw:DWORD):DWORD;
  871. function SMF_TIMEDIV_GETSMPTE(dw:DWORD):byte;
  872. function SMF_TIMEDIV_GETTPF(dw:DWORD):DWORD;
  873. function SMF_TIMEDIV_GETTPQN(dw:DWORD):DWORD;
  874. type
  875. midiproptimediv_tag = record
  876. cbStruct:DWORD;
  877. dwTimeDiv:DWORD;
  878. end;
  879. MIDIPROPTIMEDIV = midiproptimediv_tag;
  880. LPMIDIPROPTIMEDIV = ^midiproptimediv_tag;
  881. type
  882. midiproptempo_tag = record
  883. cbStruct:DWORD;
  884. dwTempo:DWORD;
  885. end;
  886. MIDIPROPTEMPO = midiproptempo_tag;
  887. LPMIDIPROPTEMPO = ^midiproptempo_tag;
  888. const
  889. MIDIPROP_PROPVAL = $3FFFFFFF; //* Internal */
  890. // The library exports midi-functions.
  891. {$IFDEF _WIN32}
  892. const
  893. MIDIDLL = 'winmm.dll';
  894. {$ELSE _WIN32}
  895. const
  896. MIDIDLL = KernelDLL;
  897. {$ENDIF _WIN32}
  898. //* MIDI function prototypes */
  899. function midiOutGetNumDevs:UINT; external MIDIDLL name 'midiOutGetNumDevs';
  900. function midiStreamOpen(phms:LPHMIDISTRM; puDeviceID:LPUINT; cMidi:DWORD; dwCallback:DWORD; dwInstance:DWORD; fdwOpen:DWORD):MMRESULT; external MIDIDLL name 'midiStreamOpen'; // index
  901. function midiStreamClose(hms:HMIDISTRM):MMRESULT; external MIDIDLL name 'midiStreamClose'; // index
  902. function midiStreamProperty(hms:HMIDISTRM; lppropdata:LPBYTE; dwProperty:DWORD):MMRESULT; external MIDIDLL name 'midiStreamProperty'; // index
  903. function midiStreamPosition(hms:HMIDISTRM; lpmmt:LPMMTIME; cbmmt:UINT):MMRESULT; external MIDIDLL name 'midiStreamPosition'; // index
  904. function midiStreamOut(hms:HMIDISTRM; pmh:LPMIDIHDR; cbmh:UINT):MMRESULT; external MIDIDLL name 'midiStreamOut'; // index
  905. function midiStreamPause(hms:HMIDISTRM):MMRESULT; external MIDIDLL name 'midiStreamPause'; // index
  906. function midiStreamRestart(hms:HMIDISTRM):MMRESULT; external MIDIDLL name 'midiStreamRestart'; // index
  907. function midiStreamStop(hms:HMIDISTRM):MMRESULT; external MIDIDLL name 'midiStreamStop'; // index
  908. {$IFDEF _WIN32}
  909. function midiConnect(hmi:HMIDI; hmo:HMIDIOUT; pReserved:LPVOID):MMRESULT; external MIDIDLL name 'midiConnect'; // index
  910. function midiDisconnect(hmi:HMIDI; hmo:HMIDIOUT; pReserved:LPVOID):MMRESULT; external MIDIDLL name 'midiDisconnect'; // index
  911. {$ENDIF} // _WIN32
  912. {$IFDEF _WIN32}
  913. function midiOutGetDevCapsA(uDeviceID:UINT; pmoc:LPMIDIOUTCAPSA; cbmoc:UINT):MMRESULT; external MIDIDLL name 'midiOutGetDevCapsA'; // index
  914. function midiOutGetDevCapsW(uDeviceID:UINT; pmoc:LPMIDIOUTCAPSW; cbmoc:UINT):MMRESULT; external MIDIDLL name 'midiOutGetDevCapsW'; // index
  915. {$IFDEF UNICODE}
  916. function midiOutGetDevCaps(uDeviceID:UINT; pmoc:LPMIDIOUTCAPSW; cbmoc:UINT):MMRESULT; external MIDIDLL name 'midiOutGetDevCapsW'; // index
  917. {$ELSE} // UNICODE
  918. function midiOutGetDevCaps(uDeviceID:UINT; pmoc:LPMIDIOUTCAPSA; cbmoc:UINT):MMRESULT; external MIDIDLL name 'midiOutGetDevCapsA'; // index
  919. {$ENDIF} // UNICODE
  920. {$ELSE} // _WIN32
  921. function midiOutGetDevCaps(uDeviceID:UINT; pmoc:LPMIDIOUTCAPS; cbmoc:UINT):MMRESULT; external MIDIDLL name 'midiOutGetDevCaps'; // index
  922. {$ENDIF} // _WIN32
  923. function midiOutGetVolume(hmo:HMIDIOUT; pdwVolume:LPDWORD):MMRESULT; external MIDIDLL name 'midiOutGetVolume'; // index
  924. function midiOutSetVolume(hmo:HMIDIOUT; dwVolume:DWORD):MMRESULT; external MIDIDLL name 'midiOutSetVolume'; // index
  925. {$IFDEF _WIN32}
  926. function midiOutGetErrorTextA(mmrError:MMRESULT; pszText:LPSTR; cchText:UINT):MMRESULT; external MIDIDLL name 'midiOutGetErrorTextA'; // index
  927. function midiOutGetErrorTextW(mmrError:MMRESULT; pszText:LPWSTR; cchText:UINT):MMRESULT; external MIDIDLL name 'midiOutGetErrorTextW'; // index
  928. {$IFDEF UNICODE}
  929. function midiOutGetErrorText(mmrError:MMRESULT; pszText:LPWSTR; cchText:UINT):MMRESULT; external MIDIDLL name 'midiOutGetErrorTextW'; // index
  930. {$ELSE} // UNICODE
  931. function midiOutGetErrorText(mmrError:MMRESULT; pszText:LPSTR; cchText:UINT):MMRESULT; external MIDIDLL name 'midiOutGetErrorTextA'; // index
  932. {$ENDIF} // UNICODE
  933. {$ELSE} // _WIN32
  934. function midiOutGetErrorText(mmrError:MMRESULT; pszText:LPSTR; cchText:UINT):MMRESULT; external MIDIDLL name 'midiOutGetErrorText'; // index
  935. {$ENDIF} // _WIN32
  936. function midiOutOpen(phmo:LPHMIDIOUT; uDeviceID:UINT;
  937. dwCallback:DWORD; dwInstance:DWORD; fdwOpen:DWORD):MMRESULT; external MIDIDLL name 'midiOutOpen'; // index
  938. function midiOutClose(hmo:HMIDIOUT):MMRESULT; external MIDIDLL name 'midiOutClose'; // index
  939. function midiOutPrepareHeader(hmo:HMIDIOUT; pmh:LPMIDIHDR; cbmh:UINT):MMRESULT; external MIDIDLL name 'midiOutPrepareHeader'; // index
  940. function midiOutUnprepareHeader(hmo:HMIDIOUT; pmh:LPMIDIHDR; cbmh:UINT):MMRESULT; external MIDIDLL name 'midiOutUnprepareHeader'; // index
  941. function midiOutShortMsg(hmo:HMIDIOUT; dwMsg:DWORD):MMRESULT; external MIDIDLL name 'midiOutShortMsg'; // index
  942. function midiOutLongMsg(hmo:HMIDIOUT; pmh:LPMIDIHDR; cbmh:UINT):MMRESULT; external MIDIDLL name 'midiOutLongMsg'; // index
  943. function midiOutReset(hmo:HMIDIOUT):MMRESULT; external MIDIDLL name 'midiOutReset'; // index
  944. function midiOutCachePatches(hmo:HMIDIOUT; uBank:UINT; pwpa:LPWORD; fuCache:UINT):MMRESULT; external MIDIDLL name 'midiOutCachePatches'; // index
  945. function midiOutCacheDrumPatches(hmo:HMIDIOUT; uPatch:UINT; pwkya:LPWORD; fuCache:UINT):MMRESULT; external MIDIDLL name 'midiOutCacheDrumPatches'; // index
  946. function midiOutGetID(hmo:HMIDIOUT; puDeviceID:LPUINT):MMRESULT; external MIDIDLL name 'midiOutGetID'; // index
  947. {$IFDEF _WIN32}
  948. function midiOutMessage(hmo:HMIDIOUT; uMsg:UINT; dw1:DWORD; dw2:DWORD):MMRESULT; external MIDIDLL name 'midiOutMessage'; // index
  949. {$ELSE} // _WIN32
  950. function midiOutMessage(hmo:HMIDIOUT; uMsg:UINT; dw1:DWORD; dw2:DWORD):DWORD; external MIDIDLL name 'midiOutMessage'; // index
  951. {$ENDIF} // _WIN32
  952. function midiInGetNumDevs:UINT; external MIDIDLL name 'midiInGetNumDevs'; // index
  953. {$IFDEF _WIN32}
  954. function midiInGetDevCapsA(uDeviceID:UINT; pmic:LPMIDIINCAPSA; cbmic:UINT):MMRESULT; external MIDIDLL name 'midiInGetDevCapsA'; // index
  955. function midiInGetDevCapsW(uDeviceID:UINT; pmic:LPMIDIINCAPSW; cbmic:UINT):MMRESULT; external MIDIDLL name 'midiInGetDevCapsW'; // index
  956. {$IFDEF UNICODE}
  957. function midiInGetDevCaps(uDeviceID:UINT; pmic:LPMIDIINCAPSW; cbmic:UINT):MMRESULT; external MIDIDLL name 'midiInGetDevCapsW'; // index
  958. {$ELSE} // UNICODE
  959. function midiInGetDevCaps(uDeviceID:UINT; pmic:LPMIDIINCAPSA; cbmic:UINT):MMRESULT; external MIDIDLL name 'midiInGetDevCapsA'; // index
  960. {$ENDIF} // UNICODE
  961. function midiInGetErrorTextA(mmrError:MMRESULT; pszText:LPSTR; cchText:UINT):MMRESULT; external MIDIDLL name 'midiInGetErrorTextA'; // index
  962. function midiInGetErrorTextW(mmrError:MMRESULT; pszText:LPWSTR; cchText:UINT):MMRESULT; external MIDIDLL name 'midiInGetErrorTextW'; // index
  963. {$IFDEF UNICODE}
  964. function midiInGetErrorText(mmrError:MMRESULT; pszText:LPWSTR; cchText:UINT):MMRESULT; external MIDIDLL name 'midiInGetErrorTextW'; // index
  965. {$ELSE} // UNICODE
  966. function midiInGetErrorText(mmrError:MMRESULT; pszText:LPSTR; cchText:UINT):MMRESULT; external MIDIDLL name 'midiInGetErrorTextA'; // index
  967. {$ENDIF} // UNICODE
  968. {$ELSE} // _WIN32
  969. function midiInGetDevCaps(uDeviceID:UINT; pmic:LPMIDIINCAPS; cbmic:UINT):MMRESULT; external MIDIDLL name 'midiInGetDevCaps'; // index
  970. function midiInGetErrorText(mmrError:MMRESULT; pszText:LPSTR; cchText:UINT):MMRESULT; external MIDIDLL name 'midiInGetErrorText'; // index
  971. {$ENDIF} // _WIN32
  972. function midiInOpen(phmi:LPHMIDIIN; uDeviceID:UINT;
  973. dwCallback:DWORD; dwInstance:DWORD; fdwOpen:DWORD):MMRESULT; external MIDIDLL name 'midiInOpen'; // index
  974. function midiInClose(hmi:HMIDIIN):MMRESULT; external MIDIDLL name 'midiInClose'; // index
  975. function midiInPrepareHeader(hmi:HMIDIIN; pmh:LPMIDIHDR; cbmh:UINT):MMRESULT; external MIDIDLL name 'midiInPrepareHeader'; // index
  976. function midiInUnprepareHeader(hmi:HMIDIIN; pmh:LPMIDIHDR; cbmh:UINT):MMRESULT; external MIDIDLL name 'midiInUnprepareHeader'; // index
  977. function midiInAddBuffer(hmi:HMIDIIN; pmh:LPMIDIHDR; cbmh:UINT):MMRESULT; external MIDIDLL name 'midiInAddBuffer'; // index
  978. function midiInStart(hmi:HMIDIIN):MMRESULT; external MIDIDLL name 'midiInStart'; // index
  979. function midiInStop(hmi:HMIDIIN):MMRESULT; external MIDIDLL name 'midiInStop'; // index
  980. function midiInReset(hmi:HMIDIIN):MMRESULT; external MIDIDLL name 'midiInReset'; // index
  981. function midiInGetID(hmi:HMIDIIN; puDeviceID:LPUINT):MMRESULT; external MIDIDLL name 'midiInGetID'; // index
  982. {$IFDEF _WIN32}
  983. function midiInMessage(hmi:HMIDIIN; uMsg:UINT; dw1:DWORD; dw2:DWORD):MMRESULT; external MIDIDLL name 'midiInMessage'; // index
  984. {$ELSE} // _WIN32
  985. function midiInMessage(hmi:HMIDIIN; uMsg:UINT; dw1:DWORD; dw2:DWORD):DWORD; external MIDIDLL name 'midiInMessage'; // index
  986. {$ENDIF} // _WIN32
  987. {$ENDIF} // MMNOMIDI
  988. {$IFNDEF MMNOMIXER}
  989. {****************************************************************************
  990. Mixer Support
  991. ****************************************************************************}
  992. type
  993. HMIXEROBJ = HANDLE;
  994. LPHMIXEROBJ = ^HMIXEROBJ;
  995. HMIXER = HANDLE;
  996. LPHMIXER = ^HMIXER;
  997. const
  998. MIXER_SHORT_NAME_CHARS = 16;
  999. MIXER_LONG_NAME_CHARS = 64;
  1000. //* */
  1001. //* MMRESULT error return values specific to the mixer API */
  1002. //* */
  1003. //* */
  1004. const
  1005. MIXERR_INVALLINE = MIXERR_BASE + 0;
  1006. MIXERR_INVALCONTROL = MIXERR_BASE + 1;
  1007. MIXERR_INVALVALUE = MIXERR_BASE + 2;
  1008. MIXERR_LASTERROR = MIXERR_BASE + 2;
  1009. MIXER_OBJECTF_HANDLE = $80000000;
  1010. MIXER_OBJECTF_MIXER = $00000000;
  1011. MIXER_OBJECTF_HMIXER = MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIXER;
  1012. MIXER_OBJECTF_WAVEOUT = $10000000;
  1013. MIXER_OBJECTF_HWAVEOUT = MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_WAVEOUT;
  1014. MIXER_OBJECTF_WAVEIN = $20000000;
  1015. MIXER_OBJECTF_HWAVEIN = MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_WAVEIN;
  1016. MIXER_OBJECTF_MIDIOUT = $30000000;
  1017. MIXER_OBJECTF_HMIDIOUT = MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIOUT;
  1018. MIXER_OBJECTF_MIDIIN = $40000000;
  1019. MIXER_OBJECTF_HMIDIIN = MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIIN;
  1020. MIXER_OBJECTF_AUX = $50000000;
  1021. function mixerGetNumDevs:UINT; external KernelDLL name 'mixerGetNumDevs'; // index 2AE
  1022. type
  1023. tagMIXERCAPS = record
  1024. wMid:word; //* manufacturer id */
  1025. wPid:word; //* product id */
  1026. vDriverVersion:MMVERSION; //* version of the driver */
  1027. szPname:array[0..MAXPNAMELEN-1] of TCHAR; //* product name */
  1028. fdwSupport:DWORD; //* misc. support bits */
  1029. cDestinations:DWORD; //* count of destinations */
  1030. end;
  1031. MIXERCAPS = tagMIXERCAPS;
  1032. PMIXERCAPS = ^tagMIXERCAPS;
  1033. LPMIXERCAPS = ^tagMIXERCAPS;
  1034. function mixerGetDevCaps(uMxId:UINT; pmxcaps:LPMIXERCAPS; cbmxcaps:UINT):MMRESULT; external KernelDLL name 'mixerGetDevCaps'; // index 2AA
  1035. function mixerOpen(phmx:LPHMIXER; uMxId:UINT; dwCallback:DWORD; dwInstance:DWORD; fdwOpen:DWORD):MMRESULT; external KernelDLL name 'mixerOpen'; // index 2B0
  1036. function mixerClose(hmx:HMIXER):MMRESULT; external KernelDLL name 'mixerClose'; // index 2B2
  1037. function mixerMessage(hmx:HMIXER; uMsg:UINT; dwParam1:DWORD; dwParam2:DWORD):DWORD; external KernelDLL name 'mixerMessage'; // index 2AF
  1038. type
  1039. tMIXERLINE = record
  1040. cbStruct:DWORD; //* size of MIXERLINE structure */
  1041. dwDestination:DWORD; //* zero based destination index */
  1042. dwSource:DWORD; //* zero based source index (if source) */
  1043. dwLineID:DWORD; //* unique line id for mixer device */
  1044. fdwLine:DWORD; //* state/information about line */
  1045. dwUser:DWORD; //* driver specific information */
  1046. dwComponentType:DWORD; //* component type line connects to */
  1047. cChannels:DWORD; //* number of channels line supports */
  1048. cConnections:DWORD; //* number of connections [possible] */
  1049. cControls:DWORD; //* number of controls at this line */
  1050. szShortName:array[0..MIXER_SHORT_NAME_CHARS-1] of TCHAR;
  1051. szName:array[0..MIXER_LONG_NAME_CHARS-1] of TCHAR;
  1052. Target:record
  1053. dwType:DWORD; //* MIXERLINE_TARGETTYPE_xxxx */
  1054. dwDeviceID:DWORD; //* target device ID of device type */
  1055. wMid:word; //* of target device */
  1056. wPid:word; //* " */
  1057. vDriverVersion:MMVERSION; //* " */
  1058. szPname:array[0..MAXPNAMELEN-1] of TCHAR; //* " */
  1059. end;
  1060. end;
  1061. MIXERLINE = tMIXERLINE;
  1062. PMIXERLINE = ^tMIXERLINE;
  1063. LPMIXERLINE = ^tMIXERLINE;
  1064. //* */
  1065. //* MIXERLINE.fdwLine */
  1066. //* */
  1067. //* */
  1068. const
  1069. MIXERLINE_LINEF_ACTIVE = $00000001;
  1070. MIXERLINE_LINEF_DISCONNECTED = $00008000;
  1071. MIXERLINE_LINEF_SOURCE = $80000000;
  1072. //* */
  1073. //* MIXERLINE.dwComponentType */
  1074. //* */
  1075. //* component types for destinations and sources */
  1076. //* */
  1077. //* */
  1078. MIXERLINE_COMPONENTTYPE_DST_FIRST = $00000000;
  1079. MIXERLINE_COMPONENTTYPE_DST_UNDEFINED = MIXERLINE_COMPONENTTYPE_DST_FIRST + 0;
  1080. MIXERLINE_COMPONENTTYPE_DST_DIGITAL = MIXERLINE_COMPONENTTYPE_DST_FIRST + 1;
  1081. MIXERLINE_COMPONENTTYPE_DST_LINE = MIXERLINE_COMPONENTTYPE_DST_FIRST + 2;
  1082. MIXERLINE_COMPONENTTYPE_DST_MONITOR = MIXERLINE_COMPONENTTYPE_DST_FIRST + 3;
  1083. MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = MIXERLINE_COMPONENTTYPE_DST_FIRST + 4;
  1084. MIXERLINE_COMPONENTTYPE_DST_HEADPHONES = MIXERLINE_COMPONENTTYPE_DST_FIRST + 5;
  1085. MIXERLINE_COMPONENTTYPE_DST_TELEPHONE = MIXERLINE_COMPONENTTYPE_DST_FIRST + 6;
  1086. MIXERLINE_COMPONENTTYPE_DST_WAVEIN = MIXERLINE_COMPONENTTYPE_DST_FIRST + 7;
  1087. MIXERLINE_COMPONENTTYPE_DST_VOICEIN = MIXERLINE_COMPONENTTYPE_DST_FIRST + 8;
  1088. MIXERLINE_COMPONENTTYPE_DST_LAST = MIXERLINE_COMPONENTTYPE_DST_FIRST + 8;
  1089. MIXERLINE_COMPONENTTYPE_SRC_FIRST = $00001000;
  1090. MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0;
  1091. MIXERLINE_COMPONENTTYPE_SRC_DIGITAL = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1;
  1092. MIXERLINE_COMPONENTTYPE_SRC_LINE = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2;
  1093. MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3;
  1094. MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 4;
  1095. MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 5;
  1096. MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 6;
  1097. MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 7;
  1098. MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 8;
  1099. MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 9;
  1100. MIXERLINE_COMPONENTTYPE_SRC_ANALOG = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10;
  1101. MIXERLINE_COMPONENTTYPE_SRC_LAST = MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10;
  1102. //* */
  1103. //* MIXERLINE.Target.dwType */
  1104. //* */
  1105. //* */
  1106. MIXERLINE_TARGETTYPE_UNDEFINED = 0;
  1107. MIXERLINE_TARGETTYPE_WAVEOUT = 1;
  1108. MIXERLINE_TARGETTYPE_WAVEIN = 2;
  1109. MIXERLINE_TARGETTYPE_MIDIOUT = 3;
  1110. MIXERLINE_TARGETTYPE_MIDIIN = 4;
  1111. MIXERLINE_TARGETTYPE_AUX = 5;
  1112. function mixerGetLineInfo(hmxobj:HMIXEROBJ; pmxl:LPMIXERLINE; fdwInfo:DWORD):MMRESULT; external KernelDLL name 'mixerGetLineInfo'; // index 2AD
  1113. const
  1114. MIXER_GETLINEINFOF_DESTINATION = $00000000;
  1115. MIXER_GETLINEINFOF_SOURCE = $00000001;
  1116. MIXER_GETLINEINFOF_LINEID = $00000002;
  1117. MIXER_GETLINEINFOF_COMPONENTTYPE = $00000003;
  1118. MIXER_GETLINEINFOF_TARGETTYPE = $00000004;
  1119. MIXER_GETLINEINFOF_QUERYMASK = $0000000F;
  1120. function mixerGetID(hmxobj:HMIXEROBJ; puMxId:LPUINT; fdwId:DWORD):MMRESULT; external KernelDLL name 'mixerGetID'; // index 2AB
  1121. //* */
  1122. //* MIXERCONTROL */
  1123. //* */
  1124. //* */
  1125. type
  1126. tMIXERCONTROL = record
  1127. cbStruct:DWORD; //* size in bytes of MIXERCONTROL */
  1128. dwControlID:DWORD; //* unique control id for mixer device */
  1129. dwControlType:DWORD; //* MIXERCONTROL_CONTROLTYPE_xxx */
  1130. fdwControl:DWORD; //* MIXERCONTROL_CONTROLF_xxx */
  1131. cMultipleItems:DWORD; //* if MIXERCONTROL_CONTROLF_MULTIPLE set */
  1132. szShortName:array[0..MIXER_SHORT_NAME_CHARS-1] of TCHAR;
  1133. szName:array[0..MIXER_LONG_NAME_CHARS-1] of TCHAR;
  1134. Bounds:record
  1135. case DWORD of
  1136. 0: (lMinimum:LONG; //* signed minimum for this control */
  1137. lMaximum:LONG); //* signed maximum for this control */
  1138. 1: (dwMinimum:DWORD; //* unsigned minimum for this control */
  1139. dwMaximum:DWORD); //* unsigned maximum for this control */
  1140. 2: (dwReserved:array[0..5] of DWORD);
  1141. end;
  1142. Metrics:record
  1143. case DWORD of
  1144. 0: (cSteps:DWORD); //* # of steps between min & max */
  1145. 1: (cbCustomData:DWORD); //* size in bytes of custom data */
  1146. 2: (dwReserved:array[0..5] of DWORD);
  1147. end;
  1148. end;
  1149. MIXERCONTROL = tMIXERCONTROL;
  1150. PMIXERCONTROL = ^tMIXERCONTROL;
  1151. LPMIXERCONTROL = ^tMIXERCONTROL;
  1152. const
  1153. //* */
  1154. //* MIXERCONTROL.fdwControl */
  1155. //* */
  1156. //* */
  1157. MIXERCONTROL_CONTROLF_UNIFORM = $00000001;
  1158. MIXERCONTROL_CONTROLF_MULTIPLE = $00000002;
  1159. MIXERCONTROL_CONTROLF_DISABLED = $80000000;
  1160. //* */
  1161. //* MIXERCONTROL_CONTROLTYPE_xxx building block defines */
  1162. //* */
  1163. //* */
  1164. MIXERCONTROL_CT_CLASS_MASK = $F0000000;
  1165. MIXERCONTROL_CT_CLASS_CUSTOM = $00000000;
  1166. MIXERCONTROL_CT_CLASS_METER = $10000000;
  1167. MIXERCONTROL_CT_CLASS_SWITCH = $20000000;
  1168. MIXERCONTROL_CT_CLASS_NUMBER = $30000000;
  1169. MIXERCONTROL_CT_CLASS_SLIDER = $40000000;
  1170. MIXERCONTROL_CT_CLASS_FADER = $50000000;
  1171. MIXERCONTROL_CT_CLASS_TIME = $60000000;
  1172. MIXERCONTROL_CT_CLASS_LIST = $70000000;
  1173. MIXERCONTROL_CT_SUBCLASS_MASK = $0F000000;
  1174. MIXERCONTROL_CT_SC_SWITCH_BOOLEAN = $00000000;
  1175. MIXERCONTROL_CT_SC_SWITCH_BUTTON = $01000000;
  1176. MIXERCONTROL_CT_SC_METER_POLLED = $00000000;
  1177. MIXERCONTROL_CT_SC_TIME_MICROSECS = $00000000;
  1178. MIXERCONTROL_CT_SC_TIME_MILLISECS = $01000000;
  1179. MIXERCONTROL_CT_SC_LIST_SINGLE = $00000000;
  1180. MIXERCONTROL_CT_SC_LIST_MULTIPLE = $01000000;
  1181. MIXERCONTROL_CT_UNITS_MASK = $00FF0000;
  1182. MIXERCONTROL_CT_UNITS_CUSTOM = $00000000;
  1183. MIXERCONTROL_CT_UNITS_BOOLEAN = $00010000;
  1184. MIXERCONTROL_CT_UNITS_SIGNED = $00020000;
  1185. MIXERCONTROL_CT_UNITS_UNSIGNED = $00030000;
  1186. MIXERCONTROL_CT_UNITS_DECIBELS = $00040000; //* in 10ths */
  1187. MIXERCONTROL_CT_UNITS_PERCENT = $00050000; //* in 10ths */
  1188. //* */
  1189. //* Commonly used control types for specifying MIXERCONTROL.dwControlType */
  1190. //* */
  1191. MIXERCONTROL_CONTROLTYPE_CUSTOM = MIXERCONTROL_CT_CLASS_CUSTOM or MIXERCONTROL_CT_UNITS_CUSTOM;
  1192. MIXERCONTROL_CONTROLTYPE_BOOLEANMETER = MIXERCONTROL_CT_CLASS_METER or MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_BOOLEAN;
  1193. MIXERCONTROL_CONTROLTYPE_SIGNEDMETER = MIXERCONTROL_CT_CLASS_METER or MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_SIGNED;
  1194. MIXERCONTROL_CONTROLTYPE_PEAKMETER = MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1;
  1195. MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER = MIXERCONTROL_CT_CLASS_METER or MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_UNSIGNED;
  1196. MIXERCONTROL_CONTROLTYPE_BOOLEAN = MIXERCONTROL_CT_CLASS_SWITCH or MIXERCONTROL_CT_SC_SWITCH_BOOLEAN or MIXERCONTROL_CT_UNITS_BOOLEAN;
  1197. MIXERCONTROL_CONTROLTYPE_ONOFF = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 1;
  1198. MIXERCONTROL_CONTROLTYPE_MUTE = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2;
  1199. MIXERCONTROL_CONTROLTYPE_MONO = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 3;
  1200. MIXERCONTROL_CONTROLTYPE_LOUDNESS = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 4;
  1201. MIXERCONTROL_CONTROLTYPE_STEREOENH = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 5;
  1202. // - mmreg.h
  1203. MIXERCONTROL_CONTROLTYPE_SRS_MTS = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 6;
  1204. MIXERCONTROL_CONTROLTYPE_SRS_ONOFF = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 7;
  1205. MIXERCONTROL_CONTROLTYPE_SRS_SYNTHSELECT = MIXERCONTROL_CONTROLTYPE_BOOLEAN + 8;
  1206. // - end of mmreg.h
  1207. MIXERCONTROL_CONTROLTYPE_BUTTON = MIXERCONTROL_CT_CLASS_SWITCH or MIXERCONTROL_CT_SC_SWITCH_BUTTON or MIXERCONTROL_CT_UNITS_BOOLEAN;
  1208. MIXERCONTROL_CONTROLTYPE_DECIBELS = MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_DECIBELS;
  1209. MIXERCONTROL_CONTROLTYPE_SIGNED = MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_SIGNED;
  1210. MIXERCONTROL_CONTROLTYPE_UNSIGNED = MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_UNSIGNED;
  1211. MIXERCONTROL_CONTROLTYPE_PERCENT = MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_PERCENT;
  1212. MIXERCONTROL_CONTROLTYPE_SLIDER = MIXERCONTROL_CT_CLASS_SLIDER or MIXERCONTROL_CT_UNITS_SIGNED;
  1213. MIXERCONTROL_CONTROLTYPE_PAN = MIXERCONTROL_CONTROLTYPE_SLIDER + 1;
  1214. MIXERCONTROL_CONTROLTYPE_QSOUNDPAN = MIXERCONTROL_CONTROLTYPE_SLIDER + 2;
  1215. MIXERCONTROL_CONTROLTYPE_FADER = MIXERCONTROL_CT_CLASS_FADER or MIXERCONTROL_CT_UNITS_UNSIGNED;
  1216. MIXERCONTROL_CONTROLTYPE_VOLUME = MIXERCONTROL_CONTROLTYPE_FADER + 1;
  1217. MIXERCONTROL_CONTROLTYPE_BASS = MIXERCONTROL_CONTROLTYPE_FADER + 2;
  1218. MIXERCONTROL_CONTROLTYPE_TREBLE = MIXERCONTROL_CONTROLTYPE_FADER + 3;
  1219. MIXERCONTROL_CONTROLTYPE_EQUALIZER = MIXERCONTROL_CONTROLTYPE_FADER + 4;
  1220. MIXERCONTROL_CONTROLTYPE_SINGLESELECT = MIXERCONTROL_CT_CLASS_LIST or MIXERCONTROL_CT_SC_LIST_SINGLE or MIXERCONTROL_CT_UNITS_BOOLEAN;
  1221. MIXERCONTROL_CONTROLTYPE_MUX = MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1;
  1222. MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT = MIXERCONTROL_CT_CLASS_LIST or MIXERCONTROL_CT_SC_LIST_MULTIPLE or MIXERCONTROL_CT_UNITS_BOOLEAN;
  1223. MIXERCONTROL_CONTROLTYPE_MIXER = MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT + 1;
  1224. MIXERCONTROL_CONTROLTYPE_MICROTIME = MIXERCONTROL_CT_CLASS_TIME or MIXERCONTROL_CT_SC_TIME_MICROSECS or MIXERCONTROL_CT_UNITS_UNSIGNED;
  1225. MIXERCONTROL_CONTROLTYPE_MILLITIME = MIXERCONTROL_CT_CLASS_TIME or MIXERCONTROL_CT_SC_TIME_MILLISECS or MIXERCONTROL_CT_UNITS_UNSIGNED;
  1226. //* */
  1227. //* MIXERLINECONTROLS */
  1228. //* */
  1229. type
  1230. tMIXERLINECONTROLS = record
  1231. cbStruct:DWORD; //* size in bytes of MIXERLINECONTROLS */
  1232. dwLineID:DWORD; //* line id (from MIXERLINE.dwLineID) */
  1233. case DWORD of
  1234. 0: (dwControlID:DWORD); //* MIXER_GETLINECONTROLSF_ONEBYID */
  1235. 1: (dwControlType:DWORD; //* MIXER_GETLINECONTROLSF_ONEBYTYPE */
  1236. cControls:DWORD; //* count of controls pmxctrl points to */
  1237. cbmxctrl:DWORD; //* size in bytes of _one_ MIXERCONTROL */
  1238. pamxctrl:LPMIXERCONTROL); //* pointer to first MIXERCONTROL array */
  1239. end;
  1240. MIXERLINECONTROLS = tMIXERLINECONTROLS;
  1241. PMIXERLINECONTROLS = ^tMIXERLINECONTROLS;
  1242. LPMIXERLINECONTROLS = ^tMIXERLINECONTROLS;
  1243. function mixerGetLineControls(hmxobj:HMIXEROBJ; pmxlc:LPMIXERLINECONTROLS; fdwControls:DWORD):MMRESULT; external KernelDLL name 'mixerGetLineControls'; // index 2AC
  1244. const
  1245. MIXER_GETLINECONTROLSF_ALL = $00000000;
  1246. MIXER_GETLINECONTROLSF_ONEBYID = $00000001;
  1247. MIXER_GETLINECONTROLSF_ONEBYTYPE = $00000002;
  1248. MIXER_GETLINECONTROLSF_QUERYMASK = $0000000F;
  1249. type
  1250. tMIXERCONTROLDETAILS = record
  1251. cbStruct:DWORD; //* size in bytes of MIXERCONTROLDETAILS */
  1252. dwControlID:DWORD; //* control id to get/set details on */
  1253. cChannels:DWORD; //* number of channels in paDetails array */
  1254. case DWORD of
  1255. 0: (hwndOwner:HWND); //* for MIXER_SETCONTROLDETAILSF_CUSTOM */
  1256. 1: (cMultipleItems:DWORD; //* if _MULTIPLE, the number of items per channel */
  1257. cbDetails:DWORD; //* size of _one_ details_XX struct */
  1258. paDetails:LPVOID); //* pointer to array of details_XX structs */
  1259. end;
  1260. MIXERCONTROLDETAILS = tMIXERCONTROLDETAILS;
  1261. PMIXERCONTROLDETAILS = ^tMIXERCONTROLDETAILS;
  1262. LPMIXERCONTROLDETAILS = ^tMIXERCONTROLDETAILS;
  1263. //* */
  1264. //* MIXER_GETCONTROLDETAILSF_LISTTEXT */
  1265. //* */
  1266. //* */
  1267. type
  1268. tMIXERCONTROLDETAILS_LISTTEXT = record
  1269. dwParam1:DWORD;
  1270. dwParam2:DWORD;
  1271. szName:array[0..MIXER_LONG_NAME_CHARS-1] of TCHAR;
  1272. end;
  1273. MIXERCONTROLDETAILS_LISTTEXT = tMIXERCONTROLDETAILS_LISTTEXT;
  1274. PMIXERCONTROLDETAILS_LISTTEXT = ^tMIXERCONTROLDETAILS_LISTTEXT;
  1275. LPMIXERCONTROLDETAILS_LISTTEXT = ^tMIXERCONTROLDETAILS_LISTTEXT;
  1276. //* */
  1277. //* MIXER_GETCONTROLDETAILSF_VALUE */
  1278. //* */
  1279. //* */
  1280. type
  1281. tMIXERCONTROLDETAILS_BOOLEAN = record
  1282. fValue:LONG;
  1283. end;
  1284. MIXERCONTROLDETAILS_BOOLEAN = tMIXERCONTROLDETAILS_BOOLEAN;
  1285. PMIXERCONTROLDETAILS_BOOLEAN = ^tMIXERCONTROLDETAILS_BOOLEAN;
  1286. LPMIXERCONTROLDETAILS_BOOLEAN = ^tMIXERCONTROLDETAILS_BOOLEAN;
  1287. type
  1288. tMIXERCONTROLDETAILS_SIGNED = record
  1289. lValue:LONG;
  1290. end;
  1291. MIXERCONTROLDETAILS_SIGNED = tMIXERCONTROLDETAILS_SIGNED;
  1292. PMIXERCONTROLDETAILS_SIGNED = ^tMIXERCONTROLDETAILS_SIGNED;
  1293. LPMIXERCONTROLDETAILS_SIGNED = ^tMIXERCONTROLDETAILS_SIGNED;
  1294. type
  1295. tMIXERCONTROLDETAILS_UNSIGNED = record
  1296. dwValue:DWORD;
  1297. end;
  1298. MIXERCONTROLDETAILS_UNSIGNED = tMIXERCONTROLDETAILS_UNSIGNED;
  1299. PMIXERCONTROLDETAILS_UNSIGNED = ^tMIXERCONTROLDETAILS_UNSIGNED;
  1300. LPMIXERCONTROLDETAILS_UNSIGNED = ^tMIXERCONTROLDETAILS_UNSIGNED;
  1301. function mixerGetControlDetails(hmxobj:HMIXEROBJ; pmxcd:LPMIXERCONTROLDETAILS; fdwDetails:DWORD):MMRESULT; external KernelDLL name 'mixerGetControlDetails'; // index 2A9
  1302. const
  1303. MIXER_GETCONTROLDETAILSF_VALUE = $00000000;
  1304. MIXER_GETCONTROLDETAILSF_LISTTEXT = $00000001;
  1305. MIXER_GETCONTROLDETAILSF_QUERYMASK = $0000000F;
  1306. function mixerSetControlDetails(hmxobj:HMIXEROBJ; pmxcd:LPMIXERCONTROLDETAILS; fdwDetails:DWORD):MMRESULT; external KernelDLL name 'mixerSetControlDetails'; // index 2B1
  1307. const
  1308. MIXER_SETCONTROLDETAILSF_VALUE = $00000000;
  1309. MIXER_SETCONTROLDETAILSF_CUSTOM = $00000001;
  1310. MIXER_SETCONTROLDETAILSF_QUERYMASK = $0000000F;
  1311. {$ENDIF} // MMNOMIXER
  1312. {$IFNDEF MMNOTIMER}
  1313. {****************************************************************************
  1314. Timer support
  1315. ****************************************************************************}
  1316. //* timer error return values */
  1317. const
  1318. TIMERR_NOERROR = 0; //* no error */
  1319. TIMERR_NOCANDO = TIMERR_BASE+1; //* request not completed */
  1320. TIMERR_STRUCT = TIMERR_BASE+33; //* time struct size */
  1321. //* timer data types */
  1322. type
  1323. TIMECALLBACK = procedure(uTimerID:UINT; uMsg:UINT; dwUser:DWORD; dw1:DWORD; dw2:DWORD); cdecl;
  1324. LPTIMECALLBACK = TIMECALLBACK;
  1325. //* flags for fuEvent parameter of timeSetEvent() function */
  1326. const
  1327. TIME_ONESHOT = $0000; //* program timer for single event */
  1328. TIME_PERIODIC = $0001; //* program for continuous periodic event */
  1329. {.$IFDEF _WIN32}
  1330. TIME_CALLBACK_FUNCTION = $0000; //* callback is function */
  1331. TIME_CALLBACK_EVENT_SET = $0010; //* callback is event - use SetEvent */
  1332. TIME_CALLBACK_EVENT_PULSE = $0020; //* callback is event - use PulseEvent */
  1333. TIME_CALLBACK_TYPEMASK = $00F0; //* Internal */
  1334. {.$ENDIF} // _WIN32
  1335. //* timer device capabilities data structure */
  1336. type
  1337. timecaps_tag = record
  1338. wPeriodMin:UINT; //* minimum period supported */
  1339. wPeriodMax:UINT; //* maximum period supported */
  1340. end;
  1341. TIMECAPS = timecaps_tag;
  1342. PTIMECAPS = ^timecaps_tag;
  1343. NPTIMECAPS = ^timecaps_tag;
  1344. LPTIMECAPS = ^timecaps_tag;
  1345. {$IFDEF _WIN32}
  1346. const
  1347. MMTimerDLL = 'winmm.dll';
  1348. {$ELSE _WIN32}
  1349. const
  1350. MMTimerDLL = 'mmtimer.dll';
  1351. {$ENDIF _WIN32}
  1352. //* timer function prototypes */
  1353. function timeGetSystemTime(pmmt:LPMMTIME; cbmmt:UINT):MMRESULT; external MMTimerDLL name 'timeGetSystemTime'; // index
  1354. function timeGetTime:DWORD; external MMTimerDLL name 'timeGetTime'; // index
  1355. function timeSetEvent(uDelay:UINT;
  1356. uResolution:UINT;
  1357. fptc:LPTIMECALLBACK;
  1358. dwUser:DWORD;
  1359. fuEvent:UINT):MMRESULT; external MMTimerDLL name 'timeSetEvent'; // index
  1360. function timeKillEvent(uTimerID:UINT):MMRESULT; external MMTimerDLL name 'timeKillEvent'; // index
  1361. function timeGetDevCaps(ptc:LPTIMECAPS; cbtc:UINT):MMRESULT; external MMTimerDLL name 'timeGetDevCaps'; // index
  1362. function timeBeginPeriod(uPeriod:UINT):MMRESULT; external MMTimerDLL name 'timeBeginPeriod'; // index
  1363. function timeEndPeriod(uPeriod:UINT):MMRESULT; external MMTimerDLL name 'timeEndPeriod'; // index
  1364. function timeGetTimeSinceInterrupt:DWORD; external MMTimerDLL name 'timeGetTimeSinceInterrupt'; // index
  1365. function timeGetHardwareFrequency:DWORD; external MMTimerDLL name 'timeGetHardwareFrequency'; // index
  1366. {$ENDIF} // MMNOTIMER
  1367. {$IFNDEF MMNOMMIO}
  1368. {****************************************************************************
  1369. Multimedia File I/O support
  1370. ****************************************************************************}
  1371. const
  1372. //* MMIO error return values */
  1373. MMIOERR_BASE = 256;
  1374. MMIOERR_FILENOTFOUND = MMIOERR_BASE + 1; //* file not found */
  1375. MMIOERR_OUTOFMEMORY = MMIOERR_BASE + 2; //* out of memory */
  1376. MMIOERR_CANNOTOPEN = MMIOERR_BASE + 3; //* cannot open */
  1377. MMIOERR_CANNOTCLOSE = MMIOERR_BASE + 4; //* cannot close */
  1378. MMIOERR_CANNOTREAD = MMIOERR_BASE + 5; //* cannot read */
  1379. MMIOERR_CANNOTWRITE = MMIOERR_BASE + 6; //* cannot write */
  1380. MMIOERR_CANNOTSEEK = MMIOERR_BASE + 7; //* cannot seek */
  1381. MMIOERR_CANNOTEXPAND = MMIOERR_BASE + 8; //* cannot expand file */
  1382. MMIOERR_CHUNKNOTFOUND = MMIOERR_BASE + 9; //* chunk not found */
  1383. MMIOERR_UNBUFFERED = MMIOERR_BASE + 10; //* */
  1384. MMIOERR_PATHNOTFOUND = MMIOERR_BASE + 11; //* path incorrect */
  1385. MMIOERR_ACCESSDENIED = MMIOERR_BASE + 12; //* file was protected */
  1386. MMIOERR_SHARINGVIOLATION = MMIOERR_BASE + 13; //* file in use */
  1387. MMIOERR_NETWORKERROR = MMIOERR_BASE + 14; //* network not responding */
  1388. MMIOERR_TOOMANYOPENFILES = MMIOERR_BASE + 15; //* no more file handles */
  1389. MMIOERR_INVALIDFILE = MMIOERR_BASE + 16; //* default error file error */
  1390. //* MMIO constants */
  1391. CFSEPCHAR = '+'; //* compound file name separator AnsiChar. */
  1392. //* MMIO data types */
  1393. type
  1394. HPSTR = ^AnsiChar; //* a huge version of LPSTR */
  1395. HMMIO = HANDLE; //* a handle to an open file */
  1396. type
  1397. MMIOPROC = function(lpmmioinfo:LPSTR; uMsg:UINT; lParam1:LPARAM; lParam2:LPARAM):LRESULT; cdecl;
  1398. LPMMIOPROC = MMIOPROC;
  1399. //* general MMIO information data structure */
  1400. type
  1401. _MMIOINFO = record
  1402. //* general fields */
  1403. dwFlags:DWORD; //* general status flags */
  1404. fccIOProc:FOURCC; //* pointer to I/O procedure */
  1405. pIOProc:LPMMIOPROC; //* pointer to I/O procedure */
  1406. wErrorRet:UINT; //* place for error to be returned */
  1407. htask:HTASK; //* alternate local task */
  1408. //* fields maintained by MMIO functions during buffered I/O */
  1409. cchBuffer:LONG; //* size of I/O buffer (or 0L) */
  1410. pchBuffer:HPSTR; //* start of I/O buffer (or NULL) */
  1411. pchNext:HPSTR; //* pointer to next byte to read/write */
  1412. pchEndRead:HPSTR; //* pointer to last valid byte to read */
  1413. pchEndWrite:HPSTR; //* pointer to last byte to write */
  1414. lBufOffset:LONG; //* disk offset of start of buffer */
  1415. //* fields maintained by I/O procedure */
  1416. lDiskOffset:LONG; //* disk offset of next read or write */
  1417. adwInfo:array[0..2] of DWORD; //* data specific to type of MMIOPROC */
  1418. //* other fields maintained by MMIO */
  1419. dwReserved1:DWORD; //* reserved for MMIO use */
  1420. dwReserved2:DWORD; //* reserved for MMIO use */
  1421. hmmio:HMMIO; //* handle to open file */
  1422. end;
  1423. MMIOINFO = _MMIOINFO;
  1424. PMMIOINFO = ^_MMIOINFO;
  1425. NPMMIOINFO = ^_MMIOINFO;
  1426. LPMMIOINFO = ^_MMIOINFO;
  1427. LPCMMIOINFO = ^MMIOINFO;
  1428. //* RIFF chunk information data structure */
  1429. type
  1430. _MMCKINFO = record
  1431. ckid:FOURCC; //* chunk ID */
  1432. cksize:DWORD; //* chunk size */
  1433. fccType:FOURCC; //* form type or list type */
  1434. dwDataOffset:DWORD; //* offset of data portion of chunk */
  1435. dwFlags:DWORD; //* flags used by MMIO functions */
  1436. end;
  1437. MMCKINFO = _MMCKINFO;
  1438. PMMCKINFO = ^_MMCKINFO;
  1439. NPMMCKINFO = ^_MMCKINFO;
  1440. LPMMCKINFO = ^_MMCKINFO;
  1441. LPCMMCKINFO = ^MMCKINFO;
  1442. const
  1443. //* bit field masks */
  1444. MMIO_RWMODE = $00000003; //* open file for reading/writing/both */
  1445. MMIO_SHAREMODE = $00000070; //* file sharing mode number */
  1446. //* read/write mode numbers (bit field MMIO_RWMODE) */
  1447. MMIO_READ = $00000000; //* open file for reading only */
  1448. MMIO_WRITE = $00000001; //* open file for writing only */
  1449. MMIO_READWRITE = $00000002; //* open file for reading and writing */
  1450. //* various MMIO flags */
  1451. MMIO_FHOPEN = $0010; //* mmioClose: keep file handle open */
  1452. MMIO_EMPTYBUF = $0010; //* mmioFlush: empty the I/O buffer */
  1453. MMIO_TOUPPER = $0010; //* mmioStringToFOURCC: to u-case */
  1454. MMIO_INSTALLPROC = $00010000; //* mmioInstallIOProc: install MMIOProc */
  1455. MMIO_GLOBALPROC = $10000000; //* mmioInstallIOProc: install globally */
  1456. MMIO_REMOVEPROC = $00020000; //* mmioInstallIOProc: remove MMIOProc */
  1457. MMIO_UNICODEPROC = $01000000; //* mmioInstallIOProc: Unicode MMIOProc */
  1458. MMIO_FINDPROC = $00040000; //* mmioInstallIOProc: find an MMIOProc */
  1459. MMIO_FINDCHUNK = $0010; //* mmioDescend: find a chunk by ID */
  1460. MMIO_FINDRIFF = $0020; //* mmioDescend: find a LIST chunk */
  1461. MMIO_FINDLIST = $0040; //* mmioDescend: find a RIFF chunk */
  1462. MMIO_CREATERIFF = $0020; //* mmioCreateChunk: make a LIST chunk */
  1463. MMIO_CREATELIST = $0040; //* mmioCreateChunk: make a RIFF chunk */
  1464. MMIO_VALIDPROC = $10070000; //* valid for mmioInstallIOProc */ /* Internal */
  1465. //* constants for dwFlags field of MMIOINFO */
  1466. MMIO_CREATE = $00001000; //* create new file (or truncate file) */
  1467. MMIO_PARSE = $00000100; //* parse new file returning path */
  1468. MMIO_DELETE = $00000200; //* create new file (or truncate file) */
  1469. MMIO_EXIST = $00004000; //* checks for existence of file */
  1470. MMIO_ALLOCBUF = $00010000; //* mmioOpen() should allocate a buffer */
  1471. MMIO_GETTEMP = $00020000; //* mmioOpen() should retrieve temp name */
  1472. MMIO_DIRTY = $10000000; //* I/O buffer is dirty */
  1473. MMIO_OPEN_VALID = $0003FFFF; //* valid flags for mmioOpen */ /* Internal */
  1474. MMIO_FLUSH_VALID = MMIO_EMPTYBUF; //* valid flags for mmioFlush */ /* Internal */
  1475. MMIO_ADVANCE_VALID = MMIO_WRITE or MMIO_READ; //* valid flags for mmioAdvance */ /* Internal */
  1476. MMIO_FOURCC_VALID = MMIO_TOUPPER; //* valid flags for mmioStringToFOURCC */ /* Internal */
  1477. MMIO_DESCEND_VALID = MMIO_FINDCHUNK or MMIO_FINDRIFF or MMIO_FINDLIST; //* Internal */
  1478. MMIO_CREATE_VALID = MMIO_CREATERIFF or MMIO_CREATELIST; //* Internal */
  1479. //* share mode numbers (bit field MMIO_SHAREMODE) */
  1480. MMIO_COMPAT = $00000000; //* compatibility mode */
  1481. MMIO_EXCLUSIVE = $00000010; //* exclusive-access mode */
  1482. MMIO_DENYWRITE = $00000020; //* deny writing to other processes */
  1483. MMIO_DENYREAD = $00000030; //* deny reading to other processes */
  1484. MMIO_DENYNONE = $00000040; //* deny nothing to other processes */
  1485. //* message numbers for MMIOPROC I/O procedure functions */
  1486. MMIOM_READ = MMIO_READ; //* read */
  1487. MMIOM_WRITE = MMIO_WRITE; //* write */
  1488. MMIOM_SEEK = 2; //* seek to a new position in file */
  1489. MMIOM_OPEN = 3; //* open file */
  1490. MMIOM_CLOSE = 4; //* close file */
  1491. MMIOM_WRITEFLUSH = 5; //* write and flush */
  1492. MMIOM_RENAME = 6; //* rename specified file */
  1493. MMIOM_USER = $8000; //* beginning of user-defined messages */
  1494. //* standard four character codes */
  1495. const
  1496. FOURCC_RIFF = FOURCC(byte(AnsiChar('R')) or
  1497. (byte(AnsiChar('I')) shl 8) or
  1498. (byte(AnsiChar('F')) shl 16) or
  1499. (byte(AnsiChar('F')) shl 24)
  1500. );
  1501. FOURCC_LIST = FOURCC(byte(AnsiChar('L')) or
  1502. (byte(AnsiChar('I')) shl 8) or
  1503. (byte(AnsiChar('S')) shl 16) or
  1504. (byte(AnsiChar('T')) shl 24)
  1505. );
  1506. //* four character codes used to identify standard built-in I/O procedures */
  1507. FOURCC_DOS = FOURCC(byte(AnsiChar('D')) or
  1508. (byte(AnsiChar('O')) shl 8) or
  1509. (byte(AnsiChar('S')) shl 16) or
  1510. (byte(AnsiChar(' ')) shl 24)
  1511. );
  1512. FOURCC_MEM = FOURCC(byte(AnsiChar('M')) or
  1513. (byte(AnsiChar('E')) shl 8) or
  1514. (byte(AnsiChar('M')) shl 16) or
  1515. (byte(AnsiChar(' ')) shl 24)
  1516. );
  1517. //* flags for mmioSeek() */
  1518. const
  1519. SEEK_SET = 0; //* seek to an absolute position */
  1520. SEEK_CUR = 1; //* seek relative to current position */
  1521. SEEK_END = 2; //* seek relative to end of file */
  1522. //* other constants */
  1523. const
  1524. MMIO_DEFAULTBUFFER = 8192; //* default buffer size */
  1525. {$ENDIF} // MMNOMMIO
  1526. {$PACKRECORDS DEFAULT} // #include "poppack.h" /* Revert to default packing */
  1527. implementation
  1528. { Was declared as
  1529. MAKEFOURCC(ch0, ch1, ch2, ch3) \
  1530. ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
  1531. ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
  1532. mmioFOURCC(ch0, ch1, ch2, ch3) MAKEFOURCC(ch0, ch1, ch2, ch3)
  1533. }
  1534. function MAKEFOURCC(ch0:AnsiChar; ch1:AnsiChar; ch2:AnsiChar; ch3:AnsiChar):FOURCC; inline;
  1535. begin
  1536. MAKEFOURCC:=DWORD(ch0) or
  1537. (DWORD(ch1) shl 8) or
  1538. (DWORD(ch2) shl 16) or
  1539. (DWORD(ch3) shl 24);
  1540. end;
  1541. function mmioFOURCC(ch0:AnsiChar; ch1:AnsiChar; ch2:AnsiChar; ch3:AnsiChar):FOURCC;
  1542. begin
  1543. mmioFOURCC:=MAKEFOURCC(ch0,ch1,ch2,ch3);
  1544. end;
  1545. { Was declared as
  1546. #define sndAlias( ch0, ch1 ) \
  1547. ( SND_ALIAS_START + (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ))
  1548. }
  1549. function sndAlias(ch0:AnsiChar; ch1:AnsiChar):DWORD; inline;
  1550. begin
  1551. sndAlias:=SND_ALIAS_START+(DWORD(ch0) or (DWORD(ch1) shl 8));
  1552. end;
  1553. function MEVT_EVENTTYPE(x:DWORD):byte; inline;
  1554. begin
  1555. MEVT_EVENTTYPE:=byte(((x shr 24) and $FF));
  1556. end;
  1557. function MEVT_EVENTPARM(x:DWORD):DWORD; inline;
  1558. begin
  1559. MEVT_EVENTPARM:=DWORD(x and $00FFFFFF);
  1560. end;
  1561. {$IFNDEF MMNOMIDI}
  1562. function MIDIPROP_PROPERTY(mp:DWORD):DWORD; inline;
  1563. begin
  1564. MIDIPROP_PROPERTY:=mp and (not (MIDIPROP_SET or MIDIPROP_GET));
  1565. end;
  1566. function SMF_TIMEDIV(format:DWORD; division:DWORD):DWORD; inline;
  1567. begin
  1568. SMF_TIMEDIV:=(format shr 15) or division;
  1569. end;
  1570. function SMF_TIMEDIV_SMPTE(smpte:DWORD; division:DWORD):DWORD; inline;
  1571. begin
  1572. SMF_TIMEDIV_SMPTE:=(smpte shl 8) or division;
  1573. end;
  1574. function SMF_TIMEDIV_ISSMPTE(dw:DWORD):DWORD; inline;
  1575. begin
  1576. SMF_TIMEDIV_ISSMPTE:=dw shr 15;
  1577. end;
  1578. function SMF_TIMEDIV_GETSMPTE(dw:DWORD):byte; inline;
  1579. begin
  1580. SMF_TIMEDIV_GETSMPTE:=byte((dw shr 8) and $ff);
  1581. end;
  1582. function SMF_TIMEDIV_GETTPF(dw:DWORD):DWORD; inline;
  1583. begin
  1584. SMF_TIMEDIV_GETTPF:=dw and $ff;
  1585. end;
  1586. function SMF_TIMEDIV_GETTPQN(dw:DWORD):DWORD; inline;
  1587. begin
  1588. SMF_TIMEDIV_GETTPQN:=dw and $7fff;
  1589. end;
  1590. {$ENDIF MMNOMIDI}
  1591. end.