home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / MMSYSTEM.H < prev    next >
C/C++ Source or Header  |  1997-01-16  |  155KB  |  3,771 lines

  1. /*==========================================================================
  2.  *
  3.  *  mmsystem.h -- Include file for Multimedia API's
  4.  *
  5.  *  Version 4.00
  6.  *
  7.  *  Copyright (C) 1992-1995 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. #if defined(_ANONYMOUS_STRUCT)
  1624.     };
  1625. #else
  1626.     }s;
  1627. #endif
  1628.     struct {
  1629.         DWORD   dwMinimum;          /* unsigned minimum for this control */
  1630.         DWORD   dwMaximum;          /* unsigned maximum for this control */
  1631. #if defined(_ANONYMOUS_STRUCT)
  1632.     };
  1633. #else
  1634.     }s1;
  1635. #endif
  1636.     DWORD       dwReserved[6];
  1637.     } Bounds;
  1638.     union {
  1639.     DWORD       cSteps;             /* # of steps between min & max */
  1640.     DWORD       cbCustomData;       /* size in bytes of custom data */
  1641.     DWORD       dwReserved[6];      /* !!! needed? we have cbStruct.... */
  1642.     } Metrics;
  1643. } MIXERCONTROLA, *PMIXERCONTROLA, *LPMIXERCONTROLA;
  1644. typedef struct tagMIXERCONTROLW {
  1645.     DWORD           cbStruct;           /* size in bytes of MIXERCONTROL */
  1646.     DWORD           dwControlID;        /* unique control id for mixer device */
  1647.     DWORD           dwControlType;      /* MIXERCONTROL_CONTROLTYPE_xxx */
  1648.     DWORD           fdwControl;         /* MIXERCONTROL_CONTROLF_xxx */
  1649.     DWORD           cMultipleItems;     /* if MIXERCONTROL_CONTROLF_MULTIPLE set */
  1650.     WCHAR           szShortName[MIXER_SHORT_NAME_CHARS];
  1651.     WCHAR           szName[MIXER_LONG_NAME_CHARS];
  1652.     union {
  1653.     struct {
  1654.         LONG    lMinimum;           /* signed minimum for this control */
  1655.         LONG    lMaximum;           /* signed maximum for this control */
  1656. #if defined(_ANONYMOUS_STRUCT)
  1657.     };
  1658. #else
  1659.     }s;
  1660. #endif
  1661.     struct {
  1662.         DWORD   dwMinimum;          /* unsigned minimum for this control */
  1663.         DWORD   dwMaximum;          /* unsigned maximum for this control */
  1664. #if defined(_ANONYMOUS_STRUCT)
  1665.     };
  1666. #else
  1667.     }s1;
  1668. #endif
  1669.     DWORD       dwReserved[6];
  1670.     } Bounds;
  1671.     union {
  1672.     DWORD       cSteps;             /* # of steps between min & max */
  1673.     DWORD       cbCustomData;       /* size in bytes of custom data */
  1674.     DWORD       dwReserved[6];      /* !!! needed? we have cbStruct.... */
  1675.     } Metrics;
  1676. } MIXERCONTROLW, *PMIXERCONTROLW, *LPMIXERCONTROLW;
  1677. #ifdef UNICODE
  1678. typedef MIXERCONTROLW MIXERCONTROL;
  1679. typedef PMIXERCONTROLW PMIXERCONTROL;
  1680. typedef LPMIXERCONTROLW LPMIXERCONTROL;
  1681. #else
  1682. typedef MIXERCONTROLA MIXERCONTROL;
  1683. typedef PMIXERCONTROLA PMIXERCONTROL;
  1684. typedef LPMIXERCONTROLA LPMIXERCONTROL;
  1685. #endif // UNICODE
  1686.  
  1687. #else
  1688. typedef struct tMIXERCONTROL {
  1689.     DWORD           cbStruct;           /* size in bytes of MIXERCONTROL */
  1690.     DWORD           dwControlID;        /* unique control id for mixer device */
  1691.     DWORD           dwControlType;      /* MIXERCONTROL_CONTROLTYPE_xxx */
  1692.     DWORD           fdwControl;         /* MIXERCONTROL_CONTROLF_xxx */
  1693.     DWORD           cMultipleItems;     /* if MIXERCONTROL_CONTROLF_MULTIPLE set */
  1694.     char            szShortName[MIXER_SHORT_NAME_CHARS];
  1695.     char            szName[MIXER_LONG_NAME_CHARS];
  1696.     union {
  1697.     struct {
  1698.         LONG    lMinimum;           /* signed minimum for this control */
  1699.         LONG    lMaximum;           /* signed maximum for this control */
  1700.     }s1;
  1701.     struct {
  1702.         DWORD   dwMinimum;          /* unsigned minimum for this control */
  1703.         DWORD   dwMaximum;          /* unsigned maximum for this control */
  1704.     }s2;
  1705.     DWORD       dwReserved[6];
  1706.     } Bounds;
  1707.     union {
  1708.     DWORD       cSteps;             /* # of steps between min & max */
  1709.     DWORD       cbCustomData;       /* size in bytes of custom data */
  1710.     DWORD       dwReserved[6];      /* !!! needed? we have cbStruct.... */
  1711.     } Metrics;
  1712. } MIXERCONTROL, *PMIXERCONTROL, FAR *LPMIXERCONTROL;
  1713. #endif
  1714.  
  1715. /* */
  1716. /*  MIXERCONTROL.fdwControl */
  1717. /* */
  1718. /* */
  1719. #define MIXERCONTROL_CONTROLF_UNIFORM   0x00000001L
  1720. #define MIXERCONTROL_CONTROLF_MULTIPLE  0x00000002L
  1721. #define MIXERCONTROL_CONTROLF_DISABLED  0x80000000L
  1722.  
  1723. /* */
  1724. /*  MIXERCONTROL_CONTROLTYPE_xxx building block defines */
  1725. /* */
  1726. /* */
  1727. #define MIXERCONTROL_CT_CLASS_MASK          0xF0000000L
  1728. #define MIXERCONTROL_CT_CLASS_CUSTOM        0x00000000L
  1729. #define MIXERCONTROL_CT_CLASS_METER         0x10000000L
  1730. #define MIXERCONTROL_CT_CLASS_SWITCH        0x20000000L
  1731. #define MIXERCONTROL_CT_CLASS_NUMBER        0x30000000L
  1732. #define MIXERCONTROL_CT_CLASS_SLIDER        0x40000000L
  1733. #define MIXERCONTROL_CT_CLASS_FADER         0x50000000L
  1734. #define MIXERCONTROL_CT_CLASS_TIME          0x60000000L
  1735. #define MIXERCONTROL_CT_CLASS_LIST          0x70000000L
  1736.  
  1737. #define MIXERCONTROL_CT_SUBCLASS_MASK       0x0F000000L
  1738.  
  1739. #define MIXERCONTROL_CT_SC_SWITCH_BOOLEAN   0x00000000L
  1740. #define MIXERCONTROL_CT_SC_SWITCH_BUTTON    0x01000000L
  1741.  
  1742. #define MIXERCONTROL_CT_SC_METER_POLLED     0x00000000L
  1743.  
  1744. #define MIXERCONTROL_CT_SC_TIME_MICROSECS   0x00000000L
  1745. #define MIXERCONTROL_CT_SC_TIME_MILLISECS   0x01000000L
  1746.  
  1747. #define MIXERCONTROL_CT_SC_LIST_SINGLE      0x00000000L
  1748. #define MIXERCONTROL_CT_SC_LIST_MULTIPLE    0x01000000L
  1749.  
  1750. #define MIXERCONTROL_CT_UNITS_MASK          0x00FF0000L
  1751. #define MIXERCONTROL_CT_UNITS_CUSTOM        0x00000000L
  1752. #define MIXERCONTROL_CT_UNITS_BOOLEAN       0x00010000L
  1753. #define MIXERCONTROL_CT_UNITS_SIGNED        0x00020000L
  1754. #define MIXERCONTROL_CT_UNITS_UNSIGNED      0x00030000L
  1755. #define MIXERCONTROL_CT_UNITS_DECIBELS      0x00040000L /* in 10ths */
  1756. #define MIXERCONTROL_CT_UNITS_PERCENT       0x00050000L /* in 10ths */
  1757.  
  1758. /* */
  1759. /*  Commonly used control types for specifying MIXERCONTROL.dwControlType */
  1760. /* */
  1761.  
  1762. #define MIXERCONTROL_CONTROLTYPE_CUSTOM         (MIXERCONTROL_CT_CLASS_CUSTOM | MIXERCONTROL_CT_UNITS_CUSTOM)
  1763. #define MIXERCONTROL_CONTROLTYPE_BOOLEANMETER   (MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_BOOLEAN)
  1764. #define MIXERCONTROL_CONTROLTYPE_SIGNEDMETER    (MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_SIGNED)
  1765. #define MIXERCONTROL_CONTROLTYPE_PEAKMETER      (MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1)
  1766. #define MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER  (MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_UNSIGNED)
  1767. #define MIXERCONTROL_CONTROLTYPE_BOOLEAN        (MIXERCONTROL_CT_CLASS_SWITCH | MIXERCONTROL_CT_SC_SWITCH_BOOLEAN | MIXERCONTROL_CT_UNITS_BOOLEAN)
  1768. #define MIXERCONTROL_CONTROLTYPE_ONOFF          (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 1)
  1769. #define MIXERCONTROL_CONTROLTYPE_MUTE           (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2)
  1770. #define MIXERCONTROL_CONTROLTYPE_MONO           (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 3)
  1771. #define MIXERCONTROL_CONTROLTYPE_LOUDNESS       (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 4)
  1772. #define MIXERCONTROL_CONTROLTYPE_STEREOENH      (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 5)
  1773. #define MIXERCONTROL_CONTROLTYPE_BUTTON         (MIXERCONTROL_CT_CLASS_SWITCH | MIXERCONTROL_CT_SC_SWITCH_BUTTON | MIXERCONTROL_CT_UNITS_BOOLEAN)
  1774. #define MIXERCONTROL_CONTROLTYPE_DECIBELS       (MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_DECIBELS)
  1775. #define MIXERCONTROL_CONTROLTYPE_SIGNED         (MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_SIGNED)
  1776. #define MIXERCONTROL_CONTROLTYPE_UNSIGNED       (MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_UNSIGNED)
  1777. #define MIXERCONTROL_CONTROLTYPE_PERCENT        (MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_PERCENT)
  1778. #define MIXERCONTROL_CONTROLTYPE_SLIDER         (MIXERCONTROL_CT_CLASS_SLIDER | MIXERCONTROL_CT_UNITS_SIGNED)
  1779. #define MIXERCONTROL_CONTROLTYPE_PAN            (MIXERCONTROL_CONTROLTYPE_SLIDER + 1)
  1780. #define MIXERCONTROL_CONTROLTYPE_QSOUNDPAN      (MIXERCONTROL_CONTROLTYPE_SLIDER + 2)
  1781. #define MIXERCONTROL_CONTROLTYPE_FADER          (MIXERCONTROL_CT_CLASS_FADER | MIXERCONTROL_CT_UNITS_UNSIGNED)
  1782. #define MIXERCONTROL_CONTROLTYPE_VOLUME         (MIXERCONTROL_CONTROLTYPE_FADER + 1)
  1783. #define MIXERCONTROL_CONTROLTYPE_BASS           (MIXERCONTROL_CONTROLTYPE_FADER + 2)
  1784. #define MIXERCONTROL_CONTROLTYPE_TREBLE         (MIXERCONTROL_CONTROLTYPE_FADER + 3)
  1785. #define MIXERCONTROL_CONTROLTYPE_EQUALIZER      (MIXERCONTROL_CONTROLTYPE_FADER + 4)
  1786. #define MIXERCONTROL_CONTROLTYPE_SINGLESELECT   (MIXERCONTROL_CT_CLASS_LIST | MIXERCONTROL_CT_SC_LIST_SINGLE | MIXERCONTROL_CT_UNITS_BOOLEAN)
  1787. #define MIXERCONTROL_CONTROLTYPE_MUX            (MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1)
  1788. #define MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT (MIXERCONTROL_CT_CLASS_LIST | MIXERCONTROL_CT_SC_LIST_MULTIPLE | MIXERCONTROL_CT_UNITS_BOOLEAN)
  1789. #define MIXERCONTROL_CONTROLTYPE_MIXER          (MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT + 1)
  1790. #define MIXERCONTROL_CONTROLTYPE_MICROTIME      (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MICROSECS | MIXERCONTROL_CT_UNITS_UNSIGNED)
  1791. #define MIXERCONTROL_CONTROLTYPE_MILLITIME      (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MILLISECS | MIXERCONTROL_CT_UNITS_UNSIGNED)
  1792.  
  1793. /* */
  1794. /*  MIXERLINECONTROLS */
  1795. /* */
  1796. #ifdef _WIN32
  1797.  
  1798. typedef struct tagMIXERLINECONTROLSA {
  1799.     DWORD           cbStruct;       /* size in bytes of MIXERLINECONTROLS */
  1800.     DWORD           dwLineID;       /* line id (from MIXERLINE.dwLineID) */
  1801.     union {
  1802.     DWORD       dwControlID;    /* MIXER_GETLINECONTROLSF_ONEBYID */
  1803.     DWORD       dwControlType;  /* MIXER_GETLINECONTROLSF_ONEBYTYPE */
  1804. #if defined(__cplusplus) || defined(_ANONYMOUS_UNION)
  1805.     };
  1806. #else
  1807.     }u;
  1808. #endif
  1809.     DWORD           cControls;      /* count of controls pmxctrl points to */
  1810.     DWORD           cbmxctrl;       /* size in bytes of _one_ MIXERCONTROL */
  1811.     LPMIXERCONTROLA pamxctrl;       /* pointer to first MIXERCONTROL array */
  1812. } MIXERLINECONTROLSA, *PMIXERLINECONTROLSA, *LPMIXERLINECONTROLSA;
  1813. typedef struct tagMIXERLINECONTROLSW {
  1814.     DWORD           cbStruct;       /* size in bytes of MIXERLINECONTROLS */
  1815.     DWORD           dwLineID;       /* line id (from MIXERLINE.dwLineID) */
  1816.     union {
  1817.     DWORD       dwControlID;    /* MIXER_GETLINECONTROLSF_ONEBYID */
  1818.     DWORD       dwControlType;  /* MIXER_GETLINECONTROLSF_ONEBYTYPE */
  1819. #if defined(__cplusplus) || defined(_ANONYMOUS_UNION)
  1820.     };
  1821. #else
  1822.     }u;
  1823. #endif
  1824.     DWORD           cControls;      /* count of controls pmxctrl points to */
  1825.     DWORD           cbmxctrl;       /* size in bytes of _one_ MIXERCONTROL */
  1826.     LPMIXERCONTROLW pamxctrl;       /* pointer to first MIXERCONTROL array */
  1827. } MIXERLINECONTROLSW, *PMIXERLINECONTROLSW, *LPMIXERLINECONTROLSW;
  1828. #ifdef UNICODE
  1829. typedef MIXERLINECONTROLSW MIXERLINECONTROLS;
  1830. typedef PMIXERLINECONTROLSW PMIXERLINECONTROLS;
  1831. typedef LPMIXERLINECONTROLSW LPMIXERLINECONTROLS;
  1832. #else
  1833. typedef MIXERLINECONTROLSA MIXERLINECONTROLS;
  1834. typedef PMIXERLINECONTROLSA PMIXERLINECONTROLS;
  1835. typedef LPMIXERLINECONTROLSA LPMIXERLINECONTROLS;
  1836. #endif // UNICODE
  1837.  
  1838. #else
  1839. typedef struct tMIXERLINECONTROLS {
  1840.     DWORD           cbStruct;       /* size in bytes of MIXERLINECONTROLS */
  1841.     DWORD           dwLineID;       /* line id (from MIXERLINE.dwLineID) */
  1842.     union {
  1843.     DWORD       dwControlID;    /* MIXER_GETLINECONTROLSF_ONEBYID */
  1844.     DWORD       dwControlType;  /* MIXER_GETLINECONTROLSF_ONEBYTYPE */
  1845.     };
  1846.     DWORD           cControls;      /* count of controls pmxctrl points to */
  1847.     DWORD           cbmxctrl;       /* size in bytes of _one_ MIXERCONTROL */
  1848.     LPMIXERCONTROL  pamxctrl;       /* pointer to first MIXERCONTROL array */
  1849. } MIXERLINECONTROLS, *PMIXERLINECONTROLS, FAR *LPMIXERLINECONTROLS;
  1850. #endif
  1851.  
  1852. /* */
  1853. /* */
  1854. /* */
  1855. #ifdef _WIN32
  1856.  
  1857. WINMMAPI MMRESULT WINAPI mixerGetLineControlsA(HMIXEROBJ hmxobj, LPMIXERLINECONTROLSA pmxlc, DWORD fdwControls);
  1858. WINMMAPI MMRESULT WINAPI mixerGetLineControlsW(HMIXEROBJ hmxobj, LPMIXERLINECONTROLSW pmxlc, DWORD fdwControls);
  1859. #ifdef UNICODE
  1860. #define mixerGetLineControls  mixerGetLineControlsW
  1861. #else
  1862. #define mixerGetLineControls  mixerGetLineControlsA
  1863. #endif // !UNICODE
  1864.  
  1865. #else
  1866. MMRESULT WINAPI mixerGetLineControls(HMIXEROBJ hmxobj, LPMIXERLINECONTROLS pmxlc, DWORD fdwControls);
  1867. #endif
  1868.  
  1869. #define MIXER_GETLINECONTROLSF_ALL          0x00000000L
  1870. #define MIXER_GETLINECONTROLSF_ONEBYID      0x00000001L
  1871. #define MIXER_GETLINECONTROLSF_ONEBYTYPE    0x00000002L
  1872.  
  1873. #define MIXER_GETLINECONTROLSF_QUERYMASK    0x0000000FL
  1874.  
  1875. typedef struct tMIXERCONTROLDETAILS {
  1876.     DWORD           cbStruct;       /* size in bytes of MIXERCONTROLDETAILS */
  1877.     DWORD           dwControlID;    /* control id to get/set details on */
  1878.     DWORD           cChannels;      /* number of channels in paDetails array */
  1879.     union {
  1880.     HWND        hwndOwner;      /* for MIXER_SETCONTROLDETAILSF_CUSTOM */
  1881.     DWORD       cMultipleItems; /* if _MULTIPLE, the number of items per channel */
  1882. #if defined(__cplusplus) || defined(_ANONYMOUS_UNION)
  1883.     };
  1884. #else
  1885.     }u;
  1886. #endif
  1887.     DWORD           cbDetails;      /* size of _one_ details_XX struct */
  1888.     LPVOID          paDetails;      /* pointer to array of details_XX structs */
  1889. } MIXERCONTROLDETAILS, *PMIXERCONTROLDETAILS, FAR *LPMIXERCONTROLDETAILS;
  1890.  
  1891. /* */
  1892. /*  MIXER_GETCONTROLDETAILSF_LISTTEXT */
  1893. /* */
  1894. /* */
  1895. #ifdef _WIN32
  1896.  
  1897. typedef struct tagMIXERCONTROLDETAILS_LISTTEXTA {
  1898.     DWORD           dwParam1;
  1899.     DWORD           dwParam2;
  1900.     CHAR            szName[MIXER_LONG_NAME_CHARS];
  1901. } MIXERCONTROLDETAILS_LISTTEXTA, *PMIXERCONTROLDETAILS_LISTTEXTA, *LPMIXERCONTROLDETAILS_LISTTEXTA;
  1902. typedef struct tagMIXERCONTROLDETAILS_LISTTEXTW {
  1903.     DWORD           dwParam1;
  1904.     DWORD           dwParam2;
  1905.     WCHAR           szName[MIXER_LONG_NAME_CHARS];
  1906. } MIXERCONTROLDETAILS_LISTTEXTW, *PMIXERCONTROLDETAILS_LISTTEXTW, *LPMIXERCONTROLDETAILS_LISTTEXTW;
  1907. #ifdef UNICODE
  1908. typedef MIXERCONTROLDETAILS_LISTTEXTW MIXERCONTROLDETAILS_LISTTEXT;
  1909. typedef PMIXERCONTROLDETAILS_LISTTEXTW PMIXERCONTROLDETAILS_LISTTEXT;
  1910. typedef LPMIXERCONTROLDETAILS_LISTTEXTW LPMIXERCONTROLDETAILS_LISTTEXT;
  1911. #else
  1912. typedef MIXERCONTROLDETAILS_LISTTEXTA MIXERCONTROLDETAILS_LISTTEXT;
  1913. typedef PMIXERCONTROLDETAILS_LISTTEXTA PMIXERCONTROLDETAILS_LISTTEXT;
  1914. typedef LPMIXERCONTROLDETAILS_LISTTEXTA LPMIXERCONTROLDETAILS_LISTTEXT;
  1915. #endif // UNICODE
  1916.  
  1917. #else
  1918. typedef struct tMIXERCONTROLDETAILS_LISTTEXT {
  1919.     DWORD           dwParam1;
  1920.     DWORD           dwParam2;
  1921.     char            szName[MIXER_LONG_NAME_CHARS];
  1922. } MIXERCONTROLDETAILS_LISTTEXT, *PMIXERCONTROLDETAILS_LISTTEXT, FAR *LPMIXERCONTROLDETAILS_LISTTEXT;
  1923. #endif
  1924.  
  1925. /* */
  1926. /*  MIXER_GETCONTROLDETAILSF_VALUE */
  1927. /* */
  1928. /* */
  1929. typedef struct tMIXERCONTROLDETAILS_BOOLEAN {
  1930.     LONG            fValue;
  1931. }       MIXERCONTROLDETAILS_BOOLEAN,
  1932.       *PMIXERCONTROLDETAILS_BOOLEAN,
  1933.  FAR *LPMIXERCONTROLDETAILS_BOOLEAN;
  1934.  
  1935. typedef struct tMIXERCONTROLDETAILS_SIGNED {
  1936.     LONG            lValue;
  1937. }       MIXERCONTROLDETAILS_SIGNED,
  1938.       *PMIXERCONTROLDETAILS_SIGNED,
  1939.  FAR *LPMIXERCONTROLDETAILS_SIGNED;
  1940.  
  1941. typedef struct tMIXERCONTROLDETAILS_UNSIGNED {
  1942.     DWORD           dwValue;
  1943. }       MIXERCONTROLDETAILS_UNSIGNED,
  1944.       *PMIXERCONTROLDETAILS_UNSIGNED,
  1945.  FAR *LPMIXERCONTROLDETAILS_UNSIGNED;
  1946.  
  1947. #ifdef _WIN32
  1948.  
  1949. WINMMAPI MMRESULT WINAPI mixerGetControlDetailsA(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
  1950. WINMMAPI MMRESULT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
  1951. #ifdef UNICODE
  1952. #define mixerGetControlDetails  mixerGetControlDetailsW
  1953. #else
  1954. #define mixerGetControlDetails  mixerGetControlDetailsA
  1955. #endif // !UNICODE
  1956.  
  1957. #else
  1958. MMRESULT WINAPI mixerGetControlDetails(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
  1959. #endif
  1960.  
  1961. #define MIXER_GETCONTROLDETAILSF_VALUE      0x00000000L
  1962. #define MIXER_GETCONTROLDETAILSF_LISTTEXT   0x00000001L
  1963.  
  1964. #define MIXER_GETCONTROLDETAILSF_QUERYMASK  0x0000000FL
  1965.  
  1966. WINMMAPI MMRESULT WINAPI mixerSetControlDetails(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
  1967.  
  1968. #define MIXER_SETCONTROLDETAILSF_VALUE      0x00000000L
  1969. #define MIXER_SETCONTROLDETAILSF_CUSTOM     0x00000001L
  1970.  
  1971. #define MIXER_SETCONTROLDETAILSF_QUERYMASK  0x0000000FL
  1972.  
  1973. #endif /* ifndef _WIN32_VXD */
  1974. #endif /* ifndef MMNOMIXER */
  1975.  
  1976. #ifndef MMNOTIMER
  1977. #ifndef _WIN32_VXD
  1978. /****************************************************************************
  1979.  
  1980.                 Timer support
  1981.  
  1982. ****************************************************************************/
  1983.  
  1984. /* timer error return values */
  1985. #define TIMERR_NOERROR        (0)                  /* no error */
  1986. #define TIMERR_NOCANDO        (TIMERR_BASE+1)      /* request not completed */
  1987. #define TIMERR_STRUCT         (TIMERR_BASE+33)     /* time struct size */
  1988.  
  1989. /* timer data types */
  1990. typedef void (CALLBACK TIMECALLBACK)(UINT uTimerID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2);
  1991.  
  1992. typedef TIMECALLBACK FAR *LPTIMECALLBACK;
  1993.  
  1994. /* flags for fuEvent parameter of timeSetEvent() function */
  1995. #define TIME_ONESHOT    0x0000   /* program timer for single event */
  1996. #define TIME_PERIODIC   0x0001   /* program for continuous periodic event */
  1997.  
  1998. #ifdef _WIN32
  1999. #define TIME_CALLBACK_FUNCTION      0x0000  /* callback is function */
  2000. #define TIME_CALLBACK_EVENT_SET     0x0010  /* callback is event - use SetEvent */
  2001. #define TIME_CALLBACK_EVENT_PULSE   0x0020  /* callback is event - use PulseEvent */
  2002. #endif
  2003.  
  2004. /* timer device capabilities data structure */
  2005. typedef struct timecaps_tag {
  2006.     UINT    wPeriodMin;     /* minimum period supported  */
  2007.     UINT    wPeriodMax;     /* maximum period supported  */
  2008. } TIMECAPS, *PTIMECAPS, NEAR *NPTIMECAPS, FAR *LPTIMECAPS;
  2009.  
  2010. /* timer function prototypes */
  2011. WINMMAPI MMRESULT WINAPI timeGetSystemTime(LPMMTIME pmmt, UINT cbmmt);
  2012. WINMMAPI DWORD WINAPI timeGetTime(void);
  2013. WINMMAPI MMRESULT WINAPI timeSetEvent(UINT uDelay, UINT uResolution,
  2014.     LPTIMECALLBACK fptc, DWORD dwUser, UINT fuEvent);
  2015. WINMMAPI MMRESULT WINAPI timeKillEvent(UINT uTimerID);
  2016. WINMMAPI MMRESULT WINAPI timeGetDevCaps(LPTIMECAPS ptc, UINT cbtc);
  2017. WINMMAPI MMRESULT WINAPI timeBeginPeriod(UINT uPeriod);
  2018. WINMMAPI MMRESULT WINAPI timeEndPeriod(UINT uPeriod);
  2019.  
  2020. #endif  /* ifndef _WIN32_VXD */
  2021. #endif  /* ifndef MMNOTIMER */
  2022.  
  2023. #ifndef MMNOJOY
  2024. /****************************************************************************
  2025.  
  2026.                 Joystick support
  2027.  
  2028. ****************************************************************************/
  2029.  
  2030. /* joystick error return values */
  2031. #define JOYERR_NOERROR        (0)                  /* no error */
  2032. #define JOYERR_PARMS          (JOYERR_BASE+5)      /* bad parameters */
  2033. #define JOYERR_NOCANDO        (JOYERR_BASE+6)      /* request not completed */
  2034. #define JOYERR_UNPLUGGED      (JOYERR_BASE+7)      /* joystick is unplugged */
  2035.  
  2036. /* constants used with JOYINFO and JOYINFOEX structures and MM_JOY* messages */
  2037. #define JOY_BUTTON1         0x0001
  2038. #define JOY_BUTTON2         0x0002
  2039. #define JOY_BUTTON3         0x0004
  2040. #define JOY_BUTTON4         0x0008
  2041. #define JOY_BUTTON1CHG      0x0100
  2042. #define JOY_BUTTON2CHG      0x0200
  2043. #define JOY_BUTTON3CHG      0x0400
  2044. #define JOY_BUTTON4CHG      0x0800
  2045.  
  2046. /* constants used with JOYINFOEX */
  2047. #define JOY_BUTTON5         0x00000010l
  2048. #define JOY_BUTTON6         0x00000020l
  2049. #define JOY_BUTTON7         0x00000040l
  2050. #define JOY_BUTTON8         0x00000080l
  2051. #define JOY_BUTTON9         0x00000100l
  2052. #define JOY_BUTTON10        0x00000200l
  2053. #define JOY_BUTTON11        0x00000400l
  2054. #define JOY_BUTTON12        0x00000800l
  2055. #define JOY_BUTTON13        0x00001000l
  2056. #define JOY_BUTTON14        0x00002000l
  2057. #define JOY_BUTTON15        0x00004000l
  2058. #define JOY_BUTTON16        0x00008000l
  2059. #define JOY_BUTTON17        0x00010000l
  2060. #define JOY_BUTTON18        0x00020000l
  2061. #define JOY_BUTTON19        0x00040000l
  2062. #define JOY_BUTTON20        0x00080000l
  2063. #define JOY_BUTTON21        0x00100000l
  2064. #define JOY_BUTTON22        0x00200000l
  2065. #define JOY_BUTTON23        0x00400000l
  2066. #define JOY_BUTTON24        0x00800000l
  2067. #define JOY_BUTTON25        0x01000000l
  2068. #define JOY_BUTTON26        0x02000000l
  2069. #define JOY_BUTTON27        0x04000000l
  2070. #define JOY_BUTTON28        0x08000000l
  2071. #define JOY_BUTTON29        0x10000000l
  2072. #define JOY_BUTTON30        0x20000000l
  2073. #define JOY_BUTTON31        0x40000000l
  2074. #define JOY_BUTTON32        0x80000000l
  2075.  
  2076. /* constants used with JOYINFOEX structure */
  2077. #define JOY_POVCENTERED        (WORD) -1
  2078. #define JOY_POVFORWARD        0
  2079. #define JOY_POVRIGHT        9000
  2080. #define JOY_POVBACKWARD        18000
  2081. #define JOY_POVLEFT        27000
  2082.  
  2083. #define JOY_RETURNX        0x00000001l
  2084. #define JOY_RETURNY        0x00000002l
  2085. #define JOY_RETURNZ        0x00000004l
  2086. #define JOY_RETURNR        0x00000008l
  2087. #define JOY_RETURNU        0x00000010l    /* axis 5 */
  2088. #define JOY_RETURNV        0x00000020l    /* axis 6 */
  2089. #define JOY_RETURNPOV        0x00000040l
  2090. #define JOY_RETURNBUTTONS    0x00000080l
  2091. #define JOY_RETURNRAWDATA    0x00000100l
  2092. #define JOY_RETURNPOVCTS    0x00000200l
  2093. #define JOY_RETURNCENTERED    0x00000400l
  2094. #define JOY_USEDEADZONE        0x00000800l
  2095. #define JOY_RETURNALL        (JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ | \
  2096.                  JOY_RETURNR | JOY_RETURNU | JOY_RETURNV | \
  2097.                  JOY_RETURNPOV | JOY_RETURNBUTTONS)
  2098. #define JOY_CAL_READALWAYS    0x00010000l
  2099. #define JOY_CAL_READXYONLY    0x00020000l
  2100. #define JOY_CAL_READ3        0x00040000l
  2101. #define JOY_CAL_READ4        0x00080000l
  2102. #define JOY_CAL_READXONLY    0x00100000l
  2103. #define JOY_CAL_READYONLY    0x00200000l
  2104. #define JOY_CAL_READ5        0x00400000l
  2105. #define JOY_CAL_READ6        0x00800000l
  2106. #define JOY_CAL_READZONLY    0x01000000l
  2107. #define JOY_CAL_READRONLY    0x02000000l
  2108. #define JOY_CAL_READUONLY    0x04000000l
  2109. #define JOY_CAL_READVONLY    0x08000000l
  2110.  
  2111. /* joystick ID constants */
  2112. #define JOYSTICKID1         0
  2113. #define JOYSTICKID2         1
  2114.  
  2115. /* joystick driver capabilites */
  2116. #define JOYCAPS_HASZ        0x0001
  2117. #define JOYCAPS_HASR        0x0002
  2118. #define JOYCAPS_HASU        0x0004
  2119. #define JOYCAPS_HASV        0x0008
  2120. #define JOYCAPS_HASPOV        0x0010
  2121. #define JOYCAPS_POV4DIR        0x0020
  2122. #define JOYCAPS_POVCTS        0x0040
  2123.  
  2124. /* joystick device capabilities data structure */
  2125. #ifdef _WIN32
  2126.  
  2127. typedef struct tagJOYCAPSA {
  2128.     WORD    wMid;                /* manufacturer ID */
  2129.     WORD    wPid;                /* product ID */
  2130.     CHAR    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.     CHAR    szRegKey[MAXPNAMELEN];/* registry key */
  2152.     CHAR    szOEMVxD[MAX_JOYSTICKOEMVXDNAME]; /* OEM VxD in use */
  2153. #endif
  2154. } JOYCAPSA, *PJOYCAPSA, *NPJOYCAPSA, *LPJOYCAPSA;
  2155. typedef struct tagJOYCAPSW {
  2156.     WORD    wMid;                /* manufacturer ID */
  2157.     WORD    wPid;                /* product ID */
  2158.     WCHAR   szPname[MAXPNAMELEN];/* product name (NULL terminated string) */
  2159.     UINT    wXmin;               /* minimum x position value */
  2160.     UINT    wXmax;               /* maximum x position value */
  2161.     UINT    wYmin;               /* minimum y position value */
  2162.     UINT    wYmax;               /* maximum y position value */
  2163.     UINT    wZmin;               /* minimum z position value */
  2164.     UINT    wZmax;               /* maximum z position value */
  2165.     UINT    wNumButtons;         /* number of buttons */
  2166.     UINT    wPeriodMin;          /* minimum message period when captured */
  2167.     UINT    wPeriodMax;          /* maximum message period when captured */
  2168. #if (WINVER >= 0x0400)
  2169.     UINT    wRmin;               /* minimum r position value */
  2170.     UINT    wRmax;               /* maximum r position value */
  2171.     UINT    wUmin;               /* minimum u (5th axis) position value */
  2172.     UINT    wUmax;               /* maximum u (5th axis) position value */
  2173.     UINT    wVmin;               /* minimum v (6th axis) position value */
  2174.     UINT    wVmax;               /* maximum v (6th axis) position value */
  2175.     UINT    wCaps;          /* joystick capabilites */
  2176.     UINT    wMaxAxes;          /* maximum number of axes supported */
  2177.     UINT    wNumAxes;          /* number of axes in use */
  2178.     UINT    wMaxButtons;     /* maximum number of buttons supported */
  2179.     WCHAR   szRegKey[MAXPNAMELEN];/* registry key */
  2180.     WCHAR   szOEMVxD[MAX_JOYSTICKOEMVXDNAME]; /* OEM VxD in use */
  2181. #endif
  2182. } JOYCAPSW, *PJOYCAPSW, *NPJOYCAPSW, *LPJOYCAPSW;
  2183. #ifdef UNICODE
  2184. typedef JOYCAPSW JOYCAPS;
  2185. typedef PJOYCAPSW PJOYCAPS;
  2186. typedef NPJOYCAPSW NPJOYCAPS;
  2187. typedef LPJOYCAPSW LPJOYCAPS;
  2188. #else
  2189. typedef JOYCAPSA JOYCAPS;
  2190. typedef PJOYCAPSA PJOYCAPS;
  2191. typedef NPJOYCAPSA NPJOYCAPS;
  2192. typedef LPJOYCAPSA LPJOYCAPS;
  2193. #endif // UNICODE
  2194.  
  2195. #else
  2196. typedef struct joycaps_tag {
  2197.     WORD wMid;                  /* manufacturer ID */
  2198.     WORD wPid;                  /* product ID */
  2199.     char szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  2200.     UINT wXmin;                 /* minimum x position value */
  2201.     UINT wXmax;                 /* maximum x position value */
  2202.     UINT wYmin;                 /* minimum y position value */
  2203.     UINT wYmax;                 /* maximum y position value */
  2204.     UINT wZmin;                 /* minimum z position value */
  2205.     UINT wZmax;                 /* maximum z position value */
  2206.     UINT wNumButtons;           /* number of buttons */
  2207.     UINT wPeriodMin;            /* minimum message period when captured */
  2208.     UINT wPeriodMax;            /* maximum message period when captured */
  2209. #if (WINVER >= 0x0400)
  2210.     UINT wRmin;                 /* minimum r position value */
  2211.     UINT wRmax;                 /* maximum r position value */
  2212.     UINT wUmin;                 /* minimum u (5th axis) position value */
  2213.     UINT wUmax;                 /* maximum u (5th axis) position value */
  2214.     UINT wVmin;                 /* minimum v (6th axis) position value */
  2215.     UINT wVmax;                 /* maximum v (6th axis) position value */
  2216.     UINT wCaps;                 /* joystick capabilites */
  2217.     UINT wMaxAxes;         /* maximum number of axes supported */
  2218.     UINT wNumAxes;         /* number of axes in use */
  2219.     UINT wMaxButtons;         /* maximum number of buttons supported */
  2220.     char szRegKey[MAXPNAMELEN]; /* registry key */
  2221.     char szOEMVxD[MAX_JOYSTICKOEMVXDNAME]; /* OEM VxD in use */
  2222. #endif
  2223. } JOYCAPS, *PJOYCAPS, NEAR *NPJOYCAPS, FAR *LPJOYCAPS;
  2224. #endif
  2225.  
  2226. /* joystick information data structure */
  2227. typedef struct joyinfo_tag {
  2228.     UINT wXpos;                 /* x position */
  2229.     UINT wYpos;                 /* y position */
  2230.     UINT wZpos;                 /* z position */
  2231.     UINT wButtons;              /* button states */
  2232. } JOYINFO, *PJOYINFO, NEAR *NPJOYINFO, FAR *LPJOYINFO;
  2233.  
  2234. #if(WINVER >= 0x0400)
  2235. typedef struct joyinfoex_tag {
  2236.     DWORD dwSize;         /* size of structure */
  2237.     DWORD dwFlags;         /* flags to indicate what to return */
  2238.     DWORD dwXpos;                /* x position */
  2239.     DWORD dwYpos;                /* y position */
  2240.     DWORD dwZpos;                /* z position */
  2241.     DWORD dwRpos;         /* rudder/4th axis position */
  2242.     DWORD dwUpos;         /* 5th axis position */
  2243.     DWORD dwVpos;         /* 6th axis position */
  2244.     DWORD dwButtons;             /* button states */
  2245.     DWORD dwButtonNumber;        /* current button number pressed */
  2246.     DWORD dwPOV;                 /* point of view state */
  2247.     DWORD dwReserved1;         /* reserved for communication between winmm & driver */
  2248.     DWORD dwReserved2;         /* reserved for future expansion */
  2249. } JOYINFOEX, *PJOYINFOEX, NEAR *NPJOYINFOEX, FAR *LPJOYINFOEX;
  2250. #endif /* WINVER >= 0x0400 */
  2251.  
  2252. #ifndef _WIN32_VXD
  2253.  
  2254. /* joystick function prototypes */
  2255. WINMMAPI UINT WINAPI joyGetNumDevs(void);
  2256. #ifdef _WIN32
  2257.  
  2258. WINMMAPI MMRESULT WINAPI joyGetDevCapsA(UINT uJoyID, LPJOYCAPSA pjc, UINT cbjc);
  2259. WINMMAPI MMRESULT WINAPI joyGetDevCapsW(UINT uJoyID, LPJOYCAPSW pjc, UINT cbjc);
  2260. #ifdef UNICODE
  2261. #define joyGetDevCaps  joyGetDevCapsW
  2262. #else
  2263. #define joyGetDevCaps  joyGetDevCapsA
  2264. #endif // !UNICODE
  2265.  
  2266. #else
  2267. MMRESULT WINAPI joyGetDevCaps(UINT uJoyID, LPJOYCAPS pjc, UINT cbjc);
  2268. #endif
  2269. WINMMAPI MMRESULT WINAPI joyGetPos(UINT uJoyID, LPJOYINFO pji);
  2270.  
  2271. #if(WINVER >= 0x0400)
  2272. WINMMAPI MMRESULT WINAPI joyGetPosEx(UINT uJoyID, LPJOYINFOEX pji);
  2273. #endif /* WINVER >= 0x0400 */
  2274.  
  2275. WINMMAPI MMRESULT WINAPI joyGetThreshold(UINT uJoyID, LPUINT puThreshold);
  2276. WINMMAPI MMRESULT WINAPI joyReleaseCapture(UINT uJoyID);
  2277. WINMMAPI MMRESULT WINAPI joySetCapture(HWND hwnd, UINT uJoyID, UINT uPeriod,
  2278.     BOOL fChanged);
  2279. WINMMAPI MMRESULT WINAPI joySetThreshold(UINT uJoyID, UINT uThreshold);
  2280.  
  2281. #endif /* ifndef _WIN32_VXD */
  2282.  
  2283. #endif  /* ifndef MMNOJOY */
  2284.  
  2285. #ifndef MMNOMMIO
  2286. #ifndef _WIN32_VXD
  2287. /****************************************************************************
  2288.  
  2289.             Multimedia File I/O support
  2290.  
  2291. ****************************************************************************/
  2292.  
  2293. /* MMIO error return values */
  2294. #define MMIOERR_BASE                256
  2295. #define MMIOERR_FILENOTFOUND        (MMIOERR_BASE + 1)  /* file not found */
  2296. #define MMIOERR_OUTOFMEMORY         (MMIOERR_BASE + 2)  /* out of memory */
  2297. #define MMIOERR_CANNOTOPEN          (MMIOERR_BASE + 3)  /* cannot open */
  2298. #define MMIOERR_CANNOTCLOSE         (MMIOERR_BASE + 4)  /* cannot close */
  2299. #define MMIOERR_CANNOTREAD          (MMIOERR_BASE + 5)  /* cannot read */
  2300. #define MMIOERR_CANNOTWRITE         (MMIOERR_BASE + 6)  /* cannot write */
  2301. #define MMIOERR_CANNOTSEEK          (MMIOERR_BASE + 7)  /* cannot seek */
  2302. #define MMIOERR_CANNOTEXPAND        (MMIOERR_BASE + 8)  /* cannot expand file */
  2303. #define MMIOERR_CHUNKNOTFOUND       (MMIOERR_BASE + 9)  /* chunk not found */
  2304. #define MMIOERR_UNBUFFERED          (MMIOERR_BASE + 10) /*  */
  2305. #define MMIOERR_PATHNOTFOUND        (MMIOERR_BASE + 11) /* path incorrect */
  2306. #define MMIOERR_ACCESSDENIED        (MMIOERR_BASE + 12) /* file was protected */
  2307. #define MMIOERR_SHARINGVIOLATION    (MMIOERR_BASE + 13) /* file in use */
  2308. #define MMIOERR_NETWORKERROR        (MMIOERR_BASE + 14) /* network not responding */
  2309. #define MMIOERR_TOOMANYOPENFILES    (MMIOERR_BASE + 15) /* no more file handles  */
  2310. #define MMIOERR_INVALIDFILE         (MMIOERR_BASE + 16) /* default error file error */
  2311.  
  2312. /* MMIO constants */
  2313. #define CFSEPCHAR       '+'             /* compound file name separator char. */
  2314.  
  2315. /* MMIO data types */
  2316. typedef DWORD           FOURCC;         /* a four character code */
  2317. typedef char _huge *    HPSTR;          /* a huge version of LPSTR */
  2318. DECLARE_HANDLE(HMMIO);                  /* a handle to an open file */
  2319. typedef LRESULT (CALLBACK MMIOPROC)(LPSTR lpmmioinfo, UINT uMsg,
  2320.         LPARAM lParam1, LPARAM lParam2);
  2321. typedef MMIOPROC FAR *LPMMIOPROC;
  2322.  
  2323. /* general MMIO information data structure */
  2324. typedef struct _MMIOINFO
  2325. {
  2326.     /* general fields */
  2327.     DWORD           dwFlags;        /* general status flags */
  2328.     FOURCC          fccIOProc;      /* pointer to I/O procedure */
  2329.     LPMMIOPROC      pIOProc;        /* pointer to I/O procedure */
  2330.     UINT            wErrorRet;      /* place for error to be returned */
  2331.     HTASK           htask;          /* alternate local task */
  2332.  
  2333.     /* fields maintained by MMIO functions during buffered I/O */
  2334.     LONG            cchBuffer;      /* size of I/O buffer (or 0L) */
  2335.     HPSTR           pchBuffer;      /* start of I/O buffer (or NULL) */
  2336.     HPSTR           pchNext;        /* pointer to next byte to read/write */
  2337.     HPSTR           pchEndRead;     /* pointer to last valid byte to read */
  2338.     HPSTR           pchEndWrite;    /* pointer to last byte to write */
  2339.     LONG            lBufOffset;     /* disk offset of start of buffer */
  2340.  
  2341.     /* fields maintained by I/O procedure */
  2342.     LONG            lDiskOffset;    /* disk offset of next read or write */
  2343.     DWORD           adwInfo[3];     /* data specific to type of MMIOPROC */
  2344.  
  2345.     /* other fields maintained by MMIO */
  2346.     DWORD           dwReserved1;    /* reserved for MMIO use */
  2347.     DWORD           dwReserved2;    /* reserved for MMIO use */
  2348.     HMMIO           hmmio;          /* handle to open file */
  2349. } MMIOINFO, *PMMIOINFO, NEAR *NPMMIOINFO, FAR *LPMMIOINFO;
  2350. typedef const MMIOINFO FAR *LPCMMIOINFO;
  2351.  
  2352. /* RIFF chunk information data structure */
  2353. typedef struct _MMCKINFO
  2354. {
  2355.     FOURCC          ckid;           /* chunk ID */
  2356.     DWORD           cksize;         /* chunk size */
  2357.     FOURCC          fccType;        /* form type or list type */
  2358.     DWORD           dwDataOffset;   /* offset of data portion of chunk */
  2359.     DWORD           dwFlags;        /* flags used by MMIO functions */
  2360. } MMCKINFO, *PMMCKINFO, NEAR *NPMMCKINFO, FAR *LPMMCKINFO;
  2361. typedef const MMCKINFO *LPCMMCKINFO;
  2362.  
  2363. /* bit field masks */
  2364. #define MMIO_RWMODE     0x00000003      /* open file for reading/writing/both */
  2365. #define MMIO_SHAREMODE  0x00000070      /* file sharing mode number */
  2366.  
  2367. /* constants for dwFlags field of MMIOINFO */
  2368. #define MMIO_CREATE     0x00001000      /* create new file (or truncate file) */
  2369. #define MMIO_PARSE      0x00000100      /* parse new file returning path */
  2370. #define MMIO_DELETE     0x00000200      /* create new file (or truncate file) */
  2371. #define MMIO_EXIST      0x00004000      /* checks for existence of file */
  2372. #define MMIO_ALLOCBUF   0x00010000      /* mmioOpen() should allocate a buffer */
  2373. #define MMIO_GETTEMP    0x00020000      /* mmioOpen() should retrieve temp name */
  2374.  
  2375. #define MMIO_DIRTY      0x10000000      /* I/O buffer is dirty */
  2376.  
  2377. /* read/write mode numbers (bit field MMIO_RWMODE) */
  2378. #define MMIO_READ       0x00000000      /* open file for reading only */
  2379. #define MMIO_WRITE      0x00000001      /* open file for writing only */
  2380. #define MMIO_READWRITE  0x00000002      /* open file for reading and writing */
  2381.  
  2382. /* share mode numbers (bit field MMIO_SHAREMODE) */
  2383. #define MMIO_COMPAT     0x00000000      /* compatibility mode */
  2384. #define MMIO_EXCLUSIVE  0x00000010      /* exclusive-access mode */
  2385. #define MMIO_DENYWRITE  0x00000020      /* deny writing to other processes */
  2386. #define MMIO_DENYREAD   0x00000030      /* deny reading to other processes */
  2387. #define MMIO_DENYNONE   0x00000040      /* deny nothing to other processes */
  2388.  
  2389. /* various MMIO flags */
  2390. #define MMIO_FHOPEN             0x0010  /* mmioClose: keep file handle open */
  2391. #define MMIO_EMPTYBUF           0x0010  /* mmioFlush: empty the I/O buffer */
  2392. #define MMIO_TOUPPER            0x0010  /* mmioStringToFOURCC: to u-case */
  2393. #define MMIO_INSTALLPROC    0x00010000  /* mmioInstallIOProc: install MMIOProc */
  2394. #define MMIO_GLOBALPROC     0x10000000  /* mmioInstallIOProc: install globally */
  2395. #define MMIO_REMOVEPROC     0x00020000  /* mmioInstallIOProc: remove MMIOProc */
  2396. #define MMIO_UNICODEPROC    0x01000000  /* mmioInstallIOProc: Unicode MMIOProc */
  2397. #define MMIO_FINDPROC       0x00040000  /* mmioInstallIOProc: find an MMIOProc */
  2398. #define MMIO_FINDCHUNK          0x0010  /* mmioDescend: find a chunk by ID */
  2399. #define MMIO_FINDRIFF           0x0020  /* mmioDescend: find a LIST chunk */
  2400. #define MMIO_FINDLIST           0x0040  /* mmioDescend: find a RIFF chunk */
  2401. #define MMIO_CREATERIFF         0x0020  /* mmioCreateChunk: make a LIST chunk */
  2402. #define MMIO_CREATELIST         0x0040  /* mmioCreateChunk: make a RIFF chunk */
  2403.  
  2404. /* message numbers for MMIOPROC I/O procedure functions */
  2405. #define MMIOM_READ      MMIO_READ       /* read */
  2406. #define MMIOM_WRITE    MMIO_WRITE       /* write */
  2407. #define MMIOM_SEEK              2       /* seek to a new position in file */
  2408. #define MMIOM_OPEN              3       /* open file */
  2409. #define MMIOM_CLOSE             4       /* close file */
  2410. #define MMIOM_WRITEFLUSH        5       /* write and flush */
  2411.  
  2412. #if (WINVER >= 0x030a)
  2413. #define MMIOM_RENAME            6       /* rename specified file */
  2414. #endif /* ifdef WINVER >= 0x030a */
  2415.  
  2416. #define MMIOM_USER         0x8000       /* beginning of user-defined messages */
  2417.  
  2418. /* standard four character codes */
  2419. #define FOURCC_RIFF     mmioFOURCC('R', 'I', 'F', 'F')
  2420. #define FOURCC_LIST     mmioFOURCC('L', 'I', 'S', 'T')
  2421.  
  2422. /* four character codes used to identify standard built-in I/O procedures */
  2423. #define FOURCC_DOS      mmioFOURCC('D', 'O', 'S', ' ')
  2424. #define FOURCC_MEM      mmioFOURCC('M', 'E', 'M', ' ')
  2425.  
  2426. /* flags for mmioSeek() */
  2427. #ifndef SEEK_SET
  2428. #define SEEK_SET        0               /* seek to an absolute position */
  2429. #define SEEK_CUR        1               /* seek relative to current position */
  2430. #define SEEK_END        2               /* seek relative to end of file */
  2431. #endif  /* ifndef SEEK_SET */
  2432.  
  2433. /* other constants */
  2434. #define MMIO_DEFAULTBUFFER      8192    /* default buffer size */
  2435.  
  2436. /* MMIO macros */
  2437. #define mmioFOURCC(ch0, ch1, ch2, ch3)  MAKEFOURCC(ch0, ch1, ch2, ch3)
  2438.  
  2439. /* MMIO function prototypes */
  2440. #ifdef _WIN32
  2441.  
  2442. WINMMAPI FOURCC WINAPI mmioStringToFOURCCA(LPCSTR sz, UINT uFlags);
  2443. WINMMAPI FOURCC WINAPI mmioStringToFOURCCW(LPCWSTR sz, UINT uFlags);
  2444. #ifdef UNICODE
  2445. #define mmioStringToFOURCC  mmioStringToFOURCCW
  2446. #else
  2447. #define mmioStringToFOURCC  mmioStringToFOURCCA
  2448. #endif // !UNICODE
  2449. WINMMAPI LPMMIOPROC WINAPI mmioInstallIOProcA(FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
  2450. WINMMAPI LPMMIOPROC WINAPI mmioInstallIOProcW(FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
  2451. #ifdef UNICODE
  2452. #define mmioInstallIOProc  mmioInstallIOProcW
  2453. #else
  2454. #define mmioInstallIOProc  mmioInstallIOProcA
  2455. #endif // !UNICODE
  2456. WINMMAPI HMMIO WINAPI mmioOpenA(LPSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
  2457. WINMMAPI HMMIO WINAPI mmioOpenW(LPWSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
  2458. #ifdef UNICODE
  2459. #define mmioOpen  mmioOpenW
  2460. #else
  2461. #define mmioOpen  mmioOpenA
  2462. #endif // !UNICODE
  2463. WINMMAPI MMRESULT WINAPI mmioRenameA(LPCSTR pszFileName, LPCSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename);
  2464. WINMMAPI MMRESULT WINAPI mmioRenameW(LPCWSTR pszFileName, LPCWSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename);
  2465. #ifdef UNICODE
  2466. #define mmioRename  mmioRenameW
  2467. #else
  2468. #define mmioRename  mmioRenameA
  2469. #endif // !UNICODE
  2470. #else
  2471. FOURCC WINAPI mmioStringToFOURCC(LPCSTR sz, UINT uFlags);
  2472. LPMMIOPROC WINAPI mmioInstallIOProc(FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
  2473. HMMIO WINAPI mmioOpen(LPSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
  2474. #if (WINVER >= 0x030a)
  2475. MMRESULT WINAPI mmioRename(LPCSTR pszFileName, LPCSTR pszNewFileName, const MMIOINFO FAR* pmmioinfo, DWORD fdwRename);
  2476. #endif /* ifdef WINVER >= 0x030a */
  2477. #endif
  2478.  
  2479. WINMMAPI MMRESULT WINAPI mmioClose(HMMIO hmmio, UINT fuClose);
  2480. WINMMAPI LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch);
  2481. WINMMAPI LONG WINAPI mmioWrite(HMMIO hmmio, const char _huge* pch, LONG cch);
  2482. WINMMAPI LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, int iOrigin);
  2483. WINMMAPI MMRESULT WINAPI mmioGetInfo(HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuInfo);
  2484. WINMMAPI MMRESULT WINAPI mmioSetInfo(HMMIO hmmio, LPCMMIOINFO pmmioinfo, UINT fuInfo);
  2485. WINMMAPI MMRESULT WINAPI mmioSetBuffer(HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer,
  2486.     UINT fuBuffer);
  2487. WINMMAPI MMRESULT WINAPI mmioFlush(HMMIO hmmio, UINT fuFlush);
  2488. WINMMAPI MMRESULT WINAPI mmioAdvance(HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuAdvance);
  2489. WINMMAPI LRESULT WINAPI mmioSendMessage(HMMIO hmmio, UINT uMsg,
  2490.     LPARAM lParam1, LPARAM lParam2);
  2491. WINMMAPI MMRESULT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO pmmcki,
  2492.     const MMCKINFO FAR* pmmckiParent, UINT fuDescend);
  2493. WINMMAPI MMRESULT WINAPI mmioAscend(HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuAscend);
  2494. WINMMAPI MMRESULT WINAPI mmioCreateChunk(HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuCreate);
  2495.  
  2496. #endif  /* ifndef _WIN32_VXD */
  2497. #endif  /* ifndef MMNOMMIO */
  2498.  
  2499. #ifndef MMNOMCI
  2500. #ifndef _WIN32_VXD
  2501. /****************************************************************************
  2502.  
  2503.                 MCI support
  2504.  
  2505. ****************************************************************************/
  2506.  
  2507. #ifndef _MCIERROR_              /* MCIERROR is defined in some post 3.1 apps */
  2508. #define _MCIERROR_
  2509. typedef DWORD   MCIERROR;       /* error return code, 0 means no error */
  2510. #endif
  2511.  
  2512. #ifndef _MCIDEVICEID_           /* Same with MCIDEVICEID */
  2513. #define _MCIDEVICEID_
  2514. typedef UINT    MCIDEVICEID;    /* MCI device ID type */
  2515. #endif
  2516.  
  2517. typedef UINT (CALLBACK *YIELDPROC)(MCIDEVICEID mciId, DWORD dwYieldData);
  2518.  
  2519. /* MCI function prototypes */
  2520. #ifdef _WIN32
  2521.  
  2522. WINMMAPI MCIERROR WINAPI mciSendCommandA(MCIDEVICEID mciId, UINT uMsg, DWORD dwParam1, DWORD dwParam2);
  2523. WINMMAPI MCIERROR WINAPI mciSendCommandW(MCIDEVICEID mciId, UINT uMsg, DWORD dwParam1, DWORD dwParam2);
  2524. #ifdef UNICODE
  2525. #define mciSendCommand  mciSendCommandW
  2526. #else
  2527. #define mciSendCommand  mciSendCommandA
  2528. #endif // !UNICODE
  2529. WINMMAPI MCIERROR  WINAPI mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
  2530. WINMMAPI MCIERROR  WINAPI mciSendStringW(LPCWSTR lpstrCommand, LPWSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
  2531. #ifdef UNICODE
  2532. #define mciSendString  mciSendStringW
  2533. #else
  2534. #define mciSendString  mciSendStringA
  2535. #endif // !UNICODE
  2536. WINMMAPI MCIDEVICEID WINAPI mciGetDeviceIDA(LPCSTR pszDevice);
  2537. WINMMAPI MCIDEVICEID WINAPI mciGetDeviceIDW(LPCWSTR pszDevice);
  2538. #ifdef UNICODE
  2539. #define mciGetDeviceID  mciGetDeviceIDW
  2540. #else
  2541. #define mciGetDeviceID  mciGetDeviceIDA
  2542. #endif // !UNICODE
  2543. WINMMAPI MCIDEVICEID WINAPI mciGetDeviceIDFromElementIDA(DWORD dwElementID, LPCSTR lpstrType );
  2544. WINMMAPI MCIDEVICEID WINAPI mciGetDeviceIDFromElementIDW(DWORD dwElementID, LPCWSTR lpstrType );
  2545. #ifdef UNICODE
  2546. #define mciGetDeviceIDFromElementID  mciGetDeviceIDFromElementIDW
  2547. #else
  2548. #define mciGetDeviceIDFromElementID  mciGetDeviceIDFromElementIDA
  2549. #endif // !UNICODE
  2550. WINMMAPI BOOL WINAPI mciGetErrorStringA(MCIERROR mcierr, LPSTR pszText, UINT cchText);
  2551. WINMMAPI BOOL WINAPI mciGetErrorStringW(MCIERROR mcierr, LPWSTR pszText, UINT cchText);
  2552. #ifdef UNICODE
  2553. #define mciGetErrorString  mciGetErrorStringW
  2554. #else
  2555. #define mciGetErrorString  mciGetErrorStringA
  2556. #endif // !UNICODE
  2557.  
  2558. #else
  2559. MCIERROR WINAPI mciSendCommand(MCIDEVICEID mciId, UINT uMsg, DWORD dwParam1, DWORD dwParam2);
  2560. MCIERROR  WINAPI mciSendString(LPCSTR lpstrCommand, LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
  2561. MCIDEVICEID WINAPI mciGetDeviceID(LPCSTR pszDevice);
  2562. BOOL WINAPI mciGetErrorString(MCIERROR mcierr, LPSTR pszText, UINT cchText);
  2563. #endif
  2564.  
  2565. WINMMAPI BOOL WINAPI mciSetYieldProc(MCIDEVICEID mciId, YIELDPROC fpYieldProc,
  2566.     DWORD dwYieldData);
  2567.  
  2568. #if (WINVER >= 0x030a)
  2569. WINMMAPI HTASK WINAPI mciGetCreatorTask(MCIDEVICEID mciId);
  2570. WINMMAPI YIELDPROC WINAPI mciGetYieldProc(MCIDEVICEID mciId, LPDWORD pdwYieldData);
  2571. #endif /* ifdef WINVER >= 0x030a */
  2572.  
  2573. #if (WINVER < 0x030a)
  2574. WINMMAPI BOOL WINAPI mciExecute(LPCSTR pszCommand);
  2575. #endif /* ifdef WINVER < 0x030a */
  2576.  
  2577. /* MCI error return values */
  2578. #define MCIERR_INVALID_DEVICE_ID        (MCIERR_BASE + 1)
  2579. #define MCIERR_UNRECOGNIZED_KEYWORD     (MCIERR_BASE + 3)
  2580. #define MCIERR_UNRECOGNIZED_COMMAND     (MCIERR_BASE + 5)
  2581. #define MCIERR_HARDWARE                 (MCIERR_BASE + 6)
  2582. #define MCIERR_INVALID_DEVICE_NAME      (MCIERR_BASE + 7)
  2583. #define MCIERR_OUT_OF_MEMORY            (MCIERR_BASE + 8)
  2584. #define MCIERR_DEVICE_OPEN              (MCIERR_BASE + 9)
  2585. #define MCIERR_CANNOT_LOAD_DRIVER       (MCIERR_BASE + 10)
  2586. #define MCIERR_MISSING_COMMAND_STRING   (MCIERR_BASE + 11)
  2587. #define MCIERR_PARAM_OVERFLOW           (MCIERR_BASE + 12)
  2588. #define MCIERR_MISSING_STRING_ARGUMENT  (MCIERR_BASE + 13)
  2589. #define MCIERR_BAD_INTEGER              (MCIERR_BASE + 14)
  2590. #define MCIERR_PARSER_INTERNAL          (MCIERR_BASE + 15)
  2591. #define MCIERR_DRIVER_INTERNAL          (MCIERR_BASE + 16)
  2592. #define MCIERR_MISSING_PARAMETER        (MCIERR_BASE + 17)
  2593. #define MCIERR_UNSUPPORTED_FUNCTION     (MCIERR_BASE + 18)
  2594. #define MCIERR_FILE_NOT_FOUND           (MCIERR_BASE + 19)
  2595. #define MCIERR_DEVICE_NOT_READY         (MCIERR_BASE + 20)
  2596. #define MCIERR_INTERNAL                 (MCIERR_BASE + 21)
  2597. #define MCIERR_DRIVER                   (MCIERR_BASE + 22)
  2598. #define MCIERR_CANNOT_USE_ALL           (MCIERR_BASE + 23)
  2599. #define MCIERR_MULTIPLE                 (MCIERR_BASE + 24)
  2600. #define MCIERR_EXTENSION_NOT_FOUND      (MCIERR_BASE + 25)
  2601. #define MCIERR_OUTOFRANGE               (MCIERR_BASE + 26)
  2602. #define MCIERR_FLAGS_NOT_COMPATIBLE     (MCIERR_BASE + 28)
  2603. #define MCIERR_FILE_NOT_SAVED           (MCIERR_BASE + 30)
  2604. #define MCIERR_DEVICE_TYPE_REQUIRED     (MCIERR_BASE + 31)
  2605. #define MCIERR_DEVICE_LOCKED            (MCIERR_BASE + 32)
  2606. #define MCIERR_DUPLICATE_ALIAS          (MCIERR_BASE + 33)
  2607. #define MCIERR_BAD_CONSTANT             (MCIERR_BASE + 34)
  2608. #define MCIERR_MUST_USE_SHAREABLE       (MCIERR_BASE + 35)
  2609. #define MCIERR_MISSING_DEVICE_NAME      (MCIERR_BASE + 36)
  2610. #define MCIERR_BAD_TIME_FORMAT          (MCIERR_BASE + 37)
  2611. #define MCIERR_NO_CLOSING_QUOTE         (MCIERR_BASE + 38)
  2612. #define MCIERR_DUPLICATE_FLAGS          (MCIERR_BASE + 39)
  2613. #define MCIERR_INVALID_FILE             (MCIERR_BASE + 40)
  2614. #define MCIERR_NULL_PARAMETER_BLOCK     (MCIERR_BASE + 41)
  2615. #define MCIERR_UNNAMED_RESOURCE         (MCIERR_BASE + 42)
  2616. #define MCIERR_NEW_REQUIRES_ALIAS       (MCIERR_BASE + 43)
  2617. #define MCIERR_NOTIFY_ON_AUTO_OPEN      (MCIERR_BASE + 44)
  2618. #define MCIERR_NO_ELEMENT_ALLOWED       (MCIERR_BASE + 45)
  2619. #define MCIERR_NONAPPLICABLE_FUNCTION   (MCIERR_BASE + 46)
  2620. #define MCIERR_ILLEGAL_FOR_AUTO_OPEN    (MCIERR_BASE + 47)
  2621. #define MCIERR_FILENAME_REQUIRED        (MCIERR_BASE + 48)
  2622. #define MCIERR_EXTRA_CHARACTERS         (MCIERR_BASE + 49)
  2623. #define MCIERR_DEVICE_NOT_INSTALLED     (MCIERR_BASE + 50)
  2624. #define MCIERR_GET_CD                   (MCIERR_BASE + 51)
  2625. #define MCIERR_SET_CD                   (MCIERR_BASE + 52)
  2626. #define MCIERR_SET_DRIVE                (MCIERR_BASE + 53)
  2627. #define MCIERR_DEVICE_LENGTH            (MCIERR_BASE + 54)
  2628. #define MCIERR_DEVICE_ORD_LENGTH        (MCIERR_BASE + 55)
  2629. #define MCIERR_NO_INTEGER               (MCIERR_BASE + 56)
  2630.  
  2631. #define MCIERR_WAVE_OUTPUTSINUSE        (MCIERR_BASE + 64)
  2632. #define MCIERR_WAVE_SETOUTPUTINUSE      (MCIERR_BASE + 65)
  2633. #define MCIERR_WAVE_INPUTSINUSE         (MCIERR_BASE + 66)
  2634. #define MCIERR_WAVE_SETINPUTINUSE       (MCIERR_BASE + 67)
  2635. #define MCIERR_WAVE_OUTPUTUNSPECIFIED   (MCIERR_BASE + 68)
  2636. #define MCIERR_WAVE_INPUTUNSPECIFIED    (MCIERR_BASE + 69)
  2637. #define MCIERR_WAVE_OUTPUTSUNSUITABLE   (MCIERR_BASE + 70)
  2638. #define MCIERR_WAVE_SETOUTPUTUNSUITABLE (MCIERR_BASE + 71)
  2639. #define MCIERR_WAVE_INPUTSUNSUITABLE    (MCIERR_BASE + 72)
  2640. #define MCIERR_WAVE_SETINPUTUNSUITABLE  (MCIERR_BASE + 73)
  2641.  
  2642. #define MCIERR_SEQ_DIV_INCOMPATIBLE     (MCIERR_BASE + 80)
  2643. #define MCIERR_SEQ_PORT_INUSE           (MCIERR_BASE + 81)
  2644. #define MCIERR_SEQ_PORT_NONEXISTENT     (MCIERR_BASE + 82)
  2645. #define MCIERR_SEQ_PORT_MAPNODEVICE     (MCIERR_BASE + 83)
  2646. #define MCIERR_SEQ_PORT_MISCERROR       (MCIERR_BASE + 84)
  2647. #define MCIERR_SEQ_TIMER                (MCIERR_BASE + 85)
  2648. #define MCIERR_SEQ_PORTUNSPECIFIED      (MCIERR_BASE + 86)
  2649. #define MCIERR_SEQ_NOMIDIPRESENT        (MCIERR_BASE + 87)
  2650.  
  2651. #define MCIERR_NO_WINDOW                (MCIERR_BASE + 90)
  2652. #define MCIERR_CREATEWINDOW             (MCIERR_BASE + 91)
  2653. #define MCIERR_FILE_READ                (MCIERR_BASE + 92)
  2654. #define MCIERR_FILE_WRITE               (MCIERR_BASE + 93)
  2655.  
  2656. #define MCIERR_NO_IDENTITY              (MCIERR_BASE + 94)
  2657.  
  2658. /* all custom device driver errors must be >= than this value */
  2659. #define MCIERR_CUSTOM_DRIVER_BASE       (MCIERR_BASE + 256)
  2660.  
  2661. #define MCI_FIRST                       DRV_MCI_FIRST   /* 0x0800 */
  2662. /* MCI command message identifiers */
  2663. #define MCI_OPEN                        0x0803
  2664. #define MCI_CLOSE                       0x0804
  2665. #define MCI_ESCAPE                      0x0805
  2666. #define MCI_PLAY                        0x0806
  2667. #define MCI_SEEK                        0x0807
  2668. #define MCI_STOP                        0x0808
  2669. #define MCI_PAUSE                       0x0809
  2670. #define MCI_INFO                        0x080A
  2671. #define MCI_GETDEVCAPS                  0x080B
  2672. #define MCI_SPIN                        0x080C
  2673. #define MCI_SET                         0x080D
  2674. #define MCI_STEP                        0x080E
  2675. #define MCI_RECORD                      0x080F
  2676. #define MCI_SYSINFO                     0x0810
  2677. #define MCI_BREAK                       0x0811
  2678. #define MCI_SAVE                        0x0813
  2679. #define MCI_STATUS                      0x0814
  2680. #define MCI_CUE                         0x0830
  2681. #define MCI_REALIZE                     0x0840
  2682. #define MCI_WINDOW                      0x0841
  2683. #define MCI_PUT                         0x0842
  2684. #define MCI_WHERE                       0x0843
  2685. #define MCI_FREEZE                      0x0844
  2686. #define MCI_UNFREEZE                    0x0845
  2687. #define MCI_LOAD                        0x0850
  2688. #define MCI_CUT                         0x0851
  2689. #define MCI_COPY                        0x0852
  2690. #define MCI_PASTE                       0x0853
  2691. #define MCI_UPDATE                      0x0854
  2692. #define MCI_RESUME                      0x0855
  2693. #define MCI_DELETE                      0x0856
  2694.  
  2695. /* all custom MCI command messages must be >= than this value */
  2696. #define MCI_USER_MESSAGES               (DRV_MCI_FIRST + 0x400)
  2697. #define MCI_LAST                        0x0FFF
  2698.  
  2699. /* device ID for "all devices" */
  2700. #define MCI_ALL_DEVICE_ID               ((MCIDEVICEID)-1)
  2701.  
  2702. /* constants for predefined MCI device types */
  2703. #define MCI_DEVTYPE_VCR                 513 /* (MCI_STRING_OFFSET + 1) */
  2704. #define MCI_DEVTYPE_VIDEODISC           514 /* (MCI_STRING_OFFSET + 2) */
  2705. #define MCI_DEVTYPE_OVERLAY             515 /* (MCI_STRING_OFFSET + 3) */
  2706. #define MCI_DEVTYPE_CD_AUDIO            516 /* (MCI_STRING_OFFSET + 4) */
  2707. #define MCI_DEVTYPE_DAT                 517 /* (MCI_STRING_OFFSET + 5) */
  2708. #define MCI_DEVTYPE_SCANNER             518 /* (MCI_STRING_OFFSET + 6) */
  2709. #define MCI_DEVTYPE_ANIMATION           519 /* (MCI_STRING_OFFSET + 7) */
  2710. #define MCI_DEVTYPE_DIGITAL_VIDEO       520 /* (MCI_STRING_OFFSET + 8) */
  2711. #define MCI_DEVTYPE_OTHER               521 /* (MCI_STRING_OFFSET + 9) */
  2712. #define MCI_DEVTYPE_WAVEFORM_AUDIO      522 /* (MCI_STRING_OFFSET + 10) */
  2713. #define MCI_DEVTYPE_SEQUENCER           523 /* (MCI_STRING_OFFSET + 11) */
  2714.  
  2715. #define MCI_DEVTYPE_FIRST               MCI_DEVTYPE_VCR
  2716. #define MCI_DEVTYPE_LAST                MCI_DEVTYPE_SEQUENCER
  2717.  
  2718. #define MCI_DEVTYPE_FIRST_USER          0x1000
  2719. /* return values for 'status mode' command */
  2720. #define MCI_MODE_NOT_READY              (MCI_STRING_OFFSET + 12)
  2721. #define MCI_MODE_STOP                   (MCI_STRING_OFFSET + 13)
  2722. #define MCI_MODE_PLAY                   (MCI_STRING_OFFSET + 14)
  2723. #define MCI_MODE_RECORD                 (MCI_STRING_OFFSET + 15)
  2724. #define MCI_MODE_SEEK                   (MCI_STRING_OFFSET + 16)
  2725. #define MCI_MODE_PAUSE                  (MCI_STRING_OFFSET + 17)
  2726. #define MCI_MODE_OPEN                   (MCI_STRING_OFFSET + 18)
  2727.  
  2728. /* constants used in 'set time format' and 'status time format' commands */
  2729. #define MCI_FORMAT_MILLISECONDS         0
  2730. #define MCI_FORMAT_HMS                  1
  2731. #define MCI_FORMAT_MSF                  2
  2732. #define MCI_FORMAT_FRAMES               3
  2733. #define MCI_FORMAT_SMPTE_24             4
  2734. #define MCI_FORMAT_SMPTE_25             5
  2735. #define MCI_FORMAT_SMPTE_30             6
  2736. #define MCI_FORMAT_SMPTE_30DROP         7
  2737. #define MCI_FORMAT_BYTES                8
  2738. #define MCI_FORMAT_SAMPLES              9
  2739. #define MCI_FORMAT_TMSF                 10
  2740.  
  2741. /* MCI time format conversion macros */
  2742. #define MCI_MSF_MINUTE(msf)             ((BYTE)(msf))
  2743. #define MCI_MSF_SECOND(msf)             ((BYTE)(((WORD)(msf)) >> 8))
  2744. #define MCI_MSF_FRAME(msf)              ((BYTE)((msf)>>16))
  2745.  
  2746. #define MCI_MAKE_MSF(m, s, f)           ((DWORD)(((BYTE)(m) | \
  2747.                           ((WORD)(s)<<8)) | \
  2748.                          (((DWORD)(BYTE)(f))<<16)))
  2749.  
  2750. #define MCI_TMSF_TRACK(tmsf)            ((BYTE)(tmsf))
  2751. #define MCI_TMSF_MINUTE(tmsf)           ((BYTE)(((WORD)(tmsf)) >> 8))
  2752. #define MCI_TMSF_SECOND(tmsf)           ((BYTE)((tmsf)>>16))
  2753. #define MCI_TMSF_FRAME(tmsf)            ((BYTE)((tmsf)>>24))
  2754.  
  2755. #define MCI_MAKE_TMSF(t, m, s, f)       ((DWORD)(((BYTE)(t) | \
  2756.                           ((WORD)(m)<<8)) | \
  2757.                          (((DWORD)(BYTE)(s) | \
  2758.                            ((WORD)(f)<<8))<<16)))
  2759.  
  2760. #define MCI_HMS_HOUR(hms)               ((BYTE)(hms))
  2761. #define MCI_HMS_MINUTE(hms)             ((BYTE)(((WORD)(hms)) >> 8))
  2762. #define MCI_HMS_SECOND(hms)             ((BYTE)((hms)>>16))
  2763.  
  2764. #define MCI_MAKE_HMS(h, m, s)           ((DWORD)(((BYTE)(h) | \
  2765.                           ((WORD)(m)<<8)) | \
  2766.                          (((DWORD)(BYTE)(s))<<16)))
  2767.  
  2768. /* flags for wParam of MM_MCINOTIFY message */
  2769. #define MCI_NOTIFY_SUCCESSFUL           0x0001
  2770. #define MCI_NOTIFY_SUPERSEDED           0x0002
  2771. #define MCI_NOTIFY_ABORTED              0x0004
  2772. #define MCI_NOTIFY_FAILURE              0x0008
  2773.  
  2774. /* common flags for dwFlags parameter of MCI command messages */
  2775. #define MCI_NOTIFY                      0x00000001L
  2776. #define MCI_WAIT                        0x00000002L
  2777. #define MCI_FROM                        0x00000004L
  2778. #define MCI_TO                          0x00000008L
  2779. #define MCI_TRACK                       0x00000010L
  2780.  
  2781. /* flags for dwFlags parameter of MCI_OPEN command message */
  2782. #define MCI_OPEN_SHAREABLE              0x00000100L
  2783. #define MCI_OPEN_ELEMENT                0x00000200L
  2784. #define MCI_OPEN_ALIAS                  0x00000400L
  2785. #define MCI_OPEN_ELEMENT_ID             0x00000800L
  2786. #define MCI_OPEN_TYPE_ID                0x00001000L
  2787. #define MCI_OPEN_TYPE                   0x00002000L
  2788.  
  2789. /* flags for dwFlags parameter of MCI_SEEK command message */
  2790. #define MCI_SEEK_TO_START               0x00000100L
  2791. #define MCI_SEEK_TO_END                 0x00000200L
  2792.  
  2793. /* flags for dwFlags parameter of MCI_STATUS command message */
  2794. #define MCI_STATUS_ITEM                 0x00000100L
  2795. #define MCI_STATUS_START                0x00000200L
  2796.  
  2797. /* flags for dwItem field of the MCI_STATUS_PARMS parameter block */
  2798. #define MCI_STATUS_LENGTH               0x00000001L
  2799. #define MCI_STATUS_POSITION             0x00000002L
  2800. #define MCI_STATUS_NUMBER_OF_TRACKS     0x00000003L
  2801. #define MCI_STATUS_MODE                 0x00000004L
  2802. #define MCI_STATUS_MEDIA_PRESENT        0x00000005L
  2803. #define MCI_STATUS_TIME_FORMAT          0x00000006L
  2804. #define MCI_STATUS_READY                0x00000007L
  2805. #define MCI_STATUS_CURRENT_TRACK        0x00000008L
  2806.  
  2807. /* flags for dwFlags parameter of MCI_INFO command message */
  2808. #define MCI_INFO_PRODUCT                0x00000100L
  2809. #define MCI_INFO_FILE                   0x00000200L
  2810. #define MCI_INFO_MEDIA_UPC              0x00000400L
  2811. #define MCI_INFO_MEDIA_IDENTITY         0x00000800L
  2812. #define MCI_INFO_NAME                   0x00001000L
  2813. #define MCI_INFO_COPYRIGHT              0x00002000L
  2814.  
  2815. /* flags for dwFlags parameter of MCI_GETDEVCAPS command message */
  2816. #define MCI_GETDEVCAPS_ITEM             0x00000100L
  2817.  
  2818. /* flags for dwItem field of the MCI_GETDEVCAPS_PARMS parameter block */
  2819. #define MCI_GETDEVCAPS_CAN_RECORD       0x00000001L
  2820. #define MCI_GETDEVCAPS_HAS_AUDIO        0x00000002L
  2821. #define MCI_GETDEVCAPS_HAS_VIDEO        0x00000003L
  2822. #define MCI_GETDEVCAPS_DEVICE_TYPE      0x00000004L
  2823. #define MCI_GETDEVCAPS_USES_FILES       0x00000005L
  2824. #define MCI_GETDEVCAPS_COMPOUND_DEVICE  0x00000006L
  2825. #define MCI_GETDEVCAPS_CAN_EJECT        0x00000007L
  2826. #define MCI_GETDEVCAPS_CAN_PLAY         0x00000008L
  2827. #define MCI_GETDEVCAPS_CAN_SAVE         0x00000009L
  2828.  
  2829. /* flags for dwFlags parameter of MCI_SYSINFO command message */
  2830. #define MCI_SYSINFO_QUANTITY            0x00000100L
  2831. #define MCI_SYSINFO_OPEN                0x00000200L
  2832. #define MCI_SYSINFO_NAME                0x00000400L
  2833. #define MCI_SYSINFO_INSTALLNAME         0x00000800L
  2834.  
  2835. /* flags for dwFlags parameter of MCI_SET command message */
  2836. #define MCI_SET_DOOR_OPEN               0x00000100L
  2837. #define MCI_SET_DOOR_CLOSED             0x00000200L
  2838. #define MCI_SET_TIME_FORMAT             0x00000400L
  2839. #define MCI_SET_AUDIO                   0x00000800L
  2840. #define MCI_SET_VIDEO                   0x00001000L
  2841. #define MCI_SET_ON                      0x00002000L
  2842. #define MCI_SET_OFF                     0x00004000L
  2843.  
  2844. /* flags for dwAudio field of MCI_SET_PARMS or MCI_SEQ_SET_PARMS */
  2845. #define MCI_SET_AUDIO_ALL               0x00000000L
  2846. #define MCI_SET_AUDIO_LEFT              0x00000001L
  2847. #define MCI_SET_AUDIO_RIGHT             0x00000002L
  2848.  
  2849. /* flags for dwFlags parameter of MCI_BREAK command message */
  2850. #define MCI_BREAK_KEY                   0x00000100L
  2851. #define MCI_BREAK_HWND                  0x00000200L
  2852. #define MCI_BREAK_OFF                   0x00000400L
  2853.  
  2854. /* flags for dwFlags parameter of MCI_RECORD command message */
  2855. #define MCI_RECORD_INSERT               0x00000100L
  2856. #define MCI_RECORD_OVERWRITE            0x00000200L
  2857.  
  2858. /* flags for dwFlags parameter of MCI_SAVE command message */
  2859. #define MCI_SAVE_FILE                   0x00000100L
  2860.  
  2861. /* flags for dwFlags parameter of MCI_LOAD command message */
  2862. #define MCI_LOAD_FILE                   0x00000100L
  2863.  
  2864. /* generic parameter block for MCI command messages with no special parameters */
  2865. typedef struct tagMCI_GENERIC_PARMS {
  2866.     DWORD   dwCallback;
  2867. } MCI_GENERIC_PARMS, *PMCI_GENERIC_PARMS, FAR *LPMCI_GENERIC_PARMS;
  2868.  
  2869. /* parameter block for MCI_OPEN command message */
  2870. #ifdef _WIN32
  2871.  
  2872. typedef struct tagMCI_OPEN_PARMSA {
  2873.     DWORD   dwCallback;
  2874.     MCIDEVICEID wDeviceID;
  2875.     LPCSTR     lpstrDeviceType;
  2876.     LPCSTR     lpstrElementName;
  2877.     LPCSTR     lpstrAlias;
  2878. } MCI_OPEN_PARMSA, *PMCI_OPEN_PARMSA, *LPMCI_OPEN_PARMSA;
  2879. typedef struct tagMCI_OPEN_PARMSW {
  2880.     DWORD   dwCallback;
  2881.     MCIDEVICEID wDeviceID;
  2882.     LPCWSTR    lpstrDeviceType;
  2883.     LPCWSTR    lpstrElementName;
  2884.     LPCWSTR    lpstrAlias;
  2885. } MCI_OPEN_PARMSW, *PMCI_OPEN_PARMSW, *LPMCI_OPEN_PARMSW;
  2886. #ifdef UNICODE
  2887. typedef MCI_OPEN_PARMSW MCI_OPEN_PARMS;
  2888. typedef PMCI_OPEN_PARMSW PMCI_OPEN_PARMS;
  2889. typedef LPMCI_OPEN_PARMSW LPMCI_OPEN_PARMS;
  2890. #else
  2891. typedef MCI_OPEN_PARMSA MCI_OPEN_PARMS;
  2892. typedef PMCI_OPEN_PARMSA PMCI_OPEN_PARMS;
  2893. typedef LPMCI_OPEN_PARMSA LPMCI_OPEN_PARMS;
  2894. #endif // UNICODE
  2895.  
  2896. #else
  2897. typedef struct tagMCI_OPEN_PARMS {
  2898.     DWORD       dwCallback;
  2899.     MCIDEVICEID wDeviceID;
  2900.     WORD        wReserved0;
  2901.     LPCSTR      lpstrDeviceType;
  2902.     LPCSTR      lpstrElementName;
  2903.     LPCSTR      lpstrAlias;
  2904. } MCI_OPEN_PARMS, FAR *LPMCI_OPEN_PARMS;
  2905. #endif
  2906.  
  2907. /* parameter block for MCI_PLAY command message */
  2908. typedef struct tagMCI_PLAY_PARMS {
  2909.     DWORD   dwCallback;
  2910.     DWORD   dwFrom;
  2911.     DWORD   dwTo;
  2912. } MCI_PLAY_PARMS, *PMCI_PLAY_PARMS, FAR *LPMCI_PLAY_PARMS;
  2913.  
  2914. /* parameter block for MCI_SEEK command message */
  2915. typedef struct tagMCI_SEEK_PARMS {
  2916.     DWORD   dwCallback;
  2917.     DWORD   dwTo;
  2918. } MCI_SEEK_PARMS, *PMCI_SEEK_PARMS, FAR *LPMCI_SEEK_PARMS;
  2919.  
  2920. /* parameter block for MCI_STATUS command message */
  2921. typedef struct tagMCI_STATUS_PARMS {
  2922.     DWORD   dwCallback;
  2923.     DWORD   dwReturn;
  2924.     DWORD   dwItem;
  2925.     DWORD   dwTrack;
  2926. } MCI_STATUS_PARMS, *PMCI_STATUS_PARMS, FAR * LPMCI_STATUS_PARMS;
  2927.  
  2928. /* parameter block for MCI_INFO command message */
  2929. #ifdef _WIN32
  2930.  
  2931. typedef struct tagMCI_INFO_PARMSA {
  2932.     DWORD   dwCallback;
  2933.     LPSTR   lpstrReturn;
  2934.     DWORD   dwRetSize;
  2935. } MCI_INFO_PARMSA, * LPMCI_INFO_PARMSA;
  2936. typedef struct tagMCI_INFO_PARMSW {
  2937.     DWORD   dwCallback;
  2938.     LPWSTR  lpstrReturn;
  2939.     DWORD   dwRetSize;
  2940. } MCI_INFO_PARMSW, * LPMCI_INFO_PARMSW;
  2941. #ifdef UNICODE
  2942. typedef MCI_INFO_PARMSW MCI_INFO_PARMS;
  2943. typedef LPMCI_INFO_PARMSW LPMCI_INFO_PARMS;
  2944. #else
  2945. typedef MCI_INFO_PARMSA MCI_INFO_PARMS;
  2946. typedef LPMCI_INFO_PARMSA LPMCI_INFO_PARMS;
  2947. #endif // UNICODE
  2948.  
  2949. #else
  2950. typedef struct tagMCI_INFO_PARMS {
  2951.     DWORD   dwCallback;
  2952.     LPSTR   lpstrReturn;
  2953.     DWORD   dwRetSize;
  2954. } MCI_INFO_PARMS, FAR * LPMCI_INFO_PARMS;
  2955. #endif
  2956.  
  2957. /* parameter block for MCI_GETDEVCAPS command message */
  2958. typedef struct tagMCI_GETDEVCAPS_PARMS {
  2959.     DWORD   dwCallback;
  2960.     DWORD   dwReturn;
  2961.     DWORD   dwItem;
  2962. } MCI_GETDEVCAPS_PARMS, *PMCI_GETDEVCAPS_PARMS, FAR * LPMCI_GETDEVCAPS_PARMS;
  2963.  
  2964. /* parameter block for MCI_SYSINFO command message */
  2965. #ifdef _WIN32
  2966.  
  2967. typedef struct tagMCI_SYSINFO_PARMSA {
  2968.     DWORD   dwCallback;
  2969.     LPSTR   lpstrReturn;
  2970.     DWORD   dwRetSize;
  2971.     DWORD   dwNumber;
  2972.     UINT    wDeviceType;
  2973. } MCI_SYSINFO_PARMSA, *PMCI_SYSINFO_PARMSA, * LPMCI_SYSINFO_PARMSA;
  2974. typedef struct tagMCI_SYSINFO_PARMSW {
  2975.     DWORD   dwCallback;
  2976.     LPWSTR  lpstrReturn;
  2977.     DWORD   dwRetSize;
  2978.     DWORD   dwNumber;
  2979.     UINT    wDeviceType;
  2980. } MCI_SYSINFO_PARMSW, *PMCI_SYSINFO_PARMSW, * LPMCI_SYSINFO_PARMSW;
  2981. #ifdef UNICODE
  2982. typedef MCI_SYSINFO_PARMSW MCI_SYSINFO_PARMS;
  2983. typedef PMCI_SYSINFO_PARMSW PMCI_SYSINFO_PARMS;
  2984. typedef LPMCI_SYSINFO_PARMSW LPMCI_SYSINFO_PARMS;
  2985. #else
  2986. typedef MCI_SYSINFO_PARMSA MCI_SYSINFO_PARMS;
  2987. typedef PMCI_SYSINFO_PARMSA PMCI_SYSINFO_PARMS;
  2988. typedef LPMCI_SYSINFO_PARMSA LPMCI_SYSINFO_PARMS;
  2989. #endif // UNICODE
  2990. #else
  2991. typedef struct tagMCI_SYSINFO_PARMS {
  2992.     DWORD   dwCallback;
  2993.     LPSTR   lpstrReturn;
  2994.     DWORD   dwRetSize;
  2995.     DWORD   dwNumber;
  2996.     WORD    wDeviceType;
  2997.     WORD    wReserved0;
  2998. } MCI_SYSINFO_PARMS, FAR * LPMCI_SYSINFO_PARMS;
  2999. #endif
  3000.  
  3001. /* parameter block for MCI_SET command message */
  3002. typedef struct tagMCI_SET_PARMS {
  3003.     DWORD   dwCallback;
  3004.     DWORD   dwTimeFormat;
  3005.     DWORD   dwAudio;
  3006. } MCI_SET_PARMS, *PMCI_SET_PARMS, FAR *LPMCI_SET_PARMS;
  3007.  
  3008. /* parameter block for MCI_BREAK command message */
  3009. typedef struct tagMCI_BREAK_PARMS {
  3010.     DWORD   dwCallback;
  3011. #ifdef _WIN32
  3012.     int     nVirtKey;
  3013.     HWND    hwndBreak;
  3014. #else
  3015.     short   nVirtKey;
  3016.     WORD    wReserved0;             /* padding for Win 16 */
  3017.     HWND    hwndBreak;
  3018.     WORD    wReserved1;             /* padding for Win 16 */
  3019. #endif
  3020. } MCI_BREAK_PARMS, *PMCI_BREAK_PARMS, FAR * LPMCI_BREAK_PARMS;
  3021.  
  3022. /* parameter block for MCI_SAVE command message */
  3023. #ifdef _WIN32
  3024.  
  3025. typedef struct tagMCI_SAVE_PARMSA {
  3026.     DWORD    dwCallback;
  3027.     LPCSTR    lpfilename;
  3028. } MCI_SAVE_PARMSA, *PMCI_SAVE_PARMSA, * LPMCI_SAVE_PARMSA;
  3029. typedef struct tagMCI_SAVE_PARMSW {
  3030.     DWORD    dwCallback;
  3031.     LPCWSTR   lpfilename;
  3032. } MCI_SAVE_PARMSW, *PMCI_SAVE_PARMSW, * LPMCI_SAVE_PARMSW;
  3033. #ifdef UNICODE
  3034. typedef MCI_SAVE_PARMSW MCI_SAVE_PARMS;
  3035. typedef PMCI_SAVE_PARMSW PMCI_SAVE_PARMS;
  3036. typedef LPMCI_SAVE_PARMSW LPMCI_SAVE_PARMS;
  3037. #else
  3038. typedef MCI_SAVE_PARMSA MCI_SAVE_PARMS;
  3039. typedef PMCI_SAVE_PARMSA PMCI_SAVE_PARMS;
  3040. typedef LPMCI_SAVE_PARMSA LPMCI_SAVE_PARMS;
  3041. #endif // UNICODE
  3042.  
  3043. #else
  3044. typedef struct tagMCI_SAVE_PARMS {
  3045.     DWORD   dwCallback;
  3046.     LPCSTR  lpfilename;
  3047. } MCI_SAVE_PARMS, FAR * LPMCI_SAVE_PARMS;
  3048. #endif
  3049.  
  3050. /* parameter block for MCI_LOAD command message */
  3051. #ifdef _WIN32
  3052.  
  3053. typedef struct tagMCI_LOAD_PARMSA {
  3054.     DWORD    dwCallback;
  3055.     LPCSTR      lpfilename;
  3056. } MCI_LOAD_PARMSA, *PMCI_LOAD_PARMSA, * LPMCI_LOAD_PARMSA;
  3057. typedef struct tagMCI_LOAD_PARMSW {
  3058.     DWORD    dwCallback;
  3059.     LPCWSTR     lpfilename;
  3060. } MCI_LOAD_PARMSW, *PMCI_LOAD_PARMSW, * LPMCI_LOAD_PARMSW;
  3061. #ifdef UNICODE
  3062. typedef MCI_LOAD_PARMSW MCI_LOAD_PARMS;
  3063. typedef PMCI_LOAD_PARMSW PMCI_LOAD_PARMS;
  3064. typedef LPMCI_LOAD_PARMSW LPMCI_LOAD_PARMS;
  3065. #else
  3066. typedef MCI_LOAD_PARMSA MCI_LOAD_PARMS;
  3067. typedef PMCI_LOAD_PARMSA PMCI_LOAD_PARMS;
  3068. typedef LPMCI_LOAD_PARMSA LPMCI_LOAD_PARMS;
  3069. #endif // UNICODE
  3070.  
  3071. #else
  3072. typedef struct tagMCI_LOAD_PARMS {
  3073.     DWORD   dwCallback;
  3074.     LPCSTR  lpfilename;
  3075. } MCI_LOAD_PARMS, FAR * LPMCI_LOAD_PARMS;
  3076. #endif
  3077.  
  3078. /* parameter block for MCI_RECORD command message */
  3079. typedef struct tagMCI_RECORD_PARMS {
  3080.     DWORD   dwCallback;
  3081.     DWORD   dwFrom;
  3082.     DWORD   dwTo;
  3083. } MCI_RECORD_PARMS, FAR *LPMCI_RECORD_PARMS;
  3084.  
  3085. /* MCI extensions for videodisc devices */
  3086.  
  3087. /* flag for dwReturn field of MCI_STATUS_PARMS */
  3088. /* MCI_STATUS command, (dwItem == MCI_STATUS_MODE) */
  3089. #define MCI_VD_MODE_PARK                (MCI_VD_OFFSET + 1)
  3090.  
  3091. /* flag for dwReturn field of MCI_STATUS_PARMS */
  3092. /* MCI_STATUS command, (dwItem == MCI_VD_STATUS_MEDIA_TYPE) */
  3093. #define MCI_VD_MEDIA_CLV                (MCI_VD_OFFSET + 2)
  3094. #define MCI_VD_MEDIA_CAV                (MCI_VD_OFFSET + 3)
  3095. #define MCI_VD_MEDIA_OTHER              (MCI_VD_OFFSET + 4)
  3096.  
  3097. #define MCI_VD_FORMAT_TRACK             0x4001
  3098.  
  3099. /* flags for dwFlags parameter of MCI_PLAY command message */
  3100. #define MCI_VD_PLAY_REVERSE             0x00010000L
  3101. #define MCI_VD_PLAY_FAST                0x00020000L
  3102. #define MCI_VD_PLAY_SPEED               0x00040000L
  3103. #define MCI_VD_PLAY_SCAN                0x00080000L
  3104. #define MCI_VD_PLAY_SLOW                0x00100000L
  3105.  
  3106. /* flag for dwFlags parameter of MCI_SEEK command message */
  3107. #define MCI_VD_SEEK_REVERSE             0x00010000L
  3108.  
  3109. /* flags for dwItem field of MCI_STATUS_PARMS parameter block */
  3110. #define MCI_VD_STATUS_SPEED             0x00004002L
  3111. #define MCI_VD_STATUS_FORWARD           0x00004003L
  3112. #define MCI_VD_STATUS_MEDIA_TYPE        0x00004004L
  3113. #define MCI_VD_STATUS_SIDE              0x00004005L
  3114. #define MCI_VD_STATUS_DISC_SIZE         0x00004006L
  3115.  
  3116. /* flags for dwFlags parameter of MCI_GETDEVCAPS command message */
  3117. #define MCI_VD_GETDEVCAPS_CLV           0x00010000L
  3118. #define MCI_VD_GETDEVCAPS_CAV           0x00020000L
  3119.  
  3120. #define MCI_VD_SPIN_UP                  0x00010000L
  3121. #define MCI_VD_SPIN_DOWN                0x00020000L
  3122.  
  3123. /* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
  3124. #define MCI_VD_GETDEVCAPS_CAN_REVERSE   0x00004002L
  3125. #define MCI_VD_GETDEVCAPS_FAST_RATE     0x00004003L
  3126. #define MCI_VD_GETDEVCAPS_SLOW_RATE     0x00004004L
  3127. #define MCI_VD_GETDEVCAPS_NORMAL_RATE   0x00004005L
  3128.  
  3129. /* flags for the dwFlags parameter of MCI_STEP command message */
  3130. #define MCI_VD_STEP_FRAMES              0x00010000L
  3131. #define MCI_VD_STEP_REVERSE             0x00020000L
  3132.  
  3133. /* flag for the MCI_ESCAPE command message */
  3134. #define MCI_VD_ESCAPE_STRING            0x00000100L
  3135.  
  3136. /* parameter block for MCI_PLAY command message */
  3137. typedef struct tagMCI_VD_PLAY_PARMS {
  3138.     DWORD   dwCallback;
  3139.     DWORD   dwFrom;
  3140.     DWORD   dwTo;
  3141.     DWORD   dwSpeed;
  3142. } MCI_VD_PLAY_PARMS, *PMCI_VD_PLAY_PARMS, FAR *LPMCI_VD_PLAY_PARMS;
  3143.  
  3144. /* parameter block for MCI_STEP command message */
  3145. typedef struct tagMCI_VD_STEP_PARMS {
  3146.     DWORD   dwCallback;
  3147.     DWORD   dwFrames;
  3148. } MCI_VD_STEP_PARMS, *PMCI_VD_STEP_PARMS, FAR *LPMCI_VD_STEP_PARMS;
  3149.  
  3150. /* parameter block for MCI_ESCAPE command message */
  3151. #ifdef _WIN32
  3152.  
  3153. typedef struct tagMCI_VD_ESCAPE_PARMSA {
  3154.     DWORD   dwCallback;
  3155.     LPCSTR      lpstrCommand;
  3156. } MCI_VD_ESCAPE_PARMSA, *PMCI_VD_ESCAPE_PARMSA, *LPMCI_VD_ESCAPE_PARMSA;
  3157. typedef struct tagMCI_VD_ESCAPE_PARMSW {
  3158.     DWORD   dwCallback;
  3159.     LPCWSTR     lpstrCommand;
  3160. } MCI_VD_ESCAPE_PARMSW, *PMCI_VD_ESCAPE_PARMSW, *LPMCI_VD_ESCAPE_PARMSW;
  3161. #ifdef UNICODE
  3162. typedef MCI_VD_ESCAPE_PARMSW MCI_VD_ESCAPE_PARMS;
  3163. typedef PMCI_VD_ESCAPE_PARMSW PMCI_VD_ESCAPE_PARMS;
  3164. typedef LPMCI_VD_ESCAPE_PARMSW LPMCI_VD_ESCAPE_PARMS;
  3165. #else
  3166. typedef MCI_VD_ESCAPE_PARMSA MCI_VD_ESCAPE_PARMS;
  3167. typedef PMCI_VD_ESCAPE_PARMSA PMCI_VD_ESCAPE_PARMS;
  3168. typedef LPMCI_VD_ESCAPE_PARMSA LPMCI_VD_ESCAPE_PARMS;
  3169. #endif // UNICODE
  3170.  
  3171. #else
  3172. typedef struct tagMCI_VD_ESCAPE_PARMS {
  3173.     DWORD   dwCallback;
  3174.     LPCSTR  lpstrCommand;
  3175. } MCI_VD_ESCAPE_PARMS, FAR *LPMCI_VD_ESCAPE_PARMS;
  3176. #endif
  3177.  
  3178. /* MCI extensions for CD audio devices */
  3179.  
  3180. /* flags for the dwItem field of the MCI_STATUS_PARMS parameter block */
  3181. #define MCI_CDA_STATUS_TYPE_TRACK       0x00004001L
  3182.  
  3183. /* flags for the dwReturn field of MCI_STATUS_PARMS parameter block */
  3184. /* MCI_STATUS command, (dwItem == MCI_CDA_STATUS_TYPE_TRACK) */
  3185. #define MCI_CDA_TRACK_AUDIO             (MCI_CD_OFFSET + 0)
  3186. #define MCI_CDA_TRACK_OTHER             (MCI_CD_OFFSET + 1)
  3187.  
  3188. /* MCI extensions for waveform audio devices */
  3189.  
  3190. #define MCI_WAVE_PCM                    (MCI_WAVE_OFFSET + 0)
  3191. #define MCI_WAVE_MAPPER                 (MCI_WAVE_OFFSET + 1)
  3192.  
  3193. /* flags for the dwFlags parameter of MCI_OPEN command message */
  3194. #define MCI_WAVE_OPEN_BUFFER            0x00010000L
  3195.  
  3196. /* flags for the dwFlags parameter of MCI_SET command message */
  3197. #define MCI_WAVE_SET_FORMATTAG          0x00010000L
  3198. #define MCI_WAVE_SET_CHANNELS           0x00020000L
  3199. #define MCI_WAVE_SET_SAMPLESPERSEC      0x00040000L
  3200. #define MCI_WAVE_SET_AVGBYTESPERSEC     0x00080000L
  3201. #define MCI_WAVE_SET_BLOCKALIGN         0x00100000L
  3202. #define MCI_WAVE_SET_BITSPERSAMPLE      0x00200000L
  3203.  
  3204. /* flags for the dwFlags parameter of MCI_STATUS, MCI_SET command messages */
  3205. #define MCI_WAVE_INPUT                  0x00400000L
  3206. #define MCI_WAVE_OUTPUT                 0x00800000L
  3207.  
  3208. /* flags for the dwItem field of MCI_STATUS_PARMS parameter block */
  3209. #define MCI_WAVE_STATUS_FORMATTAG       0x00004001L
  3210. #define MCI_WAVE_STATUS_CHANNELS        0x00004002L
  3211. #define MCI_WAVE_STATUS_SAMPLESPERSEC   0x00004003L
  3212. #define MCI_WAVE_STATUS_AVGBYTESPERSEC  0x00004004L
  3213. #define MCI_WAVE_STATUS_BLOCKALIGN      0x00004005L
  3214. #define MCI_WAVE_STATUS_BITSPERSAMPLE   0x00004006L
  3215. #define MCI_WAVE_STATUS_LEVEL           0x00004007L
  3216.  
  3217. /* flags for the dwFlags parameter of MCI_SET command message */
  3218. #define MCI_WAVE_SET_ANYINPUT           0x04000000L
  3219. #define MCI_WAVE_SET_ANYOUTPUT          0x08000000L
  3220.  
  3221. /* flags for the dwFlags parameter of MCI_GETDEVCAPS command message */
  3222. #define MCI_WAVE_GETDEVCAPS_INPUTS      0x00004001L
  3223. #define MCI_WAVE_GETDEVCAPS_OUTPUTS     0x00004002L
  3224.  
  3225. /* parameter block for MCI_OPEN command message */
  3226. #ifdef _WIN32
  3227.  
  3228. typedef struct tagMCI_WAVE_OPEN_PARMSA {
  3229.     DWORD   dwCallback;
  3230.     MCIDEVICEID wDeviceID;
  3231.     LPCSTR      lpstrDeviceType;
  3232.     LPCSTR      lpstrElementName;
  3233.     LPCSTR      lpstrAlias;
  3234.     DWORD   dwBufferSeconds;
  3235. } MCI_WAVE_OPEN_PARMSA, *PMCI_WAVE_OPEN_PARMSA, *LPMCI_WAVE_OPEN_PARMSA;
  3236. typedef struct tagMCI_WAVE_OPEN_PARMSW {
  3237.     DWORD   dwCallback;
  3238.     MCIDEVICEID wDeviceID;
  3239.     LPCWSTR     lpstrDeviceType;
  3240.     LPCWSTR     lpstrElementName;
  3241.     LPCWSTR     lpstrAlias;
  3242.     DWORD   dwBufferSeconds;
  3243. } MCI_WAVE_OPEN_PARMSW, *PMCI_WAVE_OPEN_PARMSW, *LPMCI_WAVE_OPEN_PARMSW;
  3244. #ifdef UNICODE
  3245. typedef MCI_WAVE_OPEN_PARMSW MCI_WAVE_OPEN_PARMS;
  3246. typedef PMCI_WAVE_OPEN_PARMSW PMCI_WAVE_OPEN_PARMS;
  3247. typedef LPMCI_WAVE_OPEN_PARMSW LPMCI_WAVE_OPEN_PARMS;
  3248. #else
  3249. typedef MCI_WAVE_OPEN_PARMSA MCI_WAVE_OPEN_PARMS;
  3250. typedef PMCI_WAVE_OPEN_PARMSA PMCI_WAVE_OPEN_PARMS;
  3251. typedef LPMCI_WAVE_OPEN_PARMSA LPMCI_WAVE_OPEN_PARMS;
  3252. #endif // UNICODE
  3253.  
  3254. #else
  3255. typedef struct tagMCI_WAVE_OPEN_PARMS {
  3256.     DWORD   dwCallback;
  3257.     MCIDEVICEID wDeviceID;
  3258.     WORD        wReserved0;
  3259.     LPCSTR      lpstrDeviceType;
  3260.     LPCSTR      lpstrElementName;
  3261.     LPCSTR      lpstrAlias;
  3262.     DWORD       dwBufferSeconds;
  3263. } MCI_WAVE_OPEN_PARMS, FAR *LPMCI_WAVE_OPEN_PARMS;
  3264. #endif
  3265.  
  3266. /* parameter block for MCI_DELETE command message */
  3267. typedef struct tagMCI_WAVE_DELETE_PARMS {
  3268.     DWORD   dwCallback;
  3269.     DWORD   dwFrom;
  3270.     DWORD   dwTo;
  3271. } MCI_WAVE_DELETE_PARMS, *PMCI_WAVE_DELETE_PARMS, FAR *LPMCI_WAVE_DELETE_PARMS;
  3272.  
  3273. /* parameter block for MCI_SET command message */
  3274. typedef struct tagMCI_WAVE_SET_PARMS {
  3275.     DWORD   dwCallback;
  3276.     DWORD   dwTimeFormat;
  3277.     DWORD   dwAudio;
  3278. #ifdef _WIN32
  3279.     UINT    wInput;
  3280.     UINT    wOutput;
  3281. #else
  3282.     WORD    wInput;
  3283.     WORD    wReserved0;
  3284.     WORD    wOutput;
  3285.     WORD    wReserved1;
  3286. #endif
  3287.     WORD    wFormatTag;
  3288.     WORD    wReserved2;
  3289.     WORD    nChannels;
  3290.     WORD    wReserved3;
  3291.     DWORD   nSamplesPerSec;
  3292.     DWORD   nAvgBytesPerSec;
  3293.     WORD    nBlockAlign;
  3294.     WORD    wReserved4;
  3295.     WORD    wBitsPerSample;
  3296.     WORD    wReserved5;
  3297. } MCI_WAVE_SET_PARMS, *PMCI_WAVE_SET_PARMS, FAR * LPMCI_WAVE_SET_PARMS;
  3298.  
  3299. /* MCI extensions for MIDI sequencer devices */
  3300.  
  3301. /* flags for the dwReturn field of MCI_STATUS_PARMS parameter block */
  3302. /* MCI_STATUS command, (dwItem == MCI_SEQ_STATUS_DIVTYPE) */
  3303. #define     MCI_SEQ_DIV_PPQN            (0 + MCI_SEQ_OFFSET)
  3304. #define     MCI_SEQ_DIV_SMPTE_24        (1 + MCI_SEQ_OFFSET)
  3305. #define     MCI_SEQ_DIV_SMPTE_25        (2 + MCI_SEQ_OFFSET)
  3306. #define     MCI_SEQ_DIV_SMPTE_30DROP    (3 + MCI_SEQ_OFFSET)
  3307. #define     MCI_SEQ_DIV_SMPTE_30        (4 + MCI_SEQ_OFFSET)
  3308.  
  3309. /* flags for the dwMaster field of MCI_SEQ_SET_PARMS parameter block */
  3310. /* MCI_SET command, (dwFlags == MCI_SEQ_SET_MASTER) */
  3311. #define     MCI_SEQ_FORMAT_SONGPTR      0x4001
  3312. #define     MCI_SEQ_FILE                0x4002
  3313. #define     MCI_SEQ_MIDI                0x4003
  3314. #define     MCI_SEQ_SMPTE               0x4004
  3315. #define     MCI_SEQ_NONE                65533
  3316. #define     MCI_SEQ_MAPPER              65535
  3317.  
  3318. /* flags for the dwItem field of MCI_STATUS_PARMS parameter block */
  3319. #define MCI_SEQ_STATUS_TEMPO            0x00004002L
  3320. #define MCI_SEQ_STATUS_PORT             0x00004003L
  3321. #define MCI_SEQ_STATUS_SLAVE            0x00004007L
  3322. #define MCI_SEQ_STATUS_MASTER           0x00004008L
  3323. #define MCI_SEQ_STATUS_OFFSET           0x00004009L
  3324. #define MCI_SEQ_STATUS_DIVTYPE          0x0000400AL
  3325. #define MCI_SEQ_STATUS_NAME             0x0000400BL
  3326. #define MCI_SEQ_STATUS_COPYRIGHT        0x0000400CL
  3327.  
  3328. /* flags for the dwFlags parameter of MCI_SET command message */
  3329. #define MCI_SEQ_SET_TEMPO               0x00010000L
  3330. #define MCI_SEQ_SET_PORT                0x00020000L
  3331. #define MCI_SEQ_SET_SLAVE               0x00040000L
  3332. #define MCI_SEQ_SET_MASTER              0x00080000L
  3333. #define MCI_SEQ_SET_OFFSET              0x01000000L
  3334.  
  3335. /* parameter block for MCI_SET command message */
  3336. typedef struct tagMCI_SEQ_SET_PARMS {
  3337.     DWORD   dwCallback;
  3338.     DWORD   dwTimeFormat;
  3339.     DWORD   dwAudio;
  3340.     DWORD   dwTempo;
  3341.     DWORD   dwPort;
  3342.     DWORD   dwSlave;
  3343.     DWORD   dwMaster;
  3344.     DWORD   dwOffset;
  3345. } MCI_SEQ_SET_PARMS, *PMCI_SEQ_SET_PARMS, FAR * LPMCI_SEQ_SET_PARMS;
  3346.  
  3347. /* MCI extensions for animation devices */
  3348.  
  3349. /* flags for dwFlags parameter of MCI_OPEN command message */
  3350. #define MCI_ANIM_OPEN_WS                0x00010000L
  3351. #define MCI_ANIM_OPEN_PARENT            0x00020000L
  3352. #define MCI_ANIM_OPEN_NOSTATIC          0x00040000L
  3353.  
  3354. /* flags for dwFlags parameter of MCI_PLAY command message */
  3355. #define MCI_ANIM_PLAY_SPEED             0x00010000L
  3356. #define MCI_ANIM_PLAY_REVERSE           0x00020000L
  3357. #define MCI_ANIM_PLAY_FAST              0x00040000L
  3358. #define MCI_ANIM_PLAY_SLOW              0x00080000L
  3359. #define MCI_ANIM_PLAY_SCAN              0x00100000L
  3360.  
  3361. /* flags for dwFlags parameter of MCI_STEP command message */
  3362. #define MCI_ANIM_STEP_REVERSE           0x00010000L
  3363. #define MCI_ANIM_STEP_FRAMES            0x00020000L
  3364.  
  3365. /* flags for dwItem field of MCI_STATUS_PARMS parameter block */
  3366. #define MCI_ANIM_STATUS_SPEED           0x00004001L
  3367. #define MCI_ANIM_STATUS_FORWARD         0x00004002L
  3368. #define MCI_ANIM_STATUS_HWND            0x00004003L
  3369. #define MCI_ANIM_STATUS_HPAL            0x00004004L
  3370. #define MCI_ANIM_STATUS_STRETCH         0x00004005L
  3371.  
  3372. /* flags for the dwFlags parameter of MCI_INFO command message */
  3373. #define MCI_ANIM_INFO_TEXT              0x00010000L
  3374.  
  3375. /* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
  3376. #define MCI_ANIM_GETDEVCAPS_CAN_REVERSE 0x00004001L
  3377. #define MCI_ANIM_GETDEVCAPS_FAST_RATE   0x00004002L
  3378. #define MCI_ANIM_GETDEVCAPS_SLOW_RATE   0x00004003L
  3379. #define MCI_ANIM_GETDEVCAPS_NORMAL_RATE 0x00004004L
  3380. #define MCI_ANIM_GETDEVCAPS_PALETTES    0x00004006L
  3381. #define MCI_ANIM_GETDEVCAPS_CAN_STRETCH 0x00004007L
  3382. #define MCI_ANIM_GETDEVCAPS_MAX_WINDOWS 0x00004008L
  3383.  
  3384. /* flags for the MCI_REALIZE command message */
  3385. #define MCI_ANIM_REALIZE_NORM           0x00010000L
  3386. #define MCI_ANIM_REALIZE_BKGD           0x00020000L
  3387.  
  3388. /* flags for dwFlags parameter of MCI_WINDOW command message */
  3389. #define MCI_ANIM_WINDOW_HWND            0x00010000L
  3390. #define MCI_ANIM_WINDOW_STATE           0x00040000L
  3391. #define MCI_ANIM_WINDOW_TEXT            0x00080000L
  3392. #define MCI_ANIM_WINDOW_ENABLE_STRETCH  0x00100000L
  3393. #define MCI_ANIM_WINDOW_DISABLE_STRETCH 0x00200000L
  3394.  
  3395. /* flags for hWnd field of MCI_ANIM_WINDOW_PARMS parameter block */
  3396. /* MCI_WINDOW command message, (dwFlags == MCI_ANIM_WINDOW_HWND) */
  3397. #define MCI_ANIM_WINDOW_DEFAULT         0x00000000L
  3398.  
  3399. /* flags for dwFlags parameter of MCI_PUT command message */
  3400. #define MCI_ANIM_RECT                   0x00010000L
  3401. #define MCI_ANIM_PUT_SOURCE             0x00020000L
  3402. #define MCI_ANIM_PUT_DESTINATION        0x00040000L
  3403.  
  3404. /* flags for dwFlags parameter of MCI_WHERE command message */
  3405. #define MCI_ANIM_WHERE_SOURCE           0x00020000L
  3406. #define MCI_ANIM_WHERE_DESTINATION      0x00040000L
  3407.  
  3408. /* flags for dwFlags parameter of MCI_UPDATE command message */
  3409. #define MCI_ANIM_UPDATE_HDC             0x00020000L
  3410.  
  3411. /* parameter block for MCI_OPEN command message */
  3412. #ifdef _WIN32
  3413.  
  3414. typedef struct tagMCI_ANIM_OPEN_PARMSA {
  3415.     DWORD   dwCallback;
  3416.     MCIDEVICEID wDeviceID;
  3417.     LPCSTR      lpstrDeviceType;
  3418.     LPCSTR      lpstrElementName;
  3419.     LPCSTR      lpstrAlias;
  3420.     DWORD   dwStyle;
  3421.     HWND    hWndParent;
  3422. } MCI_ANIM_OPEN_PARMSA, *PMCI_ANIM_OPEN_PARMSA, *LPMCI_ANIM_OPEN_PARMSA;
  3423. typedef struct tagMCI_ANIM_OPEN_PARMSW {
  3424.     DWORD   dwCallback;
  3425.     MCIDEVICEID wDeviceID;
  3426.     LPCWSTR     lpstrDeviceType;
  3427.     LPCWSTR     lpstrElementName;
  3428.     LPCWSTR     lpstrAlias;
  3429.     DWORD   dwStyle;
  3430.     HWND    hWndParent;
  3431. } MCI_ANIM_OPEN_PARMSW, *PMCI_ANIM_OPEN_PARMSW, *LPMCI_ANIM_OPEN_PARMSW;
  3432. #ifdef UNICODE
  3433. typedef MCI_ANIM_OPEN_PARMSW MCI_ANIM_OPEN_PARMS;
  3434. typedef PMCI_ANIM_OPEN_PARMSW PMCI_ANIM_OPEN_PARMS;
  3435. typedef LPMCI_ANIM_OPEN_PARMSW LPMCI_ANIM_OPEN_PARMS;
  3436. #else
  3437. typedef MCI_ANIM_OPEN_PARMSA MCI_ANIM_OPEN_PARMS;
  3438. typedef PMCI_ANIM_OPEN_PARMSA PMCI_ANIM_OPEN_PARMS;
  3439. typedef LPMCI_ANIM_OPEN_PARMSA LPMCI_ANIM_OPEN_PARMS;
  3440. #endif // UNICODE
  3441.  
  3442. #else
  3443. typedef struct tagMCI_ANIM_OPEN_PARMS {
  3444.     DWORD   dwCallback;
  3445.     MCIDEVICEID wDeviceID;
  3446.     WORD        wReserved0;
  3447.     LPCSTR      lpstrDeviceType;
  3448.     LPCSTR      lpstrElementName;
  3449.     LPCSTR      lpstrAlias;
  3450.     DWORD       dwStyle;
  3451.     HWND        hWndParent;
  3452.     WORD        wReserved1;
  3453. } MCI_ANIM_OPEN_PARMS, FAR *LPMCI_ANIM_OPEN_PARMS;
  3454. #endif
  3455.  
  3456. /* parameter block for MCI_PLAY command message */
  3457. typedef struct tagMCI_ANIM_PLAY_PARMS {
  3458.     DWORD   dwCallback;
  3459.     DWORD   dwFrom;
  3460.     DWORD   dwTo;
  3461.     DWORD   dwSpeed;
  3462. } MCI_ANIM_PLAY_PARMS, *PMCI_ANIM_PLAY_PARMS, FAR *LPMCI_ANIM_PLAY_PARMS;
  3463.  
  3464. /* parameter block for MCI_STEP command message */
  3465. typedef struct tagMCI_ANIM_STEP_PARMS {
  3466.     DWORD   dwCallback;
  3467.     DWORD   dwFrames;
  3468. } MCI_ANIM_STEP_PARMS, *PMCI_ANIM_STEP_PARMS, FAR *LPMCI_ANIM_STEP_PARMS;
  3469.  
  3470. /* parameter block for MCI_WINDOW command message */
  3471. #ifdef _WIN32
  3472.  
  3473. typedef struct tagMCI_ANIM_WINDOW_PARMSA {
  3474.     DWORD   dwCallback;
  3475.     HWND    hWnd;
  3476.     UINT    nCmdShow;
  3477.     LPCSTR     lpstrText;
  3478. } MCI_ANIM_WINDOW_PARMSA, *PMCI_ANIM_WINDOW_PARMSA, * LPMCI_ANIM_WINDOW_PARMSA;
  3479. typedef struct tagMCI_ANIM_WINDOW_PARMSW {
  3480.     DWORD   dwCallback;
  3481.     HWND    hWnd;
  3482.     UINT    nCmdShow;
  3483.     LPCWSTR    lpstrText;
  3484. } MCI_ANIM_WINDOW_PARMSW, *PMCI_ANIM_WINDOW_PARMSW, * LPMCI_ANIM_WINDOW_PARMSW;
  3485. #ifdef UNICODE
  3486. typedef MCI_ANIM_WINDOW_PARMSW MCI_ANIM_WINDOW_PARMS;
  3487. typedef PMCI_ANIM_WINDOW_PARMSW PMCI_ANIM_WINDOW_PARMS;
  3488. typedef LPMCI_ANIM_WINDOW_PARMSW LPMCI_ANIM_WINDOW_PARMS;
  3489. #else
  3490. typedef MCI_ANIM_WINDOW_PARMSA MCI_ANIM_WINDOW_PARMS;
  3491. typedef PMCI_ANIM_WINDOW_PARMSA PMCI_ANIM_WINDOW_PARMS;
  3492. typedef LPMCI_ANIM_WINDOW_PARMSA LPMCI_ANIM_WINDOW_PARMS;
  3493. #endif // UNICODE
  3494.  
  3495. #else
  3496. typedef struct tagMCI_ANIM_WINDOW_PARMS {
  3497.     DWORD   dwCallback;
  3498.     HWND    hWnd;
  3499.     WORD    wReserved1;
  3500.     WORD    nCmdShow;
  3501.     WORD    wReserved2;
  3502.     LPCSTR  lpstrText;
  3503. } MCI_ANIM_WINDOW_PARMS, FAR * LPMCI_ANIM_WINDOW_PARMS;
  3504. #endif
  3505.  
  3506. /* parameter block for MCI_PUT, MCI_UPDATE, MCI_WHERE command messages */
  3507. typedef struct tagMCI_ANIM_RECT_PARMS {
  3508.     DWORD   dwCallback;
  3509. #ifdef MCI_USE_OFFEXT
  3510.     POINT   ptOffset;
  3511.     POINT   ptExtent;
  3512. #else   /* ifdef MCI_USE_OFFEXT */
  3513.     RECT    rc;
  3514. #endif  /* ifdef MCI_USE_OFFEXT */
  3515. } MCI_ANIM_RECT_PARMS;
  3516. typedef MCI_ANIM_RECT_PARMS * PMCI_ANIM_RECT_PARMS;
  3517. typedef MCI_ANIM_RECT_PARMS FAR * LPMCI_ANIM_RECT_PARMS;
  3518.  
  3519. /* parameter block for MCI_UPDATE PARMS */
  3520. typedef struct tagMCI_ANIM_UPDATE_PARMS {
  3521.     DWORD   dwCallback;
  3522.     RECT    rc;
  3523.     HDC     hDC;
  3524. } MCI_ANIM_UPDATE_PARMS, *PMCI_ANIM_UPDATE_PARMS, FAR * LPMCI_ANIM_UPDATE_PARMS;
  3525.  
  3526. /* MCI extensions for video overlay devices */
  3527.  
  3528. /* flags for dwFlags parameter of MCI_OPEN command message */
  3529. #define MCI_OVLY_OPEN_WS                0x00010000L
  3530. #define MCI_OVLY_OPEN_PARENT            0x00020000L
  3531.  
  3532. /* flags for dwFlags parameter of MCI_STATUS command message */
  3533. #define MCI_OVLY_STATUS_HWND            0x00004001L
  3534. #define MCI_OVLY_STATUS_STRETCH         0x00004002L
  3535.  
  3536. /* flags for dwFlags parameter of MCI_INFO command message */
  3537. #define MCI_OVLY_INFO_TEXT              0x00010000L
  3538.  
  3539. /* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
  3540. #define MCI_OVLY_GETDEVCAPS_CAN_STRETCH 0x00004001L
  3541. #define MCI_OVLY_GETDEVCAPS_CAN_FREEZE  0x00004002L
  3542. #define MCI_OVLY_GETDEVCAPS_MAX_WINDOWS 0x00004003L
  3543.  
  3544. /* flags for dwFlags parameter of MCI_WINDOW command message */
  3545. #define MCI_OVLY_WINDOW_HWND            0x00010000L
  3546. #define MCI_OVLY_WINDOW_STATE           0x00040000L
  3547. #define MCI_OVLY_WINDOW_TEXT            0x00080000L
  3548. #define MCI_OVLY_WINDOW_ENABLE_STRETCH  0x00100000L
  3549. #define MCI_OVLY_WINDOW_DISABLE_STRETCH 0x00200000L
  3550.  
  3551. /* flags for hWnd parameter of MCI_OVLY_WINDOW_PARMS parameter block */
  3552. #define MCI_OVLY_WINDOW_DEFAULT         0x00000000L
  3553.  
  3554. /* flags for dwFlags parameter of MCI_PUT command message */
  3555. #define MCI_OVLY_RECT                   0x00010000L
  3556. #define MCI_OVLY_PUT_SOURCE             0x00020000L
  3557. #define MCI_OVLY_PUT_DESTINATION        0x00040000L
  3558. #define MCI_OVLY_PUT_FRAME              0x00080000L
  3559. #define MCI_OVLY_PUT_VIDEO              0x00100000L
  3560.  
  3561. /* flags for dwFlags parameter of MCI_WHERE command message */
  3562. #define MCI_OVLY_WHERE_SOURCE           0x00020000L
  3563. #define MCI_OVLY_WHERE_DESTINATION      0x00040000L
  3564. #define MCI_OVLY_WHERE_FRAME            0x00080000L
  3565. #define MCI_OVLY_WHERE_VIDEO            0x00100000L
  3566.  
  3567. /* parameter block for MCI_OPEN command message */
  3568. #ifdef _WIN32
  3569.  
  3570. typedef struct tagMCI_OVLY_OPEN_PARMSA {
  3571.     DWORD   dwCallback;
  3572.     MCIDEVICEID wDeviceID;
  3573.     LPCSTR      lpstrDeviceType;
  3574.     LPCSTR      lpstrElementName;
  3575.     LPCSTR      lpstrAlias;
  3576.     DWORD   dwStyle;
  3577.     HWND    hWndParent;
  3578. } MCI_OVLY_OPEN_PARMSA, *PMCI_OVLY_OPEN_PARMSA, *LPMCI_OVLY_OPEN_PARMSA;
  3579. typedef struct tagMCI_OVLY_OPEN_PARMSW {
  3580.     DWORD   dwCallback;
  3581.     MCIDEVICEID wDeviceID;
  3582.     LPCWSTR     lpstrDeviceType;
  3583.     LPCWSTR     lpstrElementName;
  3584.     LPCWSTR     lpstrAlias;
  3585.     DWORD   dwStyle;
  3586.     HWND    hWndParent;
  3587. } MCI_OVLY_OPEN_PARMSW, *PMCI_OVLY_OPEN_PARMSW, *LPMCI_OVLY_OPEN_PARMSW;
  3588. #ifdef UNICODE
  3589. typedef MCI_OVLY_OPEN_PARMSW MCI_OVLY_OPEN_PARMS;
  3590. typedef PMCI_OVLY_OPEN_PARMSW PMCI_OVLY_OPEN_PARMS;
  3591. typedef LPMCI_OVLY_OPEN_PARMSW LPMCI_OVLY_OPEN_PARMS;
  3592. #else
  3593. typedef MCI_OVLY_OPEN_PARMSA MCI_OVLY_OPEN_PARMS;
  3594. typedef PMCI_OVLY_OPEN_PARMSA PMCI_OVLY_OPEN_PARMS;
  3595. typedef LPMCI_OVLY_OPEN_PARMSA LPMCI_OVLY_OPEN_PARMS;
  3596. #endif // UNICODE
  3597.  
  3598. #else
  3599. typedef struct tagMCI_OVLY_OPEN_PARMS {
  3600.     DWORD   dwCallback;
  3601.     MCIDEVICEID wDeviceID;
  3602.     WORD        wReserved0;
  3603.     LPCSTR      lpstrDeviceType;
  3604.     LPCSTR      lpstrElementName;
  3605.     LPCSTR      lpstrAlias;
  3606.     DWORD       dwStyle;
  3607.     HWND        hWndParent;
  3608.     WORD        wReserved1;
  3609. } MCI_OVLY_OPEN_PARMS, FAR *LPMCI_OVLY_OPEN_PARMS;
  3610. #endif
  3611.  
  3612. /* parameter block for MCI_WINDOW command message */
  3613. #ifdef _WIN32
  3614.  
  3615. typedef struct tagMCI_OVLY_WINDOW_PARMSA {
  3616.     DWORD   dwCallback;
  3617.     HWND    hWnd;
  3618.     UINT    nCmdShow;
  3619.     LPCSTR      lpstrText;
  3620. } MCI_OVLY_WINDOW_PARMSA, *PMCI_OVLY_WINDOW_PARMSA, * LPMCI_OVLY_WINDOW_PARMSA;
  3621. typedef struct tagMCI_OVLY_WINDOW_PARMSW {
  3622.     DWORD   dwCallback;
  3623.     HWND    hWnd;
  3624.     UINT    nCmdShow;
  3625.     LPCWSTR     lpstrText;
  3626. } MCI_OVLY_WINDOW_PARMSW, *PMCI_OVLY_WINDOW_PARMSW, * LPMCI_OVLY_WINDOW_PARMSW;
  3627. #ifdef UNICODE
  3628. typedef MCI_OVLY_WINDOW_PARMSW MCI_OVLY_WINDOW_PARMS;
  3629. typedef PMCI_OVLY_WINDOW_PARMSW PMCI_OVLY_WINDOW_PARMS;
  3630. typedef LPMCI_OVLY_WINDOW_PARMSW LPMCI_OVLY_WINDOW_PARMS;
  3631. #else
  3632. typedef MCI_OVLY_WINDOW_PARMSA MCI_OVLY_WINDOW_PARMS;
  3633. typedef PMCI_OVLY_WINDOW_PARMSA PMCI_OVLY_WINDOW_PARMS;
  3634. typedef LPMCI_OVLY_WINDOW_PARMSA LPMCI_OVLY_WINDOW_PARMS;
  3635. #endif // UNICODE
  3636. #else
  3637. typedef struct tagMCI_OVLY_WINDOW_PARMS {
  3638.     DWORD   dwCallback;
  3639.     HWND    hWnd;
  3640.     WORD    wReserved1;
  3641.     UINT    nCmdShow;
  3642.     WORD    wReserved2;
  3643.     LPCSTR  lpstrText;
  3644. } MCI_OVLY_WINDOW_PARMS, FAR * LPMCI_OVLY_WINDOW_PARMS;
  3645. #endif
  3646.  
  3647. /* parameter block for MCI_PUT, MCI_UPDATE, and MCI_WHERE command messages */
  3648. typedef struct tagMCI_OVLY_RECT_PARMS {
  3649.     DWORD   dwCallback;
  3650. #ifdef MCI_USE_OFFEXT
  3651.     POINT   ptOffset;
  3652.     POINT   ptExtent;
  3653. #else   /* ifdef MCI_USE_OFFEXT */
  3654.     RECT    rc;
  3655. #endif  /* ifdef MCI_USE_OFFEXT */
  3656. } MCI_OVLY_RECT_PARMS, *PMCI_OVLY_RECT_PARMS, FAR * LPMCI_OVLY_RECT_PARMS;
  3657.  
  3658. /* parameter block for MCI_SAVE command message */
  3659. #ifdef _WIN32
  3660.  
  3661. typedef struct tagMCI_OVLY_SAVE_PARMSA {
  3662.     DWORD   dwCallback;
  3663.     LPCSTR      lpfilename;
  3664.     RECT    rc;
  3665. } MCI_OVLY_SAVE_PARMSA, *PMCI_OVLY_SAVE_PARMSA, * LPMCI_OVLY_SAVE_PARMSA;
  3666. typedef struct tagMCI_OVLY_SAVE_PARMSW {
  3667.     DWORD   dwCallback;
  3668.     LPCWSTR     lpfilename;
  3669.     RECT    rc;
  3670. } MCI_OVLY_SAVE_PARMSW, *PMCI_OVLY_SAVE_PARMSW, * LPMCI_OVLY_SAVE_PARMSW;
  3671. #ifdef UNICODE
  3672. typedef MCI_OVLY_SAVE_PARMSW MCI_OVLY_SAVE_PARMS;
  3673. typedef PMCI_OVLY_SAVE_PARMSW PMCI_OVLY_SAVE_PARMS;
  3674. typedef LPMCI_OVLY_SAVE_PARMSW LPMCI_OVLY_SAVE_PARMS;
  3675. #else
  3676. typedef MCI_OVLY_SAVE_PARMSA MCI_OVLY_SAVE_PARMS;
  3677. typedef PMCI_OVLY_SAVE_PARMSA PMCI_OVLY_SAVE_PARMS;
  3678. typedef LPMCI_OVLY_SAVE_PARMSA LPMCI_OVLY_SAVE_PARMS;
  3679. #endif // UNICODE
  3680. #else
  3681. typedef struct tagMCI_OVLY_SAVE_PARMS {
  3682.     DWORD   dwCallback;
  3683.     LPCSTR  lpfilename;
  3684.     RECT    rc;
  3685. } MCI_OVLY_SAVE_PARMS, FAR * LPMCI_OVLY_SAVE_PARMS;
  3686. #endif
  3687.  
  3688. /* parameter block for MCI_LOAD command message */
  3689. #ifdef _WIN32
  3690.  
  3691. typedef struct tagMCI_OVLY_LOAD_PARMSA {
  3692.     DWORD   dwCallback;
  3693.     LPCSTR      lpfilename;
  3694.     RECT    rc;
  3695. } MCI_OVLY_LOAD_PARMSA, *PMCI_OVLY_LOAD_PARMSA, * LPMCI_OVLY_LOAD_PARMSA;
  3696. typedef struct tagMCI_OVLY_LOAD_PARMSW {
  3697.     DWORD   dwCallback;
  3698.     LPCWSTR     lpfilename;
  3699.     RECT    rc;
  3700. } MCI_OVLY_LOAD_PARMSW, *PMCI_OVLY_LOAD_PARMSW, * LPMCI_OVLY_LOAD_PARMSW;
  3701. #ifdef UNICODE
  3702. typedef MCI_OVLY_LOAD_PARMSW MCI_OVLY_LOAD_PARMS;
  3703. typedef PMCI_OVLY_LOAD_PARMSW PMCI_OVLY_LOAD_PARMS;
  3704. typedef LPMCI_OVLY_LOAD_PARMSW LPMCI_OVLY_LOAD_PARMS;
  3705. #else
  3706. typedef MCI_OVLY_LOAD_PARMSA MCI_OVLY_LOAD_PARMS;
  3707. typedef PMCI_OVLY_LOAD_PARMSA PMCI_OVLY_LOAD_PARMS;
  3708. typedef LPMCI_OVLY_LOAD_PARMSA LPMCI_OVLY_LOAD_PARMS;
  3709. #endif // UNICODE
  3710. #else
  3711. typedef struct tagMCI_OVLY_LOAD_PARMS {
  3712.     DWORD   dwCallback;
  3713.     LPCSTR  lpfilename;
  3714.     RECT    rc;
  3715. } MCI_OVLY_LOAD_PARMS, FAR * LPMCI_OVLY_LOAD_PARMS;
  3716. #endif
  3717.  
  3718. #endif  /* ifndef _WIN32_VXD */
  3719. #endif  /* ifndef MMNOMCI */
  3720.  
  3721. /****************************************************************************
  3722.  
  3723.             DISPLAY Driver extensions
  3724.  
  3725. ****************************************************************************/
  3726.  
  3727. #ifndef NEWTRANSPARENT
  3728.     #define NEWTRANSPARENT  3           /* use with SetBkMode() */
  3729.  
  3730.     #define QUERYROPSUPPORT 40          /* use to determine ROP support */
  3731. #endif  /* ifndef NEWTRANSPARENT */
  3732.  
  3733. /****************************************************************************
  3734.  
  3735.             DIB Driver extensions
  3736.  
  3737. ****************************************************************************/
  3738.  
  3739. #define SELECTDIB       41                      /* DIB.DRV select dib escape */
  3740. #define DIBINDEX(n)     MAKELONG((n),0x10FF)
  3741.  
  3742. /****************************************************************************
  3743.  
  3744.             ScreenSaver support
  3745.  
  3746.     The current application will receive a syscommand of SC_SCREENSAVE just
  3747.     before the screen saver is invoked.  If the app wishes to prevent a
  3748.     screen save, return non-zero value, otherwise call DefWindowProc().
  3749.  
  3750. ****************************************************************************/
  3751.  
  3752. #ifndef SC_SCREENSAVE
  3753.  
  3754.     #define SC_SCREENSAVE   0xF140
  3755.  
  3756. #endif  /* ifndef SC_SCREENSAVE */
  3757.  
  3758. #ifdef __cplusplus
  3759. }                       /* End of extern "C" { */
  3760. #endif  /* __cplusplus */
  3761.  
  3762. #ifdef _WIN32
  3763. #include <poppack.h>
  3764. #else
  3765. #ifndef RC_INVOKED
  3766. #pragma pack()
  3767. #endif
  3768. #endif
  3769.  
  3770. #endif  /* _INC_MMSYSTEM */
  3771.