Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

414 lines
15 KiB

  1. /****************************************************************************/
  2. /* */
  3. /* MMDDK.H - Include file for Multimedia Device Development Kit */
  4. /* */
  5. /* Note: You must include the WINDOWS.H and MMSYSTEM.H header files */
  6. /* before including this file. */
  7. /* */
  8. /* Copyright (c) 1990-1991, Microsoft Corp. All rights reserved. */
  9. /* */
  10. /****************************************************************************/
  11. /* If defined, the following flags inhibit inclusion
  12. * of the indicated items:
  13. *
  14. * MMNOMIDIDEV - MIDI support
  15. * MMNOWAVEDEV - Waveform support
  16. * MMNOAUXDEV - Auxiliary output support
  17. * MMNOTIMERDEV - Timer support
  18. * MMNOJOYDEV - Joystick support
  19. * MMNOMCIDEV - MCI support
  20. * MMNOTASKDEV - Task support
  21. */
  22. #ifdef NOMIDIDEV /* ;Internal */
  23. #define MMNOMIDIDEV /* ;Internal */
  24. #endif /*ifdef NOMIDIDEV */ /* ;Internal */
  25. #ifdef NOWAVEDEV /* ;Internal */
  26. #define MMNOWAVEDEV /* ;Internal */
  27. #endif /*ifdef NOWAVEDEV */ /* ;Internal */
  28. #ifdef NOAUXDEV /* ;Internal */
  29. #define MMNOAUXDEV /* ;Internal */
  30. #endif /*ifdef NOAUXDEV */ /* ;Internal */
  31. #ifdef NOTIMERDEV /* ;Internal */
  32. #define MMNOTIMERDEV /* ;Internal */
  33. #endif /*ifdef NOTIMERDEV */ /* ;Internal */
  34. #ifdef NOJOYDEV /* ;Internal */
  35. #define MMNOJOYDEV /* ;Internal */
  36. #endif /*ifdef NOJOYDEV */ /* ;Internal */
  37. #ifdef NOMCIDEV /* ;Internal */
  38. #define MMNOMCIDEV /* ;Internal */
  39. #endif /*ifdef NOMCIDEV */ /* ;Internal */
  40. #ifdef NOTASKDEV /* ;Internal */
  41. #define MMNOTASKDEV /* ;Internal */
  42. #endif /*ifdef NOTASKDEV*/ /* ;Internal */
  43. #ifndef _INC_MMDDK
  44. #define _INC_MMDDK /* #defined if mmddk.h has been included */
  45. #ifndef RC_INVOKED
  46. #pragma pack(1) /* Assume byte packing throughout */
  47. #endif
  48. #ifdef __cplusplus
  49. extern "C" { /* Assume C declarations for C++ */
  50. #endif /* __cplusplus */
  51. /***************************************************************************
  52. Helper functions for drivers
  53. ***************************************************************************/
  54. #define DCB_NOSWITCH 0x0008 /* don't switch stacks for callback */
  55. #define DCB_TYPEMASK 0x0007 /* callback type mask */
  56. #define DCB_NULL 0x0000 /* unknown callback type */
  57. /* flags for wFlags parameter of DriverCallback() */
  58. #define DCB_WINDOW 0x0001 /* dwCallback is a HWND */
  59. #define DCB_TASK 0x0002 /* dwCallback is a HTASK */
  60. #define DCB_FUNCTION 0x0003 /* dwCallback is a FARPROC */
  61. BOOL WINAPI DriverCallback(DWORD dwCallback, UINT uFlags,
  62. HANDLE hDevice, UINT uMessage, DWORD dwUser, DWORD dwParam1, DWORD dwParam2);
  63. void WINAPI StackEnter(void);
  64. void WINAPI StackLeave(void);
  65. /* generic prototype for audio device driver entry-point functions */
  66. /* midMessage(), modMessage(), widMessage(), wodMessage(), auxMessage() */
  67. typedef DWORD (CALLBACK SOUNDDEVMSGPROC)(UINT uDeviceID, UINT uMessage,
  68. DWORD dwInstance, DWORD dwParam1, DWORD dwParam2);
  69. typedef SOUNDDEVMSGPROC FAR *LPSOUNDDEVMSGPROC;
  70. /* device ID for 386 AUTODMA VxD */
  71. #define VADMAD_Device_ID 0X0444
  72. #ifndef MMNOWAVEDEV
  73. /****************************************************************************
  74. Waveform device driver support
  75. ****************************************************************************/
  76. /* maximum number of wave device drivers loaded */
  77. #define MAXWAVEDRIVERS 10
  78. /* waveform input and output device open information structure */
  79. typedef struct waveopendesc_tag {
  80. HWAVE hWave; /* handle */
  81. const WAVEFORMAT FAR* lpFormat; /* format of wave data */
  82. DWORD dwCallback; /* callback */
  83. DWORD dwInstance; /* app's private instance information */
  84. } WAVEOPENDESC;
  85. typedef WAVEOPENDESC FAR *LPWAVEOPENDESC;
  86. #define DRVM_USER 0x4000
  87. /*
  88. * Message sent by mmsystem to wodMessage(), widMessage(), modMessage(),
  89. * and midMessage() when it initializes the wave and midi drivers
  90. */
  91. #define DRVM_INIT 100
  92. #define WODM_INIT DRVM_INIT
  93. #define WIDM_INIT DRVM_INIT
  94. #define MODM_INIT DRVM_INIT
  95. #define MIDM_INIT DRVM_INIT
  96. #define AUXM_INIT DRVM_INIT
  97. /* messages sent to wodMessage() entry-point function */
  98. #define WODM_GETNUMDEVS 3
  99. #define WODM_GETDEVCAPS 4
  100. #define WODM_OPEN 5
  101. #define WODM_CLOSE 6
  102. #define WODM_PREPARE 7
  103. #define WODM_UNPREPARE 8
  104. #define WODM_WRITE 9
  105. #define WODM_PAUSE 10
  106. #define WODM_RESTART 11
  107. #define WODM_RESET 12
  108. #define WODM_GETPOS 13
  109. #define WODM_GETPITCH 14
  110. #define WODM_SETPITCH 15
  111. #define WODM_GETVOLUME 16
  112. #define WODM_SETVOLUME 17
  113. #define WODM_GETPLAYBACKRATE 18
  114. #define WODM_SETPLAYBACKRATE 19
  115. #define WODM_BREAKLOOP 20
  116. /* messages sent to widMessage() entry-point function */
  117. #define WIDM_GETNUMDEVS 50
  118. #define WIDM_GETDEVCAPS 51
  119. #define WIDM_OPEN 52
  120. #define WIDM_CLOSE 53
  121. #define WIDM_PREPARE 54
  122. #define WIDM_UNPREPARE 55
  123. #define WIDM_ADDBUFFER 56
  124. #define WIDM_START 57
  125. #define WIDM_STOP 58
  126. #define WIDM_RESET 59
  127. #define WIDM_GETPOS 60
  128. #endif /*ifndef MMNOWAVEDEV */
  129. #ifndef MMNOMIDIDEV
  130. /****************************************************************************
  131. MIDI device driver support
  132. ****************************************************************************/
  133. /* maximum number of MIDI device drivers loaded */
  134. #define MAXMIDIDRIVERS 10
  135. /* MIDI input and output device open information structure */
  136. typedef struct midiopendesc_tag {
  137. HMIDI hMidi; /* handle */
  138. DWORD dwCallback; /* callback */
  139. DWORD dwInstance; /* app's private instance information */
  140. } MIDIOPENDESC;
  141. typedef MIDIOPENDESC FAR *LPMIDIOPENDESC;
  142. /* messages sent to modMessage() entry-point function */
  143. #define MODM_GETNUMDEVS 1
  144. #define MODM_GETDEVCAPS 2
  145. #define MODM_OPEN 3
  146. #define MODM_CLOSE 4
  147. #define MODM_PREPARE 5
  148. #define MODM_UNPREPARE 6
  149. #define MODM_DATA 7
  150. #define MODM_LONGDATA 8
  151. #define MODM_RESET 9
  152. #define MODM_GETVOLUME 10
  153. #define MODM_SETVOLUME 11
  154. #define MODM_CACHEPATCHES 12
  155. #define MODM_CACHEDRUMPATCHES 13
  156. /* messages sent to midMessage() entry-point function */
  157. #define MIDM_GETNUMDEVS 53
  158. #define MIDM_GETDEVCAPS 54
  159. #define MIDM_OPEN 55
  160. #define MIDM_CLOSE 56
  161. #define MIDM_PREPARE 57
  162. #define MIDM_UNPREPARE 58
  163. #define MIDM_ADDBUFFER 59
  164. #define MIDM_START 60
  165. #define MIDM_STOP 61
  166. #define MIDM_RESET 62
  167. #endif /*ifndef MMNOMIDIDEV */
  168. #ifndef MMNOAUXDEV
  169. /****************************************************************************
  170. Auxiliary audio device driver support
  171. ****************************************************************************/
  172. /* maximum number of auxiliary device drivers loaded */
  173. #define MAXAUXDRIVERS 10
  174. /* messages sent to auxMessage() entry-point function */
  175. #define AUXDM_GETNUMDEVS 3
  176. #define AUXDM_GETDEVCAPS 4
  177. #define AUXDM_GETVOLUME 5
  178. #define AUXDM_SETVOLUME 6
  179. #endif /*ifndef MMNOAUXDEV */
  180. #ifndef MMNOTIMERDEV
  181. /****************************************************************************
  182. Timer device driver support
  183. ****************************************************************************/
  184. typedef struct timerevent_tag {
  185. UINT wDelay; /* delay required */
  186. UINT wResolution; /* resolution required */
  187. LPTIMECALLBACK lpFunction; /* ptr to callback function */
  188. DWORD dwUser; /* user DWORD */
  189. UINT wFlags; /* defines how to program event */
  190. } TIMEREVENT;
  191. typedef TIMEREVENT FAR *LPTIMEREVENT;
  192. /* messages sent to tddMessage() function */
  193. #define TDD_KILLTIMEREVENT DRV_RESERVED+0 /* indices into a table of */
  194. #define TDD_SETTIMEREVENT DRV_RESERVED+4 /* functions; thus offset by */
  195. #define TDD_GETSYSTEMTIME DRV_RESERVED+8 /* four each time... */
  196. #define TDD_GETDEVCAPS DRV_RESERVED+12 /* room for future expansion */
  197. #define TDD_BEGINMINPERIOD DRV_RESERVED+16 /* room for future expansion */
  198. #define TDD_ENDMINPERIOD DRV_RESERVED+20 /* room for future expansion */
  199. #endif /*ifndef MMNOTIMERDEV */
  200. #ifndef MMNOJOYDEV
  201. /****************************************************************************
  202. Joystick device driver support
  203. ****************************************************************************/
  204. /* joystick calibration info structure */
  205. typedef struct joycalibrate_tag {
  206. UINT wXbase;
  207. UINT wXdelta;
  208. UINT wYbase;
  209. UINT wYdelta;
  210. UINT wZbase;
  211. UINT wZdelta;
  212. } JOYCALIBRATE;
  213. typedef JOYCALIBRATE FAR *LPJOYCALIBRATE;
  214. /* prototype for joystick message function */
  215. typedef UINT (CALLBACK JOYDEVMSGPROC)(DWORD dwID, UINT uMessage, LPARAM lParam1, LPARAM lParam2);
  216. typedef JOYDEVMSGPROC FAR *LPJOYDEVMSGPROC;
  217. /* messages sent to joystick driver's DriverProc() function */
  218. #define JDD_GETNUMDEVS DRV_RESERVED+0x0001
  219. #define JDD_GETDEVCAPS DRV_RESERVED+0x0002
  220. #define JDD_GETPOS DRV_RESERVED+0x0101
  221. #define JDD_SETCALIBRATION DRV_RESERVED+0x0102
  222. #endif /*ifndef MMNOJOYDEV */
  223. #ifndef MMNOMCIDEV
  224. /****************************************************************************
  225. MCI device driver support
  226. ****************************************************************************/
  227. /* internal MCI messages */
  228. #define MCI_OPEN_DRIVER 0x0801
  229. #define MCI_CLOSE_DRIVER 0x0802
  230. #define MAKEMCIRESOURCE(wRet, wRes) MAKELRESULT((wRet), (wRes))
  231. /* string return values only used with MAKEMCIRESOURCE */
  232. #define MCI_FALSE (MCI_STRING_OFFSET + 19)
  233. #define MCI_TRUE (MCI_STRING_OFFSET + 20)
  234. /* resource string return values */
  235. #define MCI_FORMAT_RETURN_BASE MCI_FORMAT_MILLISECONDS_S
  236. #define MCI_FORMAT_MILLISECONDS_S (MCI_STRING_OFFSET + 21)
  237. #define MCI_FORMAT_HMS_S (MCI_STRING_OFFSET + 22)
  238. #define MCI_FORMAT_MSF_S (MCI_STRING_OFFSET + 23)
  239. #define MCI_FORMAT_FRAMES_S (MCI_STRING_OFFSET + 24)
  240. #define MCI_FORMAT_SMPTE_24_S (MCI_STRING_OFFSET + 25)
  241. #define MCI_FORMAT_SMPTE_25_S (MCI_STRING_OFFSET + 26)
  242. #define MCI_FORMAT_SMPTE_30_S (MCI_STRING_OFFSET + 27)
  243. #define MCI_FORMAT_SMPTE_30DROP_S (MCI_STRING_OFFSET + 28)
  244. #define MCI_FORMAT_BYTES_S (MCI_STRING_OFFSET + 29)
  245. #define MCI_FORMAT_SAMPLES_S (MCI_STRING_OFFSET + 30)
  246. #define MCI_FORMAT_TMSF_S (MCI_STRING_OFFSET + 31)
  247. #define MCI_VD_FORMAT_TRACK_S (MCI_VD_OFFSET + 5)
  248. #define WAVE_FORMAT_PCM_S (MCI_WAVE_OFFSET + 0)
  249. #define WAVE_MAPPER_S (MCI_WAVE_OFFSET + 1)
  250. #define MCI_SEQ_MAPPER_S (MCI_SEQ_OFFSET + 5)
  251. #define MCI_SEQ_FILE_S (MCI_SEQ_OFFSET + 6)
  252. #define MCI_SEQ_MIDI_S (MCI_SEQ_OFFSET + 7)
  253. #define MCI_SEQ_SMPTE_S (MCI_SEQ_OFFSET + 8)
  254. #define MCI_SEQ_FORMAT_SONGPTR_S (MCI_SEQ_OFFSET + 9)
  255. #define MCI_SEQ_NONE_S (MCI_SEQ_OFFSET + 10)
  256. #define MIDIMAPPER_S (MCI_SEQ_OFFSET + 11)
  257. /* parameters for internal version of MCI_OPEN message sent from */
  258. /* mciOpenDevice() to the driver */
  259. typedef struct {
  260. UINT wDeviceID; /* device ID */
  261. LPCSTR lpstrParams; /* parameter string for entry in SYSTEM.INI */
  262. UINT wCustomCommandTable; /* custom command table (0xFFFF if none) */
  263. /* filled in by the driver */
  264. UINT wType; /* driver type */
  265. /* filled in by the driver */
  266. } MCI_OPEN_DRIVER_PARMS;
  267. typedef MCI_OPEN_DRIVER_PARMS FAR * LPMCI_OPEN_DRIVER_PARMS;
  268. /* maximum length of an MCI device type */
  269. #define MCI_MAX_DEVICE_TYPE_LENGTH 80
  270. /* flags for mciSendCommandInternal() which direct mciSendString() how to */
  271. /* interpret the return value */
  272. #define MCI_RESOURCE_RETURNED 0x00010000 /* resource ID */
  273. #define MCI_COLONIZED3_RETURN 0x00020000 /* colonized ID, 3 bytes data */
  274. #define MCI_COLONIZED4_RETURN 0x00040000 /* colonized ID, 4 bytes data */
  275. #define MCI_INTEGER_RETURNED 0x00080000 /* integer conversion needed */
  276. #define MCI_RESOURCE_DRIVER 0x00100000 /* driver owns returned resource */
  277. /* invalid command table ID */
  278. #define MCI_NO_COMMAND_TABLE 0xFFFF
  279. /* command table information type tags */
  280. #define MCI_COMMAND_HEAD 0
  281. #define MCI_STRING 1
  282. #define MCI_INTEGER 2
  283. #define MCI_END_COMMAND 3
  284. #define MCI_RETURN 4
  285. #define MCI_FLAG 5
  286. #define MCI_END_COMMAND_LIST 6
  287. #define MCI_RECT 7
  288. #define MCI_CONSTANT 8
  289. #define MCI_END_CONSTANT 9
  290. /* function prototypes for MCI driver functions */
  291. DWORD WINAPI mciGetDriverData(UINT uDeviceID);
  292. BOOL WINAPI mciSetDriverData(UINT uDeviceID, DWORD dwData);
  293. UINT WINAPI mciDriverYield(UINT uDeviceID);
  294. BOOL WINAPI mciDriverNotify(HWND hwndCallback, UINT uDeviceID,
  295. UINT uStatus);
  296. UINT WINAPI mciLoadCommandResource(HINSTANCE hInstance,
  297. LPCSTR lpResName, UINT uType);
  298. BOOL WINAPI mciFreeCommandResource(UINT uTable);
  299. #endif /*ifndef MMNOMCIDEV */
  300. #ifndef MMNOTASKDEV
  301. /*****************************************************************************
  302. Task support
  303. *****************************************************************************/
  304. /* error return values */
  305. #define TASKERR_NOTASKSUPPORT 1
  306. #define TASKERR_OUTOFMEMORY 2
  307. /* task support function prototypes */
  308. #ifdef BUILDDLL /* ;Internal */
  309. typedef void (FAR PASCAL TASKCALLBACK) (DWORD dwInst); /* ;Internal */
  310. #else /*ifdef BUILDDLL*/ /* ;Internal */
  311. typedef void (CALLBACK TASKCALLBACK) (DWORD dwInst);
  312. #endif /*ifdef BUILDDLL*/ /* ;Internal */
  313. typedef TASKCALLBACK FAR *LPTASKCALLBACK;
  314. UINT WINAPI mmTaskCreate(LPTASKCALLBACK lpfnTaskProc, HTASK FAR * lphTask, DWORD dwInst);
  315. UINT WINAPI mmTaskBlock(HTASK h);
  316. BOOL WINAPI mmTaskSignal(HTASK h);
  317. void WINAPI mmTaskYield(void);
  318. HTASK WINAPI mmGetCurrentTask(void);
  319. #endif /*ifndef MMNOTASKDEV */
  320. #define MMDDKINC /* ;Internal */
  321. #ifdef __cplusplus
  322. } /* End of extern "C" { */
  323. #endif /* __cplusplus */
  324. #ifndef RC_INVOKED
  325. #pragma pack() /* Revert to default packing */
  326. #endif
  327. #endif /* _INC_MMDDK */