home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / msinc.pak / MMSYSTEM.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  235KB  |  5,710 lines

  1. /*
  2.  *      C/C++ Run Time Library - Version 6.5
  3.  *
  4.  *      Copyright (c) 1994 by Borland International
  5.  *      All Rights Reserved.
  6.  *
  7.  */
  8.  
  9. #if !defined(__FLAT__)
  10.  
  11.  
  12. /****************************************************************************/
  13. /*                                                                          */
  14. /*        MMSYSTEM.H - Include file for Multimedia APIs                     */
  15. /*                                                                          */
  16. /****************************************************************************/
  17. /*    If defined, the following flags inhibit inclusion
  18.  *    of the indicated items:
  19.  *
  20.  *      MMNODRV          - Installable driver support
  21.  *      MMNOSOUND        - Sound support
  22.  *      MMNOWAVE         - Waveform support
  23.  *      MMNOMIDI         - MIDI support
  24.  *      MMNOAUX          - Auxiliary audio support
  25.  *      MMNOTIMER        - Timer support
  26.  *      MMNOJOY          - Joystick support
  27.  *      MMNOMCI          - MCI support
  28.  *      MMNOMMIO         - Multimedia file I/O support
  29.  *      MMNOMMSYSTEM     - General MMSYSTEM functions
  30.  */
  31.  
  32. #ifndef __MMSYSTEM_H    /* prevent multiple includes */
  33. #define __MMSYSTEM_H
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {            /* Assume C declarations for C++ */
  37. #endif  /* __cplusplus */
  38.  
  39. #if !defined(WINVER) || (WINVER < 0x030a)
  40. #error Multimedia APIs require Windows 3.1
  41. #endif
  42.  
  43. #ifndef __WINDOWS_H
  44. #include <windows.h>    /* <windows.h> must be included */
  45. #endif  /* __WINDOWS_H */
  46.  
  47. #ifndef RC_INVOKED
  48. #pragma option -a-      /* Assume byte packing throughout */
  49. #endif
  50.  
  51.  
  52. /****************************************************************************
  53.  
  54.                     General constants and data types
  55.  
  56. ****************************************************************************/
  57.  
  58. /* general constants */
  59. #define MAXPNAMELEN      32     /* max product name length (including NULL) */
  60. #define MAXERRORLENGTH   128    /* max error text length (including NULL) */
  61.  
  62. /* general data types */
  63. typedef WORD    VERSION;        /* major (high byte), minor (low byte) */
  64.  
  65. /* MMTIME data structure */
  66. typedef struct mmtime_tag {
  67.     UINT    wType;              /* indicates the contents of the union */
  68.     union {
  69.         DWORD ms;               /* milliseconds */
  70.         DWORD sample;           /* samples */
  71.         DWORD cb;               /* byte count */
  72.         struct {                /* SMPTE */
  73.             BYTE hour;          /* hours */
  74.             BYTE min;           /* minutes */
  75.             BYTE sec;           /* seconds */
  76.             BYTE frame;         /* frames  */
  77.             BYTE fps;           /* frames per second */
  78.             BYTE dummy;         /* pad */
  79.             } smpte;
  80.         struct {                /* MIDI */
  81.             DWORD songptrpos;   /* song pointer position */
  82.             } midi;
  83.         } u;
  84.     } MMTIME;
  85. typedef MMTIME       *PMMTIME;
  86. typedef MMTIME NEAR *NPMMTIME;
  87. typedef MMTIME FAR  *LPMMTIME;
  88.  
  89. /* types for wType field in MMTIME struct */
  90. #define TIME_MS         0x0001  /* time in milliseconds */
  91. #define TIME_SAMPLES    0x0002  /* number of wave samples */
  92. #define TIME_BYTES      0x0004  /* current byte offset */
  93. #define TIME_SMPTE      0x0008  /* SMPTE time */
  94. #define TIME_MIDI       0x0010  /* MIDI time */
  95.  
  96.  
  97. /****************************************************************************
  98.  
  99.                     Multimedia Extensions Window Messages
  100.  
  101. ****************************************************************************/
  102.  
  103. #define MM_JOY1MOVE         0x3A0           /* joystick */
  104. #define MM_JOY2MOVE         0x3A1
  105. #define MM_JOY1ZMOVE        0x3A2
  106. #define MM_JOY2ZMOVE        0x3A3
  107. #define MM_JOY1BUTTONDOWN   0x3B5
  108. #define MM_JOY2BUTTONDOWN   0x3B6
  109. #define MM_JOY1BUTTONUP     0x3B7
  110. #define MM_JOY2BUTTONUP     0x3B8
  111.  
  112. #define MM_MCINOTIFY        0x3B9           /* MCI */
  113.  
  114. #define MM_WOM_OPEN         0x3BB           /* waveform output */
  115. #define MM_WOM_CLOSE        0x3BC
  116. #define MM_WOM_DONE         0x3BD
  117.  
  118. #define MM_WIM_OPEN         0x3BE           /* waveform input */
  119. #define MM_WIM_CLOSE        0x3BF
  120. #define MM_WIM_DATA         0x3C0
  121.  
  122. #define MM_MIM_OPEN         0x3C1           /* MIDI input */
  123. #define MM_MIM_CLOSE        0x3C2
  124. #define MM_MIM_DATA         0x3C3
  125. #define MM_MIM_LONGDATA     0x3C4
  126. #define MM_MIM_ERROR        0x3C5
  127. #define MM_MIM_LONGERROR    0x3C6
  128.  
  129. #define MM_MOM_OPEN         0x3C7           /* MIDI output */
  130. #define MM_MOM_CLOSE        0x3C8
  131. #define MM_MOM_DONE         0x3C9
  132.  
  133.  
  134. /****************************************************************************
  135.  
  136.                 String resource number bases (internal use)
  137.  
  138. ****************************************************************************/
  139.  
  140. #define MMSYSERR_BASE          0
  141. #define WAVERR_BASE            32
  142. #define MIDIERR_BASE           64
  143. #define TIMERR_BASE            96
  144. #define JOYERR_BASE            160
  145. #define MCIERR_BASE            256
  146.  
  147. #define MCI_STRING_OFFSET      512
  148. #define MCI_VD_OFFSET          1024
  149. #define MCI_CD_OFFSET          1088
  150. #define MCI_WAVE_OFFSET        1152
  151. #define MCI_SEQ_OFFSET         1216
  152.  
  153. /****************************************************************************
  154.  
  155.                         General error return values
  156.  
  157. ****************************************************************************/
  158.  
  159. /* general error return values */
  160. #define MMSYSERR_NOERROR      0                    /* no error */
  161. #define MMSYSERR_ERROR        (MMSYSERR_BASE + 1)  /* unspecified error */
  162. #define MMSYSERR_BADDEVICEID  (MMSYSERR_BASE + 2)  /* device ID out of range */
  163. #define MMSYSERR_NOTENABLED   (MMSYSERR_BASE + 3)  /* driver failed enable */
  164. #define MMSYSERR_ALLOCATED    (MMSYSERR_BASE + 4)  /* device already allocated */
  165. #define MMSYSERR_INVALHANDLE  (MMSYSERR_BASE + 5)  /* device handle is invalid */
  166. #define MMSYSERR_NODRIVER     (MMSYSERR_BASE + 6)  /* no device driver present */
  167. #define MMSYSERR_NOMEM        (MMSYSERR_BASE + 7)  /* memory allocation error */
  168. #define MMSYSERR_NOTSUPPORTED (MMSYSERR_BASE + 8)  /* function isn't supported */
  169. #define MMSYSERR_BADERRNUM    (MMSYSERR_BASE + 9)  /* error value out of range */
  170. #define MMSYSERR_INVALFLAG    (MMSYSERR_BASE + 10) /* invalid flag passed */
  171. #define MMSYSERR_INVALPARAM   (MMSYSERR_BASE + 11) /* invalid parameter passed */
  172. #define MMSYSERR_LASTERROR    (MMSYSERR_BASE + 11) /* last error in range */
  173.  
  174.  
  175. /* If included with the 3.0 windows.h, define compatible aliases */
  176. #if !defined(WINVER) || (WINVER < 0x030a)
  177. DECLARE_HANDLE(HDRVR);
  178. #endif  /* WIN3.0 */
  179.  
  180. #ifndef MMNODRV
  181. /****************************************************************************
  182.  
  183.                         Installable driver support
  184.  
  185. ****************************************************************************/
  186.  
  187. /* If included with the 3.0 windows.h, define compatible aliases */
  188. #if !defined(WINVER) || (WINVER < 0x030a)
  189.  
  190. /* return values from DriverProc() function */
  191. #define DRV_CANCEL              0x0000
  192. #define DRV_OK                  0x0001
  193. #define DRV_RESTART             0x0002
  194.  
  195. /* Driver messages */
  196. #define DRV_LOAD                0x0001
  197. #define DRV_ENABLE              0x0002
  198. #define DRV_OPEN                0x0003
  199. #define DRV_CLOSE               0x0004
  200. #define DRV_DISABLE             0x0005
  201. #define DRV_FREE                0x0006
  202. #define DRV_CONFIGURE           0x0007
  203. #define DRV_QUERYCONFIGURE      0x0008
  204. #define DRV_INSTALL             0x0009
  205. #define DRV_REMOVE              0x000A
  206. #define DRV_RESERVED            0x0800
  207. #define DRV_USER                0x4000
  208.  
  209. /* LPARAM of DRV_CONFIGURE message */
  210. typedef struct tagDRVCONFIGINFO {
  211.     DWORD   dwDCISize;
  212.     LPCSTR  lpszDCISectionName;
  213.     LPCSTR  lpszDCIAliasName;
  214. } DRVCONFIGINFO;
  215. typedef DRVCONFIGINFO        *PDRVCONFIGINFO;
  216. typedef DRVCONFIGINFO  NEAR *NPDRVCONFIGINFO;
  217. typedef DRVCONFIGINFO  FAR  *LPDRVCONFIGINFO;
  218.  
  219. /* installable driver function prototypes */
  220. LRESULT   WINAPI DrvClose(HDRVR hDriver, LPARAM lParam1, LPARAM lParam2);
  221. HDRVR     WINAPI DrvOpen(LPCSTR szDriverName, LPCSTR szSectionName,
  222.     LPARAM lParam2);
  223. LRESULT   WINAPI DrvSendMessage(HDRVR hDriver, UINT uMessage,
  224.     LPARAM lParam1, LPARAM lParam2);
  225. HINSTANCE WINAPI DrvGetModuleHandle(HDRVR hDriver);
  226.  
  227. LRESULT WINAPI DrvDefDriverProc(DWORD dwDriverIdentifier, HDRVR driverID,
  228.     UINT uMessage, LPARAM lParam1, LPARAM lParam2);
  229.  
  230. #define DefDriverProc DrvDefDriverProc
  231.  
  232. #endif  /* WIN3.0 */
  233.  
  234.  
  235. #if defined(WINVER) && (WINVER >= 0x030a)
  236.  
  237. /* return values from DriverProc() function */
  238. #define DRV_CANCEL             DRVCNF_CANCEL
  239. #define DRV_OK                 DRVCNF_OK
  240. #define DRV_RESTART            DRVCNF_RESTART
  241.  
  242. #endif  /* WINVER >= 0x030a */
  243.  
  244. #define DRV_MCI_FIRST          DRV_RESERVED
  245. #define DRV_MCI_LAST           (DRV_RESERVED + 0xFFF)
  246.  
  247. #endif  /* ifndef MMNODRV */
  248.  
  249.  
  250. /****************************************************************************
  251.  
  252.                           Driver callback support
  253.  
  254. ****************************************************************************/
  255.  
  256. /* flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and */
  257. /* midiOutOpen() to specify the type of the dwCallback parameter. */
  258.  
  259. #define CALLBACK_TYPEMASK   0x00070000l    /* callback type mask */
  260. #define CALLBACK_NULL       0x00000000l    /* no callback */
  261. #define CALLBACK_WINDOW     0x00010000l    /* dwCallback is a HWND */
  262. #define CALLBACK_TASK       0x00020000l    /* dwCallback is a HTASK */
  263. #define CALLBACK_FUNCTION   0x00030000l    /* dwCallback is a FARPROC */
  264.  
  265. /* driver callback prototypes */
  266. typedef void (CALLBACK DRVCALLBACK) (HDRVR h, UINT uMessage, DWORD dwUser, DWORD dw1, DWORD dw2);
  267.  
  268. typedef DRVCALLBACK FAR *LPDRVCALLBACK;
  269.  
  270. /****************************************************************************
  271.  
  272.                          Manufacturer and product IDs
  273.  
  274.     Used with wMid and wPid fields in WAVEOUTCAPS, WAVEINCAPS,
  275.     MIDIOUTCAPS, MIDIINCAPS, AUXCAPS, JOYCAPS structures.
  276.  
  277. ****************************************************************************/
  278.  
  279. /* manufacturer IDs */
  280. #define MM_MICROSOFT            1       /* Microsoft Corp. */
  281.  
  282. /* product IDs */
  283. #define MM_MIDI_MAPPER          1       /* MIDI Mapper */
  284. #define MM_WAVE_MAPPER          2       /* Wave Mapper */
  285.  
  286. #define MM_SNDBLST_MIDIOUT      3       /* Sound Blaster MIDI output port */
  287. #define MM_SNDBLST_MIDIIN       4       /* Sound Blaster MIDI input port  */
  288. #define MM_SNDBLST_SYNTH        5       /* Sound Blaster internal synthesizer */
  289. #define MM_SNDBLST_WAVEOUT      6       /* Sound Blaster waveform output */
  290. #define MM_SNDBLST_WAVEIN       7       /* Sound Blaster waveform input */
  291.  
  292. #define MM_ADLIB                9       /* Ad Lib-compatible synthesizer */
  293.  
  294. #define MM_MPU401_MIDIOUT       10      /* MPU401-compatible MIDI output port */
  295. #define MM_MPU401_MIDIIN        11      /* MPU401-compatible MIDI input port */
  296.  
  297. #define MM_PC_JOYSTICK          12      /* Joystick adapter */
  298.  
  299.  
  300. #ifndef MMNOMMSYSTEM
  301. /****************************************************************************
  302.  
  303.                     General MMSYSTEM support
  304.  
  305. ****************************************************************************/
  306.  
  307. WORD WINAPI mmsystemGetVersion(void);
  308. void WINAPI OutputDebugStr(LPCSTR);
  309.  
  310. #endif  /* ifndef MMNOMMSYSTEM */
  311.  
  312.  
  313. #ifndef MMNOSOUND
  314. /****************************************************************************
  315.  
  316.                             Sound support
  317.  
  318. ****************************************************************************/
  319.  
  320. BOOL WINAPI sndPlaySound(LPCSTR lpszSoundName, UINT uFlags);
  321.  
  322. /* flag values for wFlags parameter */
  323. #define SND_SYNC            0x0000  /* play synchronously (default) */
  324. #define SND_ASYNC           0x0001  /* play asynchronously */
  325. #define SND_NODEFAULT       0x0002  /* don't use default sound */
  326. #define SND_MEMORY          0x0004  /* lpszSoundName points to a memory file */
  327. #define SND_LOOP            0x0008  /* loop the sound until next sndPlaySound */
  328. #define SND_NOSTOP          0x0010  /* don't stop any currently playing sound */
  329.  
  330. #endif  /* ifndef MMNOSOUND */
  331.  
  332.  
  333. #ifndef MMNOWAVE
  334. /****************************************************************************
  335.  
  336.                         Waveform audio support
  337.  
  338. ****************************************************************************/
  339.  
  340. /* waveform audio error return values */
  341. #define WAVERR_BADFORMAT      (WAVERR_BASE + 0)    /* unsupported wave format */
  342. #define WAVERR_STILLPLAYING   (WAVERR_BASE + 1)    /* still something playing */
  343. #define WAVERR_UNPREPARED     (WAVERR_BASE + 2)    /* header not prepared */
  344. #define WAVERR_SYNC           (WAVERR_BASE + 3)    /* device is synchronous */
  345. #define WAVERR_LASTERROR      (WAVERR_BASE + 3)    /* last error in range */
  346.  
  347. /* waveform audio data types */
  348. DECLARE_HANDLE(HWAVE);
  349. DECLARE_HANDLE(HWAVEIN);
  350. DECLARE_HANDLE(HWAVEOUT);
  351. typedef HWAVEIN FAR *LPHWAVEIN;
  352. typedef HWAVEOUT FAR *LPHWAVEOUT;
  353. typedef DRVCALLBACK WAVECALLBACK;
  354. typedef WAVECALLBACK FAR *LPWAVECALLBACK;
  355.  
  356. /* wave callback messages */
  357. #define WOM_OPEN        MM_WOM_OPEN
  358. #define WOM_CLOSE       MM_WOM_CLOSE
  359. #define WOM_DONE        MM_WOM_DONE
  360. #define WIM_OPEN        MM_WIM_OPEN
  361. #define WIM_CLOSE       MM_WIM_CLOSE
  362. #define WIM_DATA        MM_WIM_DATA
  363.  
  364. /* device ID for wave device mapper */
  365. #define WAVE_MAPPER     (-1)
  366.  
  367. /* flags for dwFlags parameter in waveOutOpen() and waveInOpen() */
  368. #define  WAVE_FORMAT_QUERY     0x0001
  369. #define  WAVE_ALLOWSYNC        0x0002
  370.  
  371. /* wave data block header */
  372. typedef struct wavehdr_tag {
  373.     LPSTR       lpData;                 /* pointer to locked data buffer */
  374.     DWORD       dwBufferLength;         /* length of data buffer */
  375.     DWORD       dwBytesRecorded;        /* used for input only */
  376.     DWORD       dwUser;                 /* for client's use */
  377.     DWORD       dwFlags;                /* assorted flags (see defines) */
  378.     DWORD       dwLoops;                /* loop control counter */
  379.     struct wavehdr_tag far *lpNext;     /* reserved for driver */
  380.     DWORD       reserved;               /* reserved for driver */
  381. } WAVEHDR;
  382. typedef WAVEHDR       *PWAVEHDR;
  383. typedef WAVEHDR NEAR *NPWAVEHDR;
  384. typedef WAVEHDR FAR  *LPWAVEHDR;
  385.  
  386. /* flags for dwFlags field of WAVEHDR */
  387. #define WHDR_DONE       0x00000001  /* done bit */
  388. #define WHDR_PREPARED   0x00000002  /* set if this header has been prepared */
  389. #define WHDR_BEGINLOOP  0x00000004  /* loop start block */
  390. #define WHDR_ENDLOOP    0x00000008  /* loop end block */
  391. #define WHDR_INQUEUE    0x00000010  /* reserved for driver */
  392.  
  393. /* waveform output device capabilities structure */
  394. typedef struct waveoutcaps_tag {
  395.     UINT    wMid;                  /* manufacturer ID */
  396.     UINT    wPid;                  /* product ID */
  397.     VERSION vDriverVersion;        /* version of the driver */
  398.     char    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  399.     DWORD   dwFormats;             /* formats supported */
  400.     UINT    wChannels;             /* number of sources supported */
  401.     DWORD   dwSupport;             /* functionality supported by driver */
  402. } WAVEOUTCAPS;
  403. typedef WAVEOUTCAPS       *PWAVEOUTCAPS;
  404. typedef WAVEOUTCAPS NEAR *NPWAVEOUTCAPS;
  405. typedef WAVEOUTCAPS FAR  *LPWAVEOUTCAPS;
  406.  
  407. /* flags for dwSupport field of WAVEOUTCAPS */
  408. #define WAVECAPS_PITCH          0x0001   /* supports pitch control */
  409. #define WAVECAPS_PLAYBACKRATE   0x0002   /* supports playback rate control */
  410. #define WAVECAPS_VOLUME         0x0004   /* supports volume control */
  411. #define WAVECAPS_LRVOLUME       0x0008   /* separate left-right volume control */
  412. #define WAVECAPS_SYNC           0x0010
  413.  
  414. /* waveform input device capabilities structure */
  415. typedef struct waveincaps_tag {
  416.     UINT    wMid;                    /* manufacturer ID */
  417.     UINT    wPid;                    /* product ID */
  418.     VERSION vDriverVersion;          /* version of the driver */
  419.     char    szPname[MAXPNAMELEN];    /* product name (NULL terminated string) */
  420.     DWORD   dwFormats;               /* formats supported */
  421.     UINT    wChannels;               /* number of channels supported */
  422. } WAVEINCAPS;
  423. typedef WAVEINCAPS       *PWAVEINCAPS;
  424. typedef WAVEINCAPS NEAR *NPWAVEINCAPS;
  425. typedef WAVEINCAPS FAR  *LPWAVEINCAPS;
  426.  
  427. /* defines for dwFormat field of WAVEINCAPS and WAVEOUTCAPS */
  428. #define WAVE_INVALIDFORMAT     0x00000000       /* invalid format */
  429. #define WAVE_FORMAT_1M08       0x00000001       /* 11.025 kHz, Mono,   8-bit  */
  430. #define WAVE_FORMAT_1S08       0x00000002       /* 11.025 kHz, Stereo, 8-bit  */
  431. #define WAVE_FORMAT_1M16       0x00000004       /* 11.025 kHz, Mono,   16-bit */
  432. #define WAVE_FORMAT_1S16       0x00000008       /* 11.025 kHz, Stereo, 16-bit */
  433. #define WAVE_FORMAT_2M08       0x00000010       /* 22.05  kHz, Mono,   8-bit  */
  434. #define WAVE_FORMAT_2S08       0x00000020       /* 22.05  kHz, Stereo, 8-bit  */
  435. #define WAVE_FORMAT_2M16       0x00000040       /* 22.05  kHz, Mono,   16-bit */
  436. #define WAVE_FORMAT_2S16       0x00000080       /* 22.05  kHz, Stereo, 16-bit */
  437. #define WAVE_FORMAT_4M08       0x00000100       /* 44.1   kHz, Mono,   8-bit  */
  438. #define WAVE_FORMAT_4S08       0x00000200       /* 44.1   kHz, Stereo, 8-bit  */
  439. #define WAVE_FORMAT_4M16       0x00000400       /* 44.1   kHz, Mono,   16-bit */
  440. #define WAVE_FORMAT_4S16       0x00000800       /* 44.1   kHz, Stereo, 16-bit */
  441.  
  442. /* general waveform format structure (information common to all formats) */
  443. typedef struct waveformat_tag {
  444.     WORD    wFormatTag;        /* format type */
  445.     WORD    nChannels;         /* number of channels (i.e. mono, stereo, etc.) */
  446.     DWORD   nSamplesPerSec;    /* sample rate */
  447.     DWORD   nAvgBytesPerSec;   /* for buffer estimation */
  448.     WORD    nBlockAlign;       /* block size of data */
  449. } WAVEFORMAT;
  450. typedef WAVEFORMAT       *PWAVEFORMAT;
  451. typedef WAVEFORMAT NEAR *NPWAVEFORMAT;
  452. typedef WAVEFORMAT FAR  *LPWAVEFORMAT;
  453.  
  454. /* flags for wFormatTag field of WAVEFORMAT */
  455. #define WAVE_FORMAT_PCM     1
  456.  
  457. /* specific waveform format structure for PCM data */
  458. typedef struct pcmwaveformat_tag {
  459.     WAVEFORMAT  wf;
  460.     WORD        wBitsPerSample;
  461. } PCMWAVEFORMAT;
  462. typedef PCMWAVEFORMAT       *PPCMWAVEFORMAT;
  463. typedef PCMWAVEFORMAT NEAR *NPPCMWAVEFORMAT;
  464. typedef PCMWAVEFORMAT FAR  *LPPCMWAVEFORMAT;
  465.  
  466. /* waveform audio function prototypes */
  467. UINT WINAPI waveOutGetNumDevs(void);
  468. UINT WINAPI waveOutGetDevCaps(UINT uDeviceID, WAVEOUTCAPS FAR* lpCaps,
  469.     UINT uSize);
  470. UINT WINAPI waveOutGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume);
  471. UINT WINAPI waveOutSetVolume(UINT uDeviceID, DWORD dwVolume);
  472. UINT WINAPI waveOutGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
  473. UINT WINAPI waveOutOpen(HWAVEOUT FAR* lphWaveOut, UINT uDeviceID,
  474.     const WAVEFORMAT FAR* lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
  475. UINT WINAPI waveOutClose(HWAVEOUT hWaveOut);
  476. UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut,
  477.      WAVEHDR FAR* lpWaveOutHdr, UINT uSize);
  478. UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut,
  479.     WAVEHDR FAR* lpWaveOutHdr, UINT uSize);
  480. UINT WINAPI waveOutWrite(HWAVEOUT hWaveOut, WAVEHDR FAR* lpWaveOutHdr,
  481.     UINT uSize);
  482. UINT WINAPI waveOutPause(HWAVEOUT hWaveOut);
  483. UINT WINAPI waveOutRestart(HWAVEOUT hWaveOut);
  484. UINT WINAPI waveOutReset(HWAVEOUT hWaveOut);
  485. UINT WINAPI waveOutBreakLoop(HWAVEOUT hWaveOut);
  486. UINT WINAPI waveOutGetPosition(HWAVEOUT hWaveOut, MMTIME FAR* lpInfo,
  487.     UINT uSize);
  488. UINT WINAPI waveOutGetPitch(HWAVEOUT hWaveOut, DWORD FAR* lpdwPitch);
  489. UINT WINAPI waveOutSetPitch(HWAVEOUT hWaveOut, DWORD dwPitch);
  490. UINT WINAPI waveOutGetPlaybackRate(HWAVEOUT hWaveOut, DWORD FAR* lpdwRate);
  491. UINT WINAPI waveOutSetPlaybackRate(HWAVEOUT hWaveOut, DWORD dwRate);
  492. UINT WINAPI waveOutGetID(HWAVEOUT hWaveOut, UINT FAR* lpuDeviceID);
  493.  
  494. #if defined(WINVER) && (WINVER >= 0x030a)
  495. DWORD WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage, DWORD dw1, DWORD dw2);
  496. #endif  /* WINVER >= 0x030a */
  497.  
  498. UINT WINAPI waveInGetNumDevs(void);
  499. UINT WINAPI waveInGetDevCaps(UINT uDeviceID, WAVEINCAPS FAR* lpCaps,
  500.     UINT uSize);
  501. UINT WINAPI waveInGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
  502. UINT WINAPI waveInOpen(HWAVEIN FAR* lphWaveIn, UINT uDeviceID,
  503.     const WAVEFORMAT FAR* lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
  504. UINT WINAPI waveInClose(HWAVEIN hWaveIn);
  505. UINT WINAPI waveInPrepareHeader(HWAVEIN hWaveIn,
  506.     WAVEHDR FAR* lpWaveInHdr, UINT uSize);
  507. UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn,
  508.     WAVEHDR FAR* lpWaveInHdr, UINT uSize);
  509. UINT WINAPI waveInAddBuffer(HWAVEIN hWaveIn,
  510.     WAVEHDR FAR* lpWaveInHdr, UINT uSize);
  511. UINT WINAPI waveInStart(HWAVEIN hWaveIn);
  512. UINT WINAPI waveInStop(HWAVEIN hWaveIn);
  513. UINT WINAPI waveInReset(HWAVEIN hWaveIn);
  514. UINT WINAPI waveInGetPosition(HWAVEIN hWaveIn, MMTIME FAR* lpInfo,
  515.     UINT uSize);
  516. UINT WINAPI waveInGetID(HWAVEIN hWaveIn, UINT FAR* lpuDeviceID);
  517.  
  518. #if defined(WINVER) && (WINVER >= 0x030a)
  519. DWORD WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage, DWORD dw1, DWORD dw2);
  520. #endif  /* WINVER >= 0x030a */
  521.  
  522. #endif  /* ifndef MMNOWAVE */
  523.  
  524.  
  525. #ifndef MMNOMIDI
  526. /****************************************************************************
  527.  
  528.                             MIDI audio support
  529.  
  530. ****************************************************************************/
  531.  
  532. /* MIDI error return values */
  533. #define MIDIERR_UNPREPARED    (MIDIERR_BASE + 0)   /* header not prepared */
  534. #define MIDIERR_STILLPLAYING  (MIDIERR_BASE + 1)   /* still something playing */
  535. #define MIDIERR_NOMAP         (MIDIERR_BASE + 2)   /* no current map */
  536. #define MIDIERR_NOTREADY      (MIDIERR_BASE + 3)   /* hardware is still busy */
  537. #define MIDIERR_NODEVICE      (MIDIERR_BASE + 4)   /* port no longer connected */
  538. #define MIDIERR_INVALIDSETUP  (MIDIERR_BASE + 5)   /* invalid setup */
  539. #define MIDIERR_LASTERROR     (MIDIERR_BASE + 5)   /* last error in range */
  540.  
  541. /* MIDI audio data types */
  542. DECLARE_HANDLE(HMIDI);
  543. DECLARE_HANDLE(HMIDIIN);
  544. DECLARE_HANDLE(HMIDIOUT);
  545. typedef HMIDIIN FAR *LPHMIDIIN;
  546. typedef HMIDIOUT FAR *LPHMIDIOUT;
  547. typedef DRVCALLBACK MIDICALLBACK;
  548. typedef MIDICALLBACK FAR *LPMIDICALLBACK;
  549. #define MIDIPATCHSIZE   128
  550. typedef WORD PATCHARRAY[MIDIPATCHSIZE];
  551. typedef WORD FAR *LPPATCHARRAY;
  552. typedef WORD KEYARRAY[MIDIPATCHSIZE];
  553. typedef WORD FAR *LPKEYARRAY;
  554.  
  555. /* MIDI callback messages */
  556. #define MIM_OPEN        MM_MIM_OPEN
  557. #define MIM_CLOSE       MM_MIM_CLOSE
  558. #define MIM_DATA        MM_MIM_DATA
  559. #define MIM_LONGDATA    MM_MIM_LONGDATA
  560. #define MIM_ERROR       MM_MIM_ERROR
  561. #define MIM_LONGERROR   MM_MIM_LONGERROR
  562. #define MOM_OPEN        MM_MOM_OPEN
  563. #define MOM_CLOSE       MM_MOM_CLOSE
  564. #define MOM_DONE        MM_MOM_DONE
  565.  
  566. /* device ID for MIDI mapper */
  567. #define MIDIMAPPER     (-1)
  568. #define MIDI_MAPPER    (-1)
  569.  
  570. /* flags for wFlags parm of midiOutCachePatches(), midiOutCacheDrumPatches() */
  571. #define MIDI_CACHE_ALL      1
  572. #define MIDI_CACHE_BESTFIT  2
  573. #define MIDI_CACHE_QUERY    3
  574. #define MIDI_UNCACHE        4
  575.  
  576. /* MIDI output device capabilities structure */
  577. typedef struct midioutcaps_tag {
  578.     UINT    wMid;                  /* manufacturer ID */
  579.     UINT    wPid;                  /* product ID */
  580.     VERSION vDriverVersion;        /* version of the driver */
  581.     char    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  582.     UINT    wTechnology;           /* type of device */
  583.     UINT    wVoices;               /* # of voices (internal synth only) */
  584.     UINT    wNotes;                /* max # of notes (internal synth only) */
  585.     UINT    wChannelMask;          /* channels used (internal synth only) */
  586.     DWORD   dwSupport;             /* functionality supported by driver */
  587. } MIDIOUTCAPS;
  588. typedef MIDIOUTCAPS       *PMIDIOUTCAPS;
  589. typedef MIDIOUTCAPS NEAR *NPMIDIOUTCAPS;
  590. typedef MIDIOUTCAPS FAR  *LPMIDIOUTCAPS;
  591.  
  592. /* flags for wTechnology field of MIDIOUTCAPS structure */
  593. #define MOD_MIDIPORT    1  /* output port */
  594. #define MOD_SYNTH       2  /* generic internal synth */
  595. #define MOD_SQSYNTH     3  /* square wave internal synth */
  596. #define MOD_FMSYNTH     4  /* FM internal synth */
  597. #define MOD_MAPPER      5  /* MIDI mapper */
  598.  
  599. /* flags for dwSupport field of MIDIOUTCAPS structure */
  600. #define MIDICAPS_VOLUME          0x0001  /* supports volume control */
  601. #define MIDICAPS_LRVOLUME        0x0002  /* separate left-right volume control */
  602. #define MIDICAPS_CACHE           0x0004
  603.  
  604. /* MIDI output device capabilities structure */
  605. typedef struct midiincaps_tag {
  606.     UINT    wMid;                  /* manufacturer ID */
  607.     UINT    wPid;                  /* product ID */
  608.     VERSION vDriverVersion;        /* version of the driver */
  609.     char    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  610. } MIDIINCAPS;
  611. typedef MIDIINCAPS      *PMIDIINCAPS;
  612. typedef MIDIINCAPS NEAR *NPMIDIINCAPS;
  613. typedef MIDIINCAPS FAR  *LPMIDIINCAPS;
  614.  
  615. /* MIDI data block header */
  616. typedef struct midihdr_tag {
  617.     LPSTR       lpData;               /* pointer to locked data block */
  618.     DWORD       dwBufferLength;       /* length of data in data block */
  619.     DWORD       dwBytesRecorded;      /* used for input only */
  620.     DWORD       dwUser;               /* for client's use */
  621.     DWORD       dwFlags;              /* assorted flags (see defines) */
  622.     struct midihdr_tag far *lpNext;   /* reserved for driver */
  623.     DWORD       reserved;             /* reserved for driver */
  624. } MIDIHDR;
  625. typedef MIDIHDR       *PMIDIHDR;
  626. typedef MIDIHDR NEAR *NPMIDIHDR;
  627. typedef MIDIHDR FAR  *LPMIDIHDR;
  628.  
  629. /* flags for dwFlags field of MIDIHDR structure */
  630. #define MHDR_DONE       0x00000001       /* done bit */
  631. #define MHDR_PREPARED   0x00000002       /* set if header prepared */
  632. #define MHDR_INQUEUE    0x00000004       /* reserved for driver */
  633.  
  634. /* MIDI function prototypes */
  635. UINT WINAPI midiOutGetNumDevs(void);
  636. UINT WINAPI midiOutGetDevCaps(UINT uDeviceID,
  637.     MIDIOUTCAPS FAR* lpCaps, UINT uSize);
  638. UINT WINAPI midiOutGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume);
  639. UINT WINAPI midiOutSetVolume(UINT uDeviceID, DWORD dwVolume);
  640. UINT WINAPI midiOutGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
  641. UINT WINAPI midiOutOpen(HMIDIOUT FAR* lphMidiOut, UINT uDeviceID,
  642.     DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
  643. UINT WINAPI midiOutClose(HMIDIOUT hMidiOut);
  644. UINT WINAPI midiOutPrepareHeader(HMIDIOUT hMidiOut,
  645.     MIDIHDR FAR* lpMidiOutHdr, UINT uSize);
  646. UINT WINAPI midiOutUnprepareHeader(HMIDIOUT hMidiOut,
  647.     MIDIHDR FAR* lpMidiOutHdr, UINT uSize);
  648. UINT WINAPI midiOutShortMsg(HMIDIOUT hMidiOut, DWORD dwMsg);
  649. UINT WINAPI midiOutLongMsg(HMIDIOUT hMidiOut,
  650.     MIDIHDR FAR* lpMidiOutHdr, UINT uSize);
  651. UINT WINAPI midiOutReset(HMIDIOUT hMidiOut);
  652. UINT WINAPI midiOutCachePatches(HMIDIOUT hMidiOut,
  653.     UINT uBank, WORD FAR* lpwPatchArray, UINT uFlags);
  654. UINT WINAPI midiOutCacheDrumPatches(HMIDIOUT hMidiOut,
  655.     UINT uPatch, WORD FAR* lpwKeyArray, UINT uFlags);
  656. UINT WINAPI midiOutGetID(HMIDIOUT hMidiOut, UINT FAR* lpuDeviceID);
  657.  
  658. #if defined(WINVER) && (WINVER >= 0x030a)
  659. DWORD WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage, DWORD dw1, DWORD dw2);
  660. #endif  /* WINVER >= 0x030a */
  661.  
  662. UINT WINAPI midiInGetNumDevs(void);
  663. UINT WINAPI midiInGetDevCaps(UINT uDeviceID,
  664.     LPMIDIINCAPS lpCaps, UINT uSize);
  665. UINT WINAPI midiInGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
  666. UINT WINAPI midiInOpen(HMIDIIN FAR* lphMidiIn, UINT uDeviceID,
  667.     DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
  668. UINT WINAPI midiInClose(HMIDIIN hMidiIn);
  669. UINT WINAPI midiInPrepareHeader(HMIDIIN hMidiIn,
  670.     MIDIHDR FAR* lpMidiInHdr, UINT uSize);
  671. UINT WINAPI midiInUnprepareHeader(HMIDIIN hMidiIn,
  672.     MIDIHDR FAR* lpMidiInHdr, UINT uSize);
  673. UINT WINAPI midiInAddBuffer(HMIDIIN hMidiIn,
  674.     MIDIHDR FAR* lpMidiInHdr, UINT uSize);
  675. UINT WINAPI midiInStart(HMIDIIN hMidiIn);
  676. UINT WINAPI midiInStop(HMIDIIN hMidiIn);
  677. UINT WINAPI midiInReset(HMIDIIN hMidiIn);
  678. UINT WINAPI midiInGetID(HMIDIIN hMidiIn, UINT FAR* lpuDeviceID);
  679.  
  680. #if defined(WINVER) && (WINVER >= 0x030a)
  681. DWORD WINAPI midiInMessage(HMIDIIN hMidiIn, UINT uMessage, DWORD dw1, DWORD dw2);
  682. #endif  /* WINVER >= 0x030a */
  683.  
  684. #endif  /* ifndef MMNOMIDI */
  685.  
  686.  
  687. #ifndef MMNOAUX
  688. /****************************************************************************
  689.  
  690.                         Auxiliary audio support
  691.  
  692. ****************************************************************************/
  693.  
  694. /* device ID for aux device mapper */
  695. #define AUX_MAPPER     (-1)
  696.  
  697. /* Auxiliary audio device capabilities structure */
  698. typedef struct auxcaps_tag {
  699.     UINT    wMid;                  /* manufacturer ID */
  700.     UINT    wPid;                  /* product ID */
  701.     VERSION vDriverVersion;        /* version of the driver */
  702.     char    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  703.     UINT    wTechnology;           /* type of device */
  704.     DWORD   dwSupport;             /* functionality supported by driver */
  705. } AUXCAPS;
  706. typedef AUXCAPS       *PAUXCAPS;
  707. typedef AUXCAPS NEAR *NPAUXCAPS;
  708. typedef AUXCAPS FAR  *LPAUXCAPS;
  709.  
  710. /* flags for wTechnology field in AUXCAPS structure */
  711. #define AUXCAPS_CDAUDIO    1       /* audio from internal CD-ROM drive */
  712. #define AUXCAPS_AUXIN      2       /* audio from auxiliary input jacks */
  713.  
  714. /* flags for dwSupport field in AUXCAPS structure */
  715. #define AUXCAPS_VOLUME          0x0001  /* supports volume control */
  716. #define AUXCAPS_LRVOLUME        0x0002  /* separate left-right volume control */
  717.  
  718. /* auxiliary audio function prototypes */
  719. UINT WINAPI auxGetNumDevs(void);
  720. UINT WINAPI auxGetDevCaps(UINT uDeviceID, AUXCAPS FAR* lpCaps, UINT uSize);
  721. UINT WINAPI auxSetVolume(UINT uDeviceID, DWORD dwVolume);
  722. UINT WINAPI auxGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume);
  723.  
  724. #if defined(WINVER) && (WINVER >= 0x030a)
  725. DWORD WINAPI auxOutMessage(UINT uDeviceID, UINT uMessage, DWORD dw1, DWORD dw2);
  726. #endif  /* WINVER >= 0x030a */
  727.  
  728. #endif  /* ifndef MMNOAUX */
  729.  
  730.  
  731. #ifndef MMNOTIMER
  732. /****************************************************************************
  733.  
  734.                             Timer support
  735.  
  736. ****************************************************************************/
  737.  
  738. /* timer error return values */
  739. #define TIMERR_NOERROR        (0)                  /* no error */
  740. #define TIMERR_NOCANDO        (TIMERR_BASE+1)      /* request not completed */
  741. #define TIMERR_STRUCT         (TIMERR_BASE+33)     /* time struct size */
  742.  
  743. /* timer data types */
  744. typedef void (CALLBACK TIMECALLBACK) (UINT uTimerID, UINT uMessage, DWORD dwUser, DWORD dw1, DWORD dw2);
  745.  
  746. typedef TIMECALLBACK FAR *LPTIMECALLBACK;
  747.  
  748. /* flags for wFlags parameter of timeSetEvent() function */
  749. #define TIME_ONESHOT    0   /* program timer for single event */
  750. #define TIME_PERIODIC   1   /* program for continuous periodic event */
  751.  
  752. /* timer device capabilities data structure */
  753. typedef struct timecaps_tag {
  754.     UINT    wPeriodMin;     /* minimum period supported  */
  755.     UINT    wPeriodMax;     /* maximum period supported  */
  756.     } TIMECAPS;
  757. typedef TIMECAPS       *PTIMECAPS;
  758. typedef TIMECAPS NEAR *NPTIMECAPS;
  759. typedef TIMECAPS FAR  *LPTIMECAPS;
  760.  
  761. /* timer function prototypes */
  762. UINT WINAPI timeGetSystemTime(MMTIME FAR* lpTime, UINT uSize);
  763. DWORD WINAPI timeGetTime(void);
  764. UINT WINAPI timeSetEvent(UINT uDelay, UINT uResolution,
  765.     LPTIMECALLBACK lpFunction, DWORD dwUser, UINT uFlags);
  766. UINT WINAPI timeKillEvent(UINT uTimerID);
  767. UINT WINAPI timeGetDevCaps(TIMECAPS FAR* lpTimeCaps, UINT uSize);
  768. UINT WINAPI timeBeginPeriod(UINT uPeriod);
  769. UINT WINAPI timeEndPeriod(UINT uPeriod);
  770.  
  771. #endif  /* ifndef MMNOTIMER */
  772.  
  773.  
  774. #ifndef MMNOJOY
  775. /****************************************************************************
  776.  
  777.                             Joystick support
  778.  
  779. ****************************************************************************/
  780.  
  781. /* joystick error return values */
  782. #define JOYERR_NOERROR        (0)                  /* no error */
  783. #define JOYERR_PARMS          (JOYERR_BASE+5)      /* bad parameters */
  784. #define JOYERR_NOCANDO        (JOYERR_BASE+6)      /* request not completed */
  785. #define JOYERR_UNPLUGGED      (JOYERR_BASE+7)      /* joystick is unplugged */
  786.  
  787. /* constants used with JOYINFO structure and MM_JOY* messages */
  788. #define JOY_BUTTON1         0x0001
  789. #define JOY_BUTTON2         0x0002
  790. #define JOY_BUTTON3         0x0004
  791. #define JOY_BUTTON4         0x0008
  792. #define JOY_BUTTON1CHG      0x0100
  793. #define JOY_BUTTON2CHG      0x0200
  794. #define JOY_BUTTON3CHG      0x0400
  795. #define JOY_BUTTON4CHG      0x0800
  796.  
  797. /* joystick ID constants */
  798. #define JOYSTICKID1         0
  799. #define JOYSTICKID2         1
  800.  
  801. /* joystick device capabilities data structure */
  802. typedef struct joycaps_tag {
  803.     UINT wMid;                  /* manufacturer ID */
  804.     UINT wPid;                  /* product ID */
  805.     char szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  806.     UINT wXmin;                 /* minimum x position value */
  807.     UINT wXmax;                 /* maximum x position value */
  808.     UINT wYmin;                 /* minimum y position value */
  809.     UINT wYmax;                 /* maximum y position value */
  810.     UINT wZmin;                 /* minimum z position value */
  811.     UINT wZmax;                 /* maximum z position value */
  812.     UINT wNumButtons;           /* number of buttons */
  813.     UINT wPeriodMin;            /* minimum message period when captured */
  814.     UINT wPeriodMax;            /* maximum message period when captured */
  815.     } JOYCAPS;
  816. typedef JOYCAPS       *PJOYCAPS;
  817. typedef JOYCAPS NEAR *NPJOYCAPS;
  818. typedef JOYCAPS FAR  *LPJOYCAPS;
  819.  
  820. /* joystick information data structure */
  821. typedef struct joyinfo_tag {
  822.     UINT wXpos;                 /* x position */
  823.     UINT wYpos;                 /* y position */
  824.     UINT wZpos;                 /* z position */
  825.     UINT wButtons;              /* button states */
  826.     } JOYINFO;
  827. typedef JOYINFO       *PJOYINFO;
  828. typedef JOYINFO NEAR *NPJOYINFO;
  829. typedef JOYINFO FAR  *LPJOYINFO;
  830.  
  831. /* joystick function prototypes */
  832. UINT WINAPI joyGetDevCaps(UINT uJoyID, JOYCAPS FAR* lpCaps, UINT uSize);
  833. UINT WINAPI joyGetNumDevs(void);
  834. UINT WINAPI joyGetPos(UINT uJoyID, JOYINFO FAR* lpInfo);
  835. UINT WINAPI joyGetThreshold(UINT uJoyID, UINT FAR* lpuThreshold);
  836. UINT WINAPI joyReleaseCapture(UINT uJoyID);
  837. UINT WINAPI joySetCapture(HWND hwnd, UINT uJoyID, UINT uPeriod,
  838.     BOOL bChanged);
  839. UINT WINAPI joySetThreshold(UINT uJoyID, UINT uThreshold);
  840.  
  841. #endif  /* ifndef MMNOJOY */
  842.  
  843.  
  844. #ifndef MMNOMMIO
  845. /****************************************************************************
  846.  
  847.                         Multimedia File I/O support
  848.  
  849. ****************************************************************************/
  850.  
  851. /* MMIO error return values */
  852. #define MMIOERR_BASE            256
  853. #define MMIOERR_FILENOTFOUND    (MMIOERR_BASE + 1)  /* file not found */
  854. #define MMIOERR_OUTOFMEMORY     (MMIOERR_BASE + 2)  /* out of memory */
  855. #define MMIOERR_CANNOTOPEN      (MMIOERR_BASE + 3)  /* cannot open */
  856. #define MMIOERR_CANNOTCLOSE     (MMIOERR_BASE + 4)  /* cannot close */
  857. #define MMIOERR_CANNOTREAD      (MMIOERR_BASE + 5)  /* cannot read */
  858. #define MMIOERR_CANNOTWRITE     (MMIOERR_BASE + 6)  /* cannot write */
  859. #define MMIOERR_CANNOTSEEK      (MMIOERR_BASE + 7)  /* cannot seek */
  860. #define MMIOERR_CANNOTEXPAND    (MMIOERR_BASE + 8)  /* cannot expand file */
  861. #define MMIOERR_CHUNKNOTFOUND   (MMIOERR_BASE + 9)  /* chunk not found */
  862. #define MMIOERR_UNBUFFERED      (MMIOERR_BASE + 10) /* file is unbuffered */
  863.  
  864. /* MMIO constants */
  865. #define CFSEPCHAR       '+'             /* compound file name separator char. */
  866.  
  867. /* MMIO data types */
  868. typedef DWORD           FOURCC;         /* a four character code */
  869. typedef char _huge *    HPSTR;          /* a huge version of LPSTR */
  870. DECLARE_HANDLE(HMMIO);                  /* a handle to an open file */
  871. typedef LRESULT (CALLBACK MMIOPROC)(LPSTR lpmmioinfo, UINT uMessage,
  872.             LPARAM lParam1, LPARAM lParam2);
  873. typedef MMIOPROC FAR *LPMMIOPROC;
  874.  
  875. /* general MMIO information data structure */
  876. typedef struct _MMIOINFO
  877. {
  878.         /* general fields */
  879.         DWORD           dwFlags;        /* general status flags */
  880.         FOURCC          fccIOProc;      /* pointer to I/O procedure */
  881.         LPMMIOPROC      pIOProc;        /* pointer to I/O procedure */
  882.         UINT            wErrorRet;      /* place for error to be returned */
  883.         HTASK           htask;          /* alternate local task */
  884.  
  885.         /* fields maintained by MMIO functions during buffered I/O */
  886.         LONG            cchBuffer;      /* size of I/O buffer (or 0L) */
  887.         HPSTR           pchBuffer;      /* start of I/O buffer (or NULL) */
  888.         HPSTR           pchNext;        /* pointer to next byte to read/write */
  889.         HPSTR           pchEndRead;     /* pointer to last valid byte to read */
  890.         HPSTR           pchEndWrite;    /* pointer to last byte to write */
  891.         LONG            lBufOffset;     /* disk offset of start of buffer */
  892.  
  893.         /* fields maintained by I/O procedure */
  894.         LONG            lDiskOffset;    /* disk offset of next read or write */
  895.         DWORD           adwInfo[3];     /* data specific to type of MMIOPROC */
  896.  
  897.         /* other fields maintained by MMIO */
  898.         DWORD           dwReserved1;    /* reserved for MMIO use */
  899.         DWORD           dwReserved2;    /* reserved for MMIO use */
  900.         HMMIO           hmmio;          /* handle to open file */
  901. } MMIOINFO;
  902. typedef MMIOINFO       *PMMIOINFO;
  903. typedef MMIOINFO NEAR *NPMMIOINFO;
  904. typedef MMIOINFO FAR  *LPMMIOINFO;
  905.  
  906. /* RIFF chunk information data structure */
  907. typedef struct _MMCKINFO
  908. {
  909.         FOURCC          ckid;           /* chunk ID */
  910.         DWORD           cksize;         /* chunk size */
  911.         FOURCC          fccType;        /* form type or list type */
  912.         DWORD           dwDataOffset;   /* offset of data portion of chunk */
  913.         DWORD           dwFlags;        /* flags used by MMIO functions */
  914. } MMCKINFO;
  915. typedef MMCKINFO       *PMMCKINFO;
  916. typedef MMCKINFO NEAR *NPMMCKINFO;
  917. typedef MMCKINFO FAR  *LPMMCKINFO;
  918.  
  919. /* bit field masks */
  920. #define MMIO_RWMODE     0x00000003      /* open file for reading/writing/both */
  921. #define MMIO_SHAREMODE  0x00000070      /* file sharing mode number */
  922.  
  923. /* constants for dwFlags field of MMIOINFO */
  924. #define MMIO_CREATE     0x00001000      /* create new file (or truncate file) */
  925. #define MMIO_PARSE      0x00000100      /* parse new file returning path */
  926. #define MMIO_DELETE     0x00000200      /* create new file (or truncate file) */
  927. #define MMIO_EXIST      0x00004000      /* checks for existence of file */
  928. #define MMIO_ALLOCBUF   0x00010000      /* mmioOpen() should allocate a buffer */
  929. #define MMIO_GETTEMP    0x00020000      /* mmioOpen() should retrieve temp name */
  930.  
  931. #define MMIO_DIRTY      0x10000000      /* I/O buffer is dirty */
  932.  
  933.  
  934. /* read/write mode numbers (bit field MMIO_RWMODE) */
  935. #define MMIO_READ       0x00000000      /* open file for reading only */
  936. #define MMIO_WRITE      0x00000001      /* open file for writing only */
  937. #define MMIO_READWRITE  0x00000002      /* open file for reading and writing */
  938.  
  939. /* share mode numbers (bit field MMIO_SHAREMODE) */
  940. #define MMIO_COMPAT     0x00000000      /* compatibility mode */
  941. #define MMIO_EXCLUSIVE  0x00000010      /* exclusive-access mode */
  942. #define MMIO_DENYWRITE  0x00000020      /* deny writing to other processes */
  943. #define MMIO_DENYREAD   0x00000030      /* deny reading to other processes */
  944. #define MMIO_DENYNONE   0x00000040      /* deny nothing to other processes */
  945.  
  946. /* various MMIO flags */
  947. #define MMIO_FHOPEN             0x0010  /* mmioClose: keep file handle open */
  948. #define MMIO_EMPTYBUF           0x0010  /* mmioFlush: empty the I/O buffer */
  949. #define MMIO_TOUPPER            0x0010  /* mmioStringToFOURCC: to u-case */
  950. #define MMIO_INSTALLPROC    0x00010000  /* mmioInstallIOProc: install MMIOProc */
  951. #define MMIO_GLOBALPROC     0x10000000  /* mmioInstallIOProc: install globally */
  952. #define MMIO_REMOVEPROC     0x00020000  /* mmioInstallIOProc: remove MMIOProc */
  953. #define MMIO_FINDPROC       0x00040000  /* mmioInstallIOProc: find an MMIOProc */
  954. #define MMIO_FINDCHUNK          0x0010  /* mmioDescend: find a chunk by ID */
  955. #define MMIO_FINDRIFF           0x0020  /* mmioDescend: find a LIST chunk */
  956. #define MMIO_FINDLIST           0x0040  /* mmioDescend: find a RIFF chunk */
  957. #define MMIO_CREATERIFF         0x0020  /* mmioCreateChunk: make a LIST chunk */
  958. #define MMIO_CREATELIST         0x0040  /* mmioCreateChunk: make a RIFF chunk */
  959.  
  960.  
  961. /* message numbers for MMIOPROC I/O procedure functions */
  962. #define MMIOM_READ      MMIO_READ       /* read */
  963. #define MMIOM_WRITE    MMIO_WRITE       /* write */
  964. #define MMIOM_SEEK              2       /* seek to a new position in file */
  965. #define MMIOM_OPEN              3       /* open file */
  966. #define MMIOM_CLOSE             4       /* close file */
  967. #define MMIOM_WRITEFLUSH        5       /* write and flush */
  968.  
  969. #if defined(WINVER) && (WINVER >= 0x030a)
  970. #define MMIOM_RENAME            6       /* rename specified file */
  971. #endif  /* WINVER >= 0x030a */
  972.  
  973. #define MMIOM_USER         0x8000       /* beginning of user-defined messages */
  974.  
  975. /* standard four character codes */
  976. #define FOURCC_RIFF     mmioFOURCC('R', 'I', 'F', 'F')
  977. #define FOURCC_LIST     mmioFOURCC('L', 'I', 'S', 'T')
  978.  
  979. /* four character codes used to identify standard built-in I/O procedures */
  980. #define FOURCC_DOS      mmioFOURCC('D', 'O', 'S', ' ')
  981. #define FOURCC_MEM      mmioFOURCC('M', 'E', 'M', ' ')
  982.  
  983. /* flags for mmioSeek() */
  984. #ifndef SEEK_SET
  985. #define SEEK_SET        0               /* seek to an absolute position */
  986. #define SEEK_CUR        1               /* seek relative to current position */
  987. #define SEEK_END        2               /* seek relative to end of file */
  988. #endif  /* ifndef SEEK_SET */
  989.  
  990. /* other constants */
  991. #define MMIO_DEFAULTBUFFER      8192    /* default buffer size */
  992.  
  993. /* MMIO macros */
  994. #define mmioFOURCC( ch0, ch1, ch2, ch3 )                                \
  995.                 ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) |    \
  996.                 ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
  997.  
  998. /* MMIO function prototypes */
  999. FOURCC WINAPI mmioStringToFOURCC(LPCSTR sz, UINT uFlags);
  1000. LPMMIOPROC WINAPI mmioInstallIOProc(FOURCC fccIOProc, LPMMIOPROC pIOProc,
  1001.     DWORD dwFlags);
  1002. HMMIO WINAPI mmioOpen(LPSTR szFileName, MMIOINFO FAR* lpmmioinfo,
  1003.     DWORD dwOpenFlags);
  1004.  
  1005. #if defined(WINVER) && (WINVER >= 0x030a)
  1006. UINT WINAPI mmioRename(LPCSTR szFileName, LPCSTR szNewFileName,
  1007.      MMIOINFO FAR* lpmmioinfo, DWORD dwRenameFlags);
  1008. #endif  /* WINVER >= 0x030a */
  1009.  
  1010. UINT WINAPI mmioClose(HMMIO hmmio, UINT uFlags);
  1011. LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch);
  1012. LONG WINAPI mmioWrite(HMMIO hmmio, const char _huge* pch, LONG cch);
  1013. LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, int iOrigin);
  1014. UINT WINAPI mmioGetInfo(HMMIO hmmio, MMIOINFO FAR* lpmmioinfo, UINT uFlags);
  1015. UINT WINAPI mmioSetInfo(HMMIO hmmio, const MMIOINFO FAR* lpmmioinfo, UINT uFlags);
  1016. UINT WINAPI mmioSetBuffer(HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer,
  1017.     UINT uFlags);
  1018. UINT WINAPI mmioFlush(HMMIO hmmio, UINT uFlags);
  1019. UINT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO FAR* lpmmioinfo, UINT uFlags);
  1020. LRESULT WINAPI mmioSendMessage(HMMIO hmmio, UINT uMessage,
  1021.     LPARAM lParam1, LPARAM lParam2);
  1022. UINT WINAPI mmioDescend(HMMIO hmmio, MMCKINFO FAR* lpck,
  1023.     const MMCKINFO FAR* lpckParent, UINT uFlags);
  1024. UINT WINAPI mmioAscend(HMMIO hmmio, MMCKINFO FAR* lpck, UINT uFlags);
  1025. UINT WINAPI mmioCreateChunk(HMMIO hmmio, MMCKINFO FAR* lpck, UINT uFlags);
  1026.  
  1027. #endif  /* ifndef MMNOMMIO */
  1028.  
  1029.  
  1030. #ifndef MMNOMCI
  1031. /****************************************************************************
  1032.  
  1033.                             MCI support
  1034.  
  1035. ****************************************************************************/
  1036.  
  1037. typedef UINT (CALLBACK *YIELDPROC) (UINT uDeviceID, DWORD dwYieldData);
  1038.  
  1039. /* MCI function prototypes */
  1040. DWORD WINAPI mciSendCommand (UINT uDeviceID, UINT uMessage,
  1041.     DWORD dwParam1, DWORD dwParam2);
  1042. DWORD WINAPI mciSendString (LPCSTR lpstrCommand,
  1043.     LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
  1044. UINT WINAPI mciGetDeviceID (LPCSTR lpstrName);
  1045. UINT WINAPI mciGetDeviceIDFromElementID (DWORD dwElementID,
  1046.     LPCSTR lpstrType);
  1047. BOOL WINAPI mciGetErrorString (DWORD wError, LPSTR lpstrBuffer,
  1048.     UINT uLength);
  1049. BOOL WINAPI mciSetYieldProc (UINT uDeviceID, YIELDPROC fpYieldProc,
  1050.     DWORD dwYieldData);
  1051.  
  1052. #if defined(WINVER) && (WINVER >= 0x030a)
  1053. HTASK WINAPI mciGetCreatorTask(UINT uDeviceID);
  1054. YIELDPROC WINAPI mciGetYieldProc (UINT uDeviceID, DWORD FAR* lpdwYieldData);
  1055. #endif  /* WINVER >= 0x030a */
  1056.  
  1057. /* If included with the 3.0 windows.h */
  1058. #if !defined(WINVER) || (WINVER < 0x030a)
  1059. BOOL WINAPI mciExecute (LPCSTR lpstrCommand);
  1060. #endif  /* WIN3.0 */
  1061.  
  1062. /* MCI error return values */
  1063. #define MCIERR_INVALID_DEVICE_ID        (MCIERR_BASE + 1)
  1064. #define MCIERR_UNRECOGNIZED_KEYWORD     (MCIERR_BASE + 3)
  1065. #define MCIERR_UNRECOGNIZED_COMMAND     (MCIERR_BASE + 5)
  1066. #define MCIERR_HARDWARE                 (MCIERR_BASE + 6)
  1067. #define MCIERR_INVALID_DEVICE_NAME      (MCIERR_BASE + 7)
  1068. #define MCIERR_OUT_OF_MEMORY            (MCIERR_BASE + 8)
  1069. #define MCIERR_DEVICE_OPEN              (MCIERR_BASE + 9)
  1070. #define MCIERR_CANNOT_LOAD_DRIVER       (MCIERR_BASE + 10)
  1071. #define MCIERR_MISSING_COMMAND_STRING   (MCIERR_BASE + 11)
  1072. #define MCIERR_PARAM_OVERFLOW           (MCIERR_BASE + 12)
  1073. #define MCIERR_MISSING_STRING_ARGUMENT  (MCIERR_BASE + 13)
  1074. #define MCIERR_BAD_INTEGER              (MCIERR_BASE + 14)
  1075. #define MCIERR_PARSER_INTERNAL          (MCIERR_BASE + 15)
  1076. #define MCIERR_DRIVER_INTERNAL          (MCIERR_BASE + 16)
  1077. #define MCIERR_MISSING_PARAMETER        (MCIERR_BASE + 17)
  1078. #define MCIERR_UNSUPPORTED_FUNCTION     (MCIERR_BASE + 18)
  1079. #define MCIERR_FILE_NOT_FOUND           (MCIERR_BASE + 19)
  1080. #define MCIERR_DEVICE_NOT_READY         (MCIERR_BASE + 20)
  1081. #define MCIERR_INTERNAL                 (MCIERR_BASE + 21)
  1082. #define MCIERR_DRIVER                   (MCIERR_BASE + 22)
  1083. #define MCIERR_CANNOT_USE_ALL           (MCIERR_BASE + 23)
  1084. #define MCIERR_MULTIPLE                 (MCIERR_BASE + 24)
  1085. #define MCIERR_EXTENSION_NOT_FOUND      (MCIERR_BASE + 25)
  1086. #define MCIERR_OUTOFRANGE               (MCIERR_BASE + 26)
  1087. #define MCIERR_FLAGS_NOT_COMPATIBLE     (MCIERR_BASE + 28)
  1088. #define MCIERR_FILE_NOT_SAVED           (MCIERR_BASE + 30)
  1089. #define MCIERR_DEVICE_TYPE_REQUIRED     (MCIERR_BASE + 31)
  1090. #define MCIERR_DEVICE_LOCKED            (MCIERR_BASE + 32)
  1091. #define MCIERR_DUPLICATE_ALIAS          (MCIERR_BASE + 33)
  1092. #define MCIERR_BAD_CONSTANT             (MCIERR_BASE + 34)
  1093. #define MCIERR_MUST_USE_SHAREABLE       (MCIERR_BASE + 35)
  1094. #define MCIERR_MISSING_DEVICE_NAME      (MCIERR_BASE + 36)
  1095. #define MCIERR_BAD_TIME_FORMAT          (MCIERR_BASE + 37)
  1096. #define MCIERR_NO_CLOSING_QUOTE         (MCIERR_BASE + 38)
  1097. #define MCIERR_DUPLICATE_FLAGS          (MCIERR_BASE + 39)
  1098. #define MCIERR_INVALID_FILE             (MCIERR_BASE + 40)
  1099. #define MCIERR_NULL_PARAMETER_BLOCK     (MCIERR_BASE + 41)
  1100. #define MCIERR_UNNAMED_RESOURCE         (MCIERR_BASE + 42)
  1101. #define MCIERR_NEW_REQUIRES_ALIAS       (MCIERR_BASE + 43)
  1102. #define MCIERR_NOTIFY_ON_AUTO_OPEN      (MCIERR_BASE + 44)
  1103. #define MCIERR_NO_ELEMENT_ALLOWED       (MCIERR_BASE + 45)
  1104. #define MCIERR_NONAPPLICABLE_FUNCTION   (MCIERR_BASE + 46)
  1105. #define MCIERR_ILLEGAL_FOR_AUTO_OPEN    (MCIERR_BASE + 47)
  1106. #define MCIERR_FILENAME_REQUIRED        (MCIERR_BASE + 48)
  1107. #define MCIERR_EXTRA_CHARACTERS         (MCIERR_BASE + 49)
  1108. #define MCIERR_DEVICE_NOT_INSTALLED     (MCIERR_BASE + 50)
  1109. #define MCIERR_GET_CD                   (MCIERR_BASE + 51)
  1110. #define MCIERR_SET_CD                   (MCIERR_BASE + 52)
  1111. #define MCIERR_SET_DRIVE                (MCIERR_BASE + 53)
  1112. #define MCIERR_DEVICE_LENGTH            (MCIERR_BASE + 54)
  1113. #define MCIERR_DEVICE_ORD_LENGTH        (MCIERR_BASE + 55)
  1114. #define MCIERR_NO_INTEGER               (MCIERR_BASE + 56)
  1115.  
  1116. #define MCIERR_WAVE_OUTPUTSINUSE        (MCIERR_BASE + 64)
  1117. #define MCIERR_WAVE_SETOUTPUTINUSE      (MCIERR_BASE + 65)
  1118. #define MCIERR_WAVE_INPUTSINUSE         (MCIERR_BASE + 66)
  1119. #define MCIERR_WAVE_SETINPUTINUSE       (MCIERR_BASE + 67)
  1120. #define MCIERR_WAVE_OUTPUTUNSPECIFIED   (MCIERR_BASE + 68)
  1121. #define MCIERR_WAVE_INPUTUNSPECIFIED    (MCIERR_BASE + 69)
  1122. #define MCIERR_WAVE_OUTPUTSUNSUITABLE   (MCIERR_BASE + 70)
  1123. #define MCIERR_WAVE_SETOUTPUTUNSUITABLE (MCIERR_BASE + 71)
  1124. #define MCIERR_WAVE_INPUTSUNSUITABLE    (MCIERR_BASE + 72)
  1125. #define MCIERR_WAVE_SETINPUTUNSUITABLE  (MCIERR_BASE + 73)
  1126.  
  1127. #define MCIERR_SEQ_DIV_INCOMPATIBLE     (MCIERR_BASE + 80)
  1128. #define MCIERR_SEQ_PORT_INUSE           (MCIERR_BASE + 81)
  1129. #define MCIERR_SEQ_PORT_NONEXISTENT     (MCIERR_BASE + 82)
  1130. #define MCIERR_SEQ_PORT_MAPNODEVICE     (MCIERR_BASE + 83)
  1131. #define MCIERR_SEQ_PORT_MISCERROR       (MCIERR_BASE + 84)
  1132. #define MCIERR_SEQ_TIMER                (MCIERR_BASE + 85)
  1133. #define MCIERR_SEQ_PORTUNSPECIFIED      (MCIERR_BASE + 86)
  1134. #define MCIERR_SEQ_NOMIDIPRESENT        (MCIERR_BASE + 87)
  1135.  
  1136. #define MCIERR_NO_WINDOW                (MCIERR_BASE + 90)
  1137. #define MCIERR_CREATEWINDOW             (MCIERR_BASE + 91)
  1138. #define MCIERR_FILE_READ                (MCIERR_BASE + 92)
  1139. #define MCIERR_FILE_WRITE               (MCIERR_BASE + 93)
  1140.  
  1141. /* all custom device driver errors must be >= than this value */
  1142. #define MCIERR_CUSTOM_DRIVER_BASE       (MCIERR_BASE + 256)
  1143.  
  1144. /* MCI command message identifiers */
  1145. #define MCI_OPEN                        0x0803
  1146. #define MCI_CLOSE                       0x0804
  1147. #define MCI_ESCAPE                      0x0805
  1148. #define MCI_PLAY                        0x0806
  1149. #define MCI_SEEK                        0x0807
  1150. #define MCI_STOP                        0x0808
  1151. #define MCI_PAUSE                       0x0809
  1152. #define MCI_INFO                        0x080A
  1153. #define MCI_GETDEVCAPS                  0x080B
  1154. #define MCI_SPIN                        0x080C
  1155. #define MCI_SET                         0x080D
  1156. #define MCI_STEP                        0x080E
  1157. #define MCI_RECORD                      0x080F
  1158. #define MCI_SYSINFO                     0x0810
  1159. #define MCI_BREAK                       0x0811
  1160. #define MCI_SOUND                       0x0812
  1161. #define MCI_SAVE                        0x0813
  1162. #define MCI_STATUS                      0x0814
  1163. #define MCI_CUE                         0x0830
  1164. #define MCI_REALIZE                     0x0840
  1165. #define MCI_WINDOW                      0x0841
  1166. #define MCI_PUT                         0x0842
  1167. #define MCI_WHERE                       0x0843
  1168. #define MCI_FREEZE                      0x0844
  1169. #define MCI_UNFREEZE                    0x0845
  1170. #define MCI_LOAD                        0x0850
  1171. #define MCI_CUT                         0x0851
  1172. #define MCI_COPY                        0x0852
  1173. #define MCI_PASTE                       0x0853
  1174. #define MCI_UPDATE                      0x0854
  1175. #define MCI_RESUME                      0x0855
  1176. #define MCI_DELETE                      0x0856
  1177.  
  1178. /* all custom MCI command messages must be >= than this value */
  1179. #define MCI_USER_MESSAGES               (0x400 + DRV_MCI_FIRST)
  1180.  
  1181.  
  1182. /* device ID for "all devices" */
  1183. #define MCI_ALL_DEVICE_ID               0xFFFF
  1184.  
  1185. /* constants for predefined MCI device types */
  1186. #define MCI_DEVTYPE_VCR                 (MCI_STRING_OFFSET + 1)
  1187. #define MCI_DEVTYPE_VIDEODISC           (MCI_STRING_OFFSET + 2)
  1188. #define MCI_DEVTYPE_OVERLAY             (MCI_STRING_OFFSET + 3)
  1189. #define MCI_DEVTYPE_CD_AUDIO            (MCI_STRING_OFFSET + 4)
  1190. #define MCI_DEVTYPE_DAT                 (MCI_STRING_OFFSET + 5)
  1191. #define MCI_DEVTYPE_SCANNER             (MCI_STRING_OFFSET + 6)
  1192. #define MCI_DEVTYPE_ANIMATION           (MCI_STRING_OFFSET + 7)
  1193. #define MCI_DEVTYPE_DIGITAL_VIDEO       (MCI_STRING_OFFSET + 8)
  1194. #define MCI_DEVTYPE_OTHER               (MCI_STRING_OFFSET + 9)
  1195. #define MCI_DEVTYPE_WAVEFORM_AUDIO      (MCI_STRING_OFFSET + 10)
  1196. #define MCI_DEVTYPE_SEQUENCER           (MCI_STRING_OFFSET + 11)
  1197.  
  1198. #define MCI_DEVTYPE_FIRST               MCI_DEVTYPE_VCR
  1199. #define MCI_DEVTYPE_LAST                MCI_DEVTYPE_SEQUENCER
  1200.  
  1201. /* return values for 'status mode' command */
  1202. #define MCI_MODE_NOT_READY              (MCI_STRING_OFFSET + 12)
  1203. #define MCI_MODE_STOP                   (MCI_STRING_OFFSET + 13)
  1204. #define MCI_MODE_PLAY                   (MCI_STRING_OFFSET + 14)
  1205. #define MCI_MODE_RECORD                 (MCI_STRING_OFFSET + 15)
  1206. #define MCI_MODE_SEEK                   (MCI_STRING_OFFSET + 16)
  1207. #define MCI_MODE_PAUSE                  (MCI_STRING_OFFSET + 17)
  1208. #define MCI_MODE_OPEN                   (MCI_STRING_OFFSET + 18)
  1209.  
  1210. /* constants used in 'set time format' and 'status time format' commands */
  1211. #define MCI_FORMAT_MILLISECONDS         0
  1212. #define MCI_FORMAT_HMS                  1
  1213. #define MCI_FORMAT_MSF                  2
  1214. #define MCI_FORMAT_FRAMES               3
  1215. #define MCI_FORMAT_SMPTE_24             4
  1216. #define MCI_FORMAT_SMPTE_25             5
  1217. #define MCI_FORMAT_SMPTE_30             6
  1218. #define MCI_FORMAT_SMPTE_30DROP         7
  1219. #define MCI_FORMAT_BYTES                8
  1220. #define MCI_FORMAT_SAMPLES              9
  1221. #define MCI_FORMAT_TMSF                 10
  1222.  
  1223. /* MCI time format conversion macros */
  1224. #define MCI_MSF_MINUTE(msf)             ((BYTE)(msf))
  1225. #define MCI_MSF_SECOND(msf)             ((BYTE)(((WORD)(msf)) >> 8))
  1226. #define MCI_MSF_FRAME(msf)              ((BYTE)((msf)>>16))
  1227.  
  1228. #define MCI_MAKE_MSF(m, s, f)           ((DWORD)(((BYTE)(m) | \
  1229.                                                   ((WORD)(s)<<8)) | \
  1230.                                                  (((DWORD)(BYTE)(f))<<16)))
  1231.  
  1232. #define MCI_TMSF_TRACK(tmsf)            ((BYTE)(tmsf))
  1233. #define MCI_TMSF_MINUTE(tmsf)           ((BYTE)(((WORD)(tmsf)) >> 8))
  1234. #define MCI_TMSF_SECOND(tmsf)           ((BYTE)((tmsf)>>16))
  1235. #define MCI_TMSF_FRAME(tmsf)            ((BYTE)((tmsf)>>24))
  1236.  
  1237. #define MCI_MAKE_TMSF(t, m, s, f)       ((DWORD)(((BYTE)(t) | \
  1238.                                                   ((WORD)(m)<<8)) | \
  1239.                                                  (((DWORD)(BYTE)(s) | \
  1240.                                                    ((WORD)(f)<<8))<<16)))
  1241.  
  1242. #define MCI_HMS_HOUR(hms)               ((BYTE)(hms))
  1243. #define MCI_HMS_MINUTE(hms)             ((BYTE)(((WORD)(hms)) >> 8))
  1244. #define MCI_HMS_SECOND(hms)             ((BYTE)((hms)>>16))
  1245.  
  1246. #define MCI_MAKE_HMS(h, m, s)           ((DWORD)(((BYTE)(h) | \
  1247.                                                   ((WORD)(m)<<8)) | \
  1248.                                                  (((DWORD)(BYTE)(s))<<16)))
  1249.  
  1250.  
  1251. /* flags for wParam of MM_MCINOTIFY message */
  1252. #define MCI_NOTIFY_SUCCESSFUL           0x0001
  1253. #define MCI_NOTIFY_SUPERSEDED           0x0002
  1254. #define MCI_NOTIFY_ABORTED              0x0004
  1255. #define MCI_NOTIFY_FAILURE              0x0008
  1256.  
  1257.  
  1258. /* common flags for dwFlags parameter of MCI command messages */
  1259. #define MCI_NOTIFY                      0x00000001L
  1260. #define MCI_WAIT                        0x00000002L
  1261. #define MCI_FROM                        0x00000004L
  1262. #define MCI_TO                          0x00000008L
  1263. #define MCI_TRACK                       0x00000010L
  1264.  
  1265. /* flags for dwFlags parameter of MCI_OPEN command message */
  1266. #define MCI_OPEN_SHAREABLE              0x00000100L
  1267. #define MCI_OPEN_ELEMENT                0x00000200L
  1268. #define MCI_OPEN_ALIAS                  0x00000400L
  1269. #define MCI_OPEN_ELEMENT_ID             0x00000800L
  1270. #define MCI_OPEN_TYPE_ID                0x00001000L
  1271. #define MCI_OPEN_TYPE                   0x00002000L
  1272.  
  1273. /* flags for dwFlags parameter of MCI_SEEK command message */
  1274. #define MCI_SEEK_TO_START               0x00000100L
  1275. #define MCI_SEEK_TO_END                 0x00000200L
  1276.  
  1277. /* flags for dwFlags parameter of MCI_STATUS command message */
  1278. #define MCI_STATUS_ITEM                 0x00000100L
  1279. #define MCI_STATUS_START                0x00000200L
  1280.  
  1281. /* flags for dwItem field of the MCI_STATUS_PARMS parameter block */
  1282. #define MCI_STATUS_LENGTH               0x00000001L
  1283. #define MCI_STATUS_POSITION             0x00000002L
  1284. #define MCI_STATUS_NUMBER_OF_TRACKS     0x00000003L
  1285. #define MCI_STATUS_MODE                 0x00000004L
  1286. #define MCI_STATUS_MEDIA_PRESENT        0x00000005L
  1287. #define MCI_STATUS_TIME_FORMAT          0x00000006L
  1288. #define MCI_STATUS_READY                0x00000007L
  1289. #define MCI_STATUS_CURRENT_TRACK        0x00000008L
  1290.  
  1291. /* flags for dwFlags parameter of MCI_INFO command message */
  1292. #define MCI_INFO_PRODUCT                0x00000100L
  1293. #define MCI_INFO_FILE                   0x00000200L
  1294.  
  1295. /* flags for dwFlags parameter of MCI_GETDEVCAPS command message */
  1296. #define MCI_GETDEVCAPS_ITEM             0x00000100L
  1297.  
  1298. /* flags for dwItem field of the MCI_GETDEVCAPS_PARMS parameter block */
  1299. #define MCI_GETDEVCAPS_CAN_RECORD       0x00000001L
  1300. #define MCI_GETDEVCAPS_HAS_AUDIO        0x00000002L
  1301. #define MCI_GETDEVCAPS_HAS_VIDEO        0x00000003L
  1302. #define MCI_GETDEVCAPS_DEVICE_TYPE      0x00000004L
  1303. #define MCI_GETDEVCAPS_USES_FILES       0x00000005L
  1304. #define MCI_GETDEVCAPS_COMPOUND_DEVICE  0x00000006L
  1305. #define MCI_GETDEVCAPS_CAN_EJECT        0x00000007L
  1306. #define MCI_GETDEVCAPS_CAN_PLAY         0x00000008L
  1307. #define MCI_GETDEVCAPS_CAN_SAVE         0x00000009L
  1308.  
  1309. /* flags for dwFlags parameter of MCI_SYSINFO command message */
  1310. #define MCI_SYSINFO_QUANTITY            0x00000100L
  1311. #define MCI_SYSINFO_OPEN                0x00000200L
  1312. #define MCI_SYSINFO_NAME                0x00000400L
  1313. #define MCI_SYSINFO_INSTALLNAME         0x00000800L
  1314.  
  1315. /* flags for dwFlags parameter of MCI_SET command message */
  1316. #define MCI_SET_DOOR_OPEN               0x00000100L
  1317. #define MCI_SET_DOOR_CLOSED             0x00000200L
  1318. #define MCI_SET_TIME_FORMAT             0x00000400L
  1319. #define MCI_SET_AUDIO                   0x00000800L
  1320. #define MCI_SET_VIDEO                   0x00001000L
  1321. #define MCI_SET_ON                      0x00002000L
  1322. #define MCI_SET_OFF                     0x00004000L
  1323.  
  1324. /* flags for dwAudio field of MCI_SET_PARMS or MCI_SEQ_SET_PARMS */
  1325. #define MCI_SET_AUDIO_ALL               0x00000000L
  1326. #define MCI_SET_AUDIO_LEFT              0x00000001L
  1327. #define MCI_SET_AUDIO_RIGHT             0x00000002L
  1328.  
  1329. /* flags for dwFlags parameter of MCI_BREAK command message */
  1330. #define MCI_BREAK_KEY                   0x00000100L
  1331. #define MCI_BREAK_HWND                  0x00000200L
  1332. #define MCI_BREAK_OFF                   0x00000400L
  1333.  
  1334. /* flags for dwFlags parameter of MCI_RECORD command message */
  1335. #define MCI_RECORD_INSERT               0x00000100L
  1336. #define MCI_RECORD_OVERWRITE            0x00000200L
  1337.  
  1338. /* flags for dwFlags parameter of MCI_SOUND command message */
  1339. #define MCI_SOUND_NAME                  0x00000100L
  1340.  
  1341. /* flags for dwFlags parameter of MCI_SAVE command message */
  1342. #define MCI_SAVE_FILE                   0x00000100L
  1343.  
  1344. /* flags for dwFlags parameter of MCI_LOAD command message */
  1345. #define MCI_LOAD_FILE                   0x00000100L
  1346.  
  1347. /* generic parameter block for MCI command messages with no special parameters */
  1348. typedef struct tagMCI_GENERIC_PARMS {
  1349.     DWORD   dwCallback;
  1350. } MCI_GENERIC_PARMS;
  1351. typedef MCI_GENERIC_PARMS FAR *LPMCI_GENERIC_PARMS;
  1352.  
  1353. /* parameter block for MCI_OPEN command message */
  1354. typedef struct tagMCI_OPEN_PARMS {
  1355.     DWORD   dwCallback;
  1356.     UINT    wDeviceID;
  1357.     UINT    wReserved0;
  1358.     LPCSTR  lpstrDeviceType;
  1359.     LPCSTR  lpstrElementName;
  1360.     LPCSTR  lpstrAlias;
  1361. } MCI_OPEN_PARMS;
  1362. typedef MCI_OPEN_PARMS FAR *LPMCI_OPEN_PARMS;
  1363.  
  1364. /* parameter block for MCI_PLAY command message */
  1365. typedef struct tagMCI_PLAY_PARMS {
  1366.     DWORD   dwCallback;
  1367.     DWORD   dwFrom;
  1368.     DWORD   dwTo;
  1369. } MCI_PLAY_PARMS;
  1370. typedef MCI_PLAY_PARMS FAR *LPMCI_PLAY_PARMS;
  1371.  
  1372. /* parameter block for MCI_SEEK command message */
  1373. typedef struct tagMCI_SEEK_PARMS {
  1374.     DWORD   dwCallback;
  1375.     DWORD   dwTo;
  1376. } MCI_SEEK_PARMS;
  1377. typedef MCI_SEEK_PARMS FAR *LPMCI_SEEK_PARMS;
  1378.  
  1379. /* parameter block for MCI_STATUS command message */
  1380. typedef struct tagMCI_STATUS_PARMS {
  1381.     DWORD   dwCallback;
  1382.     DWORD   dwReturn;
  1383.     DWORD   dwItem;
  1384.     DWORD   dwTrack;
  1385. } MCI_STATUS_PARMS;
  1386. typedef MCI_STATUS_PARMS FAR * LPMCI_STATUS_PARMS;
  1387.  
  1388. /* parameter block for MCI_INFO command message */
  1389. typedef struct tagMCI_INFO_PARMS {
  1390.     DWORD   dwCallback;
  1391.     LPSTR   lpstrReturn;
  1392.     DWORD   dwRetSize;
  1393. } MCI_INFO_PARMS;
  1394. typedef MCI_INFO_PARMS FAR * LPMCI_INFO_PARMS;
  1395.  
  1396. /* parameter block for MCI_GETDEVCAPS command message */
  1397. typedef struct tagMCI_GETDEVCAPS_PARMS {
  1398.     DWORD   dwCallback;
  1399.     DWORD   dwReturn;
  1400.     DWORD   dwItem;
  1401. } MCI_GETDEVCAPS_PARMS;
  1402. typedef MCI_GETDEVCAPS_PARMS FAR * LPMCI_GETDEVCAPS_PARMS;
  1403.  
  1404. /* parameter block for MCI_SYSINFO command message */
  1405. typedef struct tagMCI_SYSINFO_PARMS {
  1406.     DWORD   dwCallback;
  1407.     LPSTR   lpstrReturn;
  1408.     DWORD   dwRetSize;
  1409.     DWORD   dwNumber;
  1410.     UINT    wDeviceType;
  1411.     UINT    wReserved0;
  1412. } MCI_SYSINFO_PARMS;
  1413. typedef MCI_SYSINFO_PARMS FAR * LPMCI_SYSINFO_PARMS;
  1414.  
  1415. /* parameter block for MCI_SET command message */
  1416. typedef struct tagMCI_SET_PARMS {
  1417.     DWORD   dwCallback;
  1418.     DWORD   dwTimeFormat;
  1419.     DWORD   dwAudio;
  1420. } MCI_SET_PARMS;
  1421. typedef MCI_SET_PARMS FAR *LPMCI_SET_PARMS;
  1422.  
  1423. /* parameter block for MCI_BREAK command message */
  1424. typedef struct tagMCI_BREAK_PARMS {
  1425.     DWORD   dwCallback;
  1426.     int     nVirtKey;
  1427.     UINT    wReserved0;
  1428.     HWND    hwndBreak;
  1429.     UINT    wReserved1;
  1430. } MCI_BREAK_PARMS;
  1431. typedef MCI_BREAK_PARMS FAR * LPMCI_BREAK_PARMS;
  1432.  
  1433. /* parameter block for MCI_SOUND command message */
  1434. typedef struct tagMCI_SOUND_PARMS {
  1435.     DWORD   dwCallback;
  1436.     LPCSTR  lpstrSoundName;
  1437. } MCI_SOUND_PARMS;
  1438. typedef MCI_SOUND_PARMS FAR * LPMCI_SOUND_PARMS;
  1439.  
  1440. /* parameter block for MCI_SAVE command message */
  1441. typedef struct tagMCI_SAVE_PARMS {
  1442.     DWORD   dwCallback;
  1443.     LPCSTR  lpfilename;
  1444. } MCI_SAVE_PARMS;
  1445. typedef MCI_SAVE_PARMS FAR * LPMCI_SAVE_PARMS;
  1446.  
  1447. /* parameter block for MCI_LOAD command message */
  1448. typedef struct tagMCI_LOAD_PARMS {
  1449.     DWORD   dwCallback;
  1450.     LPCSTR  lpfilename;
  1451. } MCI_LOAD_PARMS;
  1452. typedef MCI_LOAD_PARMS FAR * LPMCI_LOAD_PARMS;
  1453.  
  1454. /* parameter block for MCI_RECORD command message */
  1455. typedef struct tagMCI_RECORD_PARMS {
  1456.     DWORD   dwCallback;
  1457.     DWORD   dwFrom;
  1458.     DWORD   dwTo;
  1459. } MCI_RECORD_PARMS;
  1460. typedef MCI_RECORD_PARMS FAR *LPMCI_RECORD_PARMS;
  1461.  
  1462.  
  1463. /* MCI extensions for videodisc devices */
  1464.  
  1465. /* flag for dwReturn field of MCI_STATUS_PARMS */
  1466. /* MCI_STATUS command, (dwItem == MCI_STATUS_MODE) */
  1467. #define MCI_VD_MODE_PARK                (MCI_VD_OFFSET + 1)
  1468.  
  1469. /* flag for dwReturn field of MCI_STATUS_PARMS */
  1470. /* MCI_STATUS command, (dwItem == MCI_VD_STATUS_MEDIA_TYPE) */
  1471. #define MCI_VD_MEDIA_CLV                (MCI_VD_OFFSET + 2)
  1472. #define MCI_VD_MEDIA_CAV                (MCI_VD_OFFSET + 3)
  1473. #define MCI_VD_MEDIA_OTHER              (MCI_VD_OFFSET + 4)
  1474.  
  1475. #define MCI_VD_FORMAT_TRACK             0x4001
  1476.  
  1477. /* flags for dwFlags parameter of MCI_PLAY command message */
  1478. #define MCI_VD_PLAY_REVERSE             0x00010000L
  1479. #define MCI_VD_PLAY_FAST                0x00020000L
  1480. #define MCI_VD_PLAY_SPEED               0x00040000L
  1481. #define MCI_VD_PLAY_SCAN                0x00080000L
  1482. #define MCI_VD_PLAY_SLOW                0x00100000L
  1483.  
  1484. /* flag for dwFlags parameter of MCI_SEEK command message */
  1485. #define MCI_VD_SEEK_REVERSE             0x00010000L
  1486.  
  1487. /* flags for dwItem field of MCI_STATUS_PARMS parameter block */
  1488. #define MCI_VD_STATUS_SPEED             0x00004002L
  1489. #define MCI_VD_STATUS_FORWARD           0x00004003L
  1490. #define MCI_VD_STATUS_MEDIA_TYPE        0x00004004L
  1491. #define MCI_VD_STATUS_SIDE              0x00004005L
  1492. #define MCI_VD_STATUS_DISC_SIZE         0x00004006L
  1493.  
  1494. /* flags for dwFlags parameter of MCI_GETDEVCAPS command message */
  1495. #define MCI_VD_GETDEVCAPS_CLV           0x00010000L
  1496. #define MCI_VD_GETDEVCAPS_CAV           0x00020000L
  1497.  
  1498. #define MCI_VD_SPIN_UP                  0x00010000L
  1499. #define MCI_VD_SPIN_DOWN                0x00020000L
  1500.  
  1501. /* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
  1502. #define MCI_VD_GETDEVCAPS_CAN_REVERSE   0x00004002L
  1503. #define MCI_VD_GETDEVCAPS_FAST_RATE     0x00004003L
  1504. #define MCI_VD_GETDEVCAPS_SLOW_RATE     0x00004004L
  1505. #define MCI_VD_GETDEVCAPS_NORMAL_RATE   0x00004005L
  1506.  
  1507. /* flags for the dwFlags parameter of MCI_STEP command message */
  1508. #define MCI_VD_STEP_FRAMES              0x00010000L
  1509. #define MCI_VD_STEP_REVERSE             0x00020000L
  1510.  
  1511. /* flag for the MCI_ESCAPE command message */
  1512. #define MCI_VD_ESCAPE_STRING            0x00000100L
  1513.  
  1514. /* parameter block for MCI_PLAY command message */
  1515. typedef struct tagMCI_VD_PLAY_PARMS {
  1516.     DWORD   dwCallback;
  1517.     DWORD   dwFrom;
  1518.     DWORD   dwTo;
  1519.     DWORD   dwSpeed;
  1520.     } MCI_VD_PLAY_PARMS;
  1521. typedef MCI_VD_PLAY_PARMS FAR *LPMCI_VD_PLAY_PARMS;
  1522.  
  1523. /* parameter block for MCI_STEP command message */
  1524. typedef struct tagMCI_VD_STEP_PARMS {
  1525.     DWORD   dwCallback;
  1526.     DWORD   dwFrames;
  1527. } MCI_VD_STEP_PARMS;
  1528. typedef MCI_VD_STEP_PARMS FAR *LPMCI_VD_STEP_PARMS;
  1529.  
  1530. /* parameter block for MCI_ESCAPE command message */
  1531. typedef struct tagMCI_VD_ESCAPE_PARMS {
  1532.     DWORD   dwCallback;
  1533.     LPCSTR  lpstrCommand;
  1534. } MCI_VD_ESCAPE_PARMS;
  1535. typedef MCI_VD_ESCAPE_PARMS FAR *LPMCI_VD_ESCAPE_PARMS;
  1536.  
  1537.  
  1538. /* MCI extensions for waveform audio devices */
  1539.  
  1540. /* flags for the dwFlags parameter of MCI_OPEN command message */
  1541. #define MCI_WAVE_OPEN_BUFFER            0x00010000L
  1542.  
  1543. /* flags for the dwFlags parameter of MCI_SET command message */
  1544. #define MCI_WAVE_SET_FORMATTAG          0x00010000L
  1545. #define MCI_WAVE_SET_CHANNELS           0x00020000L
  1546. #define MCI_WAVE_SET_SAMPLESPERSEC      0x00040000L
  1547. #define MCI_WAVE_SET_AVGBYTESPERSEC     0x00080000L
  1548. #define MCI_WAVE_SET_BLOCKALIGN         0x00100000L
  1549. #define MCI_WAVE_SET_BITSPERSAMPLE      0x00200000L
  1550.  
  1551. /* flags for the dwFlags parameter of MCI_STATUS, MCI_SET command messages */
  1552. #define MCI_WAVE_INPUT                  0x00400000L
  1553. #define MCI_WAVE_OUTPUT                 0x00800000L
  1554.  
  1555. /* flags for the dwItem field of MCI_STATUS_PARMS parameter block */
  1556. #define MCI_WAVE_STATUS_FORMATTAG       0x00004001L
  1557. #define MCI_WAVE_STATUS_CHANNELS        0x00004002L
  1558. #define MCI_WAVE_STATUS_SAMPLESPERSEC   0x00004003L
  1559. #define MCI_WAVE_STATUS_AVGBYTESPERSEC  0x00004004L
  1560. #define MCI_WAVE_STATUS_BLOCKALIGN      0x00004005L
  1561. #define MCI_WAVE_STATUS_BITSPERSAMPLE   0x00004006L
  1562. #define MCI_WAVE_STATUS_LEVEL           0x00004007L
  1563.  
  1564. /* flags for the dwFlags parameter of MCI_SET command message */
  1565. #define MCI_WAVE_SET_ANYINPUT           0x04000000L
  1566. #define MCI_WAVE_SET_ANYOUTPUT          0x08000000L
  1567.  
  1568. /* flags for the dwFlags parameter of MCI_GETDEVCAPS command message */
  1569. #define MCI_WAVE_GETDEVCAPS_INPUTS      0x00004001L
  1570. #define MCI_WAVE_GETDEVCAPS_OUTPUTS     0x00004002L
  1571.  
  1572. /* parameter block for MCI_OPEN command message */
  1573. typedef struct tagMCI_WAVE_OPEN_PARMS {
  1574.     DWORD   dwCallback;
  1575.     UINT    wDeviceID;
  1576.     UINT    wReserved0;
  1577.     LPCSTR  lpstrDeviceType;
  1578.     LPCSTR  lpstrElementName;
  1579.     LPCSTR  lpstrAlias;
  1580.     DWORD   dwBufferSeconds;
  1581. } MCI_WAVE_OPEN_PARMS;
  1582. typedef MCI_WAVE_OPEN_PARMS FAR *LPMCI_WAVE_OPEN_PARMS;
  1583.  
  1584. /* parameter block for MCI_DELETE command message */
  1585. typedef struct tagMCI_WAVE_DELETE_PARMS {
  1586.     DWORD   dwCallback;
  1587.     DWORD   dwFrom;
  1588.     DWORD   dwTo;
  1589. } MCI_WAVE_DELETE_PARMS;
  1590. typedef MCI_WAVE_DELETE_PARMS FAR *LPMCI_WAVE_DELETE_PARMS;
  1591.  
  1592. /* parameter block for MCI_SET command message */
  1593. typedef struct tagMCI_WAVE_SET_PARMS {
  1594.     DWORD   dwCallback;
  1595.     DWORD   dwTimeFormat;
  1596.     DWORD   dwAudio;
  1597.     UINT    wInput;
  1598.     UINT    wReserved0;
  1599.     UINT    wOutput;
  1600.     UINT    wReserved1;
  1601.     UINT    wFormatTag;
  1602.     UINT    wReserved2;
  1603.     UINT    nChannels;
  1604.     UINT    wReserved3;
  1605.     DWORD   nSamplesPerSec;
  1606.     DWORD   nAvgBytesPerSec;
  1607.     UINT    nBlockAlign;
  1608.     UINT    wReserved4;
  1609.     UINT    wBitsPerSample;
  1610.     UINT    wReserved5;
  1611. } MCI_WAVE_SET_PARMS;
  1612. typedef MCI_WAVE_SET_PARMS FAR * LPMCI_WAVE_SET_PARMS;
  1613.  
  1614.  
  1615. /* MCI extensions for MIDI sequencer devices */
  1616.  
  1617. /* flags for the dwReturn field of MCI_STATUS_PARMS parameter block */
  1618. /* MCI_STATUS command, (dwItem == MCI_SEQ_STATUS_DIVTYPE) */
  1619. #define     MCI_SEQ_DIV_PPQN            (0 + MCI_SEQ_OFFSET)
  1620. #define     MCI_SEQ_DIV_SMPTE_24        (1 + MCI_SEQ_OFFSET)
  1621. #define     MCI_SEQ_DIV_SMPTE_25        (2 + MCI_SEQ_OFFSET)
  1622. #define     MCI_SEQ_DIV_SMPTE_30DROP    (3 + MCI_SEQ_OFFSET)
  1623. #define     MCI_SEQ_DIV_SMPTE_30        (4 + MCI_SEQ_OFFSET)
  1624.  
  1625. /* flags for the dwMaster field of MCI_SEQ_SET_PARMS parameter block */
  1626. /* MCI_SET command, (dwFlags == MCI_SEQ_SET_MASTER) */
  1627. #define     MCI_SEQ_FORMAT_SONGPTR      0x4001
  1628. #define     MCI_SEQ_FILE                0x4002
  1629. #define     MCI_SEQ_MIDI                0x4003
  1630. #define     MCI_SEQ_SMPTE               0x4004
  1631. #define     MCI_SEQ_NONE                65533
  1632.  
  1633. /* flags for the dwItem field of MCI_STATUS_PARMS parameter block */
  1634. #define MCI_SEQ_STATUS_TEMPO            0x00004002L
  1635. #define MCI_SEQ_STATUS_PORT             0x00004003L
  1636. #define MCI_SEQ_STATUS_SLAVE            0x00004007L
  1637. #define MCI_SEQ_STATUS_MASTER           0x00004008L
  1638. #define MCI_SEQ_STATUS_OFFSET           0x00004009L
  1639. #define MCI_SEQ_STATUS_DIVTYPE          0x0000400AL
  1640.  
  1641. /* flags for the dwFlags parameter of MCI_SET command message */
  1642. #define MCI_SEQ_SET_TEMPO               0x00010000L
  1643. #define MCI_SEQ_SET_PORT                0x00020000L
  1644. #define MCI_SEQ_SET_SLAVE               0x00040000L
  1645. #define MCI_SEQ_SET_MASTER              0x00080000L
  1646. #define MCI_SEQ_SET_OFFSET              0x01000000L
  1647.  
  1648. /* parameter block for MCI_SET command message */
  1649. typedef struct tagMCI_SEQ_SET_PARMS {
  1650.     DWORD   dwCallback;
  1651.     DWORD   dwTimeFormat;
  1652.     DWORD   dwAudio;
  1653.     DWORD   dwTempo;
  1654.     DWORD   dwPort;
  1655.     DWORD   dwSlave;
  1656.     DWORD   dwMaster;
  1657.     DWORD   dwOffset;
  1658. } MCI_SEQ_SET_PARMS;
  1659. typedef MCI_SEQ_SET_PARMS FAR * LPMCI_SEQ_SET_PARMS;
  1660.  
  1661.  
  1662. /* MCI extensions for animation devices */
  1663.  
  1664. /* flags for dwFlags parameter of MCI_OPEN command message */
  1665. #define MCI_ANIM_OPEN_WS                0x00010000L
  1666. #define MCI_ANIM_OPEN_PARENT            0x00020000L
  1667. #define MCI_ANIM_OPEN_NOSTATIC          0x00040000L
  1668.  
  1669. /* flags for dwFlags parameter of MCI_PLAY command message */
  1670. #define MCI_ANIM_PLAY_SPEED             0x00010000L
  1671. #define MCI_ANIM_PLAY_REVERSE           0x00020000L
  1672. #define MCI_ANIM_PLAY_FAST              0x00040000L
  1673. #define MCI_ANIM_PLAY_SLOW              0x00080000L
  1674. #define MCI_ANIM_PLAY_SCAN              0x00100000L
  1675.  
  1676. /* flags for dwFlags parameter of MCI_STEP command message */
  1677. #define MCI_ANIM_STEP_REVERSE           0x00010000L
  1678. #define MCI_ANIM_STEP_FRAMES            0x00020000L
  1679.  
  1680. /* flags for dwItem field of MCI_STATUS_PARMS parameter block */
  1681. #define MCI_ANIM_STATUS_SPEED           0x00004001L
  1682. #define MCI_ANIM_STATUS_FORWARD         0x00004002L
  1683. #define MCI_ANIM_STATUS_HWND            0x00004003L
  1684. #define MCI_ANIM_STATUS_HPAL            0x00004004L
  1685. #define MCI_ANIM_STATUS_STRETCH         0x00004005L
  1686.  
  1687. /* flags for the dwFlags parameter of MCI_INFO command message */
  1688. #define MCI_ANIM_INFO_TEXT              0x00010000L
  1689.  
  1690. /* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
  1691. #define MCI_ANIM_GETDEVCAPS_CAN_REVERSE 0x00004001L
  1692. #define MCI_ANIM_GETDEVCAPS_FAST_RATE   0x00004002L
  1693. #define MCI_ANIM_GETDEVCAPS_SLOW_RATE   0x00004003L
  1694. #define MCI_ANIM_GETDEVCAPS_NORMAL_RATE 0x00004004L
  1695. #define MCI_ANIM_GETDEVCAPS_PALETTES    0x00004006L
  1696. #define MCI_ANIM_GETDEVCAPS_CAN_STRETCH 0x00004007L
  1697. #define MCI_ANIM_GETDEVCAPS_MAX_WINDOWS 0x00004008L
  1698.  
  1699. /* flags for the MCI_REALIZE command message */
  1700. #define MCI_ANIM_REALIZE_NORM           0x00010000L
  1701. #define MCI_ANIM_REALIZE_BKGD           0x00020000L
  1702.  
  1703. /* flags for dwFlags parameter of MCI_WINDOW command message */
  1704. #define MCI_ANIM_WINDOW_HWND            0x00010000L
  1705. #define MCI_ANIM_WINDOW_STATE           0x00040000L
  1706. #define MCI_ANIM_WINDOW_TEXT            0x00080000L
  1707. #define MCI_ANIM_WINDOW_ENABLE_STRETCH  0x00100000L
  1708. #define MCI_ANIM_WINDOW_DISABLE_STRETCH 0x00200000L
  1709.  
  1710. /* flags for hWnd field of MCI_ANIM_WINDOW_PARMS parameter block */
  1711. /* MCI_WINDOW command message, (dwFlags == MCI_ANIM_WINDOW_HWND) */
  1712. #define MCI_ANIM_WINDOW_DEFAULT         0x00000000L
  1713.  
  1714. /* flags for dwFlags parameter of MCI_PUT command message */
  1715. #define MCI_ANIM_RECT                   0x00010000L
  1716. #define MCI_ANIM_PUT_SOURCE             0x00020000L
  1717. #define MCI_ANIM_PUT_DESTINATION        0x00040000L
  1718.  
  1719. /* flags for dwFlags parameter of MCI_WHERE command message */
  1720. #define MCI_ANIM_WHERE_SOURCE           0x00020000L
  1721. #define MCI_ANIM_WHERE_DESTINATION      0x00040000L
  1722.  
  1723. /* flags for dwFlags parameter of MCI_UPDATE command message */
  1724. #define MCI_ANIM_UPDATE_HDC             0x00020000L
  1725.  
  1726. /* parameter block for MCI_OPEN command message */
  1727. typedef struct tagMCI_ANIM_OPEN_PARMS {
  1728.     DWORD   dwCallback;
  1729.     UINT    wDeviceID;
  1730.     UINT    wReserved0;
  1731.     LPCSTR  lpstrDeviceType;
  1732.     LPCSTR  lpstrElementName;
  1733.     LPCSTR  lpstrAlias;
  1734.     DWORD   dwStyle;
  1735.     HWND    hWndParent;
  1736.     UINT    wReserved1;
  1737. } MCI_ANIM_OPEN_PARMS;
  1738. typedef MCI_ANIM_OPEN_PARMS FAR *LPMCI_ANIM_OPEN_PARMS;
  1739.  
  1740. /* parameter block for MCI_PLAY command message */
  1741. typedef struct tagMCI_ANIM_PLAY_PARMS {
  1742.     DWORD   dwCallback;
  1743.     DWORD   dwFrom;
  1744.     DWORD   dwTo;
  1745.     DWORD   dwSpeed;
  1746. } MCI_ANIM_PLAY_PARMS;
  1747. typedef MCI_ANIM_PLAY_PARMS FAR *LPMCI_ANIM_PLAY_PARMS;
  1748.  
  1749. /* parameter block for MCI_STEP command message */
  1750. typedef struct tagMCI_ANIM_STEP_PARMS {
  1751.     DWORD   dwCallback;
  1752.     DWORD   dwFrames;
  1753. } MCI_ANIM_STEP_PARMS;
  1754. typedef MCI_ANIM_STEP_PARMS FAR *LPMCI_ANIM_STEP_PARMS;
  1755.  
  1756. /* parameter block for MCI_WINDOW command message */
  1757. typedef struct tagMCI_ANIM_WINDOW_PARMS {
  1758.     DWORD   dwCallback;
  1759.     HWND    hWnd;
  1760.     UINT    wReserved1;
  1761.     UINT    nCmdShow;
  1762.     UINT    wReserved2;
  1763.     LPCSTR  lpstrText;
  1764. } MCI_ANIM_WINDOW_PARMS;
  1765. typedef MCI_ANIM_WINDOW_PARMS FAR * LPMCI_ANIM_WINDOW_PARMS;
  1766.  
  1767. /* parameter block for MCI_PUT, MCI_UPDATE, MCI_WHERE command messages */
  1768. typedef struct tagMCI_ANIM_RECT_PARMS {
  1769.     DWORD   dwCallback;
  1770. #ifdef MCI_USE_OFFEXT
  1771.     POINT   ptOffset;
  1772.     POINT   ptExtent;
  1773. #else   /* ifdef MCI_USE_OFFEXT */
  1774.     RECT    rc;
  1775. #endif  /* ifdef MCI_USE_OFFEXT */
  1776. } MCI_ANIM_RECT_PARMS;
  1777. typedef MCI_ANIM_RECT_PARMS FAR * LPMCI_ANIM_RECT_PARMS;
  1778.  
  1779. /* parameter block for MCI_UPDATE PARMS */
  1780. typedef struct tagMCI_ANIM_UPDATE_PARMS {
  1781.     DWORD   dwCallback;
  1782.     RECT    rc;
  1783.     HDC     hDC;
  1784. } MCI_ANIM_UPDATE_PARMS;
  1785. typedef MCI_ANIM_UPDATE_PARMS FAR * LPMCI_ANIM_UPDATE_PARMS;
  1786.  
  1787.  
  1788. /* MCI extensions for video overlay devices */
  1789.  
  1790. /* flags for dwFlags parameter of MCI_OPEN command message */
  1791. #define MCI_OVLY_OPEN_WS                0x00010000L
  1792. #define MCI_OVLY_OPEN_PARENT            0x00020000L
  1793.  
  1794. /* flags for dwFlags parameter of MCI_STATUS command message */
  1795. #define MCI_OVLY_STATUS_HWND            0x00004001L
  1796. #define MCI_OVLY_STATUS_STRETCH         0x00004002L
  1797.  
  1798. /* flags for dwFlags parameter of MCI_INFO command message */
  1799. #define MCI_OVLY_INFO_TEXT              0x00010000L
  1800.  
  1801. /* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
  1802. #define MCI_OVLY_GETDEVCAPS_CAN_STRETCH 0x00004001L
  1803. #define MCI_OVLY_GETDEVCAPS_CAN_FREEZE  0x00004002L
  1804. #define MCI_OVLY_GETDEVCAPS_MAX_WINDOWS 0x00004003L
  1805.  
  1806. /* flags for dwFlags parameter of MCI_WINDOW command message */
  1807. #define MCI_OVLY_WINDOW_HWND            0x00010000L
  1808. #define MCI_OVLY_WINDOW_STATE           0x00040000L
  1809. #define MCI_OVLY_WINDOW_TEXT            0x00080000L
  1810. #define MCI_OVLY_WINDOW_ENABLE_STRETCH  0x00100000L
  1811. #define MCI_OVLY_WINDOW_DISABLE_STRETCH 0x00200000L
  1812.  
  1813. /* flags for hWnd parameter of MCI_OVLY_WINDOW_PARMS parameter block */
  1814. #define MCI_OVLY_WINDOW_DEFAULT         0x00000000L
  1815.  
  1816. /* flags for dwFlags parameter of MCI_PUT command message */
  1817. #define MCI_OVLY_RECT                   0x00010000L
  1818. #define MCI_OVLY_PUT_SOURCE             0x00020000L
  1819. #define MCI_OVLY_PUT_DESTINATION        0x00040000L
  1820. #define MCI_OVLY_PUT_FRAME              0x00080000L
  1821. #define MCI_OVLY_PUT_VIDEO              0x00100000L
  1822.  
  1823. /* flags for dwFlags parameter of MCI_WHERE command message */
  1824. #define MCI_OVLY_WHERE_SOURCE           0x00020000L
  1825. #define MCI_OVLY_WHERE_DESTINATION      0x00040000L
  1826. #define MCI_OVLY_WHERE_FRAME            0x00080000L
  1827. #define MCI_OVLY_WHERE_VIDEO            0x00100000L
  1828.  
  1829. /* parameter block for MCI_OPEN command message */
  1830. typedef struct tagMCI_OVLY_OPEN_PARMS {
  1831.     DWORD   dwCallback;
  1832.     UINT    wDeviceID;
  1833.     UINT    wReserved0;
  1834.     LPCSTR  lpstrDeviceType;
  1835.     LPCSTR  lpstrElementName;
  1836.     LPCSTR  lpstrAlias;
  1837.     DWORD   dwStyle;
  1838.     HWND    hWndParent;
  1839.     UINT    wReserved1;
  1840.  } MCI_OVLY_OPEN_PARMS;
  1841. typedef MCI_OVLY_OPEN_PARMS FAR *LPMCI_OVLY_OPEN_PARMS;
  1842.  
  1843. /* parameter block for MCI_WINDOW command message */
  1844. typedef struct tagMCI_OVLY_WINDOW_PARMS {
  1845.     DWORD   dwCallback;
  1846.     HWND    hWnd;
  1847.     UINT    wReserved1;
  1848.     UINT    nCmdShow;
  1849.     UINT    wReserved2;
  1850.     LPCSTR  lpstrText;
  1851. } MCI_OVLY_WINDOW_PARMS;
  1852. typedef MCI_OVLY_WINDOW_PARMS FAR * LPMCI_OVLY_WINDOW_PARMS;
  1853.  
  1854. /* parameter block for MCI_PUT, MCI_UPDATE, and MCI_WHERE command messages */
  1855. typedef struct tagMCI_OVLY_RECT_PARMS {
  1856.     DWORD   dwCallback;
  1857. #ifdef MCI_USE_OFFEXT
  1858.     POINT   ptOffset;
  1859.     POINT   ptExtent;
  1860. #else   /* ifdef MCI_USE_OFFEXT */
  1861.     RECT    rc;
  1862. #endif  /* ifdef MCI_USE_OFFEXT */
  1863. } MCI_OVLY_RECT_PARMS;
  1864. typedef MCI_OVLY_RECT_PARMS FAR * LPMCI_OVLY_RECT_PARMS;
  1865.  
  1866. /* parameter block for MCI_SAVE command message */
  1867. typedef struct tagMCI_OVLY_SAVE_PARMS {
  1868.     DWORD   dwCallback;
  1869.     LPCSTR  lpfilename;
  1870.     RECT    rc;
  1871. } MCI_OVLY_SAVE_PARMS;
  1872. typedef MCI_OVLY_SAVE_PARMS FAR * LPMCI_OVLY_SAVE_PARMS;
  1873.  
  1874. /* parameter block for MCI_LOAD command message */
  1875. typedef struct tagMCI_OVLY_LOAD_PARMS {
  1876.     DWORD   dwCallback;
  1877.     LPCSTR  lpfilename;
  1878.     RECT    rc;
  1879. } MCI_OVLY_LOAD_PARMS;
  1880. typedef MCI_OVLY_LOAD_PARMS FAR * LPMCI_OVLY_LOAD_PARMS;
  1881.  
  1882. #endif  /* ifndef MMNOMCI */
  1883.  
  1884. /****************************************************************************
  1885.  
  1886.                         DISPLAY Driver extensions
  1887.  
  1888. ****************************************************************************/
  1889.  
  1890. #ifndef C1_TRANSPARENT
  1891.     #define CAPS1           94          /* other caps */
  1892.     #define C1_TRANSPARENT  0x0001      /* new raster cap */
  1893.     #define NEWTRANSPARENT  3           /* use with SetBkMode() */
  1894.  
  1895.     #define QUERYROPSUPPORT 40          /* use to determine ROP support */
  1896. #endif  /* ifndef C1_TRANSPARENT */
  1897.  
  1898. /****************************************************************************
  1899.  
  1900.                         DIB Driver extensions
  1901.  
  1902. ****************************************************************************/
  1903.  
  1904. #define SELECTDIB       41                      /* DIB.DRV select dib escape */
  1905. #define DIBINDEX(n)     MAKELONG((n),0x10FF)
  1906.  
  1907.  
  1908. /****************************************************************************
  1909.  
  1910.                         ScreenSaver support
  1911.  
  1912.     The current application will receive a syscommand of SC_SCREENSAVE just
  1913.     before the screen saver is invoked.  If the app wishes to prevent a
  1914.     screen save, return non-zero value, otherwise call DefWindowProc().
  1915.  
  1916. ****************************************************************************/
  1917.  
  1918. #ifndef SC_SCREENSAVE
  1919.  
  1920.     #define SC_SCREENSAVE   0xF140
  1921.  
  1922. #endif  /* ifndef SC_SCREENSAVE */
  1923.  
  1924.  
  1925. #ifdef __cplusplus
  1926. }                       /* End of extern "C" { */
  1927. #endif  /* __cplusplus */
  1928.  
  1929. #ifndef RC_INVOKED
  1930. #pragma option -a.      /* Revert to default packing */
  1931. #endif  /* RC_INVOKED */
  1932.  
  1933. #endif  /* __MMSYSTEM_H */
  1934.  
  1935.  
  1936. #else    /* defined __FLAT__ */
  1937. /*==========================================================================
  1938.  *
  1939.  *  mmsystem.h -- Include file for Multimedia API's
  1940.  *
  1941.  *  Version 4.00
  1942.  *
  1943.  *  Copyright (C) 1992-1995 Microsoft Corporation.  All Rights Reserved.
  1944.  *
  1945.  *--------------------------------------------------------------------------
  1946.  *
  1947.  *  Define:         Prevent inclusion of:
  1948.  *  --------------  --------------------------------------------------------
  1949.  *  MMNODRV         Installable driver support
  1950.  *  MMNOSOUND       Sound support
  1951.  *  MMNOWAVE        Waveform support
  1952.  *  MMNOMIDI        MIDI support
  1953.  *  MMNOAUX         Auxiliary audio support
  1954.  *  MMNOMIXER       Mixer support
  1955.  *  MMNOTIMER       Timer support
  1956.  *  MMNOJOY         Joystick support
  1957.  *  MMNOMCI         MCI support
  1958.  *  MMNOMMIO        Multimedia file I/O support
  1959.  *  MMNOMMSYSTEM    General MMSYSTEM functions
  1960.  *
  1961.  *==========================================================================
  1962.  */
  1963.  
  1964. #ifndef _INC_MMSYSTEM
  1965. #define _INC_MMSYSTEM   /* #defined if mmsystem.h has been included */
  1966.  
  1967. #ifdef _WIN32
  1968. #include <pshpack1.h>
  1969. #else
  1970. #ifndef RC_INVOKED
  1971. #pragma pack(1)
  1972. #endif
  1973. #endif
  1974.  
  1975. #ifdef __cplusplus
  1976. extern "C" {            /* Assume C declarations for C++ */
  1977. #endif  /* __cplusplus */
  1978.  
  1979. #ifdef _WIN32
  1980. #ifndef _WINMM_
  1981. #define    WINMMAPI    DECLSPEC_IMPORT
  1982. #else
  1983. #define    WINMMAPI
  1984. #endif
  1985. #define _loadds
  1986. #define _huge
  1987. #else
  1988. #define    WINMMAPI
  1989. #endif
  1990.  
  1991. #ifdef _WIN32_VXD
  1992.  
  1993. #define NEAR
  1994. #define FAR
  1995.  
  1996. #define DECLARE_HANDLE(x) typedef WORD x
  1997. #define WINAPI
  1998.  
  1999. typedef DWORD LPSTR;
  2000. typedef DWORD LPVOID;
  2001. typedef DWORD LPCSTR;
  2002. typedef DWORD LPCWSTR;
  2003. typedef DWORD LRESULT;
  2004. typedef DWORD LPARAM;
  2005. typedef DWORD WPARAM;
  2006.  
  2007. typedef short WCHAR;
  2008.  
  2009. #endif
  2010.  
  2011. /****************************************************************************
  2012.  
  2013.             General constants and data types
  2014.  
  2015. ****************************************************************************/
  2016.  
  2017. /* general constants */
  2018. #define MAXPNAMELEN      32     /* max product name length (including NULL) */
  2019. #define MAXERRORLENGTH   256    /* max error text length (including NULL) */
  2020. #define MAX_JOYSTICKOEMVXDNAME 260 /* max oem vxd name length (including NULL) */
  2021.  
  2022. /*
  2023.  *  Microsoft Manufacturer and Product ID's (these have been moved to
  2024.  *  MMREG.H for Windows 4.00 and above).
  2025.  */
  2026. #if (WINVER <= 0x030A)
  2027. #ifndef MM_MICROSOFT
  2028. #define MM_MICROSOFT            1   /* Microsoft Corporation */
  2029. #endif
  2030.  
  2031. #ifndef MM_MIDI_MAPPER
  2032. #define MM_MIDI_MAPPER          1   /* MIDI Mapper */
  2033. #define MM_WAVE_MAPPER          2   /* Wave Mapper */
  2034. #define MM_SNDBLST_MIDIOUT      3   /* Sound Blaster MIDI output port */
  2035. #define MM_SNDBLST_MIDIIN       4   /* Sound Blaster MIDI input port */
  2036. #define MM_SNDBLST_SYNTH        5   /* Sound Blaster internal synthesizer */
  2037. #define MM_SNDBLST_WAVEOUT      6   /* Sound Blaster waveform output */
  2038. #define MM_SNDBLST_WAVEIN       7   /* Sound Blaster waveform input */
  2039. #define MM_ADLIB                9   /* Ad Lib-compatible synthesizer */
  2040. #define MM_MPU401_MIDIOUT      10   /* MPU401-compatible MIDI output port */
  2041. #define MM_MPU401_MIDIIN       11   /* MPU401-compatible MIDI input port */
  2042. #define MM_PC_JOYSTICK         12   /* Joystick adapter */
  2043. #endif
  2044. #endif
  2045.  
  2046. /* general data types */
  2047.  
  2048. #ifdef _WIN32
  2049. typedef UINT        MMVERSION;  /* major (high byte), minor (low byte) */
  2050. #else
  2051. typedef UINT        VERSION;    /* major (high byte), minor (low byte) */
  2052. #endif
  2053. typedef UINT        MMRESULT;   /* error return code, 0 means no error */
  2054.                 /* call as if(err=xxxx(...)) Error(err); else */
  2055. #define _MMRESULT_
  2056.  
  2057. typedef UINT FAR   *LPUINT;
  2058.  
  2059. /* MMTIME data structure */
  2060. typedef struct mmtime_tag
  2061. {
  2062.     UINT            wType;      /* indicates the contents of the union */
  2063.     union
  2064.     {
  2065.     DWORD       ms;         /* milliseconds */
  2066.     DWORD       sample;     /* samples */
  2067.     DWORD       cb;         /* byte count */
  2068.     DWORD       ticks;      /* ticks in MIDI stream */
  2069.  
  2070.     /* SMPTE */
  2071.     struct
  2072.     {
  2073.         BYTE    hour;       /* hours */
  2074.         BYTE    min;        /* minutes */
  2075.         BYTE    sec;        /* seconds */
  2076.         BYTE    frame;      /* frames  */
  2077.         BYTE    fps;        /* frames per second */
  2078.         BYTE    dummy;      /* pad */
  2079. #ifdef _WIN32
  2080.         BYTE    pad[2];
  2081. #endif
  2082.     } smpte;
  2083.  
  2084.     /* MIDI */
  2085.     struct
  2086.     {
  2087.         DWORD songptrpos;   /* song pointer position */
  2088.     } midi;
  2089.     } u;
  2090. } MMTIME, *PMMTIME, NEAR *NPMMTIME, FAR *LPMMTIME;
  2091.  
  2092. /* types for wType field in MMTIME struct */
  2093. #define TIME_MS         0x0001  /* time in milliseconds */
  2094. #define TIME_SAMPLES    0x0002  /* number of wave samples */
  2095. #define TIME_BYTES      0x0004  /* current byte offset */
  2096. #define TIME_SMPTE      0x0008  /* SMPTE time */
  2097. #define TIME_MIDI       0x0010  /* MIDI time */
  2098. #define TIME_TICKS      0x0020  /* Ticks within MIDI stream */
  2099.  
  2100. /*
  2101.  *
  2102.  *
  2103.  */
  2104. #define MAKEFOURCC(ch0, ch1, ch2, ch3)                              \
  2105.         ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) |   \
  2106.         ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
  2107.  
  2108. /****************************************************************************
  2109.  
  2110.             Multimedia Extensions Window Messages
  2111.  
  2112. ****************************************************************************/
  2113.  
  2114. #define MM_JOY1MOVE         0x3A0           /* joystick */
  2115. #define MM_JOY2MOVE         0x3A1
  2116. #define MM_JOY1ZMOVE        0x3A2
  2117. #define MM_JOY2ZMOVE        0x3A3
  2118. #define MM_JOY1BUTTONDOWN   0x3B5
  2119. #define MM_JOY2BUTTONDOWN   0x3B6
  2120. #define MM_JOY1BUTTONUP     0x3B7
  2121. #define MM_JOY2BUTTONUP     0x3B8
  2122.  
  2123. #define MM_MCINOTIFY        0x3B9           /* MCI */
  2124.  
  2125. #define MM_WOM_OPEN         0x3BB           /* waveform output */
  2126. #define MM_WOM_CLOSE        0x3BC
  2127. #define MM_WOM_DONE         0x3BD
  2128.  
  2129. #define MM_WIM_OPEN         0x3BE           /* waveform input */
  2130. #define MM_WIM_CLOSE        0x3BF
  2131. #define MM_WIM_DATA         0x3C0
  2132.  
  2133. #define MM_MIM_OPEN         0x3C1           /* MIDI input */
  2134. #define MM_MIM_CLOSE        0x3C2
  2135. #define MM_MIM_DATA         0x3C3
  2136. #define MM_MIM_LONGDATA     0x3C4
  2137. #define MM_MIM_ERROR        0x3C5
  2138. #define MM_MIM_LONGERROR    0x3C6
  2139.  
  2140. #define MM_MOM_OPEN         0x3C7           /* MIDI output */
  2141. #define MM_MOM_CLOSE        0x3C8
  2142. #define MM_MOM_DONE         0x3C9
  2143.  
  2144. /* these are also in msvideo.h */
  2145. #ifndef MM_DRVM_OPEN
  2146.  #define MM_DRVM_OPEN       0x3D0           /* installable drivers */
  2147.  #define MM_DRVM_CLOSE      0x3D1
  2148.  #define MM_DRVM_DATA       0x3D2
  2149.  #define MM_DRVM_ERROR      0x3D3
  2150. #endif
  2151.  
  2152. /* these are used by msacm.h */
  2153. #define MM_STREAM_OPEN        0x3D4
  2154. #define MM_STREAM_CLOSE        0x3D5
  2155. #define MM_STREAM_DONE        0x3D6
  2156. #define MM_STREAM_ERROR        0x3D7
  2157.  
  2158. #if(WINVER >= 0x0400)
  2159. #define MM_MOM_POSITIONCB   0x3CA           /* Callback for MEVT_POSITIONCB */
  2160.  
  2161. #ifndef MM_MCISIGNAL
  2162.  #define MM_MCISIGNAL        0x3CB
  2163. #endif
  2164.  
  2165. #define MM_MIM_MOREDATA      0x3CC          /* MIM_DONE w/ pending events */
  2166.  
  2167. #endif /* WINVER >= 0x0400 */
  2168. #define MM_MIXM_LINE_CHANGE     0x3D0       /* mixer line change notify */
  2169. #define MM_MIXM_CONTROL_CHANGE  0x3D1       /* mixer control change notify */
  2170.  
  2171. /****************************************************************************
  2172.  
  2173.         String resource number bases (internal use)
  2174.  
  2175. ****************************************************************************/
  2176.  
  2177. #define MMSYSERR_BASE          0
  2178. #define WAVERR_BASE            32
  2179. #define MIDIERR_BASE           64
  2180. #define TIMERR_BASE            96
  2181. #define JOYERR_BASE            160
  2182. #define MCIERR_BASE            256
  2183. #define MIXERR_BASE            1024
  2184.  
  2185. #define MCI_STRING_OFFSET      512
  2186. #define MCI_VD_OFFSET          1024
  2187. #define MCI_CD_OFFSET          1088
  2188. #define MCI_WAVE_OFFSET        1152
  2189. #define MCI_SEQ_OFFSET         1216
  2190.  
  2191. /****************************************************************************
  2192.  
  2193.             General error return values
  2194.  
  2195. ****************************************************************************/
  2196.  
  2197. /* general error return values */
  2198. #define MMSYSERR_NOERROR      0                    /* no error */
  2199. #define MMSYSERR_ERROR        (MMSYSERR_BASE + 1)  /* unspecified error */
  2200. #define MMSYSERR_BADDEVICEID  (MMSYSERR_BASE + 2)  /* device ID out of range */
  2201. #define MMSYSERR_NOTENABLED   (MMSYSERR_BASE + 3)  /* driver failed enable */
  2202. #define MMSYSERR_ALLOCATED    (MMSYSERR_BASE + 4)  /* device already allocated */
  2203. #define MMSYSERR_INVALHANDLE  (MMSYSERR_BASE + 5)  /* device handle is invalid */
  2204. #define MMSYSERR_NODRIVER     (MMSYSERR_BASE + 6)  /* no device driver present */
  2205. #define MMSYSERR_NOMEM        (MMSYSERR_BASE + 7)  /* memory allocation error */
  2206. #define MMSYSERR_NOTSUPPORTED (MMSYSERR_BASE + 8)  /* function isn't supported */
  2207. #define MMSYSERR_BADERRNUM    (MMSYSERR_BASE + 9)  /* error value out of range */
  2208. #define MMSYSERR_INVALFLAG    (MMSYSERR_BASE + 10) /* invalid flag passed */
  2209. #define MMSYSERR_INVALPARAM   (MMSYSERR_BASE + 11) /* invalid parameter passed */
  2210. #define MMSYSERR_HANDLEBUSY   (MMSYSERR_BASE + 12) /* handle being used */
  2211.                            /* simultaneously on another */
  2212.                            /* thread (eg callback) */
  2213. #define MMSYSERR_INVALIDALIAS (MMSYSERR_BASE + 13) /* specified alias not found */
  2214. #define MMSYSERR_BADDB        (MMSYSERR_BASE + 14) /* bad registry database */
  2215. #define MMSYSERR_KEYNOTFOUND  (MMSYSERR_BASE + 15) /* registry key not found */
  2216. #define MMSYSERR_READERROR    (MMSYSERR_BASE + 16) /* registry read error */
  2217. #define MMSYSERR_WRITEERROR   (MMSYSERR_BASE + 17) /* registry write error */
  2218. #define MMSYSERR_DELETEERROR  (MMSYSERR_BASE + 18) /* registry delete error */
  2219. #define MMSYSERR_VALNOTFOUND  (MMSYSERR_BASE + 19) /* registry value not found */
  2220. #define MMSYSERR_NODRIVERCB   (MMSYSERR_BASE + 20) /* driver does not call DriverCallback */
  2221. #define MMSYSERR_LASTERROR    (MMSYSERR_BASE + 20) /* last error in range */
  2222.  
  2223. #if (WINVER < 0x030a) || defined(_WIN32)
  2224. DECLARE_HANDLE(HDRVR);
  2225. #endif /* ifdef WINVER < 0x030a */
  2226.  
  2227. #ifndef MMNODRV
  2228.  
  2229. /****************************************************************************
  2230.  
  2231.             Installable driver support
  2232.  
  2233. ****************************************************************************/
  2234.  
  2235. #ifdef _WIN32
  2236. typedef struct DRVCONFIGINFOEX {
  2237.     DWORD   dwDCISize;
  2238.     LPCWSTR  lpszDCISectionName;
  2239.     LPCWSTR  lpszDCIAliasName;
  2240.     DWORD    dnDevNode;
  2241. } DRVCONFIGINFOEX, *PDRVCONFIGINFOEX, NEAR *NPDRVCONFIGINFOEX, FAR *LPDRVCONFIGINFOEX;
  2242.  
  2243. #else
  2244. typedef struct DRVCONFIGINFOEX {
  2245.     DWORD   dwDCISize;
  2246.     LPCSTR  lpszDCISectionName;
  2247.     LPCSTR  lpszDCIAliasName;
  2248.     DWORD    dnDevNode;
  2249. } DRVCONFIGINFOEX, *PDRVCONFIGINFOEX, NEAR *NPDRVCONFIGINFOEX, FAR *LPDRVCONFIGINFOEX;
  2250. #endif
  2251.  
  2252. #if (WINVER < 0x030a) || defined(_WIN32)
  2253.  
  2254. #ifndef DRV_LOAD
  2255.  
  2256. /* Driver messages */
  2257. #define DRV_LOAD                0x0001
  2258. #define DRV_ENABLE              0x0002
  2259. #define DRV_OPEN                0x0003
  2260. #define DRV_CLOSE               0x0004
  2261. #define DRV_DISABLE             0x0005
  2262. #define DRV_FREE                0x0006
  2263. #define DRV_CONFIGURE           0x0007
  2264. #define DRV_QUERYCONFIGURE      0x0008
  2265. #define DRV_INSTALL             0x0009
  2266. #define DRV_REMOVE              0x000A
  2267. #define DRV_EXITSESSION         0x000B
  2268. #define DRV_POWER               0x000F
  2269. #define DRV_RESERVED            0x0800
  2270. #define DRV_USER                0x4000
  2271.  
  2272. /* LPARAM of DRV_CONFIGURE message */
  2273. #ifdef _WIN32
  2274. typedef struct tagDRVCONFIGINFO {
  2275.     DWORD   dwDCISize;
  2276.     LPCWSTR  lpszDCISectionName;
  2277.     LPCWSTR  lpszDCIAliasName;
  2278. } DRVCONFIGINFO, *PDRVCONFIGINFO, NEAR *NPDRVCONFIGINFO, FAR *LPDRVCONFIGINFO;
  2279. #else
  2280. typedef struct tagDRVCONFIGINFO {
  2281.     DWORD   dwDCISize;
  2282.     LPCSTR  lpszDCISectionName;
  2283.     LPCSTR  lpszDCIAliasName;
  2284. } DRVCONFIGINFO, *PDRVCONFIGINFO, NEAR *NPDRVCONFIGINFO, FAR *LPDRVCONFIGINFO;
  2285. #endif
  2286.  
  2287. /* Supported return values for DRV_CONFIGURE message */
  2288. #define DRVCNF_CANCEL           0x0000
  2289. #define DRVCNF_OK               0x0001
  2290. #define DRVCNF_RESTART          0x0002
  2291.  
  2292. /* installable driver function prototypes */
  2293. #ifdef _WIN32
  2294.  #ifndef _WIN32_VXD
  2295.  
  2296. typedef LRESULT (CALLBACK* DRIVERPROC)(DWORD, HDRVR, UINT, LPARAM, LPARAM);
  2297.  
  2298. WINMMAPI LRESULT   WINAPI CloseDriver(HDRVR hDriver, LONG lParam1, LONG lParam2);
  2299. WINMMAPI HDRVR     WINAPI OpenDriver(LPCWSTR szDriverName, LPCWSTR szSectionName, LONG lParam2);
  2300. WINMMAPI LRESULT   WINAPI SendDriverMessage(HDRVR hDriver, UINT message, LONG lParam1, LONG lParam2);
  2301. WINMMAPI HMODULE   WINAPI DrvGetModuleHandle(HDRVR hDriver);
  2302. WINMMAPI HMODULE   WINAPI GetDriverModuleHandle(HDRVR hDriver);
  2303. WINMMAPI LRESULT   WINAPI DefDriverProc(DWORD dwDriverIdentifier, HDRVR hdrvr, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
  2304.  #endif /* ifndef _WIN32_VXD */
  2305. #else
  2306. LRESULT   WINAPI DrvClose(HDRVR hdrvr, LPARAM lParam1, LPARAM lParam2);
  2307. HDRVR     WINAPI DrvOpen(LPCSTR szDriverName, LPCSTR szSectionName, LPARAM lParam2);
  2308. LRESULT   WINAPI DrvSendMessage(HDRVR hdrvr, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
  2309. HINSTANCE WINAPI DrvGetModuleHandle(HDRVR hdrvr);
  2310. LRESULT   WINAPI DrvDefDriverProc(DWORD dwDriverIdentifier, HDRVR hdrvr, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
  2311. #define DefDriverProc DrvDefDriverProc
  2312. #endif /* ifdef _WIN32 */
  2313. #endif /* DRV_LOAD */
  2314. #endif /* ifdef (WINVER < 0x030a) || defined(_WIN32) */
  2315.  
  2316. #if (WINVER >= 0x030a)
  2317. /* return values from DriverProc() function */
  2318. #define DRV_CANCEL             DRVCNF_CANCEL
  2319. #define DRV_OK                 DRVCNF_OK
  2320. #define DRV_RESTART            DRVCNF_RESTART
  2321.  
  2322. #endif /* ifdef WINVER >= 0x030a */
  2323.  
  2324. #define DRV_MCI_FIRST          DRV_RESERVED
  2325. #define DRV_MCI_LAST           (DRV_RESERVED + 0xFFF)
  2326.  
  2327. #endif  /* ifndef MMNODRV */
  2328.  
  2329. /****************************************************************************
  2330.  
  2331.               Driver callback support
  2332.  
  2333. ****************************************************************************/
  2334.  
  2335. /* flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and */
  2336. /* midiOutOpen() to specify the type of the dwCallback parameter. */
  2337.  
  2338. #define CALLBACK_TYPEMASK   0x00070000l    /* callback type mask */
  2339. #define CALLBACK_NULL       0x00000000l    /* no callback */
  2340. #define CALLBACK_WINDOW     0x00010000l    /* dwCallback is a HWND */
  2341. #define CALLBACK_TASK       0x00020000l    /* dwCallback is a HTASK */
  2342. #define CALLBACK_FUNCTION   0x00030000l    /* dwCallback is a FARPROC */
  2343. #ifdef _WIN32
  2344. #define CALLBACK_THREAD     (CALLBACK_TASK)/* thread ID replaces 16 bit task */
  2345. #define CALLBACK_EVENT      0x00050000l    /* dwCallback is an EVENT Handle */
  2346. #endif
  2347.  
  2348. #ifndef _WIN32_VXD 
  2349.  
  2350. typedef void (CALLBACK DRVCALLBACK)(HDRVR hdrvr, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2);
  2351.  
  2352. typedef DRVCALLBACK FAR *LPDRVCALLBACK;
  2353. #ifdef _WIN32
  2354. typedef DRVCALLBACK     *PDRVCALLBACK;
  2355. #endif
  2356.  
  2357. #endif   /* ifndef _WIN32_VXD */ 
  2358.  
  2359. #ifndef MMNOMMSYSTEM
  2360. #ifndef _WIN32_VXD
  2361. /****************************************************************************
  2362.  
  2363.             General MMSYSTEM support
  2364.  
  2365. ****************************************************************************/
  2366.  
  2367. #if (WINVER <= 0x030A)
  2368. WINMMAPI UINT WINAPI mmsystemGetVersion(void);
  2369. #endif
  2370. #ifdef _WIN32
  2371. #define OutputDebugStr  OutputDebugString
  2372. #else
  2373. void WINAPI OutputDebugStr(LPCSTR);
  2374. #endif
  2375.  
  2376. #endif  /* ifndef _WIN32_VXD */
  2377. #endif  /* ifndef MMNOMMSYSTEM */
  2378.  
  2379. #ifndef MMNOSOUND
  2380. #ifndef _WIN32_VXD
  2381. /****************************************************************************
  2382.  
  2383.                 Sound support
  2384.  
  2385. ****************************************************************************/
  2386.  
  2387. #ifdef _WIN32
  2388.  
  2389. WINMMAPI BOOL WINAPI sndPlaySoundA(LPCSTR pszSound, UINT fuSound);
  2390. WINMMAPI BOOL WINAPI sndPlaySoundW(LPCWSTR pszSound, UINT fuSound);
  2391. #ifdef UNICODE
  2392. #define sndPlaySound  sndPlaySoundW
  2393. #else
  2394. #define sndPlaySound  sndPlaySoundA
  2395. #endif // !UNICODE
  2396.  
  2397. #else
  2398. BOOL WINAPI sndPlaySound(LPCSTR pszSound, UINT fuSound);
  2399. #endif
  2400.  
  2401. /*
  2402.  *  flag values for fuSound and fdwSound arguments on [snd]PlaySound
  2403.  */
  2404. #define SND_SYNC            0x0000  /* play synchronously (default) */
  2405. #define SND_ASYNC           0x0001  /* play asynchronously */
  2406. #define SND_NODEFAULT       0x0002  /* silence (!default) if sound not found */
  2407. #define SND_MEMORY          0x0004  /* pszSound points to a memory file */
  2408. #define SND_LOOP            0x0008  /* loop the sound until next sndPlaySound */
  2409. #define SND_NOSTOP          0x0010  /* don't stop any currently playing sound */
  2410.  
  2411. #define SND_NOWAIT    0x00002000L /* don't wait if the driver is busy */
  2412. #define SND_ALIAS       0x00010000L /* name is a registry alias */
  2413. #define SND_ALIAS_ID    0x00110000L /* alias is a predefined ID */
  2414. #define SND_FILENAME    0x00020000L /* name is file name */
  2415. #define SND_RESOURCE    0x00040004L /* name is resource name or atom */
  2416. #if(WINVER >= 0x0400)
  2417. #define SND_PURGE           0x0040  /* purge non-static events for task */
  2418. #define SND_APPLICATION     0x0080  /* look for application specific association */
  2419. #endif /* WINVER >= 0x0400 */
  2420.  
  2421. #define SND_ALIAS_START    0           /* alias base */
  2422.  
  2423. #ifdef _WIN32
  2424. #define    sndAlias(ch0, ch1)    (SND_ALIAS_START + (DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8))
  2425.  
  2426. #define SND_ALIAS_SYSTEMASTERISK        sndAlias('S', '*')
  2427. #define SND_ALIAS_SYSTEMQUESTION        sndAlias('S', '?')
  2428. #define SND_ALIAS_SYSTEMHAND            sndAlias('S', 'H')
  2429. #define SND_ALIAS_SYSTEMEXIT            sndAlias('S', 'E')
  2430. #define SND_ALIAS_SYSTEMSTART           sndAlias('S', 'S')
  2431. #define SND_ALIAS_SYSTEMWELCOME         sndAlias('S', 'W')
  2432. #define SND_ALIAS_SYSTEMEXCLAMATION     sndAlias('S', '!')
  2433. #define SND_ALIAS_SYSTEMDEFAULT         sndAlias('S', 'D')
  2434.  
  2435. WINMMAPI BOOL WINAPI PlaySoundA(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound);
  2436. WINMMAPI BOOL WINAPI PlaySoundW(LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound);
  2437. #ifdef UNICODE
  2438. #define PlaySound  PlaySoundW
  2439. #else
  2440. #define PlaySound  PlaySoundA
  2441. #endif // !UNICODE
  2442.  
  2443. #else
  2444. BOOL WINAPI PlaySound(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound);
  2445. #endif
  2446.  
  2447. #endif  /* ifndef _WIN32_VXD */
  2448. #endif  /* ifndef MMNOSOUND */
  2449.  
  2450. #ifndef MMNOWAVE
  2451. /****************************************************************************
  2452.  
  2453.             Waveform audio support
  2454.  
  2455. ****************************************************************************/
  2456.  
  2457. /* waveform audio error return values */
  2458. #define WAVERR_BADFORMAT      (WAVERR_BASE + 0)    /* unsupported wave format */
  2459. #define WAVERR_STILLPLAYING   (WAVERR_BASE + 1)    /* still something playing */
  2460. #define WAVERR_UNPREPARED     (WAVERR_BASE + 2)    /* header not prepared */
  2461. #define WAVERR_SYNC           (WAVERR_BASE + 3)    /* device is synchronous */
  2462. #define WAVERR_LASTERROR      (WAVERR_BASE + 3)    /* last error in range */
  2463.  
  2464. /* waveform audio data types */
  2465. DECLARE_HANDLE(HWAVE);
  2466. DECLARE_HANDLE(HWAVEIN);
  2467. DECLARE_HANDLE(HWAVEOUT);
  2468. #ifndef _WIN32_VXD
  2469. typedef HWAVEIN FAR *LPHWAVEIN;
  2470. typedef HWAVEOUT FAR *LPHWAVEOUT;
  2471. typedef DRVCALLBACK WAVECALLBACK;
  2472. typedef WAVECALLBACK FAR *LPWAVECALLBACK;
  2473. #endif
  2474.  
  2475. /* wave callback messages */
  2476. #define WOM_OPEN        MM_WOM_OPEN
  2477. #define WOM_CLOSE       MM_WOM_CLOSE
  2478. #define WOM_DONE        MM_WOM_DONE
  2479. #define WIM_OPEN        MM_WIM_OPEN
  2480. #define WIM_CLOSE       MM_WIM_CLOSE
  2481. #define WIM_DATA        MM_WIM_DATA
  2482.  
  2483. /* device ID for wave device mapper */
  2484. #define WAVE_MAPPER     ((UINT)-1)
  2485.  
  2486. /* flags for dwFlags parameter in waveOutOpen() and waveInOpen() */
  2487. #define  WAVE_FORMAT_QUERY         0x0001
  2488. #define  WAVE_ALLOWSYNC            0x0002
  2489. #if(WINVER >= 0x0400)
  2490. #define  WAVE_MAPPED               0x0004
  2491. #define  WAVE_FORMAT_DIRECT        0x0008
  2492. #define  WAVE_FORMAT_DIRECT_QUERY  (WAVE_FORMAT_QUERY | WAVE_FORMAT_DIRECT)
  2493. #endif /* WINVER >= 0x0400 */
  2494.  
  2495. /* wave data block header */
  2496. typedef struct wavehdr_tag {
  2497.     LPSTR       lpData;                 /* pointer to locked data buffer */
  2498.     DWORD       dwBufferLength;         /* length of data buffer */
  2499.     DWORD       dwBytesRecorded;        /* used for input only */
  2500.     DWORD       dwUser;                 /* for client's use */
  2501.     DWORD       dwFlags;                /* assorted flags (see defines) */
  2502.     DWORD       dwLoops;                /* loop control counter */
  2503.     struct wavehdr_tag FAR *lpNext;     /* reserved for driver */
  2504.     DWORD       reserved;               /* reserved for driver */
  2505. } WAVEHDR, *PWAVEHDR, NEAR *NPWAVEHDR, FAR *LPWAVEHDR;
  2506.  
  2507. /* flags for dwFlags field of WAVEHDR */
  2508. #define WHDR_DONE       0x00000001  /* done bit */
  2509. #define WHDR_PREPARED   0x00000002  /* set if this header has been prepared */
  2510. #define WHDR_BEGINLOOP  0x00000004  /* loop start block */
  2511. #define WHDR_ENDLOOP    0x00000008  /* loop end block */
  2512. #define WHDR_INQUEUE    0x00000010  /* reserved for driver */
  2513.  
  2514. /* waveform output device capabilities structure */
  2515. #ifdef _WIN32
  2516.  
  2517. typedef struct tagWAVEOUTCAPSA {
  2518.     WORD    wMid;                  /* manufacturer ID */
  2519.     WORD    wPid;                  /* product ID */
  2520.     MMVERSION vDriverVersion;      /* version of the driver */
  2521.     CHAR    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  2522.     DWORD   dwFormats;             /* formats supported */
  2523.     WORD    wChannels;             /* number of sources supported */
  2524.     WORD    wReserved1;            /* packing */
  2525.     DWORD   dwSupport;             /* functionality supported by driver */
  2526. } WAVEOUTCAPSA, *PWAVEOUTCAPSA, *NPWAVEOUTCAPSA, *LPWAVEOUTCAPSA;
  2527. typedef struct tagWAVEOUTCAPSW {
  2528.     WORD    wMid;                  /* manufacturer ID */
  2529.     WORD    wPid;                  /* product ID */
  2530.     MMVERSION vDriverVersion;      /* version of the driver */
  2531.     WCHAR   szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  2532.     DWORD   dwFormats;             /* formats supported */
  2533.     WORD    wChannels;             /* number of sources supported */
  2534.     WORD    wReserved1;            /* packing */
  2535.     DWORD   dwSupport;             /* functionality supported by driver */
  2536. } WAVEOUTCAPSW, *PWAVEOUTCAPSW, *NPWAVEOUTCAPSW, *LPWAVEOUTCAPSW;
  2537. #ifdef UNICODE
  2538. typedef WAVEOUTCAPSW WAVEOUTCAPS;
  2539. typedef PWAVEOUTCAPSW PWAVEOUTCAPS;
  2540. typedef NPWAVEOUTCAPSW NPWAVEOUTCAPS;
  2541. typedef LPWAVEOUTCAPSW LPWAVEOUTCAPS;
  2542. #else
  2543. typedef WAVEOUTCAPSA WAVEOUTCAPS;
  2544. typedef PWAVEOUTCAPSA PWAVEOUTCAPS;
  2545. typedef NPWAVEOUTCAPSA NPWAVEOUTCAPS;
  2546. typedef LPWAVEOUTCAPSA LPWAVEOUTCAPS;
  2547. #endif // UNICODE
  2548.  
  2549. #else
  2550. typedef struct waveoutcaps_tag {
  2551.     WORD    wMid;                  /* manufacturer ID */
  2552.     WORD    wPid;                  /* product ID */
  2553.     VERSION vDriverVersion;        /* version of the driver */
  2554.     char    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  2555.     DWORD   dwFormats;             /* formats supported */
  2556.     WORD    wChannels;             /* number of sources supported */
  2557.     DWORD   dwSupport;             /* functionality supported by driver */
  2558. } WAVEOUTCAPS, *PWAVEOUTCAPS, NEAR *NPWAVEOUTCAPS, FAR *LPWAVEOUTCAPS;
  2559. #endif
  2560.  
  2561. /* flags for dwSupport field of WAVEOUTCAPS */
  2562. #define WAVECAPS_PITCH          0x0001   /* supports pitch control */
  2563. #define WAVECAPS_PLAYBACKRATE   0x0002   /* supports playback rate control */
  2564. #define WAVECAPS_VOLUME         0x0004   /* supports volume control */
  2565. #define WAVECAPS_LRVOLUME       0x0008   /* separate left-right volume control */
  2566. #define WAVECAPS_SYNC           0x0010
  2567. #define WAVECAPS_SAMPLEACCURATE 0x0020
  2568. #define WAVECAPS_DIRECTSOUND    0x0040
  2569.  
  2570. /* waveform input device capabilities structure */
  2571. #ifdef _WIN32
  2572.  
  2573. typedef struct tagWAVEINCAPSA {
  2574.     WORD    wMid;                    /* manufacturer ID */
  2575.     WORD    wPid;                    /* product ID */
  2576.     MMVERSION vDriverVersion;        /* version of the driver */
  2577.     CHAR    szPname[MAXPNAMELEN];    /* product name (NULL terminated string) */
  2578.     DWORD   dwFormats;               /* formats supported */
  2579.     WORD    wChannels;               /* number of channels supported */
  2580.     WORD    wReserved1;              /* structure packing */
  2581. } WAVEINCAPSA, *PWAVEINCAPSA, *NPWAVEINCAPSA, *LPWAVEINCAPSA;
  2582. typedef struct tagWAVEINCAPSW {
  2583.     WORD    wMid;                    /* manufacturer ID */
  2584.     WORD    wPid;                    /* product ID */
  2585.     MMVERSION vDriverVersion;        /* version of the driver */
  2586.     WCHAR   szPname[MAXPNAMELEN];    /* product name (NULL terminated string) */
  2587.     DWORD   dwFormats;               /* formats supported */
  2588.     WORD    wChannels;               /* number of channels supported */
  2589.     WORD    wReserved1;              /* structure packing */
  2590. } WAVEINCAPSW, *PWAVEINCAPSW, *NPWAVEINCAPSW, *LPWAVEINCAPSW;
  2591. #ifdef UNICODE
  2592. typedef WAVEINCAPSW WAVEINCAPS;
  2593. typedef PWAVEINCAPSW PWAVEINCAPS;
  2594. typedef NPWAVEINCAPSW NPWAVEINCAPS;
  2595. typedef LPWAVEINCAPSW LPWAVEINCAPS;
  2596. #else
  2597. typedef WAVEINCAPSA WAVEINCAPS;
  2598. typedef PWAVEINCAPSA PWAVEINCAPS;
  2599. typedef NPWAVEINCAPSA NPWAVEINCAPS;
  2600. typedef LPWAVEINCAPSA LPWAVEINCAPS;
  2601. #endif // UNICODE
  2602.  
  2603. #else
  2604. typedef struct waveincaps_tag {
  2605.     WORD    wMid;                    /* manufacturer ID */
  2606.     WORD    wPid;                    /* product ID */
  2607.     VERSION vDriverVersion;          /* version of the driver */
  2608.     char    szPname[MAXPNAMELEN];    /* product name (NULL terminated string) */
  2609.     DWORD   dwFormats;               /* formats supported */
  2610.     WORD    wChannels;               /* number of channels supported */
  2611. } WAVEINCAPS, *PWAVEINCAPS, NEAR *NPWAVEINCAPS, FAR *LPWAVEINCAPS;
  2612. #endif
  2613.  
  2614. /* defines for dwFormat field of WAVEINCAPS and WAVEOUTCAPS */
  2615. #define WAVE_INVALIDFORMAT     0x00000000       /* invalid format */
  2616. #define WAVE_FORMAT_1M08       0x00000001       /* 11.025 kHz, Mono,   8-bit  */
  2617. #define WAVE_FORMAT_1S08       0x00000002       /* 11.025 kHz, Stereo, 8-bit  */
  2618. #define WAVE_FORMAT_1M16       0x00000004       /* 11.025 kHz, Mono,   16-bit */
  2619. #define WAVE_FORMAT_1S16       0x00000008       /* 11.025 kHz, Stereo, 16-bit */
  2620. #define WAVE_FORMAT_2M08       0x00000010       /* 22.05  kHz, Mono,   8-bit  */
  2621. #define WAVE_FORMAT_2S08       0x00000020       /* 22.05  kHz, Stereo, 8-bit  */
  2622. #define WAVE_FORMAT_2M16       0x00000040       /* 22.05  kHz, Mono,   16-bit */
  2623. #define WAVE_FORMAT_2S16       0x00000080       /* 22.05  kHz, Stereo, 16-bit */
  2624. #define WAVE_FORMAT_4M08       0x00000100       /* 44.1   kHz, Mono,   8-bit  */
  2625. #define WAVE_FORMAT_4S08       0x00000200       /* 44.1   kHz, Stereo, 8-bit  */
  2626. #define WAVE_FORMAT_4M16       0x00000400       /* 44.1   kHz, Mono,   16-bit */
  2627. #define WAVE_FORMAT_4S16       0x00000800       /* 44.1   kHz, Stereo, 16-bit */
  2628.  
  2629. /* OLD general waveform format structure (information common to all formats) */
  2630. typedef struct waveformat_tag {
  2631.     WORD    wFormatTag;        /* format type */
  2632.     WORD    nChannels;         /* number of channels (i.e. mono, stereo, etc.) */
  2633.     DWORD   nSamplesPerSec;    /* sample rate */
  2634.     DWORD   nAvgBytesPerSec;   /* for buffer estimation */
  2635.     WORD    nBlockAlign;       /* block size of data */
  2636. } WAVEFORMAT, *PWAVEFORMAT, NEAR *NPWAVEFORMAT, FAR *LPWAVEFORMAT;
  2637.  
  2638. /* flags for wFormatTag field of WAVEFORMAT */
  2639. #define WAVE_FORMAT_PCM     1
  2640.  
  2641. /* specific waveform format structure for PCM data */
  2642. typedef struct pcmwaveformat_tag {
  2643.     WAVEFORMAT  wf;
  2644.     WORD        wBitsPerSample;
  2645. } PCMWAVEFORMAT, *PPCMWAVEFORMAT, NEAR *NPPCMWAVEFORMAT, FAR *LPPCMWAVEFORMAT;
  2646.  
  2647. #ifndef _WAVEFORMATEX_
  2648. #define _WAVEFORMATEX_
  2649.  
  2650. /*
  2651.  *  extended waveform format structure used for all non-PCM formats. this
  2652.  *  structure is common to all non-PCM formats.
  2653.  */
  2654. typedef struct tWAVEFORMATEX
  2655. {
  2656.     WORD        wFormatTag;         /* format type */
  2657.     WORD        nChannels;          /* number of channels (i.e. mono, stereo...) */
  2658.     DWORD       nSamplesPerSec;     /* sample rate */
  2659.     DWORD       nAvgBytesPerSec;    /* for buffer estimation */
  2660.     WORD        nBlockAlign;        /* block size of data */
  2661.     WORD        wBitsPerSample;     /* number of bits per sample of mono data */
  2662.     WORD        cbSize;             /* the count in bytes of the size of */
  2663.                     /* extra information (after cbSize) */
  2664. } WAVEFORMATEX, *PWAVEFORMATEX, NEAR *NPWAVEFORMATEX, FAR *LPWAVEFORMATEX;
  2665. typedef const WAVEFORMATEX FAR *LPCWAVEFORMATEX;
  2666.  
  2667. #endif /* _WAVEFORMATEX_ */
  2668.  
  2669. #ifndef _WIN32_VXD
  2670. /* waveform audio function prototypes */
  2671. WINMMAPI UINT WINAPI waveOutGetNumDevs(void);
  2672.  
  2673. #ifdef _WIN32
  2674.  
  2675. WINMMAPI MMRESULT WINAPI waveOutGetDevCapsA(UINT uDeviceID, LPWAVEOUTCAPSA pwoc, UINT cbwoc);
  2676. WINMMAPI MMRESULT WINAPI waveOutGetDevCapsW(UINT uDeviceID, LPWAVEOUTCAPSW pwoc, UINT cbwoc);
  2677. #ifdef UNICODE
  2678. #define waveOutGetDevCaps  waveOutGetDevCapsW
  2679. #else
  2680. #define waveOutGetDevCaps  waveOutGetDevCapsA
  2681. #endif // !UNICODE
  2682.  
  2683. #else
  2684. WINMMAPI MMRESULT WINAPI waveOutGetDevCaps(UINT uDeviceID, LPWAVEOUTCAPS pwoc, UINT cbwoc);
  2685. #endif
  2686.  
  2687. #if (WINVER >= 0x0400)
  2688. WINMMAPI MMRESULT WINAPI waveOutGetVolume(HWAVEOUT hwo, LPDWORD pdwVolume);
  2689. WINMMAPI MMRESULT WINAPI waveOutSetVolume(HWAVEOUT hwo, DWORD dwVolume);
  2690. #else
  2691. WINMMAPI MMRESULT WINAPI waveOutGetVolume(UINT uId, LPDWORD pdwVolume);
  2692. WINMMAPI MMRESULT WINAPI waveOutSetVolume(UINT uId, DWORD dwVolume);
  2693. #endif
  2694.  
  2695. #ifdef _WIN32
  2696.  
  2697. WINMMAPI MMRESULT WINAPI waveOutGetErrorTextA(MMRESULT mmrError, LPSTR pszText, UINT cchText);
  2698. WINMMAPI MMRESULT WINAPI waveOutGetErrorTextW(MMRESULT mmrError, LPWSTR pszText, UINT cchText);
  2699. #ifdef UNICODE
  2700. #define waveOutGetErrorText  waveOutGetErrorTextW
  2701. #else
  2702. #define waveOutGetErrorText  waveOutGetErrorTextA
  2703. #endif // !UNICODE
  2704.  
  2705. #else
  2706. MMRESULT WINAPI waveOutGetErrorText(MMRESULT mmrError, LPSTR pszText, UINT cchText);
  2707. #endif
  2708.  
  2709. WINMMAPI MMRESULT WINAPI waveOutOpen(LPHWAVEOUT phwo, UINT uDeviceID,
  2710.     LPCWAVEFORMATEX pwfx, DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen);
  2711.  
  2712. WINMMAPI MMRESULT WINAPI waveOutClose(HWAVEOUT hwo);
  2713. WINMMAPI MMRESULT WINAPI waveOutPrepareHeader(HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh);
  2714. WINMMAPI MMRESULT WINAPI waveOutUnprepareHeader(HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh);
  2715. WINMMAPI MMRESULT WINAPI waveOutWrite(HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh);
  2716. WINMMAPI MMRESULT WINAPI waveOutPause(HWAVEOUT hwo);
  2717. WINMMAPI MMRESULT WINAPI waveOutRestart(HWAVEOUT hwo);
  2718. WINMMAPI MMRESULT WINAPI waveOutReset(HWAVEOUT hwo);
  2719. WINMMAPI MMRESULT WINAPI waveOutBreakLoop(HWAVEOUT hwo);
  2720. WINMMAPI MMRESULT WINAPI waveOutGetPosition(HWAVEOUT hwo, LPMMTIME pmmt, UINT cbmmt);
  2721. WINMMAPI MMRESULT WINAPI waveOutGetPitch(HWAVEOUT hwo, LPDWORD pdwPitch);
  2722. WINMMAPI MMRESULT WINAPI waveOutSetPitch(HWAVEOUT hwo, DWORD dwPitch);
  2723. WINMMAPI MMRESULT WINAPI waveOutGetPlaybackRate(HWAVEOUT hwo, LPDWORD pdwRate);
  2724. WINMMAPI MMRESULT WINAPI waveOutSetPlaybackRate(HWAVEOUT hwo, DWORD dwRate);
  2725. WINMMAPI MMRESULT WINAPI waveOutGetID(HWAVEOUT hwo, LPUINT puDeviceID);
  2726.  
  2727. #if (WINVER >= 0x030a)
  2728. #ifdef _WIN32
  2729. WINMMAPI MMRESULT WINAPI waveOutMessage(HWAVEOUT hwo, UINT uMsg, DWORD dw1, DWORD dw2);
  2730. #else
  2731. DWORD WINAPI waveOutMessage(HWAVEOUT hwo, UINT uMsg, DWORD dw1, DWORD dw2);
  2732. #endif
  2733. #endif /* ifdef WINVER >= 0x030a */
  2734.  
  2735. WINMMAPI UINT WINAPI waveInGetNumDevs(void);
  2736.  
  2737. #ifdef _WIN32
  2738.  
  2739. WINMMAPI MMRESULT WINAPI waveInGetDevCapsA(UINT uDeviceID, LPWAVEINCAPSA pwic, UINT cbwic);
  2740. WINMMAPI MMRESULT WINAPI waveInGetDevCapsW(UINT uDeviceID, LPWAVEINCAPSW pwic, UINT cbwic);
  2741. #ifdef UNICODE
  2742. #define waveInGetDevCaps  waveInGetDevCapsW
  2743. #else
  2744. #define waveInGetDevCaps  waveInGetDevCapsA
  2745. #endif // !UNICODE
  2746.  
  2747. #else
  2748. MMRESULT WINAPI waveInGetDevCaps(UINT uDeviceID, LPWAVEINCAPS pwic, UINT cbwic);
  2749. #endif
  2750.  
  2751. #ifdef _WIN32
  2752.  
  2753. WINMMAPI MMRESULT WINAPI waveInGetErrorTextA(MMRESULT mmrError, LPSTR pszText, UINT cchText);
  2754. WINMMAPI MMRESULT WINAPI waveInGetErrorTextW(MMRESULT mmrError, LPWSTR pszText, UINT cchText);
  2755. #ifdef UNICODE
  2756. #define waveInGetErrorText  waveInGetErrorTextW
  2757. #else
  2758. #define waveInGetErrorText  waveInGetErrorTextA
  2759. #endif // !UNICODE
  2760.  
  2761. #else
  2762. MMRESULT WINAPI waveInGetErrorText(MMRESULT mmrError, LPSTR pszText, UINT cchText);
  2763. #endif
  2764.  
  2765. WINMMAPI MMRESULT WINAPI waveInOpen(LPHWAVEIN phwi, UINT uDeviceID,
  2766.     LPCWAVEFORMATEX pwfx, DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen);
  2767.  
  2768. WINMMAPI MMRESULT WINAPI waveInClose(HWAVEIN hwi);
  2769. WINMMAPI MMRESULT WINAPI waveInPrepareHeader(HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
  2770. WINMMAPI MMRESULT WINAPI waveInUnprepareHeader(HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
  2771. WINMMAPI MMRESULT WINAPI waveInAddBuffer(HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
  2772. WINMMAPI MMRESULT WINAPI waveInStart(HWAVEIN hwi);
  2773. WINMMAPI MMRESULT WINAPI waveInStop(HWAVEIN hwi);
  2774. WINMMAPI MMRESULT WINAPI waveInReset(HWAVEIN hwi);
  2775. WINMMAPI MMRESULT WINAPI waveInGetPosition(HWAVEIN hwi, LPMMTIME pmmt, UINT cbmmt);
  2776. WINMMAPI MMRESULT WINAPI waveInGetID(HWAVEIN hwi, LPUINT puDeviceID);
  2777.  
  2778. #if (WINVER >= 0x030a)
  2779. #ifdef _WIN32
  2780. WINMMAPI MMRESULT WINAPI waveInMessage(HWAVEIN hwi, UINT uMsg, DWORD dw1, DWORD dw2);
  2781. #else
  2782. DWORD WINAPI waveInMessage(HWAVEIN hwi, UINT uMsg, DWORD dw1, DWORD dw2);
  2783. #endif
  2784. #endif /* ifdef WINVER >= 0x030a */
  2785.  
  2786. #endif /* ifndef _WIN32_VXD */
  2787.  
  2788. #endif  /* ifndef MMNOWAVE */
  2789.  
  2790. #ifndef MMNOMIDI
  2791. /****************************************************************************
  2792.  
  2793.                 MIDI audio support
  2794.  
  2795. ****************************************************************************/
  2796.  
  2797. /* MIDI error return values */
  2798. #define MIDIERR_UNPREPARED    (MIDIERR_BASE + 0)   /* header not prepared */
  2799. #define MIDIERR_STILLPLAYING  (MIDIERR_BASE + 1)   /* still something playing */
  2800. #define MIDIERR_NOMAP         (MIDIERR_BASE + 2)   /* no configured instruments */
  2801. #define MIDIERR_NOTREADY      (MIDIERR_BASE + 3)   /* hardware is still busy */
  2802. #define MIDIERR_NODEVICE      (MIDIERR_BASE + 4)   /* port no longer connected */
  2803. #define MIDIERR_INVALIDSETUP  (MIDIERR_BASE + 5)   /* invalid MIF */
  2804. #define MIDIERR_BADOPENMODE   (MIDIERR_BASE + 6)   /* operation unsupported w/ open mode */
  2805. #define MIDIERR_DONT_CONTINUE (MIDIERR_BASE + 7)   /* thru device 'eating' a message */
  2806. #define MIDIERR_LASTERROR     (MIDIERR_BASE + 7)   /* last error in range */
  2807.  
  2808. /* MIDI audio data types */
  2809. DECLARE_HANDLE(HMIDI);
  2810. DECLARE_HANDLE(HMIDIIN);
  2811. DECLARE_HANDLE(HMIDIOUT);
  2812. DECLARE_HANDLE(HMIDISTRM);
  2813. #ifndef _WIN32_VXD
  2814. typedef HMIDI FAR *LPHMIDI;
  2815. typedef HMIDIIN FAR *LPHMIDIIN;
  2816. typedef HMIDIOUT FAR *LPHMIDIOUT;
  2817. typedef HMIDISTRM FAR *LPHMIDISTRM;
  2818. typedef DRVCALLBACK MIDICALLBACK;
  2819. typedef MIDICALLBACK FAR *LPMIDICALLBACK;
  2820. #define MIDIPATCHSIZE   128
  2821. typedef WORD PATCHARRAY[MIDIPATCHSIZE];
  2822. typedef WORD FAR *LPPATCHARRAY;
  2823. typedef WORD KEYARRAY[MIDIPATCHSIZE];
  2824. typedef WORD FAR *LPKEYARRAY;
  2825. #endif  /* ifndef _WIN32_VXD */
  2826.  
  2827. /* MIDI callback messages */
  2828. #define MIM_OPEN        MM_MIM_OPEN
  2829. #define MIM_CLOSE       MM_MIM_CLOSE
  2830. #define MIM_DATA        MM_MIM_DATA
  2831. #define MIM_LONGDATA    MM_MIM_LONGDATA
  2832. #define MIM_ERROR       MM_MIM_ERROR
  2833. #define MIM_LONGERROR   MM_MIM_LONGERROR
  2834. #define MOM_OPEN        MM_MOM_OPEN
  2835. #define MOM_CLOSE       MM_MOM_CLOSE
  2836. #define MOM_DONE        MM_MOM_DONE
  2837.  
  2838. #if(WINVER >= 0x0400)
  2839. #define MIM_MOREDATA      MM_MIM_MOREDATA
  2840. #define MOM_POSITIONCB    MM_MOM_POSITIONCB
  2841. #endif /* WINVER >= 0x0400 */
  2842.  
  2843. /* device ID for MIDI mapper */
  2844. #define MIDIMAPPER     ((UINT)-1)
  2845. #define MIDI_MAPPER    ((UINT)-1)
  2846.  
  2847. #if(WINVER >= 0x0400)
  2848. /* flags for dwFlags parm of midiInOpen() */
  2849. #define MIDI_IO_STATUS      0x00000020L
  2850. #endif /* WINVER >= 0x0400 */
  2851.  
  2852. /* flags for wFlags parm of midiOutCachePatches(), midiOutCacheDrumPatches() */
  2853. #define MIDI_CACHE_ALL      1
  2854. #define MIDI_CACHE_BESTFIT  2
  2855. #define MIDI_CACHE_QUERY    3
  2856. #define MIDI_UNCACHE        4
  2857.  
  2858. /* MIDI output device capabilities structure */
  2859. #ifdef _WIN32
  2860.  
  2861. typedef struct tagMIDIOUTCAPSA {
  2862.     WORD    wMid;                  /* manufacturer ID */
  2863.     WORD    wPid;                  /* product ID */
  2864.     MMVERSION vDriverVersion;      /* version of the driver */
  2865.     CHAR    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  2866.     WORD    wTechnology;           /* type of device */
  2867.     WORD    wVoices;               /* # of voices (internal synth only) */
  2868.     WORD    wNotes;                /* max # of notes (internal synth only) */
  2869.     WORD    wChannelMask;          /* channels used (internal synth only) */
  2870.     DWORD   dwSupport;             /* functionality supported by driver */
  2871. } MIDIOUTCAPSA, *PMIDIOUTCAPSA, *NPMIDIOUTCAPSA, *LPMIDIOUTCAPSA;
  2872. typedef struct tagMIDIOUTCAPSW {
  2873.     WORD    wMid;                  /* manufacturer ID */
  2874.     WORD    wPid;                  /* product ID */
  2875.     MMVERSION vDriverVersion;      /* version of the driver */
  2876.     WCHAR   szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  2877.     WORD    wTechnology;           /* type of device */
  2878.     WORD    wVoices;               /* # of voices (internal synth only) */
  2879.     WORD    wNotes;                /* max # of notes (internal synth only) */
  2880.     WORD    wChannelMask;          /* channels used (internal synth only) */
  2881.     DWORD   dwSupport;             /* functionality supported by driver */
  2882. } MIDIOUTCAPSW, *PMIDIOUTCAPSW, *NPMIDIOUTCAPSW, *LPMIDIOUTCAPSW;
  2883. #ifdef UNICODE
  2884. typedef MIDIOUTCAPSW MIDIOUTCAPS;
  2885. typedef PMIDIOUTCAPSW PMIDIOUTCAPS;
  2886. typedef NPMIDIOUTCAPSW NPMIDIOUTCAPS;
  2887. typedef LPMIDIOUTCAPSW LPMIDIOUTCAPS;
  2888. #else
  2889. typedef MIDIOUTCAPSA MIDIOUTCAPS;
  2890. typedef PMIDIOUTCAPSA PMIDIOUTCAPS;
  2891. typedef NPMIDIOUTCAPSA NPMIDIOUTCAPS;
  2892. typedef LPMIDIOUTCAPSA LPMIDIOUTCAPS;
  2893. #endif // UNICODE
  2894.  
  2895. #else
  2896. typedef struct midioutcaps_tag {
  2897.     WORD    wMid;                  /* manufacturer ID */
  2898.     WORD    wPid;                  /* product ID */
  2899.     VERSION vDriverVersion;        /* version of the driver */
  2900.     char    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  2901.     WORD    wTechnology;           /* type of device */
  2902.     WORD    wVoices;               /* # of voices (internal synth only) */
  2903.     WORD    wNotes;                /* max # of notes (internal synth only) */
  2904.     WORD    wChannelMask;          /* channels used (internal synth only) */
  2905.     DWORD   dwSupport;             /* functionality supported by driver */
  2906. } MIDIOUTCAPS, *PMIDIOUTCAPS, NEAR *NPMIDIOUTCAPS, FAR *LPMIDIOUTCAPS;
  2907. #endif
  2908.  
  2909. /* flags for wTechnology field of MIDIOUTCAPS structure */
  2910. #define MOD_MIDIPORT    1  /* output port */
  2911. #define MOD_SYNTH       2  /* generic internal synth */
  2912. #define MOD_SQSYNTH     3  /* square wave internal synth */
  2913. #define MOD_FMSYNTH     4  /* FM internal synth */
  2914. #define MOD_MAPPER      5  /* MIDI mapper */
  2915.  
  2916. /* flags for dwSupport field of MIDIOUTCAPS structure */
  2917. #define MIDICAPS_VOLUME          0x0001  /* supports volume control */
  2918. #define MIDICAPS_LRVOLUME        0x0002  /* separate left-right volume control */
  2919. #define MIDICAPS_CACHE           0x0004
  2920. #if(WINVER >= 0x0400)
  2921. #define MIDICAPS_STREAM          0x0008  /* driver supports midiStreamOut directly */
  2922. #endif /* WINVER >= 0x0400 */
  2923.  
  2924. /* MIDI input device capabilities structure */
  2925. #ifdef _WIN32
  2926.  
  2927. typedef struct tagMIDIINCAPSA {
  2928.     WORD        wMid;                   /* manufacturer ID */
  2929.     WORD        wPid;                   /* product ID */
  2930.     MMVERSION   vDriverVersion;         /* version of the driver */
  2931.     CHAR        szPname[MAXPNAMELEN];   /* product name (NULL terminated string) */
  2932. #if (WINVER >= 0x0400)
  2933.     DWORD   dwSupport;             /* functionality supported by driver */
  2934. #endif
  2935. } MIDIINCAPSA, *PMIDIINCAPSA, *NPMIDIINCAPSA, *LPMIDIINCAPSA;
  2936. typedef struct tagMIDIINCAPSW {
  2937.     WORD        wMid;                   /* manufacturer ID */
  2938.     WORD        wPid;                   /* product ID */
  2939.     MMVERSION   vDriverVersion;         /* version of the driver */
  2940.     WCHAR       szPname[MAXPNAMELEN];   /* product name (NULL terminated string) */
  2941. #if (WINVER >= 0x0400)
  2942.     DWORD   dwSupport;             /* functionality supported by driver */
  2943. #endif
  2944. } MIDIINCAPSW, *PMIDIINCAPSW, *NPMIDIINCAPSW, *LPMIDIINCAPSW;
  2945. #ifdef UNICODE
  2946. typedef MIDIINCAPSW MIDIINCAPS;
  2947. typedef PMIDIINCAPSW PMIDIINCAPS;
  2948. typedef NPMIDIINCAPSW NPMIDIINCAPS;
  2949. typedef LPMIDIINCAPSW LPMIDIINCAPS;
  2950. #else
  2951. typedef MIDIINCAPSA MIDIINCAPS;
  2952. typedef PMIDIINCAPSA PMIDIINCAPS;
  2953. typedef NPMIDIINCAPSA NPMIDIINCAPS;
  2954. typedef LPMIDIINCAPSA LPMIDIINCAPS;
  2955. #endif // UNICODE
  2956.  
  2957. #else
  2958. typedef struct midiincaps_tag {
  2959.     WORD    wMid;                  /* manufacturer ID */
  2960.     WORD    wPid;                  /* product ID */
  2961.     VERSION vDriverVersion;        /* version of the driver */
  2962.     char    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  2963. #if (WINVER >= 0x0400)
  2964.     DWORD   dwSupport;             /* functionality supported by driver */
  2965. #endif
  2966. } MIDIINCAPS, *PMIDIINCAPS, NEAR *NPMIDIINCAPS, FAR *LPMIDIINCAPS;
  2967. #endif
  2968.  
  2969. /* MIDI data block header */
  2970. typedef struct midihdr_tag {
  2971.     LPSTR       lpData;               /* pointer to locked data block */
  2972.     DWORD       dwBufferLength;       /* length of data in data block */
  2973.     DWORD       dwBytesRecorded;      /* used for input only */
  2974.     DWORD       dwUser;               /* for client's use */
  2975.     DWORD       dwFlags;              /* assorted flags (see defines) */
  2976.     struct midihdr_tag FAR *lpNext;   /* reserved for driver */
  2977.     DWORD       reserved;             /* reserved for driver */
  2978. #if (WINVER >= 0x0400)
  2979.     DWORD       dwOffset;             /* Callback offset into buffer */
  2980.     DWORD       dwReserved[8];        /* Reserved for MMSYSTEM */
  2981. #endif
  2982. } MIDIHDR, *PMIDIHDR, NEAR *NPMIDIHDR, FAR *LPMIDIHDR;
  2983.  
  2984. #if(WINVER >= 0x0400)
  2985. typedef struct midievent_tag
  2986. {
  2987.     DWORD       dwDeltaTime;          /* Ticks since last event */
  2988.     DWORD       dwStreamID;           /* Reserved; must be zero */
  2989.     DWORD       dwEvent;              /* Event type and parameters */
  2990.     DWORD       dwParms[1];           /* Parameters if this is a long event */
  2991. } MIDIEVENT;
  2992.  
  2993. typedef struct midistrmbuffver_tag
  2994. {
  2995.     DWORD       dwVersion;                  /* Stream buffer format version */
  2996.     DWORD       dwMid;                      /* Manufacturer ID as defined in MMREG.H */
  2997.     DWORD       dwOEMVersion;               /* Manufacturer version for custom ext */
  2998. } MIDISTRMBUFFVER;
  2999. #endif /* WINVER >= 0x0400 */
  3000.  
  3001. /* flags for dwFlags field of MIDIHDR structure */
  3002. #define MHDR_DONE       0x00000001       /* done bit */
  3003. #define MHDR_PREPARED   0x00000002       /* set if header prepared */
  3004. #define MHDR_INQUEUE    0x00000004       /* reserved for driver */
  3005. #define MHDR_ISSTRM     0x00000008       /* Buffer is stream buffer */
  3006.  
  3007. #if(WINVER >= 0x0400)
  3008. /* */
  3009. /* Type codes which go in the high byte of the event DWORD of a stream buffer */
  3010. /* */
  3011. /* Type codes 00-7F contain parameters within the low 24 bits */
  3012. /* Type codes 80-FF contain a length of their parameter in the low 24 */
  3013. /* bits, followed by their parameter data in the buffer. The event */
  3014. /* DWORD contains the exact byte length; the parm data itself must be */
  3015. /* padded to be an even multiple of 4 bytes long. */
  3016. /* */
  3017.  
  3018. #define MEVT_F_SHORT        0x00000000L
  3019. #define MEVT_F_LONG         0x80000000L
  3020. #define MEVT_F_CALLBACK     0x40000000L
  3021.  
  3022. #define MEVT_EVENTTYPE(x)   ((BYTE)(((x)>>24)&0xFF))
  3023. #define MEVT_EVENTPARM(x)   ((DWORD)((x)&0x00FFFFFFL))
  3024.  
  3025. #define MEVT_SHORTMSG       ((BYTE)0x00)    /* parm = shortmsg for midiOutShortMsg */
  3026. #define MEVT_TEMPO          ((BYTE)0x01)    /* parm = new tempo in microsec/qn     */
  3027. #define MEVT_NOP            ((BYTE)0x02)    /* parm = unused; does nothing         */
  3028.  
  3029. /* 0x04-0x7F reserved */
  3030.  
  3031. #define MEVT_LONGMSG        ((BYTE)0x80)    /* parm = bytes to send verbatim       */
  3032. #define MEVT_COMMENT        ((BYTE)0x82)    /* parm = comment data                 */
  3033. #define MEVT_VERSION        ((BYTE)0x84)    /* parm = MIDISTRMBUFFVER struct       */
  3034.  
  3035. /* 0x81-0xFF reserved */
  3036.  
  3037. #define MIDISTRM_ERROR      (-2)
  3038.  
  3039. /* */
  3040. /* Structures and defines for midiStreamProperty */
  3041. /* */
  3042. #define MIDIPROP_SET        0x80000000L
  3043. #define MIDIPROP_GET        0x40000000L
  3044.  
  3045. /* These are intentionally both non-zero so the app cannot accidentally */
  3046. /* leave the operation off and happen to appear to work due to default */
  3047. /* action. */
  3048.  
  3049. #define MIDIPROP_TIMEDIV    0x00000001L
  3050. #define MIDIPROP_TEMPO      0x00000002L
  3051.  
  3052. typedef struct midiproptimediv_tag
  3053. {
  3054.     DWORD       cbStruct;
  3055.     DWORD       dwTimeDiv;
  3056. } MIDIPROPTIMEDIV, FAR *LPMIDIPROPTIMEDIV;
  3057.  
  3058. typedef struct midiproptempo_tag
  3059. {
  3060.     DWORD       cbStruct;
  3061.     DWORD       dwTempo;
  3062. } MIDIPROPTEMPO, FAR *LPMIDIPROPTEMPO;
  3063.  
  3064. #endif /* WINVER >= 0x0400 */
  3065.  
  3066. #ifndef _WIN32_VXD
  3067.  
  3068. /* MIDI function prototypes */
  3069. WINMMAPI UINT WINAPI midiOutGetNumDevs(void);
  3070. #if(WINVER >= 0x0400)
  3071. WINMMAPI MMRESULT WINAPI midiStreamOpen(LPHMIDISTRM phms, LPUINT puDeviceID, DWORD cMidi, DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen);
  3072. WINMMAPI MMRESULT WINAPI midiStreamClose(HMIDISTRM hms);
  3073.  
  3074. WINMMAPI MMRESULT WINAPI midiStreamProperty(HMIDISTRM hms, LPBYTE lppropdata, DWORD dwProperty);
  3075. WINMMAPI MMRESULT WINAPI midiStreamPosition(HMIDISTRM hms, LPMMTIME lpmmt, UINT cbmmt);
  3076.  
  3077. WINMMAPI MMRESULT WINAPI midiStreamOut(HMIDISTRM hms, LPMIDIHDR pmh, UINT cbmh);
  3078. WINMMAPI MMRESULT WINAPI midiStreamPause(HMIDISTRM hms);
  3079. WINMMAPI MMRESULT WINAPI midiStreamRestart(HMIDISTRM hms);
  3080. WINMMAPI MMRESULT WINAPI midiStreamStop(HMIDISTRM hms);
  3081.  
  3082. #ifdef _WIN32
  3083. WINMMAPI MMRESULT WINAPI midiConnect(HMIDI hmi, HMIDIOUT hmo, LPVOID pReserved);
  3084. WINMMAPI MMRESULT WINAPI midiDisconnect(HMIDI hmi, HMIDIOUT hmo, LPVOID pReserved);
  3085. #endif
  3086. #endif /* WINVER >= 0x0400 */
  3087.  
  3088. #ifdef _WIN32
  3089.  
  3090. WINMMAPI MMRESULT WINAPI midiOutGetDevCapsA(UINT uDeviceID, LPMIDIOUTCAPSA pmoc, UINT cbmoc);
  3091. WINMMAPI MMRESULT WINAPI midiOutGetDevCapsW(UINT uDeviceID, LPMIDIOUTCAPSW pmoc, UINT cbmoc);
  3092. #ifdef UNICODE
  3093. #define midiOutGetDevCaps  midiOutGetDevCapsW
  3094. #else
  3095. #define midiOutGetDevCaps  midiOutGetDevCapsA
  3096. #endif // !UNICODE
  3097.  
  3098. #else
  3099. MMRESULT WINAPI midiOutGetDevCaps(UINT uDeviceID, LPMIDIOUTCAPS pmoc, UINT cbmoc);
  3100. #endif
  3101.  
  3102. #if (WINVER >= 0x0400)
  3103. WINMMAPI MMRESULT WINAPI midiOutGetVolume(HMIDIOUT hmo, LPDWORD pdwVolume);
  3104. WINMMAPI MMRESULT WINAPI midiOutSetVolume(HMIDIOUT hmo, DWORD dwVolume);
  3105. #else
  3106. WINMMAPI MMRESULT WINAPI midiOutGetVolume(UINT uId, LPDWORD pdwVolume);
  3107. WINMMAPI MMRESULT WINAPI midiOutSetVolume(UINT uId, DWORD dwVolume);
  3108. #endif
  3109.  
  3110. #ifdef _WIN32
  3111.  
  3112. WINMMAPI MMRESULT WINAPI midiOutGetErrorTextA(MMRESULT mmrError, LPSTR pszText, UINT cchText);
  3113. WINMMAPI MMRESULT WINAPI midiOutGetErrorTextW(MMRESULT mmrError, LPWSTR pszText, UINT cchText);
  3114. #ifdef UNICODE
  3115. #define midiOutGetErrorText  midiOutGetErrorTextW
  3116. #else
  3117. #define midiOutGetErrorText  midiOutGetErrorTextA
  3118. #endif // !UNICODE
  3119.  
  3120. #else
  3121. WINMMAPI MMRESULT WINAPI midiOutGetErrorText(MMRESULT mmrError, LPSTR pszText, UINT cchText);
  3122. #endif
  3123.  
  3124. WINMMAPI MMRESULT WINAPI midiOutOpen(LPHMIDIOUT phmo, UINT uDeviceID,
  3125.     DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen);
  3126. WINMMAPI MMRESULT WINAPI midiOutClose(HMIDIOUT hmo);
  3127. WINMMAPI MMRESULT WINAPI midiOutPrepareHeader(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh);
  3128. WINMMAPI MMRESULT WINAPI midiOutUnprepareHeader(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh);
  3129. WINMMAPI MMRESULT WINAPI midiOutShortMsg(HMIDIOUT hmo, DWORD dwMsg);
  3130. WINMMAPI MMRESULT WINAPI midiOutLongMsg(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh);
  3131. WINMMAPI MMRESULT WINAPI midiOutReset(HMIDIOUT hmo);
  3132. WINMMAPI MMRESULT WINAPI midiOutCachePatches(HMIDIOUT hmo, UINT uBank, LPWORD pwpa, UINT fuCache);
  3133. WINMMAPI MMRESULT WINAPI midiOutCacheDrumPatches(HMIDIOUT hmo, UINT uPatch, LPWORD pwkya, UINT fuCache);
  3134. WINMMAPI MMRESULT WINAPI midiOutGetID(HMIDIOUT hmo, LPUINT puDeviceID);
  3135.  
  3136. #if (WINVER >= 0x030a)
  3137. #ifdef _WIN32
  3138. WINMMAPI MMRESULT WINAPI midiOutMessage(HMIDIOUT hmo, UINT uMsg, DWORD dw1, DWORD dw2);
  3139. #else
  3140. DWORD WINAPI midiOutMessage(HMIDIOUT hmo, UINT uMsg, DWORD dw1, DWORD dw2);
  3141. #endif
  3142. #endif /* ifdef WINVER >= 0x030a */
  3143.  
  3144. WINMMAPI UINT WINAPI midiInGetNumDevs(void);
  3145.  
  3146. #ifdef _WIN32
  3147.  
  3148. WINMMAPI MMRESULT WINAPI midiInGetDevCapsA(UINT uDeviceID, LPMIDIINCAPSA pmic, UINT cbmic);
  3149. WINMMAPI MMRESULT WINAPI midiInGetDevCapsW(UINT uDeviceID, LPMIDIINCAPSW pmic, UINT cbmic);
  3150. #ifdef UNICODE
  3151. #define midiInGetDevCaps  midiInGetDevCapsW
  3152. #else
  3153. #define midiInGetDevCaps  midiInGetDevCapsA
  3154. #endif // !UNICODE
  3155. WINMMAPI MMRESULT WINAPI midiInGetErrorTextA(MMRESULT mmrError, LPSTR pszText, UINT cchText);
  3156. WINMMAPI MMRESULT WINAPI midiInGetErrorTextW(MMRESULT mmrError, LPWSTR pszText, UINT cchText);
  3157. #ifdef UNICODE
  3158. #define midiInGetErrorText  midiInGetErrorTextW
  3159. #else
  3160. #define midiInGetErrorText  midiInGetErrorTextA
  3161. #endif // !UNICODE
  3162.  
  3163. #else
  3164. MMRESULT WINAPI midiInGetDevCaps(UINT uDeviceID, LPMIDIINCAPS pmic, UINT cbmic);
  3165. WINMMAPI MMRESULT WINAPI midiInGetErrorText(MMRESULT mmrError, LPSTR pszText, UINT cchText);
  3166. #endif
  3167.  
  3168. WINMMAPI MMRESULT WINAPI midiInOpen(LPHMIDIIN phmi, UINT uDeviceID,
  3169.     DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen);
  3170. WINMMAPI MMRESULT WINAPI midiInClose(HMIDIIN hmi);
  3171. WINMMAPI MMRESULT WINAPI midiInPrepareHeader(HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh);
  3172. WINMMAPI MMRESULT WINAPI midiInUnprepareHeader(HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh);
  3173. WINMMAPI MMRESULT WINAPI midiInAddBuffer(HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh);
  3174. WINMMAPI MMRESULT WINAPI midiInStart(HMIDIIN hmi);
  3175. WINMMAPI MMRESULT WINAPI midiInStop(HMIDIIN hmi);
  3176. WINMMAPI MMRESULT WINAPI midiInReset(HMIDIIN hmi);
  3177. WINMMAPI MMRESULT WINAPI midiInGetID(HMIDIIN hmi, LPUINT puDeviceID);
  3178.  
  3179. #if (WINVER >= 0x030a)
  3180. #ifdef _WIN32
  3181. WINMMAPI MMRESULT WINAPI midiInMessage(HMIDIIN hmi, UINT uMsg, DWORD dw1, DWORD dw2);
  3182. #else
  3183. DWORD WINAPI midiInMessage(HMIDIIN hmi, UINT uMsg, DWORD dw1, DWORD dw2);
  3184. #endif
  3185. #endif /* ifdef WINVER >= 0x030a */
  3186.  
  3187. #endif /* ifndef _WIN32_VXD */
  3188.  
  3189. #endif  /* ifndef MMNOMIDI */
  3190.  
  3191. #ifndef MMNOAUX
  3192. /****************************************************************************
  3193.  
  3194.             Auxiliary audio support
  3195.  
  3196. ****************************************************************************/
  3197.  
  3198. /* device ID for aux device mapper */
  3199. #define AUX_MAPPER     ((UINT)-1)
  3200.  
  3201. /* Auxiliary audio device capabilities structure */
  3202. #ifdef _WIN32
  3203.  
  3204. typedef struct tagAUXCAPSA {
  3205.     WORD        wMid;                /* manufacturer ID */
  3206.     WORD        wPid;                /* product ID */
  3207.     MMVERSION   vDriverVersion;      /* version of the driver */
  3208.     CHAR        szPname[MAXPNAMELEN];/* product name (NULL terminated string) */
  3209.     WORD        wTechnology;         /* type of device */
  3210.     WORD        wReserved1;          /* padding */
  3211.     DWORD       dwSupport;           /* functionality supported by driver */
  3212. } AUXCAPSA, *PAUXCAPSA, *NPAUXCAPSA, *LPAUXCAPSA;
  3213. typedef struct tagAUXCAPSW {
  3214.     WORD        wMid;                /* manufacturer ID */
  3215.     WORD        wPid;                /* product ID */
  3216.     MMVERSION   vDriverVersion;      /* version of the driver */
  3217.     WCHAR       szPname[MAXPNAMELEN];/* product name (NULL terminated string) */
  3218.     WORD        wTechnology;         /* type of device */
  3219.     WORD        wReserved1;          /* padding */
  3220.     DWORD       dwSupport;           /* functionality supported by driver */
  3221. } AUXCAPSW, *PAUXCAPSW, *NPAUXCAPSW, *LPAUXCAPSW;
  3222. #ifdef UNICODE
  3223. typedef AUXCAPSW AUXCAPS;
  3224. typedef PAUXCAPSW PAUXCAPS;
  3225. typedef NPAUXCAPSW NPAUXCAPS;
  3226. typedef LPAUXCAPSW LPAUXCAPS;
  3227. #else
  3228. typedef AUXCAPSA AUXCAPS;
  3229. typedef PAUXCAPSA PAUXCAPS;
  3230. typedef NPAUXCAPSA NPAUXCAPS;
  3231. typedef LPAUXCAPSA LPAUXCAPS;
  3232. #endif // UNICODE
  3233.  
  3234. #else
  3235. typedef struct auxcaps_tag {
  3236.     WORD    wMid;                  /* manufacturer ID */
  3237.     WORD    wPid;                  /* product ID */
  3238.     VERSION vDriverVersion;        /* version of the driver */
  3239.     char    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  3240.     WORD    wTechnology;           /* type of device */
  3241.     DWORD   dwSupport;             /* functionality supported by driver */
  3242. } AUXCAPS, *PAUXCAPS, NEAR *NPAUXCAPS, FAR *LPAUXCAPS;
  3243. #endif
  3244.  
  3245. /* flags for wTechnology field in AUXCAPS structure */
  3246. #define AUXCAPS_CDAUDIO    1       /* audio from internal CD-ROM drive */
  3247. #define AUXCAPS_AUXIN      2       /* audio from auxiliary input jacks */
  3248.  
  3249. /* flags for dwSupport field in AUXCAPS structure */
  3250. #define AUXCAPS_VOLUME          0x0001  /* supports volume control */
  3251. #define AUXCAPS_LRVOLUME        0x0002  /* separate left-right volume control */
  3252.  
  3253. #ifndef _WIN32_VXD
  3254.  
  3255. /* auxiliary audio function prototypes */
  3256. WINMMAPI UINT WINAPI auxGetNumDevs(void);
  3257. #ifdef _WIN32
  3258.  
  3259. WINMMAPI MMRESULT WINAPI auxGetDevCapsA(UINT uDeviceID, LPAUXCAPSA pac, UINT cbac);
  3260. WINMMAPI MMRESULT WINAPI auxGetDevCapsW(UINT uDeviceID, LPAUXCAPSW pac, UINT cbac);
  3261. #ifdef UNICODE
  3262. #define auxGetDevCaps  auxGetDevCapsW
  3263. #else
  3264. #define auxGetDevCaps  auxGetDevCapsA
  3265. #endif // !UNICODE
  3266.  
  3267. #else
  3268. MMRESULT WINAPI auxGetDevCaps(UINT uDeviceID, LPAUXCAPS pac, UINT cbac);
  3269. #endif
  3270. WINMMAPI MMRESULT WINAPI auxSetVolume(UINT uDeviceID, DWORD dwVolume);
  3271. WINMMAPI MMRESULT WINAPI auxGetVolume(UINT uDeviceID, LPDWORD pdwVolume);
  3272.  
  3273. #if (WINVER >= 0x030a)
  3274. #ifdef _WIN32
  3275. WINMMAPI MMRESULT WINAPI auxOutMessage(UINT uDeviceID, UINT uMsg, DWORD dw1, DWORD dw2);
  3276. #else
  3277. DWORD WINAPI auxOutMessage(UINT uDeviceID, UINT uMsg, DWORD dw1, DWORD dw2);
  3278. #endif
  3279. #endif /* ifdef WINVER >= 0x030a */
  3280.  
  3281. #endif /* ifndef _WIN32_VXD */
  3282.  
  3283. #endif  /* ifndef MMNOAUX */
  3284.  
  3285. #ifndef MMNOMIXER
  3286. #ifndef _WIN32_VXD
  3287. /****************************************************************************
  3288.  
  3289.                 Mixer Support
  3290.  
  3291. ****************************************************************************/
  3292.  
  3293. DECLARE_HANDLE(HMIXEROBJ);
  3294. typedef HMIXEROBJ FAR *LPHMIXEROBJ;
  3295.  
  3296. DECLARE_HANDLE(HMIXER);
  3297. typedef HMIXER     FAR *LPHMIXER;
  3298.  
  3299. #define MIXER_SHORT_NAME_CHARS   16
  3300. #define MIXER_LONG_NAME_CHARS    64
  3301.  
  3302. /* */
  3303. /*  MMRESULT error return values specific to the mixer API */
  3304. /* */
  3305. /* */
  3306. #define MIXERR_INVALLINE            (MIXERR_BASE + 0)
  3307. #define MIXERR_INVALCONTROL         (MIXERR_BASE + 1)
  3308. #define MIXERR_INVALVALUE           (MIXERR_BASE + 2)
  3309. #define MIXERR_LASTERROR            (MIXERR_BASE + 2)
  3310.  
  3311. #define MIXER_OBJECTF_HANDLE    0x80000000L
  3312. #define MIXER_OBJECTF_MIXER     0x00000000L
  3313. #define MIXER_OBJECTF_HMIXER    (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIXER)
  3314. #define MIXER_OBJECTF_WAVEOUT   0x10000000L
  3315. #define MIXER_OBJECTF_HWAVEOUT  (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEOUT)
  3316. #define MIXER_OBJECTF_WAVEIN    0x20000000L
  3317. #define MIXER_OBJECTF_HWAVEIN   (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEIN)
  3318. #define MIXER_OBJECTF_MIDIOUT   0x30000000L
  3319. #define MIXER_OBJECTF_HMIDIOUT  (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIOUT)
  3320. #define MIXER_OBJECTF_MIDIIN    0x40000000L
  3321. #define MIXER_OBJECTF_HMIDIIN   (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIIN)
  3322. #define MIXER_OBJECTF_AUX       0x50000000L
  3323.  
  3324. WINMMAPI UINT WINAPI mixerGetNumDevs(void);
  3325.  
  3326. #ifdef _WIN32
  3327.  
  3328. typedef struct tagMIXERCAPSA {
  3329.     WORD            wMid;                   /* manufacturer id */
  3330.     WORD            wPid;                   /* product id */
  3331.     MMVERSION       vDriverVersion;         /* version of the driver */
  3332.     CHAR            szPname[MAXPNAMELEN];   /* product name */
  3333.     DWORD           fdwSupport;             /* misc. support bits */
  3334.     DWORD           cDestinations;          /* count of destinations */
  3335. } MIXERCAPSA, *PMIXERCAPSA, *LPMIXERCAPSA;
  3336. typedef struct tagMIXERCAPSW {
  3337.     WORD            wMid;                   /* manufacturer id */
  3338.     WORD            wPid;                   /* product id */
  3339.     MMVERSION       vDriverVersion;         /* version of the driver */
  3340.     WCHAR           szPname[MAXPNAMELEN];   /* product name */
  3341.     DWORD           fdwSupport;             /* misc. support bits */
  3342.     DWORD           cDestinations;          /* count of destinations */
  3343. } MIXERCAPSW, *PMIXERCAPSW, *LPMIXERCAPSW;
  3344. #ifdef UNICODE
  3345. typedef MIXERCAPSW MIXERCAPS;
  3346. typedef PMIXERCAPSW PMIXERCAPS;
  3347. typedef LPMIXERCAPSW LPMIXERCAPS;
  3348. #else
  3349. typedef MIXERCAPSA MIXERCAPS;
  3350. typedef PMIXERCAPSA PMIXERCAPS;
  3351. typedef LPMIXERCAPSA LPMIXERCAPS;
  3352. #endif // UNICODE
  3353.  
  3354. #else
  3355. typedef struct tMIXERCAPS {
  3356.     WORD            wMid;                   /* manufacturer id */
  3357.     WORD            wPid;                   /* product id */
  3358.     VERSION         vDriverVersion;         /* version of the driver */
  3359.     char            szPname[MAXPNAMELEN];   /* product name */
  3360.     DWORD           fdwSupport;             /* misc. support bits */
  3361.     DWORD           cDestinations;          /* count of destinations */
  3362. } MIXERCAPS, *PMIXERCAPS, FAR *LPMIXERCAPS;
  3363. #endif
  3364.  
  3365. #ifdef _WIN32
  3366.  
  3367. WINMMAPI MMRESULT WINAPI mixerGetDevCapsA(UINT uMxId, LPMIXERCAPSA pmxcaps, UINT cbmxcaps);
  3368. WINMMAPI MMRESULT WINAPI mixerGetDevCapsW(UINT uMxId, LPMIXERCAPSW pmxcaps, UINT cbmxcaps);
  3369. #ifdef UNICODE
  3370. #define mixerGetDevCaps  mixerGetDevCapsW
  3371. #else
  3372. #define mixerGetDevCaps  mixerGetDevCapsA
  3373. #endif // !UNICODE
  3374.  
  3375. #else
  3376. MMRESULT WINAPI mixerGetDevCaps(UINT uMxId, LPMIXERCAPS pmxcaps, UINT cbmxcaps);
  3377. #endif
  3378.  
  3379. WINMMAPI MMRESULT WINAPI mixerOpen(LPHMIXER phmx, UINT uMxId, DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen);
  3380.  
  3381. WINMMAPI MMRESULT WINAPI mixerClose(HMIXER hmx);
  3382.  
  3383. WINMMAPI DWORD WINAPI mixerMessage(HMIXER hmx, UINT uMsg, DWORD dwParam1, DWORD dwParam2);
  3384.  
  3385. #ifdef _WIN32
  3386.  
  3387. typedef struct tagMIXERLINEA {
  3388.     DWORD       cbStruct;               /* size of MIXERLINE structure */
  3389.     DWORD       dwDestination;          /* zero based destination index */
  3390.     DWORD       dwSource;               /* zero based source index (if source) */
  3391.     DWORD       dwLineID;               /* unique line id for mixer device */
  3392.     DWORD       fdwLine;                /* state/information about line */
  3393.     DWORD       dwUser;                 /* driver specific information */
  3394.     DWORD       dwComponentType;        /* component type line connects to */
  3395.     DWORD       cChannels;              /* number of channels line supports */
  3396.     DWORD       cConnections;           /* number of connections [possible] */
  3397.     DWORD       cControls;              /* number of controls at this line */
  3398.     CHAR        szShortName[MIXER_SHORT_NAME_CHARS];
  3399.     CHAR        szName[MIXER_LONG_NAME_CHARS];
  3400.     struct {
  3401.     DWORD   dwType;                 /* MIXERLINE_TARGETTYPE_xxxx */
  3402.     DWORD   dwDeviceID;             /* target device ID of device type */
  3403.     WORD    wMid;                   /* of target device */
  3404.     WORD    wPid;                   /*      " */
  3405.     MMVERSION vDriverVersion;       /*      " */
  3406.     CHAR    szPname[MAXPNAMELEN];   /*      " */
  3407.     } Target;
  3408. } MIXERLINEA, *PMIXERLINEA, *LPMIXERLINEA;
  3409. typedef struct tagMIXERLINEW {
  3410.     DWORD       cbStruct;               /* size of MIXERLINE structure */
  3411.     DWORD       dwDestination;          /* zero based destination index */
  3412.     DWORD       dwSource;               /* zero based source index (if source) */
  3413.     DWORD       dwLineID;               /* unique line id for mixer device */
  3414.     DWORD       fdwLine;                /* state/information about line */
  3415.     DWORD       dwUser;                 /* driver specific information */
  3416.     DWORD       dwComponentType;        /* component type line connects to */
  3417.     DWORD       cChannels;              /* number of channels line supports */
  3418.     DWORD       cConnections;           /* number of connections [possible] */
  3419.     DWORD       cControls;              /* number of controls at this line */
  3420.     WCHAR       szShortName[MIXER_SHORT_NAME_CHARS];
  3421.     WCHAR       szName[MIXER_LONG_NAME_CHARS];
  3422.     struct {
  3423.     DWORD   dwType;                 /* MIXERLINE_TARGETTYPE_xxxx */
  3424.     DWORD   dwDeviceID;             /* target device ID of device type */
  3425.     WORD    wMid;                   /* of target device */
  3426.     WORD    wPid;                   /*      " */
  3427.     MMVERSION vDriverVersion;       /*      " */
  3428.     WCHAR   szPname[MAXPNAMELEN];   /*      " */
  3429.     } Target;
  3430. } MIXERLINEW, *PMIXERLINEW, *LPMIXERLINEW;
  3431. #ifdef UNICODE
  3432. typedef MIXERLINEW MIXERLINE;
  3433. typedef PMIXERLINEW PMIXERLINE;
  3434. typedef LPMIXERLINEW LPMIXERLINE;
  3435. #else
  3436. typedef MIXERLINEA MIXERLINE;
  3437. typedef PMIXERLINEA PMIXERLINE;
  3438. typedef LPMIXERLINEA LPMIXERLINE;
  3439. #endif // UNICODE
  3440.  
  3441. #else
  3442. typedef struct tMIXERLINE {
  3443.     DWORD       cbStruct;               /* size of MIXERLINE structure */
  3444.     DWORD       dwDestination;          /* zero based destination index */
  3445.     DWORD       dwSource;               /* zero based source index (if source) */
  3446.     DWORD       dwLineID;               /* unique line id for mixer device */
  3447.     DWORD       fdwLine;                /* state/information about line */
  3448.     DWORD       dwUser;                 /* driver specific information */
  3449.     DWORD       dwComponentType;        /* component type line connects to */
  3450.     DWORD       cChannels;              /* number of channels line supports */
  3451.     DWORD       cConnections;           /* number of connections [possible] */
  3452.     DWORD       cControls;              /* number of controls at this line */
  3453.     char        szShortName[MIXER_SHORT_NAME_CHARS];
  3454.     char        szName[MIXER_LONG_NAME_CHARS];
  3455.     struct {
  3456.     DWORD   dwType;                 /* MIXERLINE_TARGETTYPE_xxxx */
  3457.     DWORD   dwDeviceID;             /* target device ID of device type */
  3458.     WORD    wMid;                   /* of target device */
  3459.     WORD    wPid;                   /*      " */
  3460.     VERSION vDriverVersion;         /*      " */
  3461.     char    szPname[MAXPNAMELEN];   /*      " */
  3462.     } Target;
  3463. } MIXERLINE, *PMIXERLINE, FAR *LPMIXERLINE;
  3464. #endif
  3465.  
  3466. /* */
  3467. /*  MIXERLINE.fdwLine */
  3468. /* */
  3469. /* */
  3470. #define MIXERLINE_LINEF_ACTIVE              0x00000001L
  3471. #define MIXERLINE_LINEF_DISCONNECTED        0x00008000L
  3472. #define MIXERLINE_LINEF_SOURCE              0x80000000L
  3473.  
  3474. /* */
  3475. /*  MIXERLINE.dwComponentType */
  3476. /* */
  3477. /*  component types for destinations and sources */
  3478. /* */
  3479. /* */
  3480. #define MIXERLINE_COMPONENTTYPE_DST_FIRST       0x00000000L
  3481. #define MIXERLINE_COMPONENTTYPE_DST_UNDEFINED   (MIXERLINE_COMPONENTTYPE_DST_FIRST + 0)
  3482. #define MIXERLINE_COMPONENTTYPE_DST_DIGITAL     (MIXERLINE_COMPONENTTYPE_DST_FIRST + 1)
  3483. #define MIXERLINE_COMPONENTTYPE_DST_LINE        (MIXERLINE_COMPONENTTYPE_DST_FIRST + 2)
  3484. #define MIXERLINE_COMPONENTTYPE_DST_MONITOR     (MIXERLINE_COMPONENTTYPE_DST_FIRST + 3)
  3485. #define MIXERLINE_COMPONENTTYPE_DST_SPEAKERS    (MIXERLINE_COMPONENTTYPE_DST_FIRST + 4)
  3486. #define MIXERLINE_COMPONENTTYPE_DST_HEADPHONES  (MIXERLINE_COMPONENTTYPE_DST_FIRST + 5)
  3487. #define MIXERLINE_COMPONENTTYPE_DST_TELEPHONE   (MIXERLINE_COMPONENTTYPE_DST_FIRST + 6)
  3488. #define MIXERLINE_COMPONENTTYPE_DST_WAVEIN      (MIXERLINE_COMPONENTTYPE_DST_FIRST + 7)
  3489. #define MIXERLINE_COMPONENTTYPE_DST_VOICEIN     (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8)
  3490. #define MIXERLINE_COMPONENTTYPE_DST_LAST        (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8)
  3491.  
  3492. #define MIXERLINE_COMPONENTTYPE_SRC_FIRST       0x00001000L
  3493. #define MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED   (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0)
  3494. #define MIXERLINE_COMPONENTTYPE_SRC_DIGITAL     (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1)
  3495. #define MIXERLINE_COMPONENTTYPE_SRC_LINE        (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2)
  3496. #define MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE  (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3)
  3497. #define MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 4)
  3498. #define MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 5)
  3499. #define MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE   (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 6)
  3500. #define MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER   (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 7)
  3501. #define MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT     (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 8)
  3502. #define MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY   (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 9)
  3503. #define MIXERLINE_COMPONENTTYPE_SRC_ANALOG      (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10)
  3504. #define MIXERLINE_COMPONENTTYPE_SRC_LAST        (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10)
  3505.  
  3506. /* */
  3507. /*  MIXERLINE.Target.dwType */
  3508. /* */
  3509. /* */
  3510. #define MIXERLINE_TARGETTYPE_UNDEFINED      0
  3511. #define MIXERLINE_TARGETTYPE_WAVEOUT        1
  3512. #define MIXERLINE_TARGETTYPE_WAVEIN         2
  3513. #define MIXERLINE_TARGETTYPE_MIDIOUT        3
  3514. #define MIXERLINE_TARGETTYPE_MIDIIN         4
  3515. #define MIXERLINE_TARGETTYPE_AUX            5
  3516.  
  3517. #ifdef _WIN32
  3518.  
  3519. WINMMAPI MMRESULT WINAPI mixerGetLineInfoA(HMIXEROBJ hmxobj, LPMIXERLINEA pmxl, DWORD fdwInfo);
  3520. WINMMAPI MMRESULT WINAPI mixerGetLineInfoW(HMIXEROBJ hmxobj, LPMIXERLINEW pmxl, DWORD fdwInfo);
  3521. #ifdef UNICODE
  3522. #define mixerGetLineInfo  mixerGetLineInfoW
  3523. #else
  3524. #define mixerGetLineInfo  mixerGetLineInfoA
  3525. #endif // !UNICODE
  3526.  
  3527. #else
  3528. MMRESULT WINAPI mixerGetLineInfo(HMIXEROBJ hmxobj, LPMIXERLINE pmxl, DWORD fdwInfo);
  3529. #endif
  3530.  
  3531. #define MIXER_GETLINEINFOF_DESTINATION      0x00000000L
  3532. #define MIXER_GETLINEINFOF_SOURCE           0x00000001L
  3533. #define MIXER_GETLINEINFOF_LINEID           0x00000002L
  3534. #define MIXER_GETLINEINFOF_COMPONENTTYPE    0x00000003L
  3535. #define MIXER_GETLINEINFOF_TARGETTYPE       0x00000004L
  3536.  
  3537. #define MIXER_GETLINEINFOF_QUERYMASK        0x0000000FL
  3538.  
  3539. WINMMAPI MMRESULT WINAPI mixerGetID(HMIXEROBJ hmxobj, UINT FAR *puMxId, DWORD fdwId);
  3540.  
  3541. /* */
  3542. /*  MIXERCONTROL */
  3543. /* */
  3544. /* */
  3545. #ifdef _WIN32
  3546.  
  3547. typedef struct tagMIXERCONTROLA {
  3548.     DWORD           cbStruct;           /* size in bytes of MIXERCONTROL */
  3549.     DWORD           dwControlID;        /* unique control id for mixer device */
  3550.     DWORD           dwControlType;      /* MIXERCONTROL_CONTROLTYPE_xxx */
  3551.     DWORD           fdwControl;         /* MIXERCONTROL_CONTROLF_xxx */
  3552.     DWORD           cMultipleItems;     /* if MIXERCONTROL_CONTROLF_MULTIPLE set */
  3553.     CHAR            szShortName[MIXER_SHORT_NAME_CHARS];
  3554.     CHAR            szName[MIXER_LONG_NAME_CHARS];
  3555.     union {
  3556.     struct {
  3557.         LONG    lMinimum;           /* signed minimum for this control */
  3558.         LONG    lMaximum;           /* signed maximum for this control */
  3559. #if defined(_ANONYMOUS_STRUCT)
  3560.     };
  3561. #else
  3562.     }s;
  3563. #endif
  3564.     struct {
  3565.         DWORD   dwMinimum;          /* unsigned minimum for this control */
  3566.         DWORD   dwMaximum;          /* unsigned maximum for this control */
  3567. #if defined(_ANONYMOUS_STRUCT)
  3568.     };
  3569. #else
  3570.     }s1;
  3571. #endif
  3572.     DWORD       dwReserved[6];
  3573.     } Bounds;
  3574.     union {
  3575.     DWORD       cSteps;             /* # of steps between min & max */
  3576.     DWORD       cbCustomData;       /* size in bytes of custom data */
  3577.     DWORD       dwReserved[6];      /* !!! needed? we have cbStruct.... */
  3578.     } Metrics;
  3579. } MIXERCONTROLA, *PMIXERCONTROLA, *LPMIXERCONTROLA;
  3580. typedef struct tagMIXERCONTROLW {
  3581.     DWORD           cbStruct;           /* size in bytes of MIXERCONTROL */
  3582.     DWORD           dwControlID;        /* unique control id for mixer device */
  3583.     DWORD           dwControlType;      /* MIXERCONTROL_CONTROLTYPE_xxx */
  3584.     DWORD           fdwControl;         /* MIXERCONTROL_CONTROLF_xxx */
  3585.     DWORD           cMultipleItems;     /* if MIXERCONTROL_CONTROLF_MULTIPLE set */
  3586.     WCHAR           szShortName[MIXER_SHORT_NAME_CHARS];
  3587.     WCHAR           szName[MIXER_LONG_NAME_CHARS];
  3588.     union {
  3589.     struct {
  3590.         LONG    lMinimum;           /* signed minimum for this control */
  3591.         LONG    lMaximum;           /* signed maximum for this control */
  3592. #if defined(_ANONYMOUS_STRUCT)
  3593.     };
  3594. #else
  3595.     }s;
  3596. #endif
  3597.     struct {
  3598.         DWORD   dwMinimum;          /* unsigned minimum for this control */
  3599.         DWORD   dwMaximum;          /* unsigned maximum for this control */
  3600. #if defined(_ANONYMOUS_STRUCT)
  3601.     };
  3602. #else
  3603.     }s1;
  3604. #endif
  3605.     DWORD       dwReserved[6];
  3606.     } Bounds;
  3607.     union {
  3608.     DWORD       cSteps;             /* # of steps between min & max */
  3609.     DWORD       cbCustomData;       /* size in bytes of custom data */
  3610.     DWORD       dwReserved[6];      /* !!! needed? we have cbStruct.... */
  3611.     } Metrics;
  3612. } MIXERCONTROLW, *PMIXERCONTROLW, *LPMIXERCONTROLW;
  3613. #ifdef UNICODE
  3614. typedef MIXERCONTROLW MIXERCONTROL;
  3615. typedef PMIXERCONTROLW PMIXERCONTROL;
  3616. typedef LPMIXERCONTROLW LPMIXERCONTROL;
  3617. #else
  3618. typedef MIXERCONTROLA MIXERCONTROL;
  3619. typedef PMIXERCONTROLA PMIXERCONTROL;
  3620. typedef LPMIXERCONTROLA LPMIXERCONTROL;
  3621. #endif // UNICODE
  3622.  
  3623. #else
  3624. typedef struct tMIXERCONTROL {
  3625.     DWORD           cbStruct;           /* size in bytes of MIXERCONTROL */
  3626.     DWORD           dwControlID;        /* unique control id for mixer device */
  3627.     DWORD           dwControlType;      /* MIXERCONTROL_CONTROLTYPE_xxx */
  3628.     DWORD           fdwControl;         /* MIXERCONTROL_CONTROLF_xxx */
  3629.     DWORD           cMultipleItems;     /* if MIXERCONTROL_CONTROLF_MULTIPLE set */
  3630.     char            szShortName[MIXER_SHORT_NAME_CHARS];
  3631.     char            szName[MIXER_LONG_NAME_CHARS];
  3632.     union {
  3633.     struct {
  3634.         LONG    lMinimum;           /* signed minimum for this control */
  3635.         LONG    lMaximum;           /* signed maximum for this control */
  3636.     };
  3637.     struct {
  3638.         DWORD   dwMinimum;          /* unsigned minimum for this control */
  3639.         DWORD   dwMaximum;          /* unsigned maximum for this control */
  3640.     };
  3641.     DWORD       dwReserved[6];
  3642.     } Bounds;
  3643.     union {
  3644.     DWORD       cSteps;             /* # of steps between min & max */
  3645.     DWORD       cbCustomData;       /* size in bytes of custom data */
  3646.     DWORD       dwReserved[6];      /* !!! needed? we have cbStruct.... */
  3647.     } Metrics;
  3648. } MIXERCONTROL, *PMIXERCONTROL, FAR *LPMIXERCONTROL;
  3649. #endif
  3650.  
  3651. /* */
  3652. /*  MIXERCONTROL.fdwControl */
  3653. /* */
  3654. /* */
  3655. #define MIXERCONTROL_CONTROLF_UNIFORM   0x00000001L
  3656. #define MIXERCONTROL_CONTROLF_MULTIPLE  0x00000002L
  3657. #define MIXERCONTROL_CONTROLF_DISABLED  0x80000000L
  3658.  
  3659. /* */
  3660. /*  MIXERCONTROL_CONTROLTYPE_xxx building block defines */
  3661. /* */
  3662. /* */
  3663. #define MIXERCONTROL_CT_CLASS_MASK          0xF0000000L
  3664. #define MIXERCONTROL_CT_CLASS_CUSTOM        0x00000000L
  3665. #define MIXERCONTROL_CT_CLASS_METER         0x10000000L
  3666. #define MIXERCONTROL_CT_CLASS_SWITCH        0x20000000L
  3667. #define MIXERCONTROL_CT_CLASS_NUMBER        0x30000000L
  3668. #define MIXERCONTROL_CT_CLASS_SLIDER        0x40000000L
  3669. #define MIXERCONTROL_CT_CLASS_FADER         0x50000000L
  3670. #define MIXERCONTROL_CT_CLASS_TIME          0x60000000L
  3671. #define MIXERCONTROL_CT_CLASS_LIST          0x70000000L
  3672.  
  3673. #define MIXERCONTROL_CT_SUBCLASS_MASK       0x0F000000L
  3674.  
  3675. #define MIXERCONTROL_CT_SC_SWITCH_BOOLEAN   0x00000000L
  3676. #define MIXERCONTROL_CT_SC_SWITCH_BUTTON    0x01000000L
  3677.  
  3678. #define MIXERCONTROL_CT_SC_METER_POLLED     0x00000000L
  3679.  
  3680. #define MIXERCONTROL_CT_SC_TIME_MICROSECS   0x00000000L
  3681. #define MIXERCONTROL_CT_SC_TIME_MILLISECS   0x01000000L
  3682.  
  3683. #define MIXERCONTROL_CT_SC_LIST_SINGLE      0x00000000L
  3684. #define MIXERCONTROL_CT_SC_LIST_MULTIPLE    0x01000000L
  3685.  
  3686. #define MIXERCONTROL_CT_UNITS_MASK          0x00FF0000L
  3687. #define MIXERCONTROL_CT_UNITS_CUSTOM        0x00000000L
  3688. #define MIXERCONTROL_CT_UNITS_BOOLEAN       0x00010000L
  3689. #define MIXERCONTROL_CT_UNITS_SIGNED        0x00020000L
  3690. #define MIXERCONTROL_CT_UNITS_UNSIGNED      0x00030000L
  3691. #define MIXERCONTROL_CT_UNITS_DECIBELS      0x00040000L /* in 10ths */
  3692. #define MIXERCONTROL_CT_UNITS_PERCENT       0x00050000L /* in 10ths */
  3693.  
  3694. /* */
  3695. /*  Commonly used control types for specifying MIXERCONTROL.dwControlType */
  3696. /* */
  3697.  
  3698. #define MIXERCONTROL_CONTROLTYPE_CUSTOM         (MIXERCONTROL_CT_CLASS_CUSTOM | MIXERCONTROL_CT_UNITS_CUSTOM)
  3699. #define MIXERCONTROL_CONTROLTYPE_BOOLEANMETER   (MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_BOOLEAN)
  3700. #define MIXERCONTROL_CONTROLTYPE_SIGNEDMETER    (MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_SIGNED)
  3701. #define MIXERCONTROL_CONTROLTYPE_PEAKMETER      (MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1)
  3702. #define MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER  (MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_UNSIGNED)
  3703. #define MIXERCONTROL_CONTROLTYPE_BOOLEAN        (MIXERCONTROL_CT_CLASS_SWITCH | MIXERCONTROL_CT_SC_SWITCH_BOOLEAN | MIXERCONTROL_CT_UNITS_BOOLEAN)
  3704. #define MIXERCONTROL_CONTROLTYPE_ONOFF          (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 1)
  3705. #define MIXERCONTROL_CONTROLTYPE_MUTE           (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2)
  3706. #define MIXERCONTROL_CONTROLTYPE_MONO           (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 3)
  3707. #define MIXERCONTROL_CONTROLTYPE_LOUDNESS       (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 4)
  3708. #define MIXERCONTROL_CONTROLTYPE_STEREOENH      (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 5)
  3709. #define MIXERCONTROL_CONTROLTYPE_BUTTON         (MIXERCONTROL_CT_CLASS_SWITCH | MIXERCONTROL_CT_SC_SWITCH_BUTTON | MIXERCONTROL_CT_UNITS_BOOLEAN)
  3710. #define MIXERCONTROL_CONTROLTYPE_DECIBELS       (MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_DECIBELS)
  3711. #define MIXERCONTROL_CONTROLTYPE_SIGNED         (MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_SIGNED)
  3712. #define MIXERCONTROL_CONTROLTYPE_UNSIGNED       (MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_UNSIGNED)
  3713. #define MIXERCONTROL_CONTROLTYPE_PERCENT        (MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_PERCENT)
  3714. #define MIXERCONTROL_CONTROLTYPE_SLIDER         (MIXERCONTROL_CT_CLASS_SLIDER | MIXERCONTROL_CT_UNITS_SIGNED)
  3715. #define MIXERCONTROL_CONTROLTYPE_PAN            (MIXERCONTROL_CONTROLTYPE_SLIDER + 1)
  3716. #define MIXERCONTROL_CONTROLTYPE_QSOUNDPAN      (MIXERCONTROL_CONTROLTYPE_SLIDER + 2)
  3717. #define MIXERCONTROL_CONTROLTYPE_FADER          (MIXERCONTROL_CT_CLASS_FADER | MIXERCONTROL_CT_UNITS_UNSIGNED)
  3718. #define MIXERCONTROL_CONTROLTYPE_VOLUME         (MIXERCONTROL_CONTROLTYPE_FADER + 1)
  3719. #define MIXERCONTROL_CONTROLTYPE_BASS           (MIXERCONTROL_CONTROLTYPE_FADER + 2)
  3720. #define MIXERCONTROL_CONTROLTYPE_TREBLE         (MIXERCONTROL_CONTROLTYPE_FADER + 3)
  3721. #define MIXERCONTROL_CONTROLTYPE_EQUALIZER      (MIXERCONTROL_CONTROLTYPE_FADER + 4)
  3722. #define MIXERCONTROL_CONTROLTYPE_SINGLESELECT   (MIXERCONTROL_CT_CLASS_LIST | MIXERCONTROL_CT_SC_LIST_SINGLE | MIXERCONTROL_CT_UNITS_BOOLEAN)
  3723. #define MIXERCONTROL_CONTROLTYPE_MUX            (MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1)
  3724. #define MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT (MIXERCONTROL_CT_CLASS_LIST | MIXERCONTROL_CT_SC_LIST_MULTIPLE | MIXERCONTROL_CT_UNITS_BOOLEAN)
  3725. #define MIXERCONTROL_CONTROLTYPE_MIXER          (MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT + 1)
  3726. #define MIXERCONTROL_CONTROLTYPE_MICROTIME      (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MICROSECS | MIXERCONTROL_CT_UNITS_UNSIGNED)
  3727. #define MIXERCONTROL_CONTROLTYPE_MILLITIME      (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MILLISECS | MIXERCONTROL_CT_UNITS_UNSIGNED)
  3728.  
  3729. /* */
  3730. /*  MIXERLINECONTROLS */
  3731. /* */
  3732. #ifdef _WIN32
  3733.  
  3734. typedef struct tagMIXERLINECONTROLSA {
  3735.     DWORD           cbStruct;       /* size in bytes of MIXERLINECONTROLS */
  3736.     DWORD           dwLineID;       /* line id (from MIXERLINE.dwLineID) */
  3737.     union {
  3738.     DWORD       dwControlID;    /* MIXER_GETLINECONTROLSF_ONEBYID */
  3739.     DWORD       dwControlType;  /* MIXER_GETLINECONTROLSF_ONEBYTYPE */
  3740. #if defined(__cplusplus) || defined(_ANONYMOUS_UNION)
  3741.     };
  3742. #else
  3743.     }u;
  3744. #endif
  3745.     DWORD           cControls;      /* count of controls pmxctrl points to */
  3746.     DWORD           cbmxctrl;       /* size in bytes of _one_ MIXERCONTROL */
  3747.     LPMIXERCONTROLA pamxctrl;       /* pointer to first MIXERCONTROL array */
  3748. } MIXERLINECONTROLSA, *PMIXERLINECONTROLSA, *LPMIXERLINECONTROLSA;
  3749. typedef struct tagMIXERLINECONTROLSW {
  3750.     DWORD           cbStruct;       /* size in bytes of MIXERLINECONTROLS */
  3751.     DWORD           dwLineID;       /* line id (from MIXERLINE.dwLineID) */
  3752.     union {
  3753.     DWORD       dwControlID;    /* MIXER_GETLINECONTROLSF_ONEBYID */
  3754.     DWORD       dwControlType;  /* MIXER_GETLINECONTROLSF_ONEBYTYPE */
  3755. #if defined(__cplusplus) || defined(_ANONYMOUS_UNION)
  3756.     };
  3757. #else
  3758.     }u;
  3759. #endif
  3760.     DWORD           cControls;      /* count of controls pmxctrl points to */
  3761.     DWORD           cbmxctrl;       /* size in bytes of _one_ MIXERCONTROL */
  3762.     LPMIXERCONTROLW pamxctrl;       /* pointer to first MIXERCONTROL array */
  3763. } MIXERLINECONTROLSW, *PMIXERLINECONTROLSW, *LPMIXERLINECONTROLSW;
  3764. #ifdef UNICODE
  3765. typedef MIXERLINECONTROLSW MIXERLINECONTROLS;
  3766. typedef PMIXERLINECONTROLSW PMIXERLINECONTROLS;
  3767. typedef LPMIXERLINECONTROLSW LPMIXERLINECONTROLS;
  3768. #else
  3769. typedef MIXERLINECONTROLSA MIXERLINECONTROLS;
  3770. typedef PMIXERLINECONTROLSA PMIXERLINECONTROLS;
  3771. typedef LPMIXERLINECONTROLSA LPMIXERLINECONTROLS;
  3772. #endif // UNICODE
  3773.  
  3774. #else
  3775. typedef struct tMIXERLINECONTROLS {
  3776.     DWORD           cbStruct;       /* size in bytes of MIXERLINECONTROLS */
  3777.     DWORD           dwLineID;       /* line id (from MIXERLINE.dwLineID) */
  3778.     union {
  3779.     DWORD       dwControlID;    /* MIXER_GETLINECONTROLSF_ONEBYID */
  3780.     DWORD       dwControlType;  /* MIXER_GETLINECONTROLSF_ONEBYTYPE */
  3781.     };
  3782.     DWORD           cControls;      /* count of controls pmxctrl points to */
  3783.     DWORD           cbmxctrl;       /* size in bytes of _one_ MIXERCONTROL */
  3784.     LPMIXERCONTROL  pamxctrl;       /* pointer to first MIXERCONTROL array */
  3785. } MIXERLINECONTROLS, *PMIXERLINECONTROLS, FAR *LPMIXERLINECONTROLS;
  3786. #endif
  3787.  
  3788. /* */
  3789. /* */
  3790. /* */
  3791. #ifdef _WIN32
  3792.  
  3793. WINMMAPI MMRESULT WINAPI mixerGetLineControlsA(HMIXEROBJ hmxobj, LPMIXERLINECONTROLSA pmxlc, DWORD fdwControls);
  3794. WINMMAPI MMRESULT WINAPI mixerGetLineControlsW(HMIXEROBJ hmxobj, LPMIXERLINECONTROLSW pmxlc, DWORD fdwControls);
  3795. #ifdef UNICODE
  3796. #define mixerGetLineControls  mixerGetLineControlsW
  3797. #else
  3798. #define mixerGetLineControls  mixerGetLineControlsA
  3799. #endif // !UNICODE
  3800.  
  3801. #else
  3802. MMRESULT WINAPI mixerGetLineControls(HMIXEROBJ hmxobj, LPMIXERLINECONTROLS pmxlc, DWORD fdwControls);
  3803. #endif
  3804.  
  3805. #define MIXER_GETLINECONTROLSF_ALL          0x00000000L
  3806. #define MIXER_GETLINECONTROLSF_ONEBYID      0x00000001L
  3807. #define MIXER_GETLINECONTROLSF_ONEBYTYPE    0x00000002L
  3808.  
  3809. #define MIXER_GETLINECONTROLSF_QUERYMASK    0x0000000FL
  3810.  
  3811. typedef struct tMIXERCONTROLDETAILS {
  3812.     DWORD           cbStruct;       /* size in bytes of MIXERCONTROLDETAILS */
  3813.     DWORD           dwControlID;    /* control id to get/set details on */
  3814.     DWORD           cChannels;      /* number of channels in paDetails array */
  3815.     union {
  3816.     HWND        hwndOwner;      /* for MIXER_SETCONTROLDETAILSF_CUSTOM */
  3817.     DWORD       cMultipleItems; /* if _MULTIPLE, the number of items per channel */
  3818. #if defined(__cplusplus) || defined(_ANONYMOUS_UNION)
  3819.     };
  3820. #else
  3821.     }u;
  3822. #endif
  3823.     DWORD           cbDetails;      /* size of _one_ details_XX struct */
  3824.     LPVOID          paDetails;      /* pointer to array of details_XX structs */
  3825. } MIXERCONTROLDETAILS, *PMIXERCONTROLDETAILS, FAR *LPMIXERCONTROLDETAILS;
  3826.  
  3827. /* */
  3828. /*  MIXER_GETCONTROLDETAILSF_LISTTEXT */
  3829. /* */
  3830. /* */
  3831. #ifdef _WIN32
  3832.  
  3833. typedef struct tagMIXERCONTROLDETAILS_LISTTEXTA {
  3834.     DWORD           dwParam1;
  3835.     DWORD           dwParam2;
  3836.     CHAR            szName[MIXER_LONG_NAME_CHARS];
  3837. } MIXERCONTROLDETAILS_LISTTEXTA, *PMIXERCONTROLDETAILS_LISTTEXTA, *LPMIXERCONTROLDETAILS_LISTTEXTA;
  3838. typedef struct tagMIXERCONTROLDETAILS_LISTTEXTW {
  3839.     DWORD           dwParam1;
  3840.     DWORD           dwParam2;
  3841.     WCHAR           szName[MIXER_LONG_NAME_CHARS];
  3842. } MIXERCONTROLDETAILS_LISTTEXTW, *PMIXERCONTROLDETAILS_LISTTEXTW, *LPMIXERCONTROLDETAILS_LISTTEXTW;
  3843. #ifdef UNICODE
  3844. typedef MIXERCONTROLDETAILS_LISTTEXTW MIXERCONTROLDETAILS_LISTTEXT;
  3845. typedef PMIXERCONTROLDETAILS_LISTTEXTW PMIXERCONTROLDETAILS_LISTTEXT;
  3846. typedef LPMIXERCONTROLDETAILS_LISTTEXTW LPMIXERCONTROLDETAILS_LISTTEXT;
  3847. #else
  3848. typedef MIXERCONTROLDETAILS_LISTTEXTA MIXERCONTROLDETAILS_LISTTEXT;
  3849. typedef PMIXERCONTROLDETAILS_LISTTEXTA PMIXERCONTROLDETAILS_LISTTEXT;
  3850. typedef LPMIXERCONTROLDETAILS_LISTTEXTA LPMIXERCONTROLDETAILS_LISTTEXT;
  3851. #endif // UNICODE
  3852.  
  3853. #else
  3854. typedef struct tMIXERCONTROLDETAILS_LISTTEXT {
  3855.     DWORD           dwParam1;
  3856.     DWORD           dwParam2;
  3857.     char            szName[MIXER_LONG_NAME_CHARS];
  3858. } MIXERCONTROLDETAILS_LISTTEXT, *PMIXERCONTROLDETAILS_LISTTEXT, FAR *LPMIXERCONTROLDETAILS_LISTTEXT;
  3859. #endif
  3860.  
  3861. /* */
  3862. /*  MIXER_GETCONTROLDETAILSF_VALUE */
  3863. /* */
  3864. /* */
  3865. typedef struct tMIXERCONTROLDETAILS_BOOLEAN {
  3866.     LONG            fValue;
  3867. }       MIXERCONTROLDETAILS_BOOLEAN,
  3868.       *PMIXERCONTROLDETAILS_BOOLEAN,
  3869.  FAR *LPMIXERCONTROLDETAILS_BOOLEAN;
  3870.  
  3871. typedef struct tMIXERCONTROLDETAILS_SIGNED {
  3872.     LONG            lValue;
  3873. }       MIXERCONTROLDETAILS_SIGNED,
  3874.       *PMIXERCONTROLDETAILS_SIGNED,
  3875.  FAR *LPMIXERCONTROLDETAILS_SIGNED;
  3876.  
  3877. typedef struct tMIXERCONTROLDETAILS_UNSIGNED {
  3878.     DWORD           dwValue;
  3879. }       MIXERCONTROLDETAILS_UNSIGNED,
  3880.       *PMIXERCONTROLDETAILS_UNSIGNED,
  3881.  FAR *LPMIXERCONTROLDETAILS_UNSIGNED;
  3882.  
  3883. #ifdef _WIN32
  3884.  
  3885. WINMMAPI MMRESULT WINAPI mixerGetControlDetailsA(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
  3886. WINMMAPI MMRESULT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
  3887. #ifdef UNICODE
  3888. #define mixerGetControlDetails  mixerGetControlDetailsW
  3889. #else
  3890. #define mixerGetControlDetails  mixerGetControlDetailsA
  3891. #endif // !UNICODE
  3892.  
  3893. #else
  3894. MMRESULT WINAPI mixerGetControlDetails(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
  3895. #endif
  3896.  
  3897. #define MIXER_GETCONTROLDETAILSF_VALUE      0x00000000L
  3898. #define MIXER_GETCONTROLDETAILSF_LISTTEXT   0x00000001L
  3899.  
  3900. #define MIXER_GETCONTROLDETAILSF_QUERYMASK  0x0000000FL
  3901.  
  3902. WINMMAPI MMRESULT WINAPI mixerSetControlDetails(HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
  3903.  
  3904. #define MIXER_SETCONTROLDETAILSF_VALUE      0x00000000L
  3905. #define MIXER_SETCONTROLDETAILSF_CUSTOM     0x00000001L
  3906.  
  3907. #define MIXER_SETCONTROLDETAILSF_QUERYMASK  0x0000000FL
  3908.  
  3909. #endif /* ifndef _WIN32_VXD */
  3910. #endif /* ifndef MMNOMIXER */
  3911.  
  3912. #ifndef MMNOTIMER
  3913. #ifndef _WIN32_VXD
  3914. /****************************************************************************
  3915.  
  3916.                 Timer support
  3917.  
  3918. ****************************************************************************/
  3919.  
  3920. /* timer error return values */
  3921. #define TIMERR_NOERROR        (0)                  /* no error */
  3922. #define TIMERR_NOCANDO        (TIMERR_BASE+1)      /* request not completed */
  3923. #define TIMERR_STRUCT         (TIMERR_BASE+33)     /* time struct size */
  3924.  
  3925. /* timer data types */
  3926. typedef void (CALLBACK TIMECALLBACK)(UINT uTimerID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2);
  3927.  
  3928. typedef TIMECALLBACK FAR *LPTIMECALLBACK;
  3929.  
  3930. /* flags for fuEvent parameter of timeSetEvent() function */
  3931. #define TIME_ONESHOT    0x0000   /* program timer for single event */
  3932. #define TIME_PERIODIC   0x0001   /* program for continuous periodic event */
  3933.  
  3934. #ifdef _WIN32
  3935. #define TIME_CALLBACK_FUNCTION      0x0000  /* callback is function */
  3936. #define TIME_CALLBACK_EVENT_SET     0x0010  /* callback is event - use SetEvent */
  3937. #define TIME_CALLBACK_EVENT_PULSE   0x0020  /* callback is event - use PulseEvent */
  3938. #endif
  3939.  
  3940. /* timer device capabilities data structure */
  3941. typedef struct timecaps_tag {
  3942.     UINT    wPeriodMin;     /* minimum period supported  */
  3943.     UINT    wPeriodMax;     /* maximum period supported  */
  3944. } TIMECAPS, *PTIMECAPS, NEAR *NPTIMECAPS, FAR *LPTIMECAPS;
  3945.  
  3946. /* timer function prototypes */
  3947. WINMMAPI MMRESULT WINAPI timeGetSystemTime(LPMMTIME pmmt, UINT cbmmt);
  3948. WINMMAPI DWORD WINAPI timeGetTime(void);
  3949. WINMMAPI MMRESULT WINAPI timeSetEvent(UINT uDelay, UINT uResolution,
  3950.     LPTIMECALLBACK fptc, DWORD dwUser, UINT fuEvent);
  3951. WINMMAPI MMRESULT WINAPI timeKillEvent(UINT uTimerID);
  3952. WINMMAPI MMRESULT WINAPI timeGetDevCaps(LPTIMECAPS ptc, UINT cbtc);
  3953. WINMMAPI MMRESULT WINAPI timeBeginPeriod(UINT uPeriod);
  3954. WINMMAPI MMRESULT WINAPI timeEndPeriod(UINT uPeriod);
  3955.  
  3956. #endif  /* ifndef _WIN32_VXD */
  3957. #endif  /* ifndef MMNOTIMER */
  3958.  
  3959. #ifndef MMNOJOY
  3960. /****************************************************************************
  3961.  
  3962.                 Joystick support
  3963.  
  3964. ****************************************************************************/
  3965.  
  3966. /* joystick error return values */
  3967. #define JOYERR_NOERROR        (0)                  /* no error */
  3968. #define JOYERR_PARMS          (JOYERR_BASE+5)      /* bad parameters */
  3969. #define JOYERR_NOCANDO        (JOYERR_BASE+6)      /* request not completed */
  3970. #define JOYERR_UNPLUGGED      (JOYERR_BASE+7)      /* joystick is unplugged */
  3971.  
  3972. /* constants used with JOYINFO and JOYINFOEX structures and MM_JOY* messages */
  3973. #define JOY_BUTTON1         0x0001
  3974. #define JOY_BUTTON2         0x0002
  3975. #define JOY_BUTTON3         0x0004
  3976. #define JOY_BUTTON4         0x0008
  3977. #define JOY_BUTTON1CHG      0x0100
  3978. #define JOY_BUTTON2CHG      0x0200
  3979. #define JOY_BUTTON3CHG      0x0400
  3980. #define JOY_BUTTON4CHG      0x0800
  3981.  
  3982. /* constants used with JOYINFOEX */
  3983. #define JOY_BUTTON5         0x00000010l
  3984. #define JOY_BUTTON6         0x00000020l
  3985. #define JOY_BUTTON7         0x00000040l
  3986. #define JOY_BUTTON8         0x00000080l
  3987. #define JOY_BUTTON9         0x00000100l
  3988. #define JOY_BUTTON10        0x00000200l
  3989. #define JOY_BUTTON11        0x00000400l
  3990. #define JOY_BUTTON12        0x00000800l
  3991. #define JOY_BUTTON13        0x00001000l
  3992. #define JOY_BUTTON14        0x00002000l
  3993. #define JOY_BUTTON15        0x00004000l
  3994. #define JOY_BUTTON16        0x00008000l
  3995. #define JOY_BUTTON17        0x00010000l
  3996. #define JOY_BUTTON18        0x00020000l
  3997. #define JOY_BUTTON19        0x00040000l
  3998. #define JOY_BUTTON20        0x00080000l
  3999. #define JOY_BUTTON21        0x00100000l
  4000. #define JOY_BUTTON22        0x00200000l
  4001. #define JOY_BUTTON23        0x00400000l
  4002. #define JOY_BUTTON24        0x00800000l
  4003. #define JOY_BUTTON25        0x01000000l
  4004. #define JOY_BUTTON26        0x02000000l
  4005. #define JOY_BUTTON27        0x04000000l
  4006. #define JOY_BUTTON28        0x08000000l
  4007. #define JOY_BUTTON29        0x10000000l
  4008. #define JOY_BUTTON30        0x20000000l
  4009. #define JOY_BUTTON31        0x40000000l
  4010. #define JOY_BUTTON32        0x80000000l
  4011.  
  4012. /* constants used with JOYINFOEX structure */
  4013. #define JOY_POVCENTERED        (WORD) -1
  4014. #define JOY_POVFORWARD        0
  4015. #define JOY_POVRIGHT        9000
  4016. #define JOY_POVBACKWARD        18000
  4017. #define JOY_POVLEFT        27000
  4018.  
  4019. #define JOY_RETURNX        0x00000001l
  4020. #define JOY_RETURNY        0x00000002l
  4021. #define JOY_RETURNZ        0x00000004l
  4022. #define JOY_RETURNR        0x00000008l
  4023. #define JOY_RETURNU        0x00000010l    /* axis 5 */
  4024. #define JOY_RETURNV        0x00000020l    /* axis 6 */
  4025. #define JOY_RETURNPOV        0x00000040l
  4026. #define JOY_RETURNBUTTONS    0x00000080l
  4027. #define JOY_RETURNRAWDATA    0x00000100l
  4028. #define JOY_RETURNPOVCTS    0x00000200l
  4029. #define JOY_RETURNCENTERED    0x00000400l
  4030. #define JOY_USEDEADZONE        0x00000800l
  4031. #define JOY_RETURNALL        (JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ | \
  4032.                  JOY_RETURNR | JOY_RETURNU | JOY_RETURNV | \
  4033.                  JOY_RETURNPOV | JOY_RETURNBUTTONS)
  4034. #define JOY_CAL_READALWAYS    0x00010000l
  4035. #define JOY_CAL_READXYONLY    0x00020000l
  4036. #define JOY_CAL_READ3        0x00040000l
  4037. #define JOY_CAL_READ4        0x00080000l
  4038. #define JOY_CAL_READXONLY    0x00100000l
  4039. #define JOY_CAL_READYONLY    0x00200000l
  4040. #define JOY_CAL_READ5        0x00400000l
  4041. #define JOY_CAL_READ6        0x00800000l
  4042. #define JOY_CAL_READZONLY    0x01000000l
  4043. #define JOY_CAL_READRONLY    0x02000000l
  4044. #define JOY_CAL_READUONLY    0x04000000l
  4045. #define JOY_CAL_READVONLY    0x08000000l
  4046.  
  4047. /* joystick ID constants */
  4048. #define JOYSTICKID1         0
  4049. #define JOYSTICKID2         1
  4050.  
  4051. /* joystick driver capabilites */
  4052. #define JOYCAPS_HASZ        0x0001
  4053. #define JOYCAPS_HASR        0x0002
  4054. #define JOYCAPS_HASU        0x0004
  4055. #define JOYCAPS_HASV        0x0008
  4056. #define JOYCAPS_HASPOV        0x0010
  4057. #define JOYCAPS_POV4DIR        0x0020
  4058. #define JOYCAPS_POVCTS        0x0040
  4059.  
  4060. /* joystick device capabilities data structure */
  4061. #ifdef _WIN32
  4062.  
  4063. typedef struct tagJOYCAPSA {
  4064.     WORD    wMid;                /* manufacturer ID */
  4065.     WORD    wPid;                /* product ID */
  4066.     CHAR    szPname[MAXPNAMELEN];/* product name (NULL terminated string) */
  4067.     UINT    wXmin;               /* minimum x position value */
  4068.     UINT    wXmax;               /* maximum x position value */
  4069.     UINT    wYmin;               /* minimum y position value */
  4070.     UINT    wYmax;               /* maximum y position value */
  4071.     UINT    wZmin;               /* minimum z position value */
  4072.     UINT    wZmax;               /* maximum z position value */
  4073.     UINT    wNumButtons;         /* number of buttons */
  4074.     UINT    wPeriodMin;          /* minimum message period when captured */
  4075.     UINT    wPeriodMax;          /* maximum message period when captured */
  4076. #if (WINVER >= 0x0400)
  4077.     UINT    wRmin;               /* minimum r position value */
  4078.     UINT    wRmax;               /* maximum r position value */
  4079.     UINT    wUmin;               /* minimum u (5th axis) position value */
  4080.     UINT    wUmax;               /* maximum u (5th axis) position value */
  4081.     UINT    wVmin;               /* minimum v (6th axis) position value */
  4082.     UINT    wVmax;               /* maximum v (6th axis) position value */
  4083.     UINT    wCaps;          /* joystick capabilites */
  4084.     UINT    wMaxAxes;          /* maximum number of axes supported */
  4085.     UINT    wNumAxes;          /* number of axes in use */
  4086.     UINT    wMaxButtons;     /* maximum number of buttons supported */
  4087.     CHAR    szRegKey[MAXPNAMELEN];/* registry key */
  4088.     CHAR    szOEMVxD[MAX_JOYSTICKOEMVXDNAME]; /* OEM VxD in use */
  4089. #endif
  4090. } JOYCAPSA, *PJOYCAPSA, *NPJOYCAPSA, *LPJOYCAPSA;
  4091. typedef struct tagJOYCAPSW {
  4092.     WORD    wMid;                /* manufacturer ID */
  4093.     WORD    wPid;                /* product ID */
  4094.     WCHAR   szPname[MAXPNAMELEN];/* product name (NULL terminated string) */
  4095.     UINT    wXmin;               /* minimum x position value */
  4096.     UINT    wXmax;               /* maximum x position value */
  4097.     UINT    wYmin;               /* minimum y position value */
  4098.     UINT    wYmax;               /* maximum y position value */
  4099.     UINT    wZmin;               /* minimum z position value */
  4100.     UINT    wZmax;               /* maximum z position value */
  4101.     UINT    wNumButtons;         /* number of buttons */
  4102.     UINT    wPeriodMin;          /* minimum message period when captured */
  4103.     UINT    wPeriodMax;          /* maximum message period when captured */
  4104. #if (WINVER >= 0x0400)
  4105.     UINT    wRmin;               /* minimum r position value */
  4106.     UINT    wRmax;               /* maximum r position value */
  4107.     UINT    wUmin;               /* minimum u (5th axis) position value */
  4108.     UINT    wUmax;               /* maximum u (5th axis) position value */
  4109.     UINT    wVmin;               /* minimum v (6th axis) position value */
  4110.     UINT    wVmax;               /* maximum v (6th axis) position value */
  4111.     UINT    wCaps;          /* joystick capabilites */
  4112.     UINT    wMaxAxes;          /* maximum number of axes supported */
  4113.     UINT    wNumAxes;          /* number of axes in use */
  4114.     UINT    wMaxButtons;     /* maximum number of buttons supported */
  4115.     WCHAR   szRegKey[MAXPNAMELEN];/* registry key */
  4116.     WCHAR   szOEMVxD[MAX_JOYSTICKOEMVXDNAME]; /* OEM VxD in use */
  4117. #endif
  4118. } JOYCAPSW, *PJOYCAPSW, *NPJOYCAPSW, *LPJOYCAPSW;
  4119. #ifdef UNICODE
  4120. typedef JOYCAPSW JOYCAPS;
  4121. typedef PJOYCAPSW PJOYCAPS;
  4122. typedef NPJOYCAPSW NPJOYCAPS;
  4123. typedef LPJOYCAPSW LPJOYCAPS;
  4124. #else
  4125. typedef JOYCAPSA JOYCAPS;
  4126. typedef PJOYCAPSA PJOYCAPS;
  4127. typedef NPJOYCAPSA NPJOYCAPS;
  4128. typedef LPJOYCAPSA LPJOYCAPS;
  4129. #endif // UNICODE
  4130.  
  4131. #else
  4132. typedef struct joycaps_tag {
  4133.     WORD wMid;                  /* manufacturer ID */
  4134.     WORD wPid;                  /* product ID */
  4135.     char szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
  4136.     UINT wXmin;                 /* minimum x position value */
  4137.     UINT wXmax;                 /* maximum x position value */
  4138.     UINT wYmin;                 /* minimum y position value */
  4139.     UINT wYmax;                 /* maximum y position value */
  4140.     UINT wZmin;                 /* minimum z position value */
  4141.     UINT wZmax;                 /* maximum z position value */
  4142.     UINT wNumButtons;           /* number of buttons */
  4143.     UINT wPeriodMin;            /* minimum message period when captured */
  4144.     UINT wPeriodMax;            /* maximum message period when captured */
  4145. #if (WINVER >= 0x0400)
  4146.     UINT wRmin;                 /* minimum r position value */
  4147.     UINT wRmax;                 /* maximum r position value */
  4148.     UINT wUmin;                 /* minimum u (5th axis) position value */
  4149.     UINT wUmax;                 /* maximum u (5th axis) position value */
  4150.     UINT wVmin;                 /* minimum v (6th axis) position value */
  4151.     UINT wVmax;                 /* maximum v (6th axis) position value */
  4152.     UINT wCaps;                 /* joystick capabilites */
  4153.     UINT wMaxAxes;         /* maximum number of axes supported */
  4154.     UINT wNumAxes;         /* number of axes in use */
  4155.     UINT wMaxButtons;         /* maximum number of buttons supported */
  4156.     char szRegKey[MAXPNAMELEN]; /* registry key */
  4157.     char szOEMVxD[MAX_JOYSTICKOEMVXDNAME]; /* OEM VxD in use */
  4158. #endif
  4159. } JOYCAPS, *PJOYCAPS, NEAR *NPJOYCAPS, FAR *LPJOYCAPS;
  4160. #endif
  4161.  
  4162. /* joystick information data structure */
  4163. typedef struct joyinfo_tag {
  4164.     UINT wXpos;                 /* x position */
  4165.     UINT wYpos;                 /* y position */
  4166.     UINT wZpos;                 /* z position */
  4167.     UINT wButtons;              /* button states */
  4168. } JOYINFO, *PJOYINFO, NEAR *NPJOYINFO, FAR *LPJOYINFO;
  4169.  
  4170. #if(WINVER >= 0x0400)
  4171. typedef struct joyinfoex_tag {
  4172.     DWORD dwSize;         /* size of structure */
  4173.     DWORD dwFlags;         /* flags to indicate what to return */
  4174.     DWORD dwXpos;                /* x position */
  4175.     DWORD dwYpos;                /* y position */
  4176.     DWORD dwZpos;                /* z position */
  4177.     DWORD dwRpos;         /* rudder/4th axis position */
  4178.     DWORD dwUpos;         /* 5th axis position */
  4179.     DWORD dwVpos;         /* 6th axis position */
  4180.     DWORD dwButtons;             /* button states */
  4181.     DWORD dwButtonNumber;        /* current button number pressed */
  4182.     DWORD dwPOV;                 /* point of view state */
  4183.     DWORD dwReserved1;         /* reserved for communication between winmm & driver */
  4184.     DWORD dwReserved2;         /* reserved for future expansion */
  4185. } JOYINFOEX, *PJOYINFOEX, NEAR *NPJOYINFOEX, FAR *LPJOYINFOEX;
  4186. #endif /* WINVER >= 0x0400 */
  4187.  
  4188. #ifndef _WIN32_VXD
  4189.  
  4190. /* joystick function prototypes */
  4191. WINMMAPI UINT WINAPI joyGetNumDevs(void);
  4192. #ifdef _WIN32
  4193.  
  4194. WINMMAPI MMRESULT WINAPI joyGetDevCapsA(UINT uJoyID, LPJOYCAPSA pjc, UINT cbjc);
  4195. WINMMAPI MMRESULT WINAPI joyGetDevCapsW(UINT uJoyID, LPJOYCAPSW pjc, UINT cbjc);
  4196. #ifdef UNICODE
  4197. #define joyGetDevCaps  joyGetDevCapsW
  4198. #else
  4199. #define joyGetDevCaps  joyGetDevCapsA
  4200. #endif // !UNICODE
  4201.  
  4202. #else
  4203. MMRESULT WINAPI joyGetDevCaps(UINT uJoyID, LPJOYCAPS pjc, UINT cbjc);
  4204. #endif
  4205. WINMMAPI MMRESULT WINAPI joyGetPos(UINT uJoyID, LPJOYINFO pji);
  4206.  
  4207. #if(WINVER >= 0x0400)
  4208. WINMMAPI MMRESULT WINAPI joyGetPosEx(UINT uJoyID, LPJOYINFOEX pji);
  4209. #endif /* WINVER >= 0x0400 */
  4210.  
  4211. WINMMAPI MMRESULT WINAPI joyGetThreshold(UINT uJoyID, LPUINT puThreshold);
  4212. WINMMAPI MMRESULT WINAPI joyReleaseCapture(UINT uJoyID);
  4213. WINMMAPI MMRESULT WINAPI joySetCapture(HWND hwnd, UINT uJoyID, UINT uPeriod,
  4214.     BOOL fChanged);
  4215. WINMMAPI MMRESULT WINAPI joySetThreshold(UINT uJoyID, UINT uThreshold);
  4216.  
  4217. #endif /* ifndef _WIN32_VXD */
  4218.  
  4219. #endif  /* ifndef MMNOJOY */
  4220.  
  4221. #ifndef MMNOMMIO
  4222. #ifndef _WIN32_VXD
  4223. /****************************************************************************
  4224.  
  4225.             Multimedia File I/O support
  4226.  
  4227. ****************************************************************************/
  4228.  
  4229. /* MMIO error return values */
  4230. #define MMIOERR_BASE                256
  4231. #define MMIOERR_FILENOTFOUND        (MMIOERR_BASE + 1)  /* file not found */
  4232. #define MMIOERR_OUTOFMEMORY         (MMIOERR_BASE + 2)  /* out of memory */
  4233. #define MMIOERR_CANNOTOPEN          (MMIOERR_BASE + 3)  /* cannot open */
  4234. #define MMIOERR_CANNOTCLOSE         (MMIOERR_BASE + 4)  /* cannot close */
  4235. #define MMIOERR_CANNOTREAD          (MMIOERR_BASE + 5)  /* cannot read */
  4236. #define MMIOERR_CANNOTWRITE         (MMIOERR_BASE + 6)  /* cannot write */
  4237. #define MMIOERR_CANNOTSEEK          (MMIOERR_BASE + 7)  /* cannot seek */
  4238. #define MMIOERR_CANNOTEXPAND        (MMIOERR_BASE + 8)  /* cannot expand file */
  4239. #define MMIOERR_CHUNKNOTFOUND       (MMIOERR_BASE + 9)  /* chunk not found */
  4240. #define MMIOERR_UNBUFFERED          (MMIOERR_BASE + 10) /*  */
  4241. #define MMIOERR_PATHNOTFOUND        (MMIOERR_BASE + 11) /* path incorrect */
  4242. #define MMIOERR_ACCESSDENIED        (MMIOERR_BASE + 12) /* file was protected */
  4243. #define MMIOERR_SHARINGVIOLATION    (MMIOERR_BASE + 13) /* file in use */
  4244. #define MMIOERR_NETWORKERROR        (MMIOERR_BASE + 14) /* network not responding */
  4245. #define MMIOERR_TOOMANYOPENFILES    (MMIOERR_BASE + 15) /* no more file handles  */
  4246. #define MMIOERR_INVALIDFILE         (MMIOERR_BASE + 16) /* default error file error */
  4247.  
  4248. /* MMIO constants */
  4249. #define CFSEPCHAR       '+'             /* compound file name separator char. */
  4250.  
  4251. /* MMIO data types */
  4252. typedef DWORD           FOURCC;         /* a four character code */
  4253. typedef char _huge *    HPSTR;          /* a huge version of LPSTR */
  4254. DECLARE_HANDLE(HMMIO);                  /* a handle to an open file */
  4255. typedef LRESULT (CALLBACK MMIOPROC)(LPSTR lpmmioinfo, UINT uMsg,
  4256.         LPARAM lParam1, LPARAM lParam2);
  4257. typedef MMIOPROC FAR *LPMMIOPROC;
  4258.  
  4259. /* general MMIO information data structure */
  4260. typedef struct _MMIOINFO
  4261. {
  4262.     /* general fields */
  4263.     DWORD           dwFlags;        /* general status flags */
  4264.     FOURCC          fccIOProc;      /* pointer to I/O procedure */
  4265.     LPMMIOPROC      pIOProc;        /* pointer to I/O procedure */
  4266.     UINT            wErrorRet;      /* place for error to be returned */
  4267.     HTASK           htask;          /* alternate local task */
  4268.  
  4269.     /* fields maintained by MMIO functions during buffered I/O */
  4270.     LONG            cchBuffer;      /* size of I/O buffer (or 0L) */
  4271.     HPSTR           pchBuffer;      /* start of I/O buffer (or NULL) */
  4272.     HPSTR           pchNext;        /* pointer to next byte to read/write */
  4273.     HPSTR           pchEndRead;     /* pointer to last valid byte to read */
  4274.     HPSTR           pchEndWrite;    /* pointer to last byte to write */
  4275.     LONG            lBufOffset;     /* disk offset of start of buffer */
  4276.  
  4277.     /* fields maintained by I/O procedure */
  4278.     LONG            lDiskOffset;    /* disk offset of next read or write */
  4279.     DWORD           adwInfo[3];     /* data specific to type of MMIOPROC */
  4280.  
  4281.     /* other fields maintained by MMIO */
  4282.     DWORD           dwReserved1;    /* reserved for MMIO use */
  4283.     DWORD           dwReserved2;    /* reserved for MMIO use */
  4284.     HMMIO           hmmio;          /* handle to open file */
  4285. } MMIOINFO, *PMMIOINFO, NEAR *NPMMIOINFO, FAR *LPMMIOINFO;
  4286. typedef const MMIOINFO FAR *LPCMMIOINFO;
  4287.  
  4288. /* RIFF chunk information data structure */
  4289. typedef struct _MMCKINFO
  4290. {
  4291.     FOURCC          ckid;           /* chunk ID */
  4292.     DWORD           cksize;         /* chunk size */
  4293.     FOURCC          fccType;        /* form type or list type */
  4294.     DWORD           dwDataOffset;   /* offset of data portion of chunk */
  4295.     DWORD           dwFlags;        /* flags used by MMIO functions */
  4296. } MMCKINFO, *PMMCKINFO, NEAR *NPMMCKINFO, FAR *LPMMCKINFO;
  4297. typedef const MMCKINFO *LPCMMCKINFO;
  4298.  
  4299. /* bit field masks */
  4300. #define MMIO_RWMODE     0x00000003      /* open file for reading/writing/both */
  4301. #define MMIO_SHAREMODE  0x00000070      /* file sharing mode number */
  4302.  
  4303. /* constants for dwFlags field of MMIOINFO */
  4304. #define MMIO_CREATE     0x00001000      /* create new file (or truncate file) */
  4305. #define MMIO_PARSE      0x00000100      /* parse new file returning path */
  4306. #define MMIO_DELETE     0x00000200      /* create new file (or truncate file) */
  4307. #define MMIO_EXIST      0x00004000      /* checks for existence of file */
  4308. #define MMIO_ALLOCBUF   0x00010000      /* mmioOpen() should allocate a buffer */
  4309. #define MMIO_GETTEMP    0x00020000      /* mmioOpen() should retrieve temp name */
  4310.  
  4311. #define MMIO_DIRTY      0x10000000      /* I/O buffer is dirty */
  4312.  
  4313. /* read/write mode numbers (bit field MMIO_RWMODE) */
  4314. #define MMIO_READ       0x00000000      /* open file for reading only */
  4315. #define MMIO_WRITE      0x00000001      /* open file for writing only */
  4316. #define MMIO_READWRITE  0x00000002      /* open file for reading and writing */
  4317.  
  4318. /* share mode numbers (bit field MMIO_SHAREMODE) */
  4319. #define MMIO_COMPAT     0x00000000      /* compatibility mode */
  4320. #define MMIO_EXCLUSIVE  0x00000010      /* exclusive-access mode */
  4321. #define MMIO_DENYWRITE  0x00000020      /* deny writing to other processes */
  4322. #define MMIO_DENYREAD   0x00000030      /* deny reading to other processes */
  4323. #define MMIO_DENYNONE   0x00000040      /* deny nothing to other processes */
  4324.  
  4325. /* various MMIO flags */
  4326. #define MMIO_FHOPEN             0x0010  /* mmioClose: keep file handle open */
  4327. #define MMIO_EMPTYBUF           0x0010  /* mmioFlush: empty the I/O buffer */
  4328. #define MMIO_TOUPPER            0x0010  /* mmioStringToFOURCC: to u-case */
  4329. #define MMIO_INSTALLPROC    0x00010000  /* mmioInstallIOProc: install MMIOProc */
  4330. #define MMIO_GLOBALPROC     0x10000000  /* mmioInstallIOProc: install globally */
  4331. #define MMIO_REMOVEPROC     0x00020000  /* mmioInstallIOProc: remove MMIOProc */
  4332. #define MMIO_UNICODEPROC    0x01000000  /* mmioInstallIOProc: Unicode MMIOProc */
  4333. #define MMIO_FINDPROC       0x00040000  /* mmioInstallIOProc: find an MMIOProc */
  4334. #define MMIO_FINDCHUNK          0x0010  /* mmioDescend: find a chunk by ID */
  4335. #define MMIO_FINDRIFF           0x0020  /* mmioDescend: find a LIST chunk */
  4336. #define MMIO_FINDLIST           0x0040  /* mmioDescend: find a RIFF chunk */
  4337. #define MMIO_CREATERIFF         0x0020  /* mmioCreateChunk: make a LIST chunk */
  4338. #define MMIO_CREATELIST         0x0040  /* mmioCreateChunk: make a RIFF chunk */
  4339.  
  4340. /* message numbers for MMIOPROC I/O procedure functions */
  4341. #define MMIOM_READ      MMIO_READ       /* read */
  4342. #define MMIOM_WRITE    MMIO_WRITE       /* write */
  4343. #define MMIOM_SEEK              2       /* seek to a new position in file */
  4344. #define MMIOM_OPEN              3       /* open file */
  4345. #define MMIOM_CLOSE             4       /* close file */
  4346. #define MMIOM_WRITEFLUSH        5       /* write and flush */
  4347.  
  4348. #if (WINVER >= 0x030a)
  4349. #define MMIOM_RENAME            6       /* rename specified file */
  4350. #endif /* ifdef WINVER >= 0x030a */
  4351.  
  4352. #define MMIOM_USER         0x8000       /* beginning of user-defined messages */
  4353.  
  4354. /* standard four character codes */
  4355. #define FOURCC_RIFF     mmioFOURCC('R', 'I', 'F', 'F')
  4356. #define FOURCC_LIST     mmioFOURCC('L', 'I', 'S', 'T')
  4357.  
  4358. /* four character codes used to identify standard built-in I/O procedures */
  4359. #define FOURCC_DOS      mmioFOURCC('D', 'O', 'S', ' ')
  4360. #define FOURCC_MEM      mmioFOURCC('M', 'E', 'M', ' ')
  4361.  
  4362. /* flags for mmioSeek() */
  4363. #ifndef SEEK_SET
  4364. #define SEEK_SET        0               /* seek to an absolute position */
  4365. #define SEEK_CUR        1               /* seek relative to current position */
  4366. #define SEEK_END        2               /* seek relative to end of file */
  4367. #endif  /* ifndef SEEK_SET */
  4368.  
  4369. /* other constants */
  4370. #define MMIO_DEFAULTBUFFER      8192    /* default buffer size */
  4371.  
  4372. /* MMIO macros */
  4373. #define mmioFOURCC(ch0, ch1, ch2, ch3)  MAKEFOURCC(ch0, ch1, ch2, ch3)
  4374.  
  4375. /* MMIO function prototypes */
  4376. #ifdef _WIN32
  4377.  
  4378. WINMMAPI FOURCC WINAPI mmioStringToFOURCCA(LPCSTR sz, UINT uFlags);
  4379. WINMMAPI FOURCC WINAPI mmioStringToFOURCCW(LPCWSTR sz, UINT uFlags);
  4380. #ifdef UNICODE
  4381. #define mmioStringToFOURCC  mmioStringToFOURCCW
  4382. #else
  4383. #define mmioStringToFOURCC  mmioStringToFOURCCA
  4384. #endif // !UNICODE
  4385. WINMMAPI LPMMIOPROC WINAPI mmioInstallIOProcA(FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
  4386. WINMMAPI LPMMIOPROC WINAPI mmioInstallIOProcW(FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
  4387. #ifdef UNICODE
  4388. #define mmioInstallIOProc  mmioInstallIOProcW
  4389. #else
  4390. #define mmioInstallIOProc  mmioInstallIOProcA
  4391. #endif // !UNICODE
  4392. WINMMAPI HMMIO WINAPI mmioOpenA(LPSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
  4393. WINMMAPI HMMIO WINAPI mmioOpenW(LPWSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
  4394. #ifdef UNICODE
  4395. #define mmioOpen  mmioOpenW
  4396. #else
  4397. #define mmioOpen  mmioOpenA
  4398. #endif // !UNICODE
  4399. WINMMAPI MMRESULT WINAPI mmioRenameA(LPCSTR pszFileName, LPCSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename);
  4400. WINMMAPI MMRESULT WINAPI mmioRenameW(LPCWSTR pszFileName, LPCWSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename);
  4401. #ifdef UNICODE
  4402. #define mmioRename  mmioRenameW
  4403. #else
  4404. #define mmioRename  mmioRenameA
  4405. #endif // !UNICODE
  4406. #else
  4407. FOURCC WINAPI mmioStringToFOURCC(LPCSTR sz, UINT uFlags);
  4408. LPMMIOPROC WINAPI mmioInstallIOProc(FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
  4409. HMMIO WINAPI mmioOpen(LPSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
  4410. #if (WINVER >= 0x030a)
  4411. MMRESULT WINAPI mmioRename(LPCSTR pszFileName, LPCSTR pszNewFileName, const MMIOINFO FAR* pmmioinfo, DWORD fdwRename);
  4412. #endif /* ifdef WINVER >= 0x030a */
  4413. #endif
  4414.  
  4415. WINMMAPI MMRESULT WINAPI mmioClose(HMMIO hmmio, UINT fuClose);
  4416. WINMMAPI LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch);
  4417. WINMMAPI LONG WINAPI mmioWrite(HMMIO hmmio, const char _huge* pch, LONG cch);
  4418. WINMMAPI LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, int iOrigin);
  4419. WINMMAPI MMRESULT WINAPI mmioGetInfo(HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuInfo);
  4420. WINMMAPI MMRESULT WINAPI mmioSetInfo(HMMIO hmmio, LPCMMIOINFO pmmioinfo, UINT fuInfo);
  4421. WINMMAPI MMRESULT WINAPI mmioSetBuffer(HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer,
  4422.     UINT fuBuffer);
  4423. WINMMAPI MMRESULT WINAPI mmioFlush(HMMIO hmmio, UINT fuFlush);
  4424. WINMMAPI MMRESULT WINAPI mmioAdvance(HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuAdvance);
  4425. WINMMAPI LRESULT WINAPI mmioSendMessage(HMMIO hmmio, UINT uMsg,
  4426.     LPARAM lParam1, LPARAM lParam2);
  4427. WINMMAPI MMRESULT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO pmmcki,
  4428.     const MMCKINFO FAR* pmmckiParent, UINT fuDescend);
  4429. WINMMAPI MMRESULT WINAPI mmioAscend(HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuAscend);
  4430. WINMMAPI MMRESULT WINAPI mmioCreateChunk(HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuCreate);
  4431.  
  4432. #endif  /* ifndef _WIN32_VXD */
  4433. #endif  /* ifndef MMNOMMIO */
  4434.  
  4435. #ifndef MMNOMCI
  4436. #ifndef _WIN32_VXD
  4437. /****************************************************************************
  4438.  
  4439.                 MCI support
  4440.  
  4441. ****************************************************************************/
  4442.  
  4443. #ifndef _MCIERROR_              /* MCIERROR is defined in some post 3.1 apps */
  4444. #define _MCIERROR_
  4445. typedef DWORD   MCIERROR;       /* error return code, 0 means no error */
  4446. #endif
  4447.  
  4448. #ifndef _MCIDEVICEID_           /* Same with MCIDEVICEID */
  4449. #define _MCIDEVICEID_
  4450. typedef UINT    MCIDEVICEID;    /* MCI device ID type */
  4451. #endif
  4452.  
  4453. typedef UINT (CALLBACK *YIELDPROC)(MCIDEVICEID mciId, DWORD dwYieldData);
  4454.  
  4455. /* MCI function prototypes */
  4456. #ifdef _WIN32
  4457.  
  4458. WINMMAPI MCIERROR WINAPI mciSendCommandA(MCIDEVICEID mciId, UINT uMsg, DWORD dwParam1, DWORD dwParam2);
  4459. WINMMAPI MCIERROR WINAPI mciSendCommandW(MCIDEVICEID mciId, UINT uMsg, DWORD dwParam1, DWORD dwParam2);
  4460. #ifdef UNICODE
  4461. #define mciSendCommand  mciSendCommandW
  4462. #else
  4463. #define mciSendCommand  mciSendCommandA
  4464. #endif // !UNICODE
  4465. WINMMAPI MCIERROR  WINAPI mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
  4466. WINMMAPI MCIERROR  WINAPI mciSendStringW(LPCWSTR lpstrCommand, LPWSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
  4467. #ifdef UNICODE
  4468. #define mciSendString  mciSendStringW
  4469. #else
  4470. #define mciSendString  mciSendStringA
  4471. #endif // !UNICODE
  4472. WINMMAPI MCIDEVICEID WINAPI mciGetDeviceIDA(LPCSTR pszDevice);
  4473. WINMMAPI MCIDEVICEID WINAPI mciGetDeviceIDW(LPCWSTR pszDevice);
  4474. #ifdef UNICODE
  4475. #define mciGetDeviceID  mciGetDeviceIDW
  4476. #else
  4477. #define mciGetDeviceID  mciGetDeviceIDA
  4478. #endif // !UNICODE
  4479. WINMMAPI MCIDEVICEID WINAPI mciGetDeviceIDFromElementIDA(DWORD dwElementID, LPCSTR lpstrType );
  4480. WINMMAPI MCIDEVICEID WINAPI mciGetDeviceIDFromElementIDW(DWORD dwElementID, LPCWSTR lpstrType );
  4481. #ifdef UNICODE
  4482. #define mciGetDeviceIDFromElementID  mciGetDeviceIDFromElementIDW
  4483. #else
  4484. #define mciGetDeviceIDFromElementID  mciGetDeviceIDFromElementIDA
  4485. #endif // !UNICODE
  4486. WINMMAPI BOOL WINAPI mciGetErrorStringA(MCIERROR mcierr, LPSTR pszText, UINT cchText);
  4487. WINMMAPI BOOL WINAPI mciGetErrorStringW(MCIERROR mcierr, LPWSTR pszText, UINT cchText);
  4488. #ifdef UNICODE
  4489. #define mciGetErrorString  mciGetErrorStringW
  4490. #else
  4491. #define mciGetErrorString  mciGetErrorStringA
  4492. #endif // !UNICODE
  4493.  
  4494. #else
  4495. MCIERROR WINAPI mciSendCommand(MCIDEVICEID mciId, UINT uMsg, DWORD dwParam1, DWORD dwParam2);
  4496. MCIERROR  WINAPI mciSendString(LPCSTR lpstrCommand, LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
  4497. MCIDEVICEID WINAPI mciGetDeviceID(LPCSTR pszDevice);
  4498. BOOL WINAPI mciGetErrorString(MCIERROR mcierr, LPSTR pszText, UINT cchText);
  4499. #endif
  4500.  
  4501. WINMMAPI BOOL WINAPI mciSetYieldProc(MCIDEVICEID mciId, YIELDPROC fpYieldProc,
  4502.     DWORD dwYieldData);
  4503.  
  4504. #if (WINVER >= 0x030a)
  4505. WINMMAPI HTASK WINAPI mciGetCreatorTask(MCIDEVICEID mciId);
  4506. WINMMAPI YIELDPROC WINAPI mciGetYieldProc(MCIDEVICEID mciId, LPDWORD pdwYieldData);
  4507. #endif /* ifdef WINVER >= 0x030a */
  4508.  
  4509. #if (WINVER < 0x030a)
  4510. WINMMAPI BOOL WINAPI mciExecute(LPCSTR pszCommand);
  4511. #endif /* ifdef WINVER < 0x030a */
  4512.  
  4513. /* MCI error return values */
  4514. #define MCIERR_INVALID_DEVICE_ID        (MCIERR_BASE + 1)
  4515. #define MCIERR_UNRECOGNIZED_KEYWORD     (MCIERR_BASE + 3)
  4516. #define MCIERR_UNRECOGNIZED_COMMAND     (MCIERR_BASE + 5)
  4517. #define MCIERR_HARDWARE                 (MCIERR_BASE + 6)
  4518. #define MCIERR_INVALID_DEVICE_NAME      (MCIERR_BASE + 7)
  4519. #define MCIERR_OUT_OF_MEMORY            (MCIERR_BASE + 8)
  4520. #define MCIERR_DEVICE_OPEN              (MCIERR_BASE + 9)
  4521. #define MCIERR_CANNOT_LOAD_DRIVER       (MCIERR_BASE + 10)
  4522. #define MCIERR_MISSING_COMMAND_STRING   (MCIERR_BASE + 11)
  4523. #define MCIERR_PARAM_OVERFLOW           (MCIERR_BASE + 12)
  4524. #define MCIERR_MISSING_STRING_ARGUMENT  (MCIERR_BASE + 13)
  4525. #define MCIERR_BAD_INTEGER              (MCIERR_BASE + 14)
  4526. #define MCIERR_PARSER_INTERNAL          (MCIERR_BASE + 15)
  4527. #define MCIERR_DRIVER_INTERNAL          (MCIERR_BASE + 16)
  4528. #define MCIERR_MISSING_PARAMETER        (MCIERR_BASE + 17)
  4529. #define MCIERR_UNSUPPORTED_FUNCTION     (MCIERR_BASE + 18)
  4530. #define MCIERR_FILE_NOT_FOUND           (MCIERR_BASE + 19)
  4531. #define MCIERR_DEVICE_NOT_READY         (MCIERR_BASE + 20)
  4532. #define MCIERR_INTERNAL                 (MCIERR_BASE + 21)
  4533. #define MCIERR_DRIVER                   (MCIERR_BASE + 22)
  4534. #define MCIERR_CANNOT_USE_ALL           (MCIERR_BASE + 23)
  4535. #define MCIERR_MULTIPLE                 (MCIERR_BASE + 24)
  4536. #define MCIERR_EXTENSION_NOT_FOUND      (MCIERR_BASE + 25)
  4537. #define MCIERR_OUTOFRANGE               (MCIERR_BASE + 26)
  4538. #define MCIERR_FLAGS_NOT_COMPATIBLE     (MCIERR_BASE + 28)
  4539. #define MCIERR_FILE_NOT_SAVED           (MCIERR_BASE + 30)
  4540. #define MCIERR_DEVICE_TYPE_REQUIRED     (MCIERR_BASE + 31)
  4541. #define MCIERR_DEVICE_LOCKED            (MCIERR_BASE + 32)
  4542. #define MCIERR_DUPLICATE_ALIAS          (MCIERR_BASE + 33)
  4543. #define MCIERR_BAD_CONSTANT             (MCIERR_BASE + 34)
  4544. #define MCIERR_MUST_USE_SHAREABLE       (MCIERR_BASE + 35)
  4545. #define MCIERR_MISSING_DEVICE_NAME      (MCIERR_BASE + 36)
  4546. #define MCIERR_BAD_TIME_FORMAT          (MCIERR_BASE + 37)
  4547. #define MCIERR_NO_CLOSING_QUOTE         (MCIERR_BASE + 38)
  4548. #define MCIERR_DUPLICATE_FLAGS          (MCIERR_BASE + 39)
  4549. #define MCIERR_INVALID_FILE             (MCIERR_BASE + 40)
  4550. #define MCIERR_NULL_PARAMETER_BLOCK     (MCIERR_BASE + 41)
  4551. #define MCIERR_UNNAMED_RESOURCE         (MCIERR_BASE + 42)
  4552. #define MCIERR_NEW_REQUIRES_ALIAS       (MCIERR_BASE + 43)
  4553. #define MCIERR_NOTIFY_ON_AUTO_OPEN      (MCIERR_BASE + 44)
  4554. #define MCIERR_NO_ELEMENT_ALLOWED       (MCIERR_BASE + 45)
  4555. #define MCIERR_NONAPPLICABLE_FUNCTION   (MCIERR_BASE + 46)
  4556. #define MCIERR_ILLEGAL_FOR_AUTO_OPEN    (MCIERR_BASE + 47)
  4557. #define MCIERR_FILENAME_REQUIRED        (MCIERR_BASE + 48)
  4558. #define MCIERR_EXTRA_CHARACTERS         (MCIERR_BASE + 49)
  4559. #define MCIERR_DEVICE_NOT_INSTALLED     (MCIERR_BASE + 50)
  4560. #define MCIERR_GET_CD                   (MCIERR_BASE + 51)
  4561. #define MCIERR_SET_CD                   (MCIERR_BASE + 52)
  4562. #define MCIERR_SET_DRIVE                (MCIERR_BASE + 53)
  4563. #define MCIERR_DEVICE_LENGTH            (MCIERR_BASE + 54)
  4564. #define MCIERR_DEVICE_ORD_LENGTH        (MCIERR_BASE + 55)
  4565. #define MCIERR_NO_INTEGER               (MCIERR_BASE + 56)
  4566.  
  4567. #define MCIERR_WAVE_OUTPUTSINUSE        (MCIERR_BASE + 64)
  4568. #define MCIERR_WAVE_SETOUTPUTINUSE      (MCIERR_BASE + 65)
  4569. #define MCIERR_WAVE_INPUTSINUSE         (MCIERR_BASE + 66)
  4570. #define MCIERR_WAVE_SETINPUTINUSE       (MCIERR_BASE + 67)
  4571. #define MCIERR_WAVE_OUTPUTUNSPECIFIED   (MCIERR_BASE + 68)
  4572. #define MCIERR_WAVE_INPUTUNSPECIFIED    (MCIERR_BASE + 69)
  4573. #define MCIERR_WAVE_OUTPUTSUNSUITABLE   (MCIERR_BASE + 70)
  4574. #define MCIERR_WAVE_SETOUTPUTUNSUITABLE (MCIERR_BASE + 71)
  4575. #define MCIERR_WAVE_INPUTSUNSUITABLE    (MCIERR_BASE + 72)
  4576. #define MCIERR_WAVE_SETINPUTUNSUITABLE  (MCIERR_BASE + 73)
  4577.  
  4578. #define MCIERR_SEQ_DIV_INCOMPATIBLE     (MCIERR_BASE + 80)
  4579. #define MCIERR_SEQ_PORT_INUSE           (MCIERR_BASE + 81)
  4580. #define MCIERR_SEQ_PORT_NONEXISTENT     (MCIERR_BASE + 82)
  4581. #define MCIERR_SEQ_PORT_MAPNODEVICE     (MCIERR_BASE + 83)
  4582. #define MCIERR_SEQ_PORT_MISCERROR       (MCIERR_BASE + 84)
  4583. #define MCIERR_SEQ_TIMER                (MCIERR_BASE + 85)
  4584. #define MCIERR_SEQ_PORTUNSPECIFIED      (MCIERR_BASE + 86)
  4585. #define MCIERR_SEQ_NOMIDIPRESENT        (MCIERR_BASE + 87)
  4586.  
  4587. #define MCIERR_NO_WINDOW                (MCIERR_BASE + 90)
  4588. #define MCIERR_CREATEWINDOW             (MCIERR_BASE + 91)
  4589. #define MCIERR_FILE_READ                (MCIERR_BASE + 92)
  4590. #define MCIERR_FILE_WRITE               (MCIERR_BASE + 93)
  4591.  
  4592. #define MCIERR_NO_IDENTITY              (MCIERR_BASE + 94)
  4593.  
  4594. /* all custom device driver errors must be >= than this value */
  4595. #define MCIERR_CUSTOM_DRIVER_BASE       (MCIERR_BASE + 256)
  4596.  
  4597. #define MCI_FIRST                       DRV_MCI_FIRST   /* 0x0800 */
  4598. /* MCI command message identifiers */
  4599. #define MCI_OPEN                        0x0803
  4600. #define MCI_CLOSE                       0x0804
  4601. #define MCI_ESCAPE                      0x0805
  4602. #define MCI_PLAY                        0x0806
  4603. #define MCI_SEEK                        0x0807
  4604. #define MCI_STOP                        0x0808
  4605. #define MCI_PAUSE                       0x0809
  4606. #define MCI_INFO                        0x080A
  4607. #define MCI_GETDEVCAPS                  0x080B
  4608. #define MCI_SPIN                        0x080C
  4609. #define MCI_SET                         0x080D
  4610. #define MCI_STEP                        0x080E
  4611. #define MCI_RECORD                      0x080F
  4612. #define MCI_SYSINFO                     0x0810
  4613. #define MCI_BREAK                       0x0811
  4614. #define MCI_SAVE                        0x0813
  4615. #define MCI_STATUS                      0x0814
  4616. #define MCI_CUE                         0x0830
  4617. #define MCI_REALIZE                     0x0840
  4618. #define MCI_WINDOW                      0x0841
  4619. #define MCI_PUT                         0x0842
  4620. #define MCI_WHERE                       0x0843
  4621. #define MCI_FREEZE                      0x0844
  4622. #define MCI_UNFREEZE                    0x0845
  4623. #define MCI_LOAD                        0x0850
  4624. #define MCI_CUT                         0x0851
  4625. #define MCI_COPY                        0x0852
  4626. #define MCI_PASTE                       0x0853
  4627. #define MCI_UPDATE                      0x0854
  4628. #define MCI_RESUME                      0x0855
  4629. #define MCI_DELETE                      0x0856
  4630.  
  4631. /* all custom MCI command messages must be >= than this value */
  4632. #define MCI_USER_MESSAGES               (DRV_MCI_FIRST + 0x400)
  4633. #define MCI_LAST                        0x0FFF
  4634.  
  4635. /* device ID for "all devices" */
  4636. #define MCI_ALL_DEVICE_ID               ((MCIDEVICEID)-1)
  4637.  
  4638. /* constants for predefined MCI device types */
  4639. #define MCI_DEVTYPE_VCR                 513 /* (MCI_STRING_OFFSET + 1) */
  4640. #define MCI_DEVTYPE_VIDEODISC           514 /* (MCI_STRING_OFFSET + 2) */
  4641. #define MCI_DEVTYPE_OVERLAY             515 /* (MCI_STRING_OFFSET + 3) */
  4642. #define MCI_DEVTYPE_CD_AUDIO            516 /* (MCI_STRING_OFFSET + 4) */
  4643. #define MCI_DEVTYPE_DAT                 517 /* (MCI_STRING_OFFSET + 5) */
  4644. #define MCI_DEVTYPE_SCANNER             518 /* (MCI_STRING_OFFSET + 6) */
  4645. #define MCI_DEVTYPE_ANIMATION           519 /* (MCI_STRING_OFFSET + 7) */
  4646. #define MCI_DEVTYPE_DIGITAL_VIDEO       520 /* (MCI_STRING_OFFSET + 8) */
  4647. #define MCI_DEVTYPE_OTHER               521 /* (MCI_STRING_OFFSET + 9) */
  4648. #define MCI_DEVTYPE_WAVEFORM_AUDIO      522 /* (MCI_STRING_OFFSET + 10) */
  4649. #define MCI_DEVTYPE_SEQUENCER           523 /* (MCI_STRING_OFFSET + 11) */
  4650.  
  4651. #define MCI_DEVTYPE_FIRST               MCI_DEVTYPE_VCR
  4652. #define MCI_DEVTYPE_LAST                MCI_DEVTYPE_SEQUENCER
  4653.  
  4654. #define MCI_DEVTYPE_FIRST_USER          0x1000
  4655. /* return values for 'status mode' command */
  4656. #define MCI_MODE_NOT_READY              (MCI_STRING_OFFSET + 12)
  4657. #define MCI_MODE_STOP                   (MCI_STRING_OFFSET + 13)
  4658. #define MCI_MODE_PLAY                   (MCI_STRING_OFFSET + 14)
  4659. #define MCI_MODE_RECORD                 (MCI_STRING_OFFSET + 15)
  4660. #define MCI_MODE_SEEK                   (MCI_STRING_OFFSET + 16)
  4661. #define MCI_MODE_PAUSE                  (MCI_STRING_OFFSET + 17)
  4662. #define MCI_MODE_OPEN                   (MCI_STRING_OFFSET + 18)
  4663.  
  4664. /* constants used in 'set time format' and 'status time format' commands */
  4665. #define MCI_FORMAT_MILLISECONDS         0
  4666. #define MCI_FORMAT_HMS                  1
  4667. #define MCI_FORMAT_MSF                  2
  4668. #define MCI_FORMAT_FRAMES               3
  4669. #define MCI_FORMAT_SMPTE_24             4
  4670. #define MCI_FORMAT_SMPTE_25             5
  4671. #define MCI_FORMAT_SMPTE_30             6
  4672. #define MCI_FORMAT_SMPTE_30DROP         7
  4673. #define MCI_FORMAT_BYTES                8
  4674. #define MCI_FORMAT_SAMPLES              9
  4675. #define MCI_FORMAT_TMSF                 10
  4676.  
  4677. /* MCI time format conversion macros */
  4678. #define MCI_MSF_MINUTE(msf)             ((BYTE)(msf))
  4679. #define MCI_MSF_SECOND(msf)             ((BYTE)(((WORD)(msf)) >> 8))
  4680. #define MCI_MSF_FRAME(msf)              ((BYTE)((msf)>>16))
  4681.  
  4682. #define MCI_MAKE_MSF(m, s, f)           ((DWORD)(((BYTE)(m) | \
  4683.                           ((WORD)(s)<<8)) | \
  4684.                          (((DWORD)(BYTE)(f))<<16)))
  4685.  
  4686. #define MCI_TMSF_TRACK(tmsf)            ((BYTE)(tmsf))
  4687. #define MCI_TMSF_MINUTE(tmsf)           ((BYTE)(((WORD)(tmsf)) >> 8))
  4688. #define MCI_TMSF_SECOND(tmsf)           ((BYTE)((tmsf)>>16))
  4689. #define MCI_TMSF_FRAME(tmsf)            ((BYTE)((tmsf)>>24))
  4690.  
  4691. #define MCI_MAKE_TMSF(t, m, s, f)       ((DWORD)(((BYTE)(t) | \
  4692.                           ((WORD)(m)<<8)) | \
  4693.                          (((DWORD)(BYTE)(s) | \
  4694.                            ((WORD)(f)<<8))<<16)))
  4695.  
  4696. #define MCI_HMS_HOUR(hms)               ((BYTE)(hms))
  4697. #define MCI_HMS_MINUTE(hms)             ((BYTE)(((WORD)(hms)) >> 8))
  4698. #define MCI_HMS_SECOND(hms)             ((BYTE)((hms)>>16))
  4699.  
  4700. #define MCI_MAKE_HMS(h, m, s)           ((DWORD)(((BYTE)(h) | \
  4701.                           ((WORD)(m)<<8)) | \
  4702.                          (((DWORD)(BYTE)(s))<<16)))
  4703.  
  4704. /* flags for wParam of MM_MCINOTIFY message */
  4705. #define MCI_NOTIFY_SUCCESSFUL           0x0001
  4706. #define MCI_NOTIFY_SUPERSEDED           0x0002
  4707. #define MCI_NOTIFY_ABORTED              0x0004
  4708. #define MCI_NOTIFY_FAILURE              0x0008
  4709.  
  4710. /* common flags for dwFlags parameter of MCI command messages */
  4711. #define MCI_NOTIFY                      0x00000001L
  4712. #define MCI_WAIT                        0x00000002L
  4713. #define MCI_FROM                        0x00000004L
  4714. #define MCI_TO                          0x00000008L
  4715. #define MCI_TRACK                       0x00000010L
  4716.  
  4717. /* flags for dwFlags parameter of MCI_OPEN command message */
  4718. #define MCI_OPEN_SHAREABLE              0x00000100L
  4719. #define MCI_OPEN_ELEMENT                0x00000200L
  4720. #define MCI_OPEN_ALIAS                  0x00000400L
  4721. #define MCI_OPEN_ELEMENT_ID             0x00000800L
  4722. #define MCI_OPEN_TYPE_ID                0x00001000L
  4723. #define MCI_OPEN_TYPE                   0x00002000L
  4724.  
  4725. /* flags for dwFlags parameter of MCI_SEEK command message */
  4726. #define MCI_SEEK_TO_START               0x00000100L
  4727. #define MCI_SEEK_TO_END                 0x00000200L
  4728.  
  4729. /* flags for dwFlags parameter of MCI_STATUS command message */
  4730. #define MCI_STATUS_ITEM                 0x00000100L
  4731. #define MCI_STATUS_START                0x00000200L
  4732.  
  4733. /* flags for dwItem field of the MCI_STATUS_PARMS parameter block */
  4734. #define MCI_STATUS_LENGTH               0x00000001L
  4735. #define MCI_STATUS_POSITION             0x00000002L
  4736. #define MCI_STATUS_NUMBER_OF_TRACKS     0x00000003L
  4737. #define MCI_STATUS_MODE                 0x00000004L
  4738. #define MCI_STATUS_MEDIA_PRESENT        0x00000005L
  4739. #define MCI_STATUS_TIME_FORMAT          0x00000006L
  4740. #define MCI_STATUS_READY                0x00000007L
  4741. #define MCI_STATUS_CURRENT_TRACK        0x00000008L
  4742.  
  4743. /* flags for dwFlags parameter of MCI_INFO command message */
  4744. #define MCI_INFO_PRODUCT                0x00000100L
  4745. #define MCI_INFO_FILE                   0x00000200L
  4746. #define MCI_INFO_MEDIA_UPC              0x00000400L
  4747. #define MCI_INFO_MEDIA_IDENTITY         0x00000800L
  4748. #define MCI_INFO_NAME                   0x00001000L
  4749. #define MCI_INFO_COPYRIGHT              0x00002000L
  4750.  
  4751. /* flags for dwFlags parameter of MCI_GETDEVCAPS command message */
  4752. #define MCI_GETDEVCAPS_ITEM             0x00000100L
  4753.  
  4754. /* flags for dwItem field of the MCI_GETDEVCAPS_PARMS parameter block */
  4755. #define MCI_GETDEVCAPS_CAN_RECORD       0x00000001L
  4756. #define MCI_GETDEVCAPS_HAS_AUDIO        0x00000002L
  4757. #define MCI_GETDEVCAPS_HAS_VIDEO        0x00000003L
  4758. #define MCI_GETDEVCAPS_DEVICE_TYPE      0x00000004L
  4759. #define MCI_GETDEVCAPS_USES_FILES       0x00000005L
  4760. #define MCI_GETDEVCAPS_COMPOUND_DEVICE  0x00000006L
  4761. #define MCI_GETDEVCAPS_CAN_EJECT        0x00000007L
  4762. #define MCI_GETDEVCAPS_CAN_PLAY         0x00000008L
  4763. #define MCI_GETDEVCAPS_CAN_SAVE         0x00000009L
  4764.  
  4765. /* flags for dwFlags parameter of MCI_SYSINFO command message */
  4766. #define MCI_SYSINFO_QUANTITY            0x00000100L
  4767. #define MCI_SYSINFO_OPEN                0x00000200L
  4768. #define MCI_SYSINFO_NAME                0x00000400L
  4769. #define MCI_SYSINFO_INSTALLNAME         0x00000800L
  4770.  
  4771. /* flags for dwFlags parameter of MCI_SET command message */
  4772. #define MCI_SET_DOOR_OPEN               0x00000100L
  4773. #define MCI_SET_DOOR_CLOSED             0x00000200L
  4774. #define MCI_SET_TIME_FORMAT             0x00000400L
  4775. #define MCI_SET_AUDIO                   0x00000800L
  4776. #define MCI_SET_VIDEO                   0x00001000L
  4777. #define MCI_SET_ON                      0x00002000L
  4778. #define MCI_SET_OFF                     0x00004000L
  4779.  
  4780. /* flags for dwAudio field of MCI_SET_PARMS or MCI_SEQ_SET_PARMS */
  4781. #define MCI_SET_AUDIO_ALL               0x00000000L
  4782. #define MCI_SET_AUDIO_LEFT              0x00000001L
  4783. #define MCI_SET_AUDIO_RIGHT             0x00000002L
  4784.  
  4785. /* flags for dwFlags parameter of MCI_BREAK command message */
  4786. #define MCI_BREAK_KEY                   0x00000100L
  4787. #define MCI_BREAK_HWND                  0x00000200L
  4788. #define MCI_BREAK_OFF                   0x00000400L
  4789.  
  4790. /* flags for dwFlags parameter of MCI_RECORD command message */
  4791. #define MCI_RECORD_INSERT               0x00000100L
  4792. #define MCI_RECORD_OVERWRITE            0x00000200L
  4793.  
  4794. /* flags for dwFlags parameter of MCI_SAVE command message */
  4795. #define MCI_SAVE_FILE                   0x00000100L
  4796.  
  4797. /* flags for dwFlags parameter of MCI_LOAD command message */
  4798. #define MCI_LOAD_FILE                   0x00000100L
  4799.  
  4800. /* generic parameter block for MCI command messages with no special parameters */
  4801. typedef struct tagMCI_GENERIC_PARMS {
  4802.     DWORD   dwCallback;
  4803. } MCI_GENERIC_PARMS, *PMCI_GENERIC_PARMS, FAR *LPMCI_GENERIC_PARMS;
  4804.  
  4805. /* parameter block for MCI_OPEN command message */
  4806. #ifdef _WIN32
  4807.  
  4808. typedef struct tagMCI_OPEN_PARMSA {
  4809.     DWORD   dwCallback;
  4810.     MCIDEVICEID wDeviceID;
  4811.     LPCSTR     lpstrDeviceType;
  4812.     LPCSTR     lpstrElementName;
  4813.     LPCSTR     lpstrAlias;
  4814. } MCI_OPEN_PARMSA, *PMCI_OPEN_PARMSA, *LPMCI_OPEN_PARMSA;
  4815. typedef struct tagMCI_OPEN_PARMSW {
  4816.     DWORD   dwCallback;
  4817.     MCIDEVICEID wDeviceID;
  4818.     LPCWSTR    lpstrDeviceType;
  4819.     LPCWSTR    lpstrElementName;
  4820.     LPCWSTR    lpstrAlias;
  4821. } MCI_OPEN_PARMSW, *PMCI_OPEN_PARMSW, *LPMCI_OPEN_PARMSW;
  4822. #ifdef UNICODE
  4823. typedef MCI_OPEN_PARMSW MCI_OPEN_PARMS;
  4824. typedef PMCI_OPEN_PARMSW PMCI_OPEN_PARMS;
  4825. typedef LPMCI_OPEN_PARMSW LPMCI_OPEN_PARMS;
  4826. #else
  4827. typedef MCI_OPEN_PARMSA MCI_OPEN_PARMS;
  4828. typedef PMCI_OPEN_PARMSA PMCI_OPEN_PARMS;
  4829. typedef LPMCI_OPEN_PARMSA LPMCI_OPEN_PARMS;
  4830. #endif // UNICODE
  4831.  
  4832. #else
  4833. typedef struct tagMCI_OPEN_PARMS {
  4834.     DWORD       dwCallback;
  4835.     MCIDEVICEID wDeviceID;
  4836.     WORD        wReserved0;
  4837.     LPCSTR      lpstrDeviceType;
  4838.     LPCSTR      lpstrElementName;
  4839.     LPCSTR      lpstrAlias;
  4840. } MCI_OPEN_PARMS, FAR *LPMCI_OPEN_PARMS;
  4841. #endif
  4842.  
  4843. /* parameter block for MCI_PLAY command message */
  4844. typedef struct tagMCI_PLAY_PARMS {
  4845.     DWORD   dwCallback;
  4846.     DWORD   dwFrom;
  4847.     DWORD   dwTo;
  4848. } MCI_PLAY_PARMS, *PMCI_PLAY_PARMS, FAR *LPMCI_PLAY_PARMS;
  4849.  
  4850. /* parameter block for MCI_SEEK command message */
  4851. typedef struct tagMCI_SEEK_PARMS {
  4852.     DWORD   dwCallback;
  4853.     DWORD   dwTo;
  4854. } MCI_SEEK_PARMS, *PMCI_SEEK_PARMS, FAR *LPMCI_SEEK_PARMS;
  4855.  
  4856. /* parameter block for MCI_STATUS command message */
  4857. typedef struct tagMCI_STATUS_PARMS {
  4858.     DWORD   dwCallback;
  4859.     DWORD   dwReturn;
  4860.     DWORD   dwItem;
  4861.     DWORD   dwTrack;
  4862. } MCI_STATUS_PARMS, *PMCI_STATUS_PARMS, FAR * LPMCI_STATUS_PARMS;
  4863.  
  4864. /* parameter block for MCI_INFO command message */
  4865. #ifdef _WIN32
  4866.  
  4867. typedef struct tagMCI_INFO_PARMSA {
  4868.     DWORD   dwCallback;
  4869.     LPSTR   lpstrReturn;
  4870.     DWORD   dwRetSize;
  4871. } MCI_INFO_PARMSA, * LPMCI_INFO_PARMSA;
  4872. typedef struct tagMCI_INFO_PARMSW {
  4873.     DWORD   dwCallback;
  4874.     LPWSTR  lpstrReturn;
  4875.     DWORD   dwRetSize;
  4876. } MCI_INFO_PARMSW, * LPMCI_INFO_PARMSW;
  4877. #ifdef UNICODE
  4878. typedef MCI_INFO_PARMSW MCI_INFO_PARMS;
  4879. typedef LPMCI_INFO_PARMSW LPMCI_INFO_PARMS;
  4880. #else
  4881. typedef MCI_INFO_PARMSA MCI_INFO_PARMS;
  4882. typedef LPMCI_INFO_PARMSA LPMCI_INFO_PARMS;
  4883. #endif // UNICODE
  4884.  
  4885. #else
  4886. typedef struct tagMCI_INFO_PARMS {
  4887.     DWORD   dwCallback;
  4888.     LPSTR   lpstrReturn;
  4889.     DWORD   dwRetSize;
  4890. } MCI_INFO_PARMS, FAR * LPMCI_INFO_PARMS;
  4891. #endif
  4892.  
  4893. /* parameter block for MCI_GETDEVCAPS command message */
  4894. typedef struct tagMCI_GETDEVCAPS_PARMS {
  4895.     DWORD   dwCallback;
  4896.     DWORD   dwReturn;
  4897.     DWORD   dwItem;
  4898. } MCI_GETDEVCAPS_PARMS, *PMCI_GETDEVCAPS_PARMS, FAR * LPMCI_GETDEVCAPS_PARMS;
  4899.  
  4900. /* parameter block for MCI_SYSINFO command message */
  4901. #ifdef _WIN32
  4902.  
  4903. typedef struct tagMCI_SYSINFO_PARMSA {
  4904.     DWORD   dwCallback;
  4905.     LPSTR   lpstrReturn;
  4906.     DWORD   dwRetSize;
  4907.     DWORD   dwNumber;
  4908.     UINT    wDeviceType;
  4909. } MCI_SYSINFO_PARMSA, *PMCI_SYSINFO_PARMSA, * LPMCI_SYSINFO_PARMSA;
  4910. typedef struct tagMCI_SYSINFO_PARMSW {
  4911.     DWORD   dwCallback;
  4912.     LPWSTR  lpstrReturn;
  4913.     DWORD   dwRetSize;
  4914.     DWORD   dwNumber;
  4915.     UINT    wDeviceType;
  4916. } MCI_SYSINFO_PARMSW, *PMCI_SYSINFO_PARMSW, * LPMCI_SYSINFO_PARMSW;
  4917. #ifdef UNICODE
  4918. typedef MCI_SYSINFO_PARMSW MCI_SYSINFO_PARMS;
  4919. typedef PMCI_SYSINFO_PARMSW PMCI_SYSINFO_PARMS;
  4920. typedef LPMCI_SYSINFO_PARMSW LPMCI_SYSINFO_PARMS;
  4921. #else
  4922. typedef MCI_SYSINFO_PARMSA MCI_SYSINFO_PARMS;
  4923. typedef PMCI_SYSINFO_PARMSA PMCI_SYSINFO_PARMS;
  4924. typedef LPMCI_SYSINFO_PARMSA LPMCI_SYSINFO_PARMS;
  4925. #endif // UNICODE
  4926. #else
  4927. typedef struct tagMCI_SYSINFO_PARMS {
  4928.     DWORD   dwCallback;
  4929.     LPSTR   lpstrReturn;
  4930.     DWORD   dwRetSize;
  4931.     DWORD   dwNumber;
  4932.     WORD    wDeviceType;
  4933.     WORD    wReserved0;
  4934. } MCI_SYSINFO_PARMS, FAR * LPMCI_SYSINFO_PARMS;
  4935. #endif
  4936.  
  4937. /* parameter block for MCI_SET command message */
  4938. typedef struct tagMCI_SET_PARMS {
  4939.     DWORD   dwCallback;
  4940.     DWORD   dwTimeFormat;
  4941.     DWORD   dwAudio;
  4942. } MCI_SET_PARMS, *PMCI_SET_PARMS, FAR *LPMCI_SET_PARMS;
  4943.  
  4944. /* parameter block for MCI_BREAK command message */
  4945. typedef struct tagMCI_BREAK_PARMS {
  4946.     DWORD   dwCallback;
  4947. #ifdef _WIN32
  4948.     int     nVirtKey;
  4949.     HWND    hwndBreak;
  4950. #else
  4951.     short   nVirtKey;
  4952.     WORD    wReserved0;             /* padding for Win 16 */
  4953.     HWND    hwndBreak;
  4954.     WORD    wReserved1;             /* padding for Win 16 */
  4955. #endif
  4956. } MCI_BREAK_PARMS, *PMCI_BREAK_PARMS, FAR * LPMCI_BREAK_PARMS;
  4957.  
  4958. /* parameter block for MCI_SAVE command message */
  4959. #ifdef _WIN32
  4960.  
  4961. typedef struct tagMCI_SAVE_PARMSA {
  4962.     DWORD    dwCallback;
  4963.     LPCSTR    lpfilename;
  4964. } MCI_SAVE_PARMSA, *PMCI_SAVE_PARMSA, * LPMCI_SAVE_PARMSA;
  4965. typedef struct tagMCI_SAVE_PARMSW {
  4966.     DWORD    dwCallback;
  4967.     LPCWSTR   lpfilename;
  4968. } MCI_SAVE_PARMSW, *PMCI_SAVE_PARMSW, * LPMCI_SAVE_PARMSW;
  4969. #ifdef UNICODE
  4970. typedef MCI_SAVE_PARMSW MCI_SAVE_PARMS;
  4971. typedef PMCI_SAVE_PARMSW PMCI_SAVE_PARMS;
  4972. typedef LPMCI_SAVE_PARMSW LPMCI_SAVE_PARMS;
  4973. #else
  4974. typedef MCI_SAVE_PARMSA MCI_SAVE_PARMS;
  4975. typedef PMCI_SAVE_PARMSA PMCI_SAVE_PARMS;
  4976. typedef LPMCI_SAVE_PARMSA LPMCI_SAVE_PARMS;
  4977. #endif // UNICODE
  4978.  
  4979. #else
  4980. typedef struct tagMCI_SAVE_PARMS {
  4981.     DWORD   dwCallback;
  4982.     LPCSTR  lpfilename;
  4983. } MCI_SAVE_PARMS, FAR * LPMCI_SAVE_PARMS;
  4984. #endif
  4985.  
  4986. /* parameter block for MCI_LOAD command message */
  4987. #ifdef _WIN32
  4988.  
  4989. typedef struct tagMCI_LOAD_PARMSA {
  4990.     DWORD    dwCallback;
  4991.     LPCSTR      lpfilename;
  4992. } MCI_LOAD_PARMSA, *PMCI_LOAD_PARMSA, * LPMCI_LOAD_PARMSA;
  4993. typedef struct tagMCI_LOAD_PARMSW {
  4994.     DWORD    dwCallback;
  4995.     LPCWSTR     lpfilename;
  4996. } MCI_LOAD_PARMSW, *PMCI_LOAD_PARMSW, * LPMCI_LOAD_PARMSW;
  4997. #ifdef UNICODE
  4998. typedef MCI_LOAD_PARMSW MCI_LOAD_PARMS;
  4999. typedef PMCI_LOAD_PARMSW PMCI_LOAD_PARMS;
  5000. typedef LPMCI_LOAD_PARMSW LPMCI_LOAD_PARMS;
  5001. #else
  5002. typedef MCI_LOAD_PARMSA MCI_LOAD_PARMS;
  5003. typedef PMCI_LOAD_PARMSA PMCI_LOAD_PARMS;
  5004. typedef LPMCI_LOAD_PARMSA LPMCI_LOAD_PARMS;
  5005. #endif // UNICODE
  5006.  
  5007. #else
  5008. typedef struct tagMCI_LOAD_PARMS {
  5009.     DWORD   dwCallback;
  5010.     LPCSTR  lpfilename;
  5011. } MCI_LOAD_PARMS, FAR * LPMCI_LOAD_PARMS;
  5012. #endif
  5013.  
  5014. /* parameter block for MCI_RECORD command message */
  5015. typedef struct tagMCI_RECORD_PARMS {
  5016.     DWORD   dwCallback;
  5017.     DWORD   dwFrom;
  5018.     DWORD   dwTo;
  5019. } MCI_RECORD_PARMS, FAR *LPMCI_RECORD_PARMS;
  5020.  
  5021. /* MCI extensions for videodisc devices */
  5022.  
  5023. /* flag for dwReturn field of MCI_STATUS_PARMS */
  5024. /* MCI_STATUS command, (dwItem == MCI_STATUS_MODE) */
  5025. #define MCI_VD_MODE_PARK                (MCI_VD_OFFSET + 1)
  5026.  
  5027. /* flag for dwReturn field of MCI_STATUS_PARMS */
  5028. /* MCI_STATUS command, (dwItem == MCI_VD_STATUS_MEDIA_TYPE) */
  5029. #define MCI_VD_MEDIA_CLV                (MCI_VD_OFFSET + 2)
  5030. #define MCI_VD_MEDIA_CAV                (MCI_VD_OFFSET + 3)
  5031. #define MCI_VD_MEDIA_OTHER              (MCI_VD_OFFSET + 4)
  5032.  
  5033. #define MCI_VD_FORMAT_TRACK             0x4001
  5034.  
  5035. /* flags for dwFlags parameter of MCI_PLAY command message */
  5036. #define MCI_VD_PLAY_REVERSE             0x00010000L
  5037. #define MCI_VD_PLAY_FAST                0x00020000L
  5038. #define MCI_VD_PLAY_SPEED               0x00040000L
  5039. #define MCI_VD_PLAY_SCAN                0x00080000L
  5040. #define MCI_VD_PLAY_SLOW                0x00100000L
  5041.  
  5042. /* flag for dwFlags parameter of MCI_SEEK command message */
  5043. #define MCI_VD_SEEK_REVERSE             0x00010000L
  5044.  
  5045. /* flags for dwItem field of MCI_STATUS_PARMS parameter block */
  5046. #define MCI_VD_STATUS_SPEED             0x00004002L
  5047. #define MCI_VD_STATUS_FORWARD           0x00004003L
  5048. #define MCI_VD_STATUS_MEDIA_TYPE        0x00004004L
  5049. #define MCI_VD_STATUS_SIDE              0x00004005L
  5050. #define MCI_VD_STATUS_DISC_SIZE         0x00004006L
  5051.  
  5052. /* flags for dwFlags parameter of MCI_GETDEVCAPS command message */
  5053. #define MCI_VD_GETDEVCAPS_CLV           0x00010000L
  5054. #define MCI_VD_GETDEVCAPS_CAV           0x00020000L
  5055.  
  5056. #define MCI_VD_SPIN_UP                  0x00010000L
  5057. #define MCI_VD_SPIN_DOWN                0x00020000L
  5058.  
  5059. /* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
  5060. #define MCI_VD_GETDEVCAPS_CAN_REVERSE   0x00004002L
  5061. #define MCI_VD_GETDEVCAPS_FAST_RATE     0x00004003L
  5062. #define MCI_VD_GETDEVCAPS_SLOW_RATE     0x00004004L
  5063. #define MCI_VD_GETDEVCAPS_NORMAL_RATE   0x00004005L
  5064.  
  5065. /* flags for the dwFlags parameter of MCI_STEP command message */
  5066. #define MCI_VD_STEP_FRAMES              0x00010000L
  5067. #define MCI_VD_STEP_REVERSE             0x00020000L
  5068.  
  5069. /* flag for the MCI_ESCAPE command message */
  5070. #define MCI_VD_ESCAPE_STRING            0x00000100L
  5071.  
  5072. /* parameter block for MCI_PLAY command message */
  5073. typedef struct tagMCI_VD_PLAY_PARMS {
  5074.     DWORD   dwCallback;
  5075.     DWORD   dwFrom;
  5076.     DWORD   dwTo;
  5077.     DWORD   dwSpeed;
  5078. } MCI_VD_PLAY_PARMS, *PMCI_VD_PLAY_PARMS, FAR *LPMCI_VD_PLAY_PARMS;
  5079.  
  5080. /* parameter block for MCI_STEP command message */
  5081. typedef struct tagMCI_VD_STEP_PARMS {
  5082.     DWORD   dwCallback;
  5083.     DWORD   dwFrames;
  5084. } MCI_VD_STEP_PARMS, *PMCI_VD_STEP_PARMS, FAR *LPMCI_VD_STEP_PARMS;
  5085.  
  5086. /* parameter block for MCI_ESCAPE command message */
  5087. #ifdef _WIN32
  5088.  
  5089. typedef struct tagMCI_VD_ESCAPE_PARMSA {
  5090.     DWORD   dwCallback;
  5091.     LPCSTR      lpstrCommand;
  5092. } MCI_VD_ESCAPE_PARMSA, *PMCI_VD_ESCAPE_PARMSA, *LPMCI_VD_ESCAPE_PARMSA;
  5093. typedef struct tagMCI_VD_ESCAPE_PARMSW {
  5094.     DWORD   dwCallback;
  5095.     LPCWSTR     lpstrCommand;
  5096. } MCI_VD_ESCAPE_PARMSW, *PMCI_VD_ESCAPE_PARMSW, *LPMCI_VD_ESCAPE_PARMSW;
  5097. #ifdef UNICODE
  5098. typedef MCI_VD_ESCAPE_PARMSW MCI_VD_ESCAPE_PARMS;
  5099. typedef PMCI_VD_ESCAPE_PARMSW PMCI_VD_ESCAPE_PARMS;
  5100. typedef LPMCI_VD_ESCAPE_PARMSW LPMCI_VD_ESCAPE_PARMS;
  5101. #else
  5102. typedef MCI_VD_ESCAPE_PARMSA MCI_VD_ESCAPE_PARMS;
  5103. typedef PMCI_VD_ESCAPE_PARMSA PMCI_VD_ESCAPE_PARMS;
  5104. typedef LPMCI_VD_ESCAPE_PARMSA LPMCI_VD_ESCAPE_PARMS;
  5105. #endif // UNICODE
  5106.  
  5107. #else
  5108. typedef struct tagMCI_VD_ESCAPE_PARMS {
  5109.     DWORD   dwCallback;
  5110.     LPCSTR  lpstrCommand;
  5111. } MCI_VD_ESCAPE_PARMS, FAR *LPMCI_VD_ESCAPE_PARMS;
  5112. #endif
  5113.  
  5114. /* MCI extensions for CD audio devices */
  5115.  
  5116. /* flags for the dwItem field of the MCI_STATUS_PARMS parameter block */
  5117. #define MCI_CDA_STATUS_TYPE_TRACK       0x00004001L
  5118.  
  5119. /* flags for the dwReturn field of MCI_STATUS_PARMS parameter block */
  5120. /* MCI_STATUS command, (dwItem == MCI_CDA_STATUS_TYPE_TRACK) */
  5121. #define MCI_CDA_TRACK_AUDIO             (MCI_CD_OFFSET + 0)
  5122. #define MCI_CDA_TRACK_OTHER             (MCI_CD_OFFSET + 1)
  5123.  
  5124. /* MCI extensions for waveform audio devices */
  5125.  
  5126. #define MCI_WAVE_PCM                    (MCI_WAVE_OFFSET + 0)
  5127. #define MCI_WAVE_MAPPER                 (MCI_WAVE_OFFSET + 1)
  5128.  
  5129. /* flags for the dwFlags parameter of MCI_OPEN command message */
  5130. #define MCI_WAVE_OPEN_BUFFER            0x00010000L
  5131.  
  5132. /* flags for the dwFlags parameter of MCI_SET command message */
  5133. #define MCI_WAVE_SET_FORMATTAG          0x00010000L
  5134. #define MCI_WAVE_SET_CHANNELS           0x00020000L
  5135. #define MCI_WAVE_SET_SAMPLESPERSEC      0x00040000L
  5136. #define MCI_WAVE_SET_AVGBYTESPERSEC     0x00080000L
  5137. #define MCI_WAVE_SET_BLOCKALIGN         0x00100000L
  5138. #define MCI_WAVE_SET_BITSPERSAMPLE      0x00200000L
  5139.  
  5140. /* flags for the dwFlags parameter of MCI_STATUS, MCI_SET command messages */
  5141. #define MCI_WAVE_INPUT                  0x00400000L
  5142. #define MCI_WAVE_OUTPUT                 0x00800000L
  5143.  
  5144. /* flags for the dwItem field of MCI_STATUS_PARMS parameter block */
  5145. #define MCI_WAVE_STATUS_FORMATTAG       0x00004001L
  5146. #define MCI_WAVE_STATUS_CHANNELS        0x00004002L
  5147. #define MCI_WAVE_STATUS_SAMPLESPERSEC   0x00004003L
  5148. #define MCI_WAVE_STATUS_AVGBYTESPERSEC  0x00004004L
  5149. #define MCI_WAVE_STATUS_BLOCKALIGN      0x00004005L
  5150. #define MCI_WAVE_STATUS_BITSPERSAMPLE   0x00004006L
  5151. #define MCI_WAVE_STATUS_LEVEL           0x00004007L
  5152.  
  5153. /* flags for the dwFlags parameter of MCI_SET command message */
  5154. #define MCI_WAVE_SET_ANYINPUT           0x04000000L
  5155. #define MCI_WAVE_SET_ANYOUTPUT          0x08000000L
  5156.  
  5157. /* flags for the dwFlags parameter of MCI_GETDEVCAPS command message */
  5158. #define MCI_WAVE_GETDEVCAPS_INPUTS      0x00004001L
  5159. #define MCI_WAVE_GETDEVCAPS_OUTPUTS     0x00004002L
  5160.  
  5161. /* parameter block for MCI_OPEN command message */
  5162. #ifdef _WIN32
  5163.  
  5164. typedef struct tagMCI_WAVE_OPEN_PARMSA {
  5165.     DWORD   dwCallback;
  5166.     MCIDEVICEID wDeviceID;
  5167.     LPCSTR      lpstrDeviceType;
  5168.     LPCSTR      lpstrElementName;
  5169.     LPCSTR      lpstrAlias;
  5170.     DWORD   dwBufferSeconds;
  5171. } MCI_WAVE_OPEN_PARMSA, *PMCI_WAVE_OPEN_PARMSA, *LPMCI_WAVE_OPEN_PARMSA;
  5172. typedef struct tagMCI_WAVE_OPEN_PARMSW {
  5173.     DWORD   dwCallback;
  5174.     MCIDEVICEID wDeviceID;
  5175.     LPCWSTR     lpstrDeviceType;
  5176.     LPCWSTR     lpstrElementName;
  5177.     LPCWSTR     lpstrAlias;
  5178.     DWORD   dwBufferSeconds;
  5179. } MCI_WAVE_OPEN_PARMSW, *PMCI_WAVE_OPEN_PARMSW, *LPMCI_WAVE_OPEN_PARMSW;
  5180. #ifdef UNICODE
  5181. typedef MCI_WAVE_OPEN_PARMSW MCI_WAVE_OPEN_PARMS;
  5182. typedef PMCI_WAVE_OPEN_PARMSW PMCI_WAVE_OPEN_PARMS;
  5183. typedef LPMCI_WAVE_OPEN_PARMSW LPMCI_WAVE_OPEN_PARMS;
  5184. #else
  5185. typedef MCI_WAVE_OPEN_PARMSA MCI_WAVE_OPEN_PARMS;
  5186. typedef PMCI_WAVE_OPEN_PARMSA PMCI_WAVE_OPEN_PARMS;
  5187. typedef LPMCI_WAVE_OPEN_PARMSA LPMCI_WAVE_OPEN_PARMS;
  5188. #endif // UNICODE
  5189.  
  5190. #else
  5191. typedef struct tagMCI_WAVE_OPEN_PARMS {
  5192.     DWORD   dwCallback;
  5193.     MCIDEVICEID wDeviceID;
  5194.     WORD        wReserved0;
  5195.     LPCSTR      lpstrDeviceType;
  5196.     LPCSTR      lpstrElementName;
  5197.     LPCSTR      lpstrAlias;
  5198.     DWORD       dwBufferSeconds;
  5199. } MCI_WAVE_OPEN_PARMS, FAR *LPMCI_WAVE_OPEN_PARMS;
  5200. #endif
  5201.  
  5202. /* parameter block for MCI_DELETE command message */
  5203. typedef struct tagMCI_WAVE_DELETE_PARMS {
  5204.     DWORD   dwCallback;
  5205.     DWORD   dwFrom;
  5206.     DWORD   dwTo;
  5207. } MCI_WAVE_DELETE_PARMS, *PMCI_WAVE_DELETE_PARMS, FAR *LPMCI_WAVE_DELETE_PARMS;
  5208.  
  5209. /* parameter block for MCI_SET command message */
  5210. typedef struct tagMCI_WAVE_SET_PARMS {
  5211.     DWORD   dwCallback;
  5212.     DWORD   dwTimeFormat;
  5213.     DWORD   dwAudio;
  5214. #ifdef _WIN32
  5215.     UINT    wInput;
  5216.     UINT    wOutput;
  5217. #else
  5218.     WORD    wInput;
  5219.     WORD    wReserved0;
  5220.     WORD    wOutput;
  5221.     WORD    wReserved1;
  5222. #endif
  5223.     WORD    wFormatTag;
  5224.     WORD    wReserved2;
  5225.     WORD    nChannels;
  5226.     WORD    wReserved3;
  5227.     DWORD   nSamplesPerSec;
  5228.     DWORD   nAvgBytesPerSec;
  5229.     WORD    nBlockAlign;
  5230.     WORD    wReserved4;
  5231.     WORD    wBitsPerSample;
  5232.     WORD    wReserved5;
  5233. } MCI_WAVE_SET_PARMS, *PMCI_WAVE_SET_PARMS, FAR * LPMCI_WAVE_SET_PARMS;
  5234.  
  5235. /* MCI extensions for MIDI sequencer devices */
  5236.  
  5237. /* flags for the dwReturn field of MCI_STATUS_PARMS parameter block */
  5238. /* MCI_STATUS command, (dwItem == MCI_SEQ_STATUS_DIVTYPE) */
  5239. #define     MCI_SEQ_DIV_PPQN            (0 + MCI_SEQ_OFFSET)
  5240. #define     MCI_SEQ_DIV_SMPTE_24        (1 + MCI_SEQ_OFFSET)
  5241. #define     MCI_SEQ_DIV_SMPTE_25        (2 + MCI_SEQ_OFFSET)
  5242. #define     MCI_SEQ_DIV_SMPTE_30DROP    (3 + MCI_SEQ_OFFSET)
  5243. #define     MCI_SEQ_DIV_SMPTE_30        (4 + MCI_SEQ_OFFSET)
  5244.  
  5245. /* flags for the dwMaster field of MCI_SEQ_SET_PARMS parameter block */
  5246. /* MCI_SET command, (dwFlags == MCI_SEQ_SET_MASTER) */
  5247. #define     MCI_SEQ_FORMAT_SONGPTR      0x4001
  5248. #define     MCI_SEQ_FILE                0x4002
  5249. #define     MCI_SEQ_MIDI                0x4003
  5250. #define     MCI_SEQ_SMPTE               0x4004
  5251. #define     MCI_SEQ_NONE                65533
  5252. #define     MCI_SEQ_MAPPER              65535
  5253.  
  5254. /* flags for the dwItem field of MCI_STATUS_PARMS parameter block */
  5255. #define MCI_SEQ_STATUS_TEMPO            0x00004002L
  5256. #define MCI_SEQ_STATUS_PORT             0x00004003L
  5257. #define MCI_SEQ_STATUS_SLAVE            0x00004007L
  5258. #define MCI_SEQ_STATUS_MASTER           0x00004008L
  5259. #define MCI_SEQ_STATUS_OFFSET           0x00004009L
  5260. #define MCI_SEQ_STATUS_DIVTYPE          0x0000400AL
  5261. #define MCI_SEQ_STATUS_NAME             0x0000400BL
  5262. #define MCI_SEQ_STATUS_COPYRIGHT        0x0000400CL
  5263.  
  5264. /* flags for the dwFlags parameter of MCI_SET command message */
  5265. #define MCI_SEQ_SET_TEMPO               0x00010000L
  5266. #define MCI_SEQ_SET_PORT                0x00020000L
  5267. #define MCI_SEQ_SET_SLAVE               0x00040000L
  5268. #define MCI_SEQ_SET_MASTER              0x00080000L
  5269. #define MCI_SEQ_SET_OFFSET              0x01000000L
  5270.  
  5271. /* parameter block for MCI_SET command message */
  5272. typedef struct tagMCI_SEQ_SET_PARMS {
  5273.     DWORD   dwCallback;
  5274.     DWORD   dwTimeFormat;
  5275.     DWORD   dwAudio;
  5276.     DWORD   dwTempo;
  5277.     DWORD   dwPort;
  5278.     DWORD   dwSlave;
  5279.     DWORD   dwMaster;
  5280.     DWORD   dwOffset;
  5281. } MCI_SEQ_SET_PARMS, *PMCI_SEQ_SET_PARMS, FAR * LPMCI_SEQ_SET_PARMS;
  5282.  
  5283. /* MCI extensions for animation devices */
  5284.  
  5285. /* flags for dwFlags parameter of MCI_OPEN command message */
  5286. #define MCI_ANIM_OPEN_WS                0x00010000L
  5287. #define MCI_ANIM_OPEN_PARENT            0x00020000L
  5288. #define MCI_ANIM_OPEN_NOSTATIC          0x00040000L
  5289.  
  5290. /* flags for dwFlags parameter of MCI_PLAY command message */
  5291. #define MCI_ANIM_PLAY_SPEED             0x00010000L
  5292. #define MCI_ANIM_PLAY_REVERSE           0x00020000L
  5293. #define MCI_ANIM_PLAY_FAST              0x00040000L
  5294. #define MCI_ANIM_PLAY_SLOW              0x00080000L
  5295. #define MCI_ANIM_PLAY_SCAN              0x00100000L
  5296.  
  5297. /* flags for dwFlags parameter of MCI_STEP command message */
  5298. #define MCI_ANIM_STEP_REVERSE           0x00010000L
  5299. #define MCI_ANIM_STEP_FRAMES            0x00020000L
  5300.  
  5301. /* flags for dwItem field of MCI_STATUS_PARMS parameter block */
  5302. #define MCI_ANIM_STATUS_SPEED           0x00004001L
  5303. #define MCI_ANIM_STATUS_FORWARD         0x00004002L
  5304. #define MCI_ANIM_STATUS_HWND            0x00004003L
  5305. #define MCI_ANIM_STATUS_HPAL            0x00004004L
  5306. #define MCI_ANIM_STATUS_STRETCH         0x00004005L
  5307.  
  5308. /* flags for the dwFlags parameter of MCI_INFO command message */
  5309. #define MCI_ANIM_INFO_TEXT              0x00010000L
  5310.  
  5311. /* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
  5312. #define MCI_ANIM_GETDEVCAPS_CAN_REVERSE 0x00004001L
  5313. #define MCI_ANIM_GETDEVCAPS_FAST_RATE   0x00004002L
  5314. #define MCI_ANIM_GETDEVCAPS_SLOW_RATE   0x00004003L
  5315. #define MCI_ANIM_GETDEVCAPS_NORMAL_RATE 0x00004004L
  5316. #define MCI_ANIM_GETDEVCAPS_PALETTES    0x00004006L
  5317. #define MCI_ANIM_GETDEVCAPS_CAN_STRETCH 0x00004007L
  5318. #define MCI_ANIM_GETDEVCAPS_MAX_WINDOWS 0x00004008L
  5319.  
  5320. /* flags for the MCI_REALIZE command message */
  5321. #define MCI_ANIM_REALIZE_NORM           0x00010000L
  5322. #define MCI_ANIM_REALIZE_BKGD           0x00020000L
  5323.  
  5324. /* flags for dwFlags parameter of MCI_WINDOW command message */
  5325. #define MCI_ANIM_WINDOW_HWND            0x00010000L
  5326. #define MCI_ANIM_WINDOW_STATE           0x00040000L
  5327. #define MCI_ANIM_WINDOW_TEXT            0x00080000L
  5328. #define MCI_ANIM_WINDOW_ENABLE_STRETCH  0x00100000L
  5329. #define MCI_ANIM_WINDOW_DISABLE_STRETCH 0x00200000L
  5330.  
  5331. /* flags for hWnd field of MCI_ANIM_WINDOW_PARMS parameter block */
  5332. /* MCI_WINDOW command message, (dwFlags == MCI_ANIM_WINDOW_HWND) */
  5333. #define MCI_ANIM_WINDOW_DEFAULT         0x00000000L
  5334.  
  5335. /* flags for dwFlags parameter of MCI_PUT command message */
  5336. #define MCI_ANIM_RECT                   0x00010000L
  5337. #define MCI_ANIM_PUT_SOURCE             0x00020000L
  5338. #define MCI_ANIM_PUT_DESTINATION        0x00040000L
  5339.  
  5340. /* flags for dwFlags parameter of MCI_WHERE command message */
  5341. #define MCI_ANIM_WHERE_SOURCE           0x00020000L
  5342. #define MCI_ANIM_WHERE_DESTINATION      0x00040000L
  5343.  
  5344. /* flags for dwFlags parameter of MCI_UPDATE command message */
  5345. #define MCI_ANIM_UPDATE_HDC             0x00020000L
  5346.  
  5347. /* parameter block for MCI_OPEN command message */
  5348. #ifdef _WIN32
  5349.  
  5350. typedef struct tagMCI_ANIM_OPEN_PARMSA {
  5351.     DWORD   dwCallback;
  5352.     MCIDEVICEID wDeviceID;
  5353.     LPCSTR      lpstrDeviceType;
  5354.     LPCSTR      lpstrElementName;
  5355.     LPCSTR      lpstrAlias;
  5356.     DWORD   dwStyle;
  5357.     HWND    hWndParent;
  5358. } MCI_ANIM_OPEN_PARMSA, *PMCI_ANIM_OPEN_PARMSA, *LPMCI_ANIM_OPEN_PARMSA;
  5359. typedef struct tagMCI_ANIM_OPEN_PARMSW {
  5360.     DWORD   dwCallback;
  5361.     MCIDEVICEID wDeviceID;
  5362.     LPCWSTR     lpstrDeviceType;
  5363.     LPCWSTR     lpstrElementName;
  5364.     LPCWSTR     lpstrAlias;
  5365.     DWORD   dwStyle;
  5366.     HWND    hWndParent;
  5367. } MCI_ANIM_OPEN_PARMSW, *PMCI_ANIM_OPEN_PARMSW, *LPMCI_ANIM_OPEN_PARMSW;
  5368. #ifdef UNICODE
  5369. typedef MCI_ANIM_OPEN_PARMSW MCI_ANIM_OPEN_PARMS;
  5370. typedef PMCI_ANIM_OPEN_PARMSW PMCI_ANIM_OPEN_PARMS;
  5371. typedef LPMCI_ANIM_OPEN_PARMSW LPMCI_ANIM_OPEN_PARMS;
  5372. #else
  5373. typedef MCI_ANIM_OPEN_PARMSA MCI_ANIM_OPEN_PARMS;
  5374. typedef PMCI_ANIM_OPEN_PARMSA PMCI_ANIM_OPEN_PARMS;
  5375. typedef LPMCI_ANIM_OPEN_PARMSA LPMCI_ANIM_OPEN_PARMS;
  5376. #endif // UNICODE
  5377.  
  5378. #else
  5379. typedef struct tagMCI_ANIM_OPEN_PARMS {
  5380.     DWORD   dwCallback;
  5381.     MCIDEVICEID wDeviceID;
  5382.     WORD        wReserved0;
  5383.     LPCSTR      lpstrDeviceType;
  5384.     LPCSTR      lpstrElementName;
  5385.     LPCSTR      lpstrAlias;
  5386.     DWORD       dwStyle;
  5387.     HWND        hWndParent;
  5388.     WORD        wReserved1;
  5389. } MCI_ANIM_OPEN_PARMS, FAR *LPMCI_ANIM_OPEN_PARMS;
  5390. #endif
  5391.  
  5392. /* parameter block for MCI_PLAY command message */
  5393. typedef struct tagMCI_ANIM_PLAY_PARMS {
  5394.     DWORD   dwCallback;
  5395.     DWORD   dwFrom;
  5396.     DWORD   dwTo;
  5397.     DWORD   dwSpeed;
  5398. } MCI_ANIM_PLAY_PARMS, *PMCI_ANIM_PLAY_PARMS, FAR *LPMCI_ANIM_PLAY_PARMS;
  5399.  
  5400. /* parameter block for MCI_STEP command message */
  5401. typedef struct tagMCI_ANIM_STEP_PARMS {
  5402.     DWORD   dwCallback;
  5403.     DWORD   dwFrames;
  5404. } MCI_ANIM_STEP_PARMS, *PMCI_ANIM_STEP_PARMS, FAR *LPMCI_ANIM_STEP_PARMS;
  5405.  
  5406. /* parameter block for MCI_WINDOW command message */
  5407. #ifdef _WIN32
  5408.  
  5409. typedef struct tagMCI_ANIM_WINDOW_PARMSA {
  5410.     DWORD   dwCallback;
  5411.     HWND    hWnd;
  5412.     UINT    nCmdShow;
  5413.     LPCSTR     lpstrText;
  5414. } MCI_ANIM_WINDOW_PARMSA, *PMCI_ANIM_WINDOW_PARMSA, * LPMCI_ANIM_WINDOW_PARMSA;
  5415. typedef struct tagMCI_ANIM_WINDOW_PARMSW {
  5416.     DWORD   dwCallback;
  5417.     HWND    hWnd;
  5418.     UINT    nCmdShow;
  5419.     LPCWSTR    lpstrText;
  5420. } MCI_ANIM_WINDOW_PARMSW, *PMCI_ANIM_WINDOW_PARMSW, * LPMCI_ANIM_WINDOW_PARMSW;
  5421. #ifdef UNICODE
  5422. typedef MCI_ANIM_WINDOW_PARMSW MCI_ANIM_WINDOW_PARMS;
  5423. typedef PMCI_ANIM_WINDOW_PARMSW PMCI_ANIM_WINDOW_PARMS;
  5424. typedef LPMCI_ANIM_WINDOW_PARMSW LPMCI_ANIM_WINDOW_PARMS;
  5425. #else
  5426. typedef MCI_ANIM_WINDOW_PARMSA MCI_ANIM_WINDOW_PARMS;
  5427. typedef PMCI_ANIM_WINDOW_PARMSA PMCI_ANIM_WINDOW_PARMS;
  5428. typedef LPMCI_ANIM_WINDOW_PARMSA LPMCI_ANIM_WINDOW_PARMS;
  5429. #endif // UNICODE
  5430.  
  5431. #else
  5432. typedef struct tagMCI_ANIM_WINDOW_PARMS {
  5433.     DWORD   dwCallback;
  5434.     HWND    hWnd;
  5435.     WORD    wReserved1;
  5436.     WORD    nCmdShow;
  5437.     WORD    wReserved2;
  5438.     LPCSTR  lpstrText;
  5439. } MCI_ANIM_WINDOW_PARMS, FAR * LPMCI_ANIM_WINDOW_PARMS;
  5440. #endif
  5441.  
  5442. /* parameter block for MCI_PUT, MCI_UPDATE, MCI_WHERE command messages */
  5443. typedef struct tagMCI_ANIM_RECT_PARMS {
  5444.     DWORD   dwCallback;
  5445. #ifdef MCI_USE_OFFEXT
  5446.     POINT   ptOffset;
  5447.     POINT   ptExtent;
  5448. #else   /* ifdef MCI_USE_OFFEXT */
  5449.     RECT    rc;
  5450. #endif  /* ifdef MCI_USE_OFFEXT */
  5451. } MCI_ANIM_RECT_PARMS;
  5452. typedef MCI_ANIM_RECT_PARMS * PMCI_ANIM_RECT_PARMS;
  5453. typedef MCI_ANIM_RECT_PARMS FAR * LPMCI_ANIM_RECT_PARMS;
  5454.  
  5455. /* parameter block for MCI_UPDATE PARMS */
  5456. typedef struct tagMCI_ANIM_UPDATE_PARMS {
  5457.     DWORD   dwCallback;
  5458.     RECT    rc;
  5459.     HDC     hDC;
  5460. } MCI_ANIM_UPDATE_PARMS, *PMCI_ANIM_UPDATE_PARMS, FAR * LPMCI_ANIM_UPDATE_PARMS;
  5461.  
  5462. /* MCI extensions for video overlay devices */
  5463.  
  5464. /* flags for dwFlags parameter of MCI_OPEN command message */
  5465. #define MCI_OVLY_OPEN_WS                0x00010000L
  5466. #define MCI_OVLY_OPEN_PARENT            0x00020000L
  5467.  
  5468. /* flags for dwFlags parameter of MCI_STATUS command message */
  5469. #define MCI_OVLY_STATUS_HWND            0x00004001L
  5470. #define MCI_OVLY_STATUS_STRETCH         0x00004002L
  5471.  
  5472. /* flags for dwFlags parameter of MCI_INFO command message */
  5473. #define MCI_OVLY_INFO_TEXT              0x00010000L
  5474.  
  5475. /* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
  5476. #define MCI_OVLY_GETDEVCAPS_CAN_STRETCH 0x00004001L
  5477. #define MCI_OVLY_GETDEVCAPS_CAN_FREEZE  0x00004002L
  5478. #define MCI_OVLY_GETDEVCAPS_MAX_WINDOWS 0x00004003L
  5479.  
  5480. /* flags for dwFlags parameter of MCI_WINDOW command message */
  5481. #define MCI_OVLY_WINDOW_HWND            0x00010000L
  5482. #define MCI_OVLY_WINDOW_STATE           0x00040000L
  5483. #define MCI_OVLY_WINDOW_TEXT            0x00080000L
  5484. #define MCI_OVLY_WINDOW_ENABLE_STRETCH  0x00100000L
  5485. #define MCI_OVLY_WINDOW_DISABLE_STRETCH 0x00200000L
  5486.  
  5487. /* flags for hWnd parameter of MCI_OVLY_WINDOW_PARMS parameter block */
  5488. #define MCI_OVLY_WINDOW_DEFAULT         0x00000000L
  5489.  
  5490. /* flags for dwFlags parameter of MCI_PUT command message */
  5491. #define MCI_OVLY_RECT                   0x00010000L
  5492. #define MCI_OVLY_PUT_SOURCE             0x00020000L
  5493. #define MCI_OVLY_PUT_DESTINATION        0x00040000L
  5494. #define MCI_OVLY_PUT_FRAME              0x00080000L
  5495. #define MCI_OVLY_PUT_VIDEO              0x00100000L
  5496.  
  5497. /* flags for dwFlags parameter of MCI_WHERE command message */
  5498. #define MCI_OVLY_WHERE_SOURCE           0x00020000L
  5499. #define MCI_OVLY_WHERE_DESTINATION      0x00040000L
  5500. #define MCI_OVLY_WHERE_FRAME            0x00080000L
  5501. #define MCI_OVLY_WHERE_VIDEO            0x00100000L
  5502.  
  5503. /* parameter block for MCI_OPEN command message */
  5504. #ifdef _WIN32
  5505.  
  5506. typedef struct tagMCI_OVLY_OPEN_PARMSA {
  5507.     DWORD   dwCallback;
  5508.     MCIDEVICEID wDeviceID;
  5509.     LPCSTR      lpstrDeviceType;
  5510.     LPCSTR      lpstrElementName;
  5511.     LPCSTR      lpstrAlias;
  5512.     DWORD   dwStyle;
  5513.     HWND    hWndParent;
  5514. } MCI_OVLY_OPEN_PARMSA, *PMCI_OVLY_OPEN_PARMSA, *LPMCI_OVLY_OPEN_PARMSA;
  5515. typedef struct tagMCI_OVLY_OPEN_PARMSW {
  5516.     DWORD   dwCallback;
  5517.     MCIDEVICEID wDeviceID;
  5518.     LPCWSTR     lpstrDeviceType;
  5519.     LPCWSTR     lpstrElementName;
  5520.     LPCWSTR     lpstrAlias;
  5521.     DWORD   dwStyle;
  5522.     HWND    hWndParent;
  5523. } MCI_OVLY_OPEN_PARMSW, *PMCI_OVLY_OPEN_PARMSW, *LPMCI_OVLY_OPEN_PARMSW;
  5524. #ifdef UNICODE
  5525. typedef MCI_OVLY_OPEN_PARMSW MCI_OVLY_OPEN_PARMS;
  5526. typedef PMCI_OVLY_OPEN_PARMSW PMCI_OVLY_OPEN_PARMS;
  5527. typedef LPMCI_OVLY_OPEN_PARMSW LPMCI_OVLY_OPEN_PARMS;
  5528. #else
  5529. typedef MCI_OVLY_OPEN_PARMSA MCI_OVLY_OPEN_PARMS;
  5530. typedef PMCI_OVLY_OPEN_PARMSA PMCI_OVLY_OPEN_PARMS;
  5531. typedef LPMCI_OVLY_OPEN_PARMSA LPMCI_OVLY_OPEN_PARMS;
  5532. #endif // UNICODE
  5533.  
  5534. #else
  5535. typedef struct tagMCI_OVLY_OPEN_PARMS {
  5536.     DWORD   dwCallback;
  5537.     MCIDEVICEID wDeviceID;
  5538.     WORD        wReserved0;
  5539.     LPCSTR      lpstrDeviceType;
  5540.     LPCSTR      lpstrElementName;
  5541.     LPCSTR      lpstrAlias;
  5542.     DWORD       dwStyle;
  5543.     HWND        hWndParent;
  5544.     WORD        wReserved1;
  5545. } MCI_OVLY_OPEN_PARMS, FAR *LPMCI_OVLY_OPEN_PARMS;
  5546. #endif
  5547.  
  5548. /* parameter block for MCI_WINDOW command message */
  5549. #ifdef _WIN32
  5550.  
  5551. typedef struct tagMCI_OVLY_WINDOW_PARMSA {
  5552.     DWORD   dwCallback;
  5553.     HWND    hWnd;
  5554.     UINT    nCmdShow;
  5555.     LPCSTR      lpstrText;
  5556. } MCI_OVLY_WINDOW_PARMSA, *PMCI_OVLY_WINDOW_PARMSA, * LPMCI_OVLY_WINDOW_PARMSA;
  5557. typedef struct tagMCI_OVLY_WINDOW_PARMSW {
  5558.     DWORD   dwCallback;
  5559.     HWND    hWnd;
  5560.     UINT    nCmdShow;
  5561.     LPCWSTR     lpstrText;
  5562. } MCI_OVLY_WINDOW_PARMSW, *PMCI_OVLY_WINDOW_PARMSW, * LPMCI_OVLY_WINDOW_PARMSW;
  5563. #ifdef UNICODE
  5564. typedef MCI_OVLY_WINDOW_PARMSW MCI_OVLY_WINDOW_PARMS;
  5565. typedef PMCI_OVLY_WINDOW_PARMSW PMCI_OVLY_WINDOW_PARMS;
  5566. typedef LPMCI_OVLY_WINDOW_PARMSW LPMCI_OVLY_WINDOW_PARMS;
  5567. #else
  5568. typedef MCI_OVLY_WINDOW_PARMSA MCI_OVLY_WINDOW_PARMS;
  5569. typedef PMCI_OVLY_WINDOW_PARMSA PMCI_OVLY_WINDOW_PARMS;
  5570. typedef LPMCI_OVLY_WINDOW_PARMSA LPMCI_OVLY_WINDOW_PARMS;
  5571. #endif // UNICODE
  5572. #else
  5573. typedef struct tagMCI_OVLY_WINDOW_PARMS {
  5574.     DWORD   dwCallback;
  5575.     HWND    hWnd;
  5576.     WORD    wReserved1;
  5577.     UINT    nCmdShow;
  5578.     WORD    wReserved2;
  5579.     LPCSTR  lpstrText;
  5580. } MCI_OVLY_WINDOW_PARMS, FAR * LPMCI_OVLY_WINDOW_PARMS;
  5581. #endif
  5582.  
  5583. /* parameter block for MCI_PUT, MCI_UPDATE, and MCI_WHERE command messages */
  5584. typedef struct tagMCI_OVLY_RECT_PARMS {
  5585.     DWORD   dwCallback;
  5586. #ifdef MCI_USE_OFFEXT
  5587.     POINT   ptOffset;
  5588.     POINT   ptExtent;
  5589. #else   /* ifdef MCI_USE_OFFEXT */
  5590.     RECT    rc;
  5591. #endif  /* ifdef MCI_USE_OFFEXT */
  5592. } MCI_OVLY_RECT_PARMS, *PMCI_OVLY_RECT_PARMS, FAR * LPMCI_OVLY_RECT_PARMS;
  5593.  
  5594. /* parameter block for MCI_SAVE command message */
  5595. #ifdef _WIN32
  5596.  
  5597. typedef struct tagMCI_OVLY_SAVE_PARMSA {
  5598.     DWORD   dwCallback;
  5599.     LPCSTR      lpfilename;
  5600.     RECT    rc;
  5601. } MCI_OVLY_SAVE_PARMSA, *PMCI_OVLY_SAVE_PARMSA, * LPMCI_OVLY_SAVE_PARMSA;
  5602. typedef struct tagMCI_OVLY_SAVE_PARMSW {
  5603.     DWORD   dwCallback;
  5604.     LPCWSTR     lpfilename;
  5605.     RECT    rc;
  5606. } MCI_OVLY_SAVE_PARMSW, *PMCI_OVLY_SAVE_PARMSW, * LPMCI_OVLY_SAVE_PARMSW;
  5607. #ifdef UNICODE
  5608. typedef MCI_OVLY_SAVE_PARMSW MCI_OVLY_SAVE_PARMS;
  5609. typedef PMCI_OVLY_SAVE_PARMSW PMCI_OVLY_SAVE_PARMS;
  5610. typedef LPMCI_OVLY_SAVE_PARMSW LPMCI_OVLY_SAVE_PARMS;
  5611. #else
  5612. typedef MCI_OVLY_SAVE_PARMSA MCI_OVLY_SAVE_PARMS;
  5613. typedef PMCI_OVLY_SAVE_PARMSA PMCI_OVLY_SAVE_PARMS;
  5614. typedef LPMCI_OVLY_SAVE_PARMSA LPMCI_OVLY_SAVE_PARMS;
  5615. #endif // UNICODE
  5616. #else
  5617. typedef struct tagMCI_OVLY_SAVE_PARMS {
  5618.     DWORD   dwCallback;
  5619.     LPCSTR  lpfilename;
  5620.     RECT    rc;
  5621. } MCI_OVLY_SAVE_PARMS, FAR * LPMCI_OVLY_SAVE_PARMS;
  5622. #endif
  5623.  
  5624. /* parameter block for MCI_LOAD command message */
  5625. #ifdef _WIN32
  5626.  
  5627. typedef struct tagMCI_OVLY_LOAD_PARMSA {
  5628.     DWORD   dwCallback;
  5629.     LPCSTR      lpfilename;
  5630.     RECT    rc;
  5631. } MCI_OVLY_LOAD_PARMSA, *PMCI_OVLY_LOAD_PARMSA, * LPMCI_OVLY_LOAD_PARMSA;
  5632. typedef struct tagMCI_OVLY_LOAD_PARMSW {
  5633.     DWORD   dwCallback;
  5634.     LPCWSTR     lpfilename;
  5635.     RECT    rc;
  5636. } MCI_OVLY_LOAD_PARMSW, *PMCI_OVLY_LOAD_PARMSW, * LPMCI_OVLY_LOAD_PARMSW;
  5637. #ifdef UNICODE
  5638. typedef MCI_OVLY_LOAD_PARMSW MCI_OVLY_LOAD_PARMS;
  5639. typedef PMCI_OVLY_LOAD_PARMSW PMCI_OVLY_LOAD_PARMS;
  5640. typedef LPMCI_OVLY_LOAD_PARMSW LPMCI_OVLY_LOAD_PARMS;
  5641. #else
  5642. typedef MCI_OVLY_LOAD_PARMSA MCI_OVLY_LOAD_PARMS;
  5643. typedef PMCI_OVLY_LOAD_PARMSA PMCI_OVLY_LOAD_PARMS;
  5644. typedef LPMCI_OVLY_LOAD_PARMSA LPMCI_OVLY_LOAD_PARMS;
  5645. #endif // UNICODE
  5646. #else
  5647. typedef struct tagMCI_OVLY_LOAD_PARMS {
  5648.     DWORD   dwCallback;
  5649.     LPCSTR  lpfilename;
  5650.     RECT    rc;
  5651. } MCI_OVLY_LOAD_PARMS, FAR * LPMCI_OVLY_LOAD_PARMS;
  5652. #endif
  5653.  
  5654. #endif  /* ifndef _WIN32_VXD */
  5655. #endif  /* ifndef MMNOMCI */
  5656.  
  5657. /****************************************************************************
  5658.  
  5659.             DISPLAY Driver extensions
  5660.  
  5661. ****************************************************************************/
  5662.  
  5663. #ifndef NEWTRANSPARENT
  5664.     #define NEWTRANSPARENT  3           /* use with SetBkMode() */
  5665.  
  5666.     #define QUERYROPSUPPORT 40          /* use to determine ROP support */
  5667. #endif  /* ifndef NEWTRANSPARENT */
  5668.  
  5669. /****************************************************************************
  5670.  
  5671.             DIB Driver extensions
  5672.  
  5673. ****************************************************************************/
  5674.  
  5675. #define SELECTDIB       41                      /* DIB.DRV select dib escape */
  5676. #define DIBINDEX(n)     MAKELONG((n),0x10FF)
  5677.  
  5678. /****************************************************************************
  5679.  
  5680.             ScreenSaver support
  5681.  
  5682.     The current application will receive a syscommand of SC_SCREENSAVE just
  5683.     before the screen saver is invoked.  If the app wishes to prevent a
  5684.     screen save, return non-zero value, otherwise call DefWindowProc().
  5685.  
  5686. ****************************************************************************/
  5687.  
  5688. #ifndef SC_SCREENSAVE
  5689.  
  5690.     #define SC_SCREENSAVE   0xF140
  5691.  
  5692. #endif  /* ifndef SC_SCREENSAVE */
  5693.  
  5694. #ifdef __cplusplus
  5695. }                       /* End of extern "C" { */
  5696. #endif  /* __cplusplus */
  5697.  
  5698. #ifdef _WIN32
  5699. #include <poppack.h>
  5700. #else
  5701. #ifndef RC_INVOKED
  5702. #pragma pack()
  5703. #endif
  5704. #endif
  5705.  
  5706. #endif  /* _INC_MMSYSTEM */
  5707.  
  5708.  
  5709. #endif  /* __FLAT__ */
  5710.