home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / mmsystem.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  154KB  |  3,743 lines

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