home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 August / VPR9608A.BIN / del20try / install / data.z / MMSYSTEM.PAS < prev    next >
Pascal/Delphi Source File  |  1996-05-08  |  131KB  |  3,146 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Runtime Library                          }
  5. {       Windows 32bit API Interface Unit                }
  6. {       Multimedia Interface unit                       }
  7. {                                                       }
  8. {       Copyright (c) 1992,96 Borland International     }
  9. {                                                       }
  10. {*******************************************************}
  11.  
  12. unit MMSystem;
  13.  
  14. interface
  15.  
  16. uses Windows;
  17.  
  18.  
  19. {***************************************************************************
  20.  
  21.                     General constants and data types
  22.  
  23. ***************************************************************************}
  24.  
  25. { general constants }
  26. const
  27.   MAXPNAMELEN      =  32;    { max product name length (including nil) }
  28.   MAXERRORLENGTH   = 128;    { max error text length (including nil) }
  29.   MAX_JOYSTICKOEMVXDNAME = 260; { max oem vxd name length (including nil) }
  30.  
  31. {***************************************************************************
  32.  
  33.                          Manufacturer and product IDs
  34.  
  35.     Used with wMid and wPid fields in WAVEOUTCAPS, WAVEINCAPS,
  36.     MIDIOUTCAPS, MIDIINCAPS, AUXCAPS, JOYCAPS structures.
  37.  
  38. ***************************************************************************}
  39.  
  40. { manufacturer IDs }
  41. const
  42.   MM_MICROSOFT            = 1;       { Microsoft Corp. }
  43.  
  44. { product IDs }
  45.   MM_MIDI_MAPPER          = 1;       { MIDI Mapper }
  46.   MM_WAVE_MAPPER          = 2;       { Wave Mapper }
  47.   MM_SNDBLST_MIDIOUT      = 3;       { Sound Blaster MIDI output port }
  48.   MM_SNDBLST_MIDIIN       = 4;       { Sound Blaster MIDI input port  }
  49.   MM_SNDBLST_SYNTH        = 5;       { Sound Blaster internal synthesizer }
  50.   MM_SNDBLST_WAVEOUT      = 6;       { Sound Blaster waveform output }
  51.   MM_SNDBLST_WAVEIN       = 7;       { Sound Blaster waveform input }
  52.   MM_ADLIB                = 9;       { Ad Lib-compatible synthesizer }
  53.   MM_MPU401_MIDIOUT       = 10;      { MPU401-compatible MIDI output port }
  54.   MM_MPU401_MIDIIN        = 11;      { MPU401-compatible MIDI input port }
  55.   MM_PC_JOYSTICK          = 12;      { Joystick adapter }
  56.  
  57.  
  58. { general data types }
  59. type
  60.   VERSION = UINT;               { major (high byte), minor (low byte) }
  61.   MMVERSION = UINT;             { major (high byte), minor (low byte) }
  62.   MMRESULT = UINT;              { error return code, 0 means no error }
  63.  
  64. { types for wType field in MMTIME struct }
  65. const
  66.   TIME_MS         = $0001;  { time in milliseconds }
  67.   TIME_SAMPLES    = $0002;  { number of wave samples }
  68.   TIME_BYTES      = $0004;  { current byte offset }
  69.   TIME_SMPTE      = $0008;  { SMPTE time }
  70.   TIME_MIDI       = $0010;  { MIDI time }
  71.   TIME_TICKS      = $0020;  { Ticks within MIDI stream }
  72.  
  73. { MMTIME data structure }
  74. type
  75.   PMMTime = ^TMMTime;
  76.   TMMTime = record
  77.     case wType: UINT of        { indicates the contents of the variant record }
  78.      TIME_MS:      (ms: DWORD);
  79.      TIME_SAMPLES: (sample: DWORD);
  80.      TIME_BYTES:   (cb: DWORD);
  81.      TIME_TICKS:   (ticks: DWORD);
  82.      TIME_SMPTE: (
  83.         hour: Byte;
  84.         min: Byte;
  85.         sec: Byte;
  86.         frame: Byte;
  87.         fps: Byte;
  88.         dummy: Byte;
  89.         pad: array[0..1] of Byte);
  90.       TIME_MIDI : (songptrpos: DWORD);
  91.   end;
  92.  
  93.  
  94. {***************************************************************************
  95.  
  96.                     Multimedia Extensions Window Messages
  97.  
  98. ***************************************************************************}
  99.  
  100. { joystick }
  101. const
  102.   MM_JOY1MOVE         = $3A0;
  103.   MM_JOY2MOVE         = $3A1;
  104.   MM_JOY1ZMOVE        = $3A2;
  105.   MM_JOY2ZMOVE        = $3A3;
  106.   MM_JOY1BUTTONDOWN   = $3B5;
  107.   MM_JOY2BUTTONDOWN   = $3B6;
  108.   MM_JOY1BUTTONUP     = $3B7;
  109.   MM_JOY2BUTTONUP     = $3B8;
  110.  
  111. { MCI }
  112.   MM_MCINOTIFY        = $3B9;
  113.  
  114. { waveform output }
  115.   MM_WOM_OPEN         = $3BB;
  116.   MM_WOM_CLOSE        = $3BC;
  117.   MM_WOM_DONE         = $3BD;
  118.  
  119. { waveform input }
  120.   MM_WIM_OPEN         = $3BE;
  121.   MM_WIM_CLOSE        = $3BF;
  122.   MM_WIM_DATA         = $3C0;
  123.  
  124. { MIDI input }
  125.   MM_MIM_OPEN         = $3C1;
  126.   MM_MIM_CLOSE        = $3C2;
  127.   MM_MIM_DATA         = $3C3;
  128.   MM_MIM_LONGDATA     = $3C4;
  129.   MM_MIM_ERROR        = $3C5;
  130.   MM_MIM_LONGERROR    = $3C6;
  131.  
  132. { MIDI output }
  133.   MM_MOM_OPEN         = $3C7;
  134.   MM_MOM_CLOSE        = $3C8;
  135.   MM_MOM_DONE         = $3C9;
  136.  
  137.   MM_DRVM_OPEN        = $3D0;
  138.   MM_DRVM_CLOSE       = $3D1;
  139.   MM_DRVM_DATA        = $3D2;
  140.   MM_DRVM_ERROR       = $3D3;
  141.  
  142.   MM_STREAM_OPEN        = $3D4;
  143.   MM_STREAM_CLOSE        = $3D5;
  144.   MM_STREAM_DONE        = $3D6;
  145.   MM_STREAM_ERROR        = $3D7;
  146.  
  147.   MM_MOM_POSITIONCB   = $3CA;
  148.  
  149.   MM_MCISIGNAL        = $3CB;
  150.   MM_MIM_MOREDATA     = $3CC;
  151.  
  152.   MM_MIXM_LINE_CHANGE     = $3D0;
  153.   MM_MIXM_CONTROL_CHANGE  = $3D1;
  154.  
  155. {***************************************************************************
  156.  
  157.                 String resource number bases (internal use)
  158.  
  159. ***************************************************************************}
  160.  
  161. const
  162.   MMSYSERR_BASE          = 0;
  163.   WAVERR_BASE            = 32;
  164.   MIDIERR_BASE           = 64;
  165.   TIMERR_BASE            = 96;
  166.   JOYERR_BASE            = 160;
  167.   MCIERR_BASE            = 256;
  168.   MIXERR_BASE            = 1024;
  169.  
  170.   MCI_STRING_OFFSET      = 512;
  171.   MCI_VD_OFFSET          = 1024;
  172.   MCI_CD_OFFSET          = 1088;
  173.   MCI_WAVE_OFFSET        = 1152;
  174.   MCI_SEQ_OFFSET         = 1216;
  175.  
  176. {***************************************************************************
  177.  
  178.                         General error return values
  179.  
  180. ***************************************************************************}
  181.  
  182. { general error return values }
  183. const
  184.   MMSYSERR_NOERROR      = 0;                  { no error }
  185.   MMSYSERR_ERROR        = MMSYSERR_BASE + 1;  { unspecified error }
  186.   MMSYSERR_BADDEVICEID  = MMSYSERR_BASE + 2;  { device ID out of range }
  187.   MMSYSERR_NOTENABLED   = MMSYSERR_BASE + 3;  { driver failed enable }
  188.   MMSYSERR_ALLOCATED    = MMSYSERR_BASE + 4;  { device already allocated }
  189.   MMSYSERR_INVALHANDLE  = MMSYSERR_BASE + 5;  { device handle is invalid }
  190.   MMSYSERR_NODRIVER     = MMSYSERR_BASE + 6;  { no device driver present }
  191.   MMSYSERR_NOMEM        = MMSYSERR_BASE + 7;  { memory allocation error }
  192.   MMSYSERR_NOTSUPPORTED = MMSYSERR_BASE + 8;  { function isn't supported }
  193.   MMSYSERR_BADERRNUM    = MMSYSERR_BASE + 9;  { error value out of range }
  194.   MMSYSERR_INVALFLAG    = MMSYSERR_BASE + 10; { invalid flag passed }
  195.   MMSYSERR_INVALPARAM   = MMSYSERR_BASE + 11; { invalid parameter passed }
  196.   MMSYSERR_HANDLEBUSY   = MMSYSERR_BASE + 12; { handle being used
  197.                                                 simultaneously on another
  198.                                                 thread (eg callback) }
  199.   MMSYSERR_INVALIDALIAS = MMSYSERR_BASE + 13; { specified alias not found }
  200.   MMSYSERR_BADDB        = MMSYSERR_BASE + 14; { bad registry database }
  201.   MMSYSERR_KEYNOTFOUND  = MMSYSERR_BASE + 15; { registry key not found }
  202.   MMSYSERR_READERROR    = MMSYSERR_BASE + 16; { registry read error }
  203.   MMSYSERR_WRITEERROR   = MMSYSERR_BASE + 17; { registry write error }
  204.   MMSYSERR_DELETEERROR  = MMSYSERR_BASE + 18; { registry delete error }
  205.   MMSYSERR_VALNOTFOUND  = MMSYSERR_BASE + 19; { registry value not found }
  206.   MMSYSERR_NODRIVERCB   = MMSYSERR_BASE + 20; { driver does not call DriverCallback }
  207.   MMSYSERR_LASTERROR    = MMSYSERR_BASE + 20; { last error in range }
  208.  
  209. type
  210.   HDRVR = Integer;
  211.  
  212. {***************************************************************************
  213.  
  214.                         Installable driver support
  215.  
  216. ***************************************************************************}
  217.  
  218. type
  219.   PDrvConfigInfoEx = ^TDrvConfigInfoEx;
  220.   TDrvConfigInfoEx = packed record
  221.     dwDCISize: DWORD;
  222.     lpszDCISectionName: PWideChar;
  223.     lpszDCIAliasName: PWideChar;
  224.     dnDevNode: DWORD;
  225.   end;
  226.  
  227. const
  228. { Driver messages }
  229.   DRV_LOAD                = $0001;
  230.   DRV_ENABLE              = $0002;
  231.   DRV_OPEN                = $0003;
  232.   DRV_CLOSE               = $0004;
  233.   DRV_DISABLE             = $0005;
  234.   DRV_FREE                = $0006;
  235.   DRV_CONFIGURE           = $0007;
  236.   DRV_QUERYCONFIGURE      = $0008;
  237.   DRV_INSTALL             = $0009;
  238.   DRV_REMOVE              = $000A;
  239.   DRV_EXITSESSION         = $000B;
  240.   DRV_POWER               = $000F;
  241.   DRV_RESERVED            = $0800;
  242.   DRV_USER                = $4000;
  243.  
  244. type
  245. { LPARAM of DRV_CONFIGURE message }
  246.   PDrvConfigInfo = ^TDrvConfigInfo;
  247.   TDrvConfigInfo = packed record
  248.     dwDCISize: DWORD;
  249.     lpszDCISectionName: PWideChar;
  250.     lpszDCIAliasName: PWideChar;
  251.   end;
  252.  
  253. const
  254. { Supported return values for DRV_CONFIGURE message }
  255.   DRVCNF_CANCEL           = $0000;
  256.   DRVCNF_OK               = $0001;
  257.   DRVCNF_RESTART          = $0002;
  258.  
  259.  
  260. { installable driver function prototypes }
  261. type 
  262.   TFNDriverProc = function(dwDriverId: DWORD; hdrvr: HDRVR; 
  263.     msg: UINT; lparam1, lparam2: LPARAM): Longint stdcall;
  264.  
  265. function CloseDriver(hDriver: HDRVR; lParam1, lParam2: Longint): Longint; stdcall;
  266. function OpenDriver(szDriverName: PWideChar; szSectionName: PWideChar; lParam2: Longint): HDRVR; stdcall;
  267. function SendDriverMessage(hDriver: HDRVR; message: UINT; lParam1, lParam2: Longint): Longint; stdcall;
  268. function DrvGetModuleHandle(hDriver: HDRVR): HMODULE; stdcall;
  269. function GetDriverModuleHandle(hDriver: HDRVR): HMODULE; stdcall;
  270. function DefDriverProc(dwDriverIdentifier: DWORD; hdrvr: HDRVR; uMsg: UINT; 
  271.   lParam1, lParam2: LPARAM): Longint; stdcall;
  272.  
  273. { return values from DriverProc() function }
  274. const
  275.   DRV_CANCEL             = DRVCNF_CANCEL;
  276.   DRV_OK                 = DRVCNF_OK;
  277.   DRV_RESTART            = DRVCNF_RESTART;
  278.  
  279.   DRV_MCI_FIRST          = DRV_RESERVED;
  280.   DRV_MCI_LAST           = DRV_RESERVED + $FFF;
  281.  
  282.  
  283. {***************************************************************************
  284.  
  285.                           Driver callback support
  286.  
  287. ***************************************************************************}
  288.  
  289. { flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and }
  290. { midiOutOpen() to specify the type of the dwCallback parameter. }
  291.  
  292. const
  293.   CALLBACK_TYPEMASK   = $00070000;    { callback type mask }
  294.   CALLBACK_NULL       = $00000000;    { no callback }
  295.   CALLBACK_WINDOW     = $00010000;    { dwCallback is a HWND }
  296.   CALLBACK_TASK       = $00020000;    { dwCallback is a HTASK }
  297.   CALLBACK_FUNCTION   = $00030000;    { dwCallback is a FARPROC }
  298.   CALLBACK_THREAD     = CALLBACK_TASK;{ thread ID replaces 16 bit task }
  299.   CALLBACK_EVENT      = $00050000;    { dwCallback is an EVENT Handle }
  300.  
  301. { driver callback prototypes }
  302.  
  303. type
  304.   TFNDrvCallBack = procedure(hdrvr: HDRVR; uMsg: UINT; dwUser: DWORD;
  305.     dw1, dw2: DWORD) stdcall;
  306.  
  307.  
  308. {***************************************************************************
  309.  
  310.                     General MMSYSTEM support
  311.  
  312. ***************************************************************************}
  313.  
  314. function mmsystemGetVersion: UINT; stdcall;
  315.  
  316. {***************************************************************************
  317.  
  318.                             Sound support
  319.  
  320. ***************************************************************************}
  321.  
  322. function sndPlaySoundA(lpszSoundName: PAnsiChar; uFlags: UINT): BOOL; stdcall;
  323. function sndPlaySoundW(lpszSoundName: PWideChar; uFlags: UINT): BOOL; stdcall;
  324. function sndPlaySound(lpszSoundName: PChar; uFlags: UINT): BOOL; stdcall;
  325.  
  326. { flag values for wFlags parameter }
  327. const
  328.   SND_SYNC            = $0000;  { play synchronously (default) }
  329.   SND_ASYNC           = $0001;  { play asynchronously }
  330.   SND_NODEFAULT       = $0002;  { don't use default sound }
  331.   SND_MEMORY          = $0004;  { lpszSoundName points to a memory file }
  332.   SND_LOOP            = $0008;  { loop the sound until next sndPlaySound }
  333.   SND_NOSTOP          = $0010;  { don't stop any currently playing sound }
  334.  
  335.   SND_NOWAIT          = $00002000;  { don't wait if the driver is busy }
  336.   SND_ALIAS           = $00010000;  { name is a registry alias }
  337.   SND_ALIAS_ID        = $00110000;  { alias is a predefined ID }
  338.   SND_FILENAME        = $00020000;  { name is file name }
  339.   SND_RESOURCE        = $00040004;  { name is resource name or atom }
  340.   SND_PURGE           = $0040;      { purge non-static events for task }
  341.   SND_APPLICATION     = $0080;      { look for application specific association }
  342.  
  343.   SND_ALIAS_START     = 0;   { alias base }
  344.  
  345.   SND_ALIAS_SYSTEMASTERISK       = SND_ALIAS_START + (Longint(Ord('S')) or (Longint(Ord('*')) shl 8));
  346.   SND_ALIAS_SYSTEMQUESTION       = SND_ALIAS_START + (Longint(Ord('S')) or (Longint(Ord('?')) shl 8));
  347.   SND_ALIAS_SYSTEMHAND           = SND_ALIAS_START + (Longint(Ord('S')) or (Longint(Ord('H')) shl 8));
  348.   SND_ALIAS_SYSTEMEXIT           = SND_ALIAS_START + (Longint(Ord('S')) or (Longint(Ord('E')) shl 8));
  349.   SND_ALIAS_SYSTEMSTART          = SND_ALIAS_START + (Longint(Ord('S')) or (Longint(Ord('S')) shl 8));
  350.   SND_ALIAS_SYSTEMWELCOME        = SND_ALIAS_START + (Longint(Ord('S')) or (Longint(Ord('W')) shl 8));
  351.   SND_ALIAS_SYSTEMEXCLAMATION    = SND_ALIAS_START + (Longint(Ord('S')) or (Longint(Ord('!')) shl 8));
  352.   SND_ALIAS_SYSTEMDEFAULT        = SND_ALIAS_START + (Longint(Ord('S')) or (Longint(Ord('D')) shl 8));
  353.  
  354. function PlaySoundA(pszSound: PAnsiChar; hmod: HMODULE; fdwSound: DWORD): BOOL; stdcall;
  355. function PlaySoundW(pszSound: PWideChar; hmod: HMODULE; fdwSound: DWORD): BOOL; stdcall;
  356. function PlaySound(pszSound: PChar; hmod: HMODULE; fdwSound: DWORD): BOOL; stdcall;
  357.  
  358. {***************************************************************************
  359.  
  360.                         Waveform audio support
  361.  
  362. ***************************************************************************}
  363.  
  364. { waveform audio error return values }
  365. const
  366.   WAVERR_BADFORMAT      = WAVERR_BASE + 0;    { unsupported wave format }
  367.   WAVERR_STILLPLAYING   = WAVERR_BASE + 1;    { still something playing }
  368.   WAVERR_UNPREPARED     = WAVERR_BASE + 2;    { header not prepared }
  369.   WAVERR_SYNC           = WAVERR_BASE + 3;    { device is synchronous }
  370.   WAVERR_LASTERROR      = WAVERR_BASE + 3;    { last error in range }
  371.  
  372. { waveform audio data types }
  373. type
  374.   PHWAVE = ^HWAVE;
  375.   HWAVE = Integer;
  376.   PHWAVEIN = ^HWAVEIN;
  377.   HWAVEIN = Integer;
  378.   PHWAVEOUT = ^HWAVEOUT;
  379.   HWAVEOUT = Integer;
  380.  
  381. type
  382.   TFNWaveCallBack = TFNDrvCallBack;
  383.  
  384. { wave callback messages }
  385. const
  386.   WOM_OPEN        = MM_WOM_OPEN;
  387.   WOM_CLOSE       = MM_WOM_CLOSE;
  388.   WOM_DONE        = MM_WOM_DONE;
  389.   WIM_OPEN        = MM_WIM_OPEN;
  390.   WIM_CLOSE       = MM_WIM_CLOSE;
  391.   WIM_DATA        = MM_WIM_DATA;
  392.  
  393. { device ID for wave device mapper }
  394.   WAVE_MAPPER     = UINT(-1);
  395.  
  396. { flags for dwFlags parameter in waveOutOpen() and waveInOpen() }
  397.   WAVE_FORMAT_QUERY     = $0001;
  398.   WAVE_ALLOWSYNC        = $0002;
  399.   WAVE_MAPPED           = $0004;
  400.  
  401. { wave data block header }
  402. type
  403.   PWaveHdr = ^TWaveHdr;
  404.   TWaveHdr = record
  405.     lpData: PChar;              { pointer to locked data buffer }
  406.     dwBufferLength: DWORD;      { length of data buffer }
  407.     dwBytesRecorded: DWORD;     { used for input only }
  408.     dwUser: DWORD;              { for client's use }
  409.     dwFlags: DWORD;             { assorted flags (see defines) }
  410.     dwLoops: DWORD;             { loop control counter }
  411.     lpNext: PWaveHdr;           { reserved for driver }
  412.     reserved: DWORD;            { reserved for driver }
  413.   end;
  414.  
  415.  
  416. { flags for dwFlags field of WAVEHDR }
  417. const
  418.   WHDR_DONE       = $00000001;  { done bit }
  419.   WHDR_PREPARED   = $00000002;  { set if this header has been prepared }
  420.   WHDR_BEGINLOOP  = $00000004;  { loop start block }
  421.   WHDR_ENDLOOP    = $00000008;  { loop end block }
  422.   WHDR_INQUEUE    = $00000010;  { reserved for driver }
  423.  
  424. { waveform output device capabilities structure }
  425. type
  426.   PWaveOutCapsA = ^TWaveOutCapsA;
  427.   PWaveOutCapsW = ^TWaveOutCapsW;
  428.   PWaveOutCaps = PWaveOutCapsA;
  429.   TWaveOutCapsA = record
  430.     wMid: Word;                 { manufacturer ID }
  431.     wPid: Word;                 { product ID }
  432.     vDriverVersion: MMVERSION;       { version of the driver }
  433.     szPname: array[0..MAXPNAMELEN-1] of AnsiChar;  { product name (NULL terminated string) }
  434.     dwFormats: DWORD;          { formats supported }
  435.     wChannels: Word;            { number of sources supported }
  436.     dwSupport: DWORD;          { functionality supported by driver }
  437.   end;
  438.   TWaveOutCapsW = record
  439.     wMid: Word;                 { manufacturer ID }
  440.     wPid: Word;                 { product ID }
  441.     vDriverVersion: MMVERSION;       { version of the driver }
  442.     szPname: array[0..MAXPNAMELEN-1] of WideChar;  { product name (NULL terminated string) }
  443.     dwFormats: DWORD;          { formats supported }
  444.     wChannels: Word;            { number of sources supported }
  445.     dwSupport: DWORD;          { functionality supported by driver }
  446.   end;
  447.   TWaveOutCaps = TWaveOutCapsA;
  448.  
  449.  
  450. { flags for dwSupport field of WAVEOUTCAPS }
  451. const
  452.   WAVECAPS_PITCH          = $0001;   { supports pitch control }
  453.   WAVECAPS_PLAYBACKRATE   = $0002;   { supports playback rate control }
  454.   WAVECAPS_VOLUME         = $0004;   { supports volume control }
  455.   WAVECAPS_LRVOLUME       = $0008;   { separate left-right volume control }
  456.   WAVECAPS_SYNC           = $0010;
  457.   WAVECAPS_SAMPLEACCURATE = $0020;
  458.   WAVECAPS_DIRECTSOUND    = $0040;
  459.  
  460. { waveform input device capabilities structure }
  461. type
  462.   PWaveInCapsA = ^TWaveInCapsA;
  463.   PWaveInCapsW = ^TWaveInCapsW;
  464.   PWaveInCaps = PWaveInCapsA;
  465.   TWaveInCapsA = record
  466.     wMid: Word;                   { manufacturer ID }
  467.     wPid: Word;                   { product ID }
  468.     vDriverVersion: MMVERSION;         { version of the driver }
  469.     szPname: array[0..MAXPNAMELEN-1] of AnsiChar;    { product name (NULL terminated string) }
  470.     dwFormats: DWORD;             { formats supported }
  471.     wChannels: Word;              { number of channels supported }
  472.     wReserved1: Word;             { structure packing }
  473.   end;
  474.   TWaveInCapsW = record
  475.     wMid: Word;                   { manufacturer ID }
  476.     wPid: Word;                   { product ID }
  477.     vDriverVersion: MMVERSION;         { version of the driver }
  478.     szPname: array[0..MAXPNAMELEN-1] of WideChar;    { product name (NULL terminated string) }
  479.     dwFormats: DWORD;             { formats supported }
  480.     wChannels: Word;              { number of channels supported }
  481.     wReserved1: Word;             { structure packing }
  482.   end;
  483.   TWaveInCaps = TWaveInCapsA;
  484.  
  485.  
  486. { defines for dwFormat field of WAVEINCAPS and WAVEOUTCAPS }
  487. const
  488.   WAVE_INVALIDFORMAT     = $00000000;       { invalid format }
  489.   WAVE_FORMAT_1M08       = $00000001;       { 11.025 kHz, Mono,   8-bit  }
  490.   WAVE_FORMAT_1S08       = $00000002;       { 11.025 kHz, Stereo, 8-bit  }
  491.   WAVE_FORMAT_1M16       = $00000004;       { 11.025 kHz, Mono,   16-bit }
  492.   WAVE_FORMAT_1S16       = $00000008;       { 11.025 kHz, Stereo, 16-bit }
  493.   WAVE_FORMAT_2M08       = $00000010;       { 22.05  kHz, Mono,   8-bit  }
  494.   WAVE_FORMAT_2S08       = $00000020;       { 22.05  kHz, Stereo, 8-bit  }
  495.   WAVE_FORMAT_2M16       = $00000040;       { 22.05  kHz, Mono,   16-bit }
  496.   WAVE_FORMAT_2S16       = $00000080;       { 22.05  kHz, Stereo, 16-bit }
  497.   WAVE_FORMAT_4M08       = $00000100;       { 44.1   kHz, Mono,   8-bit  }
  498.   WAVE_FORMAT_4S08       = $00000200;       { 44.1   kHz, Stereo, 8-bit  }
  499.   WAVE_FORMAT_4M16       = $00000400;       { 44.1   kHz, Mono,   16-bit }
  500.   WAVE_FORMAT_4S16       = $00000800;       { 44.1   kHz, Stereo, 16-bit }
  501.  
  502. { general waveform format structure (information common to all formats) }
  503. type
  504.   PWaveFormat = ^TWaveFormat;
  505.   TWaveFormat = record
  506.     wFormatTag: Word;         { format type }
  507.     nChannels: Word;          { number of channels (i.e. mono, stereo, etc.) }
  508.     nSamplesPerSec: DWORD;  { sample rate }
  509.     nAvgBytesPerSec: DWORD; { for buffer estimation }
  510.     nBlockAlign: Word;      { block size of data }
  511.   end;
  512.  
  513. { flags for wFormatTag field of WAVEFORMAT }
  514. const
  515.   WAVE_FORMAT_PCM     = 1;
  516.  
  517. { specific waveform format structure for PCM data }
  518. type
  519.   PPCMWaveFormat = ^TPCMWaveFormat;
  520.   TPCMWaveFormat = record
  521.       wf: TWaveFormat;
  522.       wBitsPerSample: Word;
  523.    end;
  524.  
  525.  
  526. { extended waveform format structure used for all non-PCM formats. this
  527.   structure is common to all non-PCM formats. }
  528.  
  529.   PWaveFormatEx = ^TWaveFormatEx;
  530.   TWaveFormatEx = record
  531.     wFormatTag: Word;         { format type }
  532.     nChannels: Word;          { number of channels (i.e. mono, stereo, etc.) }
  533.     nSamplesPerSec: DWORD;  { sample rate }
  534.     nAvgBytesPerSec: DWORD; { for buffer estimation }
  535.     nBlockAlign: Word;      { block size of data }
  536.     wBitsPerSample: Word;   { number of bits per sample of mono data }
  537.     cbSize: Word;           { the count in bytes of the size of }
  538.   end;
  539.  
  540.  
  541. { waveform audio function prototypes }
  542. function waveOutGetNumDevs: UINT; stdcall;
  543.  
  544. function waveOutGetDevCapsA(uDeviceID: UINT; lpCaps: PWaveOutCapsA; uSize: UINT): MMRESULT; stdcall;
  545. function waveOutGetDevCapsW(uDeviceID: UINT; lpCaps: PWaveOutCapsW; uSize: UINT): MMRESULT; stdcall;
  546. function waveOutGetDevCaps(uDeviceID: UINT; lpCaps: PWaveOutCaps; uSize: UINT): MMRESULT; stdcall;
  547. function waveOutGetVolume(hwo: HWAVEOUT; lpdwVolume: PDWORD): MMRESULT; stdcall;
  548. function waveOutSetVolume(hwo: HWAVEOUT; dwVolume: DWORD): MMRESULT; stdcall;
  549. function waveOutGetErrorTextA(mmrError: MMRESULT; lpText: PAnsiChar; uSize: UINT): MMRESULT; stdcall;
  550. function waveOutGetErrorTextW(mmrError: MMRESULT; lpText: PWideChar; uSize: UINT): MMRESULT; stdcall;
  551. function waveOutGetErrorText(mmrError: MMRESULT; lpText: PChar; uSize: UINT): MMRESULT; stdcall;
  552. function waveOutOpen(lphWaveOut: PHWaveOut; uDeviceID: UINT;
  553.   lpFormat: PWaveFormatEx; dwCallback, dwInstance, dwFlags: DWORD): MMRESULT; stdcall;
  554. function waveOutClose(hWaveOut: HWAVEOUT): MMRESULT; stdcall;
  555. function waveOutPrepareHeader(hWaveOut: HWAVEOUT; lpWaveOutHdr: PWaveHdr;
  556.   uSize: UINT): MMRESULT; stdcall;
  557. function waveOutUnprepareHeader(hWaveOut: HWAVEOUT; lpWaveOutHdr: PWaveHdr;
  558.   uSize: UINT): MMRESULT; stdcall;
  559. function waveOutWrite(hWaveOut: HWAVEOUT; lpWaveOutHdr: PWaveHdr;
  560.   uSize: UINT): MMRESULT; stdcall;
  561. function waveOutPause(hWaveOut: HWAVEOUT): MMRESULT; stdcall;
  562. function waveOutRestart(hWaveOut: HWAVEOUT): MMRESULT; stdcall;
  563. function waveOutReset(hWaveOut: HWAVEOUT): MMRESULT; stdcall;
  564. function waveOutBreakLoop(hWaveOut: HWAVEOUT): MMRESULT; stdcall;
  565. function waveOutGetPosition(hWaveOut: HWAVEOUT; lpInfo: PMMTime; uSize: UINT): MMRESULT; stdcall;
  566. function waveOutGetPitch(hWaveOut: HWAVEOUT; lpdwPitch: PDWORD): MMRESULT; stdcall;
  567. function waveOutSetPitch(hWaveOut: HWAVEOUT; dwPitch: DWORD): MMRESULT; stdcall;
  568. function waveOutGetPlaybackRate(hWaveOut: HWAVEOUT; lpdwRate: PDWORD): MMRESULT; stdcall;
  569. function waveOutSetPlaybackRate(hWaveOut: HWAVEOUT; dwRate: DWORD): MMRESULT; stdcall;
  570. function waveOutGetID(hWaveOut: HWAVEOUT; lpuDeviceID: PUINT): MMRESULT; stdcall;
  571. function waveOutMessage(hWaveOut: HWAVEOUT; uMessage: UINT; dw1, dw2: DWORD): Longint; stdcall;
  572. function waveInGetNumDevs: UINT; stdcall;
  573. function waveInGetDevCapsA(hwo: HWAVEOUT; lpCaps: PWaveInCapsA; uSize: UINT): MMRESULT; stdcall;
  574. function waveInGetDevCapsW(hwo: HWAVEOUT; lpCaps: PWaveInCapsW; uSize: UINT): MMRESULT; stdcall;
  575. function waveInGetDevCaps(hwo: HWAVEOUT; lpCaps: PWaveInCaps; uSize: UINT): MMRESULT; stdcall;
  576. function waveInGetErrorTextA(mmrError: MMRESULT; lpText: PAnsiChar; uSize: UINT): MMRESULT; stdcall;
  577. function waveInGetErrorTextW(mmrError: MMRESULT; lpText: PWideChar; uSize: UINT): MMRESULT; stdcall;
  578. function waveInGetErrorText(mmrError: MMRESULT; lpText: PChar; uSize: UINT): MMRESULT; stdcall;
  579. function waveInOpen(lphWaveIn: PHWAVEIN; uDeviceID: UINT;
  580.   lpFormatEx: PWaveFormatEx; dwCallback, dwInstance, dwFlags: DWORD): MMRESULT; stdcall;
  581. function waveInClose(hWaveIn: HWAVEIN): MMRESULT; stdcall;
  582. function waveInPrepareHeader(hWaveIn: HWAVEIN; lpWaveInHdr: PWaveHdr;
  583.   uSize: UINT): MMRESULT; stdcall;
  584. function waveInUnprepareHeader(hWaveIn: HWAVEIN; lpWaveInHdr: PWaveHdr;
  585.   uSize: UINT): MMRESULT; stdcall;
  586. function waveInAddBuffer(hWaveIn: HWAVEIN; lpWaveInHdr: PWaveHdr;
  587.   uSize: UINT): MMRESULT; stdcall;
  588. function waveInStart(hWaveIn: HWAVEIN): MMRESULT; stdcall;
  589. function waveInStop(hWaveIn: HWAVEIN): MMRESULT; stdcall;
  590. function waveInReset(hWaveIn: HWAVEIN): MMRESULT; stdcall;
  591. function waveInGetPosition(hWaveIn: HWAVEIN; lpInfo: PMMTime;
  592.   uSize: UINT): MMRESULT; stdcall;
  593. function waveInGetID(hWaveIn: HWAVEIN; lpuDeviceID: PUINT): MMRESULT; stdcall;
  594. function waveInMessage(hWaveIn: HWAVEIN; uMessage: UINT;
  595.   dw1, dw2: DWORD): MMRESULT; stdcall;
  596.  
  597. {***************************************************************************
  598.  
  599.                             MIDI audio support
  600.  
  601. ***************************************************************************}
  602.  
  603. { MIDI error return values }
  604. const
  605.   MIDIERR_UNPREPARED    = MIDIERR_BASE + 0;   { header not prepared }
  606.   MIDIERR_STILLPLAYING  = MIDIERR_BASE + 1;   { still something playing }
  607.   MIDIERR_NOMAP         = MIDIERR_BASE + 2;   { no current map }
  608.   MIDIERR_NOTREADY      = MIDIERR_BASE + 3;   { hardware is still busy }
  609.   MIDIERR_NODEVICE      = MIDIERR_BASE + 4;   { port no longer connected }
  610.   MIDIERR_INVALIDSETUP  = MIDIERR_BASE + 5;   { invalid setup }
  611.   MIDIERR_BADOPENMODE   = MIDIERR_BASE + 6;   { operation unsupported w/ open mode }
  612.   MIDIERR_DONT_CONTINUE = MIDIERR_BASE + 7;   { thru device 'eating' a message }
  613.   MIDIERR_LASTERROR     = MIDIERR_BASE + 5;   { last error in range }
  614.  
  615. { MIDI audio data types }
  616. type
  617.   PHMIDI = ^HMIDI;
  618.   HMIDI = Integer;
  619.   PHMIDIIN = ^HMIDIIN;
  620.   HMIDIIN = Integer;
  621.   PHMIDIOUT = ^HMIDIOUT;
  622.   HMIDIOUT = Integer;
  623.   PHMIDISTRM = ^HMIDISTRM;
  624.   HMIDISTRM = Integer;
  625.  
  626. type
  627.   TFNMidiCallBack = TFNDrvCallBack;
  628.  
  629. const
  630.   MIDIPATCHSIZE   = 128;
  631.  
  632. type
  633.   PPatchArray = ^TPatchArray;
  634.   TPatchArray = array[0..MIDIPATCHSIZE-1] of Word;
  635.  
  636.   PKeyArray = ^TKeyArray;
  637.   TKeyArray = array[0..MIDIPATCHSIZE-1] of Word;
  638.  
  639.  
  640. { MIDI callback messages }
  641. const
  642.   MIM_OPEN        = MM_MIM_OPEN;
  643.   MIM_CLOSE       = MM_MIM_CLOSE;
  644.   MIM_DATA        = MM_MIM_DATA;
  645.   MIM_LONGDATA    = MM_MIM_LONGDATA;
  646.   MIM_ERROR       = MM_MIM_ERROR;
  647.   MIM_LONGERROR   = MM_MIM_LONGERROR;
  648.   MOM_OPEN        = MM_MOM_OPEN;
  649.   MOM_CLOSE       = MM_MOM_CLOSE;
  650.   MOM_DONE        = MM_MOM_DONE;
  651.  
  652.   MIM_MOREDATA    = MM_MIM_MOREDATA;
  653.   MOM_POSITIONCB  = MM_MOM_POSITIONCB;
  654.  
  655. { device ID for MIDI mapper }
  656.   MIDIMAPPER     = UINT(-1);
  657.   MIDI_MAPPER    = UINT(-1);
  658.  
  659. { flags for dwFlags parm of midiInOpen() }
  660.   MIDI_IO_STATUS = $00000020;
  661.  
  662. { flags for wFlags parm of midiOutCachePatches(), midiOutCacheDrumPatches() }
  663.   MIDI_CACHE_ALL      = 1;
  664.   MIDI_CACHE_BESTFIT  = 2;
  665.   MIDI_CACHE_QUERY    = 3;
  666.   MIDI_UNCACHE        = 4;
  667.  
  668. { MIDI output device capabilities structure }
  669. type
  670.   PMidiOutCapsA = ^TMidiOutCapsA;
  671.   PMidiOutCapsW = ^TMidiOutCapsW;
  672.   PMidiOutCaps = PMidiOutCapsA;
  673.   TMidiOutCapsA = record
  674.     wMid: Word;                  { manufacturer ID }
  675.     wPid: Word;                  { product ID }
  676.     vDriverVersion: MMVERSION;        { version of the driver }
  677.     szPname: array[0..MAXPNAMELEN-1] of AnsiChar;  { product name (NULL terminated string) }
  678.     wTechnology: Word;           { type of device }
  679.     wVoices: Word;               { # of voices (internal synth only) }
  680.     wNotes: Word;                { max # of notes (internal synth only) }
  681.     wChannelMask: Word;          { channels used (internal synth only) }
  682.     dwSupport: DWORD;            { functionality supported by driver }
  683.   end;
  684.   TMidiOutCapsW = record
  685.     wMid: Word;                  { manufacturer ID }
  686.     wPid: Word;                  { product ID }
  687.     vDriverVersion: MMVERSION;        { version of the driver }
  688.     szPname: array[0..MAXPNAMELEN-1] of WideChar;  { product name (NULL terminated string) }
  689.     wTechnology: Word;           { type of device }
  690.     wVoices: Word;               { # of voices (internal synth only) }
  691.     wNotes: Word;                { max # of notes (internal synth only) }
  692.     wChannelMask: Word;          { channels used (internal synth only) }
  693.     dwSupport: DWORD;            { functionality supported by driver }
  694.   end;
  695.   TMidiOutCaps = TMidiOutCapsA;
  696.  
  697.  
  698. { flags for wTechnology field of MIDIOUTCAPS structure }
  699. const
  700.   MOD_MIDIPORT    = 1;  { output port }
  701.   MOD_SYNTH       = 2;  { generic internal synth }
  702.   MOD_SQSYNTH     = 3;  { square wave internal synth }
  703.   MOD_FMSYNTH     = 4;  { FM internal synth }
  704.   MOD_MAPPER      = 5;  { MIDI mapper }
  705.  
  706. { flags for dwSupport field of MIDIOUTCAPS structure }
  707. const
  708.   MIDICAPS_VOLUME          = $0001;  { supports volume control }
  709.   MIDICAPS_LRVOLUME        = $0002;  { separate left-right volume control }
  710.   MIDICAPS_CACHE           = $0004;
  711.   MIDICAPS_STREAM          = $0008;  { driver supports midiStreamOut directly }
  712.  
  713. { MIDI output device capabilities structure }
  714.  
  715. type
  716.   PMidiInCapsA = ^TMidiInCapsA;
  717.   PMidiInCapsW = ^TMidiInCapsW;
  718.   PMidiInCaps = PMidiInCapsA;
  719.   TMidiInCapsA = record
  720.     wMid: Word;                  { manufacturer ID }
  721.     wPid: Word;                  { product ID }
  722.     vDriverVersion: MMVERSION;   { version of the driver }
  723.     szPname: array[0..MAXPNAMELEN-1] of AnsiChar;  { product name (NULL terminated string) }
  724.     dwSupport: DWORD;            { functionality supported by driver }
  725.   end;
  726.   TMidiInCapsW = record
  727.     wMid: Word;                  { manufacturer ID }
  728.     wPid: Word;                  { product ID }
  729.     vDriverVersion: MMVERSION;   { version of the driver }
  730.     szPname: array[0..MAXPNAMELEN-1] of WideChar;  { product name (NULL terminated string) }
  731.     dwSupport: DWORD;            { functionality supported by driver }
  732.   end;
  733.   TMidiInCaps = TMidiInCapsA;
  734.  
  735. { MIDI data block header }
  736. type
  737.   PMidiHdr = ^TMidiHdr;
  738.   TMidiHdr = record
  739.     lpData: PChar;               { pointer to locked data block }
  740.     dwBufferLength: DWORD;       { length of data in data block }
  741.     dwBytesRecorded: DWORD;      { used for input only }
  742.     dwUser: DWORD;               { for client's use }
  743.     dwFlags: DWORD;              { assorted flags (see defines) }
  744.     lpNext: PMidiHdr;            { reserved for driver }
  745.     reserved: DWORD;             { reserved for driver }
  746.     dwOffset: DWORD;             { Callback offset into buffer }
  747.     dwReserved: array[0..7] of DWORD; { Reserved for MMSYSTEM }
  748.   end;
  749.  
  750.   PMidiEvent = ^TMidiEvent;
  751.   TMidiEvent = record
  752.     dwDeltaTime: DWORD;          { Ticks since last event }
  753.     dwStreamID: DWORD;           { Reserved; must be zero }
  754.     dwEvent: DWORD;              { Event type and parameters }
  755.     dwParms: array[0..0] of DWORD;  { Parameters if this is a long event }
  756.   end;
  757.  
  758.   PMidiStrmBuffVer = ^TMidiStrmBuffVer;
  759.   TMidiStrmBuffVer = record
  760.     dwVersion: DWORD;                  { Stream buffer format version }
  761.     dwMid: DWORD;                      { Manufacturer ID as defined in MMREG.H }
  762.     dwOEMVersion: DWORD;               { Manufacturer version for custom ext }
  763.   end;
  764.  
  765. { flags for dwFlags field of MIDIHDR structure }
  766. const
  767.   MHDR_DONE       = $00000001;       { done bit }
  768.   MHDR_PREPARED   = $00000002;       { set if header prepared }
  769.   MHDR_INQUEUE    = $00000004;       { reserved for driver }
  770.   MHDR_ISSTRM     = $00000008;       { Buffer is stream buffer }
  771.  
  772. (* 
  773.   Type codes which go in the high byte of the event DWORD of a stream buffer 
  774.  
  775.   Type codes 00-7F contain parameters within the low 24 bits 
  776.   Type codes 80-FF contain a length of their parameter in the low 24 
  777.   bits, followed by their parameter data in the buffer. The event 
  778.   DWORD contains the exact byte length; the parm data itself must be 
  779.   padded to be an even multiple of 4 bytes long. 
  780. *) 
  781.  
  782.   MEVT_F_SHORT       = $00000000;
  783.   MEVT_F_LONG        = $80000000;
  784.   MEVT_F_CALLBACK    = $40000000;
  785.  
  786.   MEVT_SHORTMSG     = $00;    { parm = shortmsg for midiOutShortMsg }
  787.   MEVT_TEMPO        = $01;    { parm = new tempo in microsec/qn     }
  788.   MEVT_NOP          = $02;    { parm = unused; does nothing         }
  789.  
  790. { 0x04-0x7F reserved }
  791.  
  792.   MEVT_LONGMSG      = $80;    { parm = bytes to send verbatim       }
  793.   MEVT_COMMENT      = $82;    { parm = comment data                 }
  794.   MEVT_VERSION      = $84;    { parm = MIDISTRMBUFFVER struct       }
  795.  
  796. { 0x81-0xFF reserved }
  797.  
  798.   MIDISTRM_ERROR    =  -2;
  799.  
  800. { Structures and defines for midiStreamProperty }
  801.   MIDIPROP_SET       = $80000000;
  802.   MIDIPROP_GET       = $40000000;
  803.  
  804. { These are intentionally both non-zero so the app cannot accidentally
  805.   leave the operation off and happen to appear to work due to default
  806.   action. }
  807.   MIDIPROP_TIMEDIV   = $00000001;
  808.   MIDIPROP_TEMPO     = $00000002;
  809.  
  810. type
  811.   PMidiPropTimeDiv = ^TMidiPropTimeDiv;
  812.   TMidiPropTimeDiv = record
  813.     cbStruct: DWORD;
  814.     dwTimeDiv: DWORD;
  815.   end;
  816.  
  817.   PMidiPropTempo = ^TMidiPropTempo;
  818.   TMidiPropTempo = record
  819.     cbStruct: DWORD;
  820.     dwTempo: DWORD;
  821.   end;
  822.  
  823. { MIDI function prototypes }
  824.  
  825. function midiOutGetNumDevs: UINT; stdcall;
  826. function midiStreamOpen(phms: PHMIDISTRM; puDeviceID: PUINT; 
  827.   cMidi, dwCallback, dwInstance, fdwOpen: DWORD): MMRESULT; stdcall
  828. function midiStreamClose(hms: HMIDISTRM): MMRESULT; stdcall;
  829. function midiStreamProperty(hms: HMIDISTRM; lppropdata: PBYTE; dwProperty: DWORD): MMRESULT; stdcall;
  830. function midiStreamPosition(hms: HMIDISTRM; lpmmt: PMMTime; cbmmt: UINT): MMRESULT; stdcall;
  831. function midiStreamOut(hms: HMIDISTRM; pmh: PMidiHdr; cbmh: UINT): MMRESULT; stdcall;
  832. function midiStreamPause(hms: HMIDISTRM): MMRESULT; stdcall;
  833. function midiStreamRestart(hms: HMIDISTRM): MMRESULT; stdcall;
  834. function midiStreamStop(hms: HMIDISTRM): MMRESULT; stdcall;
  835. function midiConnect(hmi: HMIDI; hmo: HMIDIOUT; pReserved: Pointer): MMRESULT; stdcall;
  836. function midiDisconnect(hmi: HMIDI; hmo: HMIDIOUT; pReserved: Pointer): MMRESULT; stdcall;
  837. function midiOutGetDevCapsA(uDeviceID: UINT; lpCaps: PMidiOutCapsA; uSize: UINT): MMRESULT; stdcall;
  838. function midiOutGetDevCapsW(uDeviceID: UINT; lpCaps: PMidiOutCapsW; uSize: UINT): MMRESULT; stdcall;
  839. function midiOutGetDevCaps(uDeviceID: UINT; lpCaps: PMidiOutCaps; uSize: UINT): MMRESULT; stdcall;
  840. function midiOutGetVolume(hmo: HMIDIOUT; lpdwVolume: PDWORD): MMRESULT; stdcall;
  841. function midiOutSetVolume(hmo: HMIDIOUT; dwVolume: DWORD): MMRESULT; stdcall;
  842. function midiOutGetErrorTextA(mmrError: MMRESULT; pszText: PAnsiChar; uSize: UINT): MMRESULT; stdcall;
  843. function midiOutGetErrorTextW(mmrError: MMRESULT; pszText: PWideChar; uSize: UINT): MMRESULT; stdcall;
  844. function midiOutGetErrorText(mmrError: MMRESULT; pszText: PChar; uSize: UINT): MMRESULT; stdcall;
  845. function midiOutOpen(lphMidiOut: PHMIDIOUT; uDeviceID: UINT;
  846.   dwCallback, dwInstance, dwFlags: DWORD): MMRESULT; stdcall;
  847. function midiOutClose(hMidiOut: HMIDIOUT): MMRESULT; stdcall;
  848. function midiOutPrepareHeader(hMidiOut: HMIDIOUT; lpMidiOutHdr: PMidiHdr; uSize: UINT): MMRESULT; stdcall;
  849. function midiOutUnprepareHeader(hMidiOut: HMIDIOUT; lpMidiOutHdr: PMidiHdr; uSize: UINT): MMRESULT; stdcall;
  850. function midiOutShortMsg(hMidiOut: HMIDIOUT; dwMsg: DWORD): MMRESULT; stdcall;
  851. function midiOutLongMsg(hMidiOut: HMIDIOUT; lpMidiOutHdr: PMidiHdr; uSize: UINT): MMRESULT; stdcall;
  852. function midiOutReset(hMidiOut: HMIDIOUT): MMRESULT; stdcall;
  853. function midiOutCachePatches(hMidiOut: HMIDIOUT;
  854.   uBank: UINT; lpwPatchArray: PWord; uFlags: UINT): MMRESULT; stdcall;
  855. function midiOutCacheDrumPatches(hMidiOut: HMIDIOUT;
  856.   uPatch: UINT; lpwKeyArray: PWord; uFlags: UINT): MMRESULT; stdcall;
  857. function midiOutGetID(hMidiOut: HMIDIOUT; lpuDeviceID: PUINT): MMRESULT; stdcall;
  858. function midiOutMessage(hMidiOut: HMIDIOUT; uMessage: UINT; dw1, dw2: DWORD): MMRESULT; stdcall;
  859. function midiInGetNumDevs: UINT; stdcall;
  860. function midiInGetDevCapsA(DeviceID: UINT; lpCaps: PMidiInCapsA; uSize: UINT): MMRESULT; stdcall;
  861. function midiInGetDevCapsW(DeviceID: UINT; lpCaps: PMidiInCapsW; uSize: UINT): MMRESULT; stdcall;
  862. function midiInGetDevCaps(DeviceID: UINT; lpCaps: PMidiInCaps; uSize: UINT): MMRESULT; stdcall;
  863. function midiInGetErrorTextA(mmrError: MMRESULT; pszText: PAnsiChar; uSize: UINT): MMRESULT; stdcall;
  864. function midiInGetErrorTextW(mmrError: MMRESULT; pszText: PWideChar; uSize: UINT): MMRESULT; stdcall;
  865. function midiInGetErrorText(mmrError: MMRESULT; pszText: PChar; uSize: UINT): MMRESULT; stdcall;
  866. function midiInOpen(lphMidiIn: PHMIDIIN; uDeviceID: UINT;
  867.   dwCallback, dwInstance, dwFlags: DWORD): MMRESULT; stdcall;
  868. function midiInClose(hMidiIn: HMIDIIN): MMRESULT; stdcall;
  869. function midiInPrepareHeader(hMidiIn: HMIDIIN; lpMidiInHdr: PMidiHdr; uSize: UINT): MMRESULT; stdcall;
  870. function midiInUnprepareHeader(hMidiIn: HMIDIIN; lpMidiInHdr: PMidiHdr; uSize: UINT): MMRESULT; stdcall;
  871. function midiInAddBuffer(hMidiIn: HMIDIIN; lpMidiInHdr: PMidiHdr; uSize: UINT): MMRESULT; stdcall;
  872. function midiInStart(hMidiIn: HMIDIIN): MMRESULT; stdcall;
  873. function midiInStop(hMidiIn: HMIDIIN): MMRESULT; stdcall;
  874. function midiInReset(hMidiIn: HMIDIIN): MMRESULT; stdcall;
  875. function midiInGetID(hMidiIn: HMIDIIN; lpuDeviceID: PUINT): MMRESULT; stdcall;
  876. function midiInMessage(hMidiIn: HMIDIIN; uMessage: UINT; dw1, dw2: DWORD): MMRESULT; stdcall;
  877.  
  878.  
  879. {***************************************************************************
  880.  
  881.                         Auxiliary audio support
  882.  
  883. ***************************************************************************}
  884.  
  885. { device ID for aux device mapper }
  886. const
  887.   AUX_MAPPER     = UINT(-1);
  888.  
  889. { Auxiliary audio device capabilities structure }
  890. type
  891.   PAuxCapsA = ^TAuxCapsA;
  892.   PAuxCapsW = ^TAuxCapsW;
  893.   PAuxCaps = PAuxCapsA;
  894.   TAuxCapsA = record
  895.     wMid: Word;                  { manufacturer ID }
  896.     wPid: Word;                  { product ID }
  897.     vDriverVersion: MMVERSION;        { version of the driver }
  898.     szPname: array[0..MAXPNAMELEN-1] of AnsiChar;  { product name (NULL terminated string) }
  899.     wTechnology: Word;           { type of device }
  900.     dwSupport: DWORD;            { functionality supported by driver }
  901.   end;
  902.   TAuxCapsW = record
  903.     wMid: Word;                  { manufacturer ID }
  904.     wPid: Word;                  { product ID }
  905.     vDriverVersion: MMVERSION;        { version of the driver }
  906.     szPname: array[0..MAXPNAMELEN-1] of WideChar;  { product name (NULL terminated string) }
  907.     wTechnology: Word;           { type of device }
  908.     dwSupport: DWORD;            { functionality supported by driver }
  909.   end;
  910.   TAuxCaps = TAuxCapsA;
  911.  
  912. { flags for wTechnology field in AUXCAPS structure }
  913. const
  914.   AUXCAPS_CDAUDIO    = 1;       { audio from internal CD-ROM drive }
  915.   AUXCAPS_AUXIN      = 2;       { audio from auxiliary input jacks }
  916.  
  917. { flags for dwSupport field in AUXCAPS structure }
  918. const
  919.   AUXCAPS_VOLUME     = $0001;  { supports volume control }
  920.   AUXCAPS_LRVOLUME   = $0002;  { separate left-right volume control }
  921.  
  922. { auxiliary audio function prototypes }
  923. function auxGetNumDevs: UINT; stdcall;
  924. function auxGetDevCapsA(uDeviceID: UINT; lpCaps: PAuxCapsA; uSize: UINT): MMRESULT; stdcall;
  925. function auxGetDevCapsW(uDeviceID: UINT; lpCaps: PAuxCapsW; uSize: UINT): MMRESULT; stdcall;
  926. function auxGetDevCaps(uDeviceID: UINT; lpCaps: PAuxCaps; uSize: UINT): MMRESULT; stdcall;
  927. function auxSetVolume(uDeviceID: UINT; dwVolume: DWORD): MMRESULT; stdcall;
  928. function auxGetVolume(uDeviceID: UINT; lpdwVolume: PDWORD): MMRESULT; stdcall;
  929. function auxOutMessage(uDeviceID, uMessage: UINT; dw1, dw2: DWORD): MMRESULT; stdcall;
  930.  
  931.  
  932. {****************************************************************************
  933.  
  934.                 Mixer Support
  935.  
  936. ****************************************************************************}
  937.  
  938. type
  939.   PHMIXEROBJ = ^HMIXEROBJ;
  940.   HMIXEROBJ = Integer;
  941.  
  942.   PHMIXER = ^HMIXER;
  943.   HMIXER = Integer;
  944.  
  945. const
  946.   MIXER_SHORT_NAME_CHARS   = 16;
  947.   MIXER_LONG_NAME_CHARS    = 64;
  948.  
  949. { MMRESULT error return values specific to the mixer API }
  950.  
  951.   MIXERR_INVALLINE            = (MIXERR_BASE + 0);
  952.   MIXERR_INVALCONTROL         = (MIXERR_BASE + 1);
  953.   MIXERR_INVALVALUE           = (MIXERR_BASE + 2);
  954.   MIXERR_LASTERROR            = (MIXERR_BASE + 2);
  955.  
  956.   MIXER_OBJECTF_HANDLE    = $80000000;
  957.   MIXER_OBJECTF_MIXER     = $00000000;
  958.   MIXER_OBJECTF_HMIXER    = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIXER);
  959.   MIXER_OBJECTF_WAVEOUT   = $10000000;
  960.   MIXER_OBJECTF_HWAVEOUT  = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_WAVEOUT);
  961.   MIXER_OBJECTF_WAVEIN    = $20000000;
  962.   MIXER_OBJECTF_HWAVEIN   = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_WAVEIN);
  963.   MIXER_OBJECTF_MIDIOUT   = $30000000;
  964.   MIXER_OBJECTF_HMIDIOUT  = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIOUT);
  965.   MIXER_OBJECTF_MIDIIN    = $40000000;
  966.   MIXER_OBJECTF_HMIDIIN   = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIIN);
  967.   MIXER_OBJECTF_AUX       = $50000000;
  968.  
  969. function mixerGetNumDevs: UINT; stdcall;
  970.  
  971. type
  972.   PMixerCapsA = ^TMixerCapsA;
  973.   PMixerCapsW = ^TMixerCapsW;
  974.   PMixerCaps = PMixerCapsA;
  975.   TMixerCapsA = record
  976.     wMid: WORD;                    { manufacturer id }
  977.     wPid: WORD;                    { product id }
  978.     vDriverVersion: MMVERSION;     { version of the driver }
  979.     szPname: array [0..MAXPNAMELEN - 1] of AnsiChar;   { product name }
  980.     fdwSupport: DWORD;             { misc. support bits }
  981.     cDestinations: DWORD;          { count of destinations }
  982.   end;
  983.   TMixerCapsW = record
  984.     wMid: WORD;                    { manufacturer id }
  985.     wPid: WORD;                    { product id }
  986.     vDriverVersion: MMVERSION;     { version of the driver }
  987.     szPname: array [0..MAXPNAMELEN - 1] of WideChar;   { product name }
  988.     fdwSupport: DWORD;             { misc. support bits }
  989.     cDestinations: DWORD;          { count of destinations }
  990.   end;
  991.   TMixerCaps = TMixerCapsA;
  992.  
  993. function mixerGetDevCapsA(uMxId: UINT; pmxcaps: PMixerCapsA; cbmxcaps: UINT): MMRESULT; stdcall;
  994. function mixerGetDevCapsW(uMxId: UINT; pmxcaps: PMixerCapsW; cbmxcaps: UINT): MMRESULT; stdcall;
  995. function mixerGetDevCaps(uMxId: UINT; pmxcaps: PMixerCaps; cbmxcaps: UINT): MMRESULT; stdcall;
  996. function mixerOpen(phmx: PHMIXER; uMxId: UINT; dwCallback, dwInstance, fdwOpen: DWORD): MMRESULT; stdcall;
  997. function mixerClose(hmx: HMIXER): MMRESULT; stdcall;
  998. function erMessage(hmx: HMIXER; uMsg: UINT; dwParam1, dwParam2: DWORD): DWORD; stdcall;
  999.  
  1000. type
  1001.   PMixerLineA = ^TMixerLineA;
  1002.   PMixerLineW = ^TMixerLineW;
  1003.   PMixerLine = PMixerLineA;
  1004.   TMixerLineA = record
  1005.     cbStruct: DWORD;               { size of MIXERLINE structure }
  1006.     dwDestination: DWORD;          { zero based destination index }
  1007.     dwSource: DWORD;               { zero based source index (if source) }
  1008.     dwLineID: DWORD;               { unique line id for mixer device }
  1009.     fdwLine: DWORD;                { state/information about line }
  1010.     dwUser: DWORD;                 { driver specific information }
  1011.     dwComponentType: DWORD;        { component type line connects to }
  1012.     cChannels: DWORD;              { number of channels line supports }
  1013.     cConnections: DWORD;           { number of connections [possible] }
  1014.     cControls: DWORD;              { number of controls at this line }
  1015.     szShortName: array[0..MIXER_SHORT_NAME_CHARS - 1] of AnsiChar;
  1016.     szName: array[0..MIXER_LONG_NAME_CHARS - 1] of AnsiChar;
  1017.     Target: record
  1018.       dwType: DWORD;                 { MIXERLINE_TARGETTYPE_xxxx }
  1019.       dwDeviceID: DWORD;             { target device ID of device type }
  1020.       wMid: WORD;                                   { of target device }
  1021.       wPid: WORD;                                   {      " }
  1022.       vDriverVersion: MMVERSION;                    {      " }
  1023.       szPname: array[0..MAXPNAMELEN - 1] of AnsiChar;  {      " }
  1024.      end;
  1025.   end;
  1026.   TMixerLineW = record
  1027.     cbStruct: DWORD;               { size of MIXERLINE structure }
  1028.     dwDestination: DWORD;          { zero based destination index }
  1029.     dwSource: DWORD;               { zero based source index (if source) }
  1030.     dwLineID: DWORD;               { unique line id for mixer device }
  1031.     fdwLine: DWORD;                { state/information about line }
  1032.     dwUser: DWORD;                 { driver specific information }
  1033.     dwComponentType: DWORD;        { component type line connects to }
  1034.     cChannels: DWORD;              { number of channels line supports }
  1035.     cConnections: DWORD;           { number of connections [possible] }
  1036.     cControls: DWORD;              { number of controls at this line }
  1037.     szShortName: array[0..MIXER_SHORT_NAME_CHARS - 1] of WideChar;
  1038.     szName: array[0..MIXER_LONG_NAME_CHARS - 1] of WideChar;
  1039.     Target: record
  1040.       dwType: DWORD;                 { MIXERLINE_TARGETTYPE_xxxx }
  1041.       dwDeviceID: DWORD;             { target device ID of device type }
  1042.       wMid: WORD;                                   { of target device }
  1043.       wPid: WORD;                                   {      " }
  1044.       vDriverVersion: MMVERSION;                    {      " }
  1045.       szPname: array[0..MAXPNAMELEN - 1] of WideChar;  {      " }
  1046.      end;
  1047.   end;
  1048.   TMixerLine = TMixerLineA;
  1049.  
  1050. const
  1051. { TMixerLine.fdwLine }
  1052.  
  1053.   MIXERLINE_LINEF_ACTIVE              = $00000001;
  1054.   MIXERLINE_LINEF_DISCONNECTED        = $00008000;
  1055.   MIXERLINE_LINEF_SOURCE              = $80000000;
  1056.  
  1057. { TMixerLine.dwComponentType
  1058.   component types for destinations and sources }
  1059.  
  1060.   MIXERLINE_COMPONENTTYPE_DST_FIRST       = $00000000;
  1061.   MIXERLINE_COMPONENTTYPE_DST_UNDEFINED   = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 0);
  1062.   MIXERLINE_COMPONENTTYPE_DST_DIGITAL     = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 1);
  1063.   MIXERLINE_COMPONENTTYPE_DST_LINE        = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 2);
  1064.   MIXERLINE_COMPONENTTYPE_DST_MONITOR     = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 3);
  1065.   MIXERLINE_COMPONENTTYPE_DST_SPEAKERS    = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 4);
  1066.   MIXERLINE_COMPONENTTYPE_DST_HEADPHONES  = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 5);
  1067.   MIXERLINE_COMPONENTTYPE_DST_TELEPHONE   = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 6);
  1068.   MIXERLINE_COMPONENTTYPE_DST_WAVEIN      = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 7);
  1069.   MIXERLINE_COMPONENTTYPE_DST_VOICEIN     = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8);
  1070.   MIXERLINE_COMPONENTTYPE_DST_LAST        = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8);
  1071.  
  1072.   MIXERLINE_COMPONENTTYPE_SRC_FIRST       = $00001000;
  1073.   MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED   = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0);
  1074.   MIXERLINE_COMPONENTTYPE_SRC_DIGITAL     = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1);
  1075.   MIXERLINE_COMPONENTTYPE_SRC_LINE        = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2);
  1076.   MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE  = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3);
  1077.   MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 4);
  1078.   MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 5);
  1079.   MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE   = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 6);
  1080.   MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER   = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 7);
  1081.   MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT     = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 8);
  1082.   MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY   = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 9);
  1083.   MIXERLINE_COMPONENTTYPE_SRC_ANALOG      = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10);
  1084.   MIXERLINE_COMPONENTTYPE_SRC_LAST        = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10);
  1085.  
  1086. { TMixerLine.Target.dwType }
  1087.  
  1088.   MIXERLINE_TARGETTYPE_UNDEFINED      = 0;
  1089.   MIXERLINE_TARGETTYPE_WAVEOUT        = 1;
  1090.   MIXERLINE_TARGETTYPE_WAVEIN         = 2;
  1091.   MIXERLINE_TARGETTYPE_MIDIOUT        = 3;
  1092.   MIXERLINE_TARGETTYPE_MIDIIN         = 4;
  1093.   MIXERLINE_TARGETTYPE_AUX            = 5;
  1094.  
  1095. function mixerGetLineInfoA(hmxobj: HMIXEROBJ; pmxl: PMixerLineA; 
  1096.   fdwInfo: DWORD): MMRESULT; stdcall;
  1097. function mixerGetLineInfoW(hmxobj: HMIXEROBJ; pmxl: PMixerLineW; 
  1098.   fdwInfo: DWORD): MMRESULT; stdcall;
  1099. function mixerGetLineInfo(hmxobj: HMIXEROBJ; pmxl: PMixerLine; 
  1100.   fdwInfo: DWORD): MMRESULT; stdcall;
  1101.  
  1102. const
  1103.   MIXER_GETLINEINFOF_DESTINATION      = $00000000;
  1104.   MIXER_GETLINEINFOF_SOURCE           = $00000001;
  1105.   MIXER_GETLINEINFOF_LINEID           = $00000002;
  1106.   MIXER_GETLINEINFOF_COMPONENTTYPE    = $00000003;
  1107.   MIXER_GETLINEINFOF_TARGETTYPE       = $00000004;
  1108.  
  1109.   MIXER_GETLINEINFOF_QUERYMASK        = $0000000F;
  1110.  
  1111. function mixerGetID(hmxobj: HMIXEROBJ; var puMxId: UINT; fdwId: DWORD): MMRESULT; stdcall;
  1112.  
  1113. type
  1114.   PMixerControlA = ^TMixerControlA;
  1115.   PMixerControlW = ^TMixerControlW;
  1116.   PMixerControl = PMixerControlA;
  1117.   TMixerControlA = record
  1118.     cbStruct: DWORD;           { size in bytes of MIXERCONTROL }
  1119.     dwControlID: DWORD;        { unique control id for mixer device }
  1120.     dwControlType: DWORD;      { MIXERCONTROL_CONTROLTYPE_xxx }
  1121.     fdwControl: DWORD;         { MIXERCONTROL_CONTROLF_xxx }
  1122.     cMultipleItems: DWORD;     { if MIXERCONTROL_CONTROLF_MULTIPLE set }
  1123.     szShortName: array[0..MIXER_SHORT_NAME_CHARS - 1] of AnsiChar;
  1124.     szName: array[0..MIXER_LONG_NAME_CHARS - 1] of AnsiChar;
  1125.     Bounds: record
  1126.       case Integer of
  1127.         0: (lMinimum, lMaximum: Longint);
  1128.         1: (dwMinimum, dwMaximum: DWORD; dwReserved: array[0..5] of DWORD);
  1129.     end;
  1130.     Metrics: record
  1131.       case Integer of
  1132.         0: (cSteps: DWORD);        { # of steps between min & max }
  1133.         1: (cbCustomData: DWORD);  { size in bytes of custom data }
  1134.         2: (dwReserved: array[0..5] of DWORD);
  1135.     end;
  1136.   end;  
  1137.   TMixerControlW = record
  1138.     cbStruct: DWORD;           { size in bytes of MIXERCONTROL }
  1139.     dwControlID: DWORD;        { unique control id for mixer device }
  1140.     dwControlType: DWORD;      { MIXERCONTROL_CONTROLTYPE_xxx }
  1141.     fdwControl: DWORD;         { MIXERCONTROL_CONTROLF_xxx }
  1142.     cMultipleItems: DWORD;     { if MIXERCONTROL_CONTROLF_MULTIPLE set }
  1143.     szShortName: array[0..MIXER_SHORT_NAME_CHARS - 1] of WideChar;
  1144.     szName: array[0..MIXER_LONG_NAME_CHARS - 1] of WideChar;
  1145.     Bounds: record
  1146.       case Integer of
  1147.         0: (lMinimum, lMaximum: Longint);
  1148.         1: (dwMinimum, dwMaximum: DWORD; dwReserved: array[0..5] of DWORD);
  1149.     end;
  1150.     Metrics: record
  1151.       case Integer of
  1152.         0: (cSteps: DWORD);        { # of steps between min & max }
  1153.         1: (cbCustomData: DWORD);  { size in bytes of custom data }
  1154.         2: (dwReserved: array[0..5] of DWORD);
  1155.     end;
  1156.   end;  
  1157.   TMixerControl = TMixerControlA;
  1158.  
  1159. const
  1160. { TMixerControl.fdwControl }
  1161.  
  1162.   MIXERCONTROL_CONTROLF_UNIFORM   = $00000001;
  1163.   MIXERCONTROL_CONTROLF_MULTIPLE  = $00000002;
  1164.   MIXERCONTROL_CONTROLF_DISABLED  = $80000000;
  1165.  
  1166. { MIXERCONTROL_CONTROLTYPE_xxx building block defines }
  1167.  
  1168.   MIXERCONTROL_CT_CLASS_MASK          = $F0000000;
  1169.   MIXERCONTROL_CT_CLASS_CUSTOM        = $00000000;
  1170.   MIXERCONTROL_CT_CLASS_METER         = $10000000;
  1171.   MIXERCONTROL_CT_CLASS_SWITCH        = $20000000;
  1172.   MIXERCONTROL_CT_CLASS_NUMBER        = $30000000;
  1173.   MIXERCONTROL_CT_CLASS_SLIDER        = $40000000;
  1174.   MIXERCONTROL_CT_CLASS_FADER         = $50000000;
  1175.   MIXERCONTROL_CT_CLASS_TIME          = $60000000;
  1176.   MIXERCONTROL_CT_CLASS_LIST          = $70000000;
  1177.  
  1178.   MIXERCONTROL_CT_SUBCLASS_MASK       = $0F000000;
  1179.  
  1180.   MIXERCONTROL_CT_SC_SWITCH_BOOLEAN   = $00000000;
  1181.   MIXERCONTROL_CT_SC_SWITCH_BUTTON    = $01000000;
  1182.  
  1183.   MIXERCONTROL_CT_SC_METER_POLLED     = $00000000;
  1184.  
  1185.   MIXERCONTROL_CT_SC_TIME_MICROSECS   = $00000000;
  1186.   MIXERCONTROL_CT_SC_TIME_MILLISECS   = $01000000;
  1187.  
  1188.   MIXERCONTROL_CT_SC_LIST_SINGLE      = $00000000;
  1189.   MIXERCONTROL_CT_SC_LIST_MULTIPLE    = $01000000;
  1190.  
  1191.   MIXERCONTROL_CT_UNITS_MASK          = $00FF0000;
  1192.   MIXERCONTROL_CT_UNITS_CUSTOM        = $00000000;
  1193.   MIXERCONTROL_CT_UNITS_BOOLEAN       = $00010000;
  1194.   MIXERCONTROL_CT_UNITS_SIGNED        = $00020000;
  1195.   MIXERCONTROL_CT_UNITS_UNSIGNED      = $00030000;
  1196.   MIXERCONTROL_CT_UNITS_DECIBELS      = $00040000; { in 10ths }
  1197.   MIXERCONTROL_CT_UNITS_PERCENT       = $00050000; { in 10ths }
  1198.  
  1199. { Commonly used control types for specifying TMixerControl.dwControlType }
  1200.  
  1201.   MIXERCONTROL_CONTROLTYPE_CUSTOM         = (MIXERCONTROL_CT_CLASS_CUSTOM or MIXERCONTROL_CT_UNITS_CUSTOM);
  1202.   MIXERCONTROL_CONTROLTYPE_BOOLEANMETER   = (MIXERCONTROL_CT_CLASS_METER or MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_BOOLEAN);
  1203.   MIXERCONTROL_CONTROLTYPE_SIGNEDMETER    = (MIXERCONTROL_CT_CLASS_METER or MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_SIGNED);
  1204.   MIXERCONTROL_CONTROLTYPE_PEAKMETER      = (MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1);
  1205.   MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER  = (MIXERCONTROL_CT_CLASS_METER or MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_UNSIGNED);
  1206.   MIXERCONTROL_CONTROLTYPE_BOOLEAN        = (MIXERCONTROL_CT_CLASS_SWITCH or MIXERCONTROL_CT_SC_SWITCH_BOOLEAN or 
  1207.     MIXERCONTROL_CT_UNITS_BOOLEAN);
  1208.   MIXERCONTROL_CONTROLTYPE_ONOFF          = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 1);
  1209.   MIXERCONTROL_CONTROLTYPE_MUTE           = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2);
  1210.   MIXERCONTROL_CONTROLTYPE_MONO           = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 3);
  1211.   MIXERCONTROL_CONTROLTYPE_LOUDNESS       = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 4);
  1212.   MIXERCONTROL_CONTROLTYPE_STEREOENH      = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 5);
  1213.   MIXERCONTROL_CONTROLTYPE_BUTTON         = (MIXERCONTROL_CT_CLASS_SWITCH or MIXERCONTROL_CT_SC_SWITCH_BUTTON or 
  1214.     MIXERCONTROL_CT_UNITS_BOOLEAN);
  1215.   MIXERCONTROL_CONTROLTYPE_DECIBELS       = (MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_DECIBELS);
  1216.   MIXERCONTROL_CONTROLTYPE_SIGNED         = (MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_SIGNED);
  1217.   MIXERCONTROL_CONTROLTYPE_UNSIGNED       = (MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_UNSIGNED);
  1218.   MIXERCONTROL_CONTROLTYPE_PERCENT        = (MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_PERCENT);
  1219.   MIXERCONTROL_CONTROLTYPE_SLIDER         = (MIXERCONTROL_CT_CLASS_SLIDER or MIXERCONTROL_CT_UNITS_SIGNED);
  1220.   MIXERCONTROL_CONTROLTYPE_PAN            = (MIXERCONTROL_CONTROLTYPE_SLIDER + 1);
  1221.   MIXERCONTROL_CONTROLTYPE_QSOUNDPAN      = (MIXERCONTROL_CONTROLTYPE_SLIDER + 2);
  1222.   MIXERCONTROL_CONTROLTYPE_FADER          = (MIXERCONTROL_CT_CLASS_FADER or MIXERCONTROL_CT_UNITS_UNSIGNED);
  1223.   MIXERCONTROL_CONTROLTYPE_VOLUME         = (MIXERCONTROL_CONTROLTYPE_FADER + 1);
  1224.   MIXERCONTROL_CONTROLTYPE_BASS           = (MIXERCONTROL_CONTROLTYPE_FADER + 2);
  1225.   MIXERCONTROL_CONTROLTYPE_TREBLE         = (MIXERCONTROL_CONTROLTYPE_FADER + 3);
  1226.   MIXERCONTROL_CONTROLTYPE_EQUALIZER      = (MIXERCONTROL_CONTROLTYPE_FADER + 4);
  1227.   MIXERCONTROL_CONTROLTYPE_SINGLESELECT   = (MIXERCONTROL_CT_CLASS_LIST or MIXERCONTROL_CT_SC_LIST_SINGLE or MIXERCONTROL_CT_UNITS_BOOLEAN);
  1228.   MIXERCONTROL_CONTROLTYPE_MUX            = (MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1);
  1229.   MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT = (MIXERCONTROL_CT_CLASS_LIST or MIXERCONTROL_CT_SC_LIST_MULTIPLE or MIXERCONTROL_CT_UNITS_BOOLEAN);
  1230.   MIXERCONTROL_CONTROLTYPE_MIXER          = (MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT + 1);
  1231.   MIXERCONTROL_CONTROLTYPE_MICROTIME      = (MIXERCONTROL_CT_CLASS_TIME or MIXERCONTROL_CT_SC_TIME_MICROSECS or 
  1232.     MIXERCONTROL_CT_UNITS_UNSIGNED);
  1233.   MIXERCONTROL_CONTROLTYPE_MILLITIME      = (MIXERCONTROL_CT_CLASS_TIME or MIXERCONTROL_CT_SC_TIME_MILLISECS or 
  1234.     MIXERCONTROL_CT_UNITS_UNSIGNED);
  1235.  
  1236.  
  1237. type
  1238.   PMixerLineControlsA = ^TMixerLineControlsA;
  1239.   PMixerLineControlsW = ^TMixerLineControlsW;
  1240.   PMixerLineControls = PMixerLineControlsA;
  1241.   TMixerLineControlsA = record
  1242.     cbStruct: DWORD;               { size in bytes of MIXERLINECONTROLS }
  1243.     dwLineID: DWORD;               { line id (from MIXERLINE.dwLineID) }
  1244.     case Integer of
  1245.       0: (dwControlID: DWORD);     { MIXER_GETLINECONTROLSF_ONEBYID }
  1246.       1: (dwControlType: DWORD;    { MIXER_GETLINECONTROLSF_ONEBYTYPE }
  1247.           cControls: DWORD;        { count of controls pmxctrl points to }
  1248.           cbmxctrl: DWORD;         { size in bytes of _one_ MIXERCONTROL }
  1249.           pamxctrl: PMixerControlA);   { pointer to first MIXERCONTROL array }
  1250.   end;
  1251.   TMixerLineControlsW = record
  1252.     cbStruct: DWORD;               { size in bytes of MIXERLINECONTROLS }
  1253.     dwLineID: DWORD;               { line id (from MIXERLINE.dwLineID) }
  1254.     case Integer of
  1255.       0: (dwControlID: DWORD);     { MIXER_GETLINECONTROLSF_ONEBYID }
  1256.       1: (dwControlType: DWORD;    { MIXER_GETLINECONTROLSF_ONEBYTYPE }
  1257.           cControls: DWORD;        { count of controls pmxctrl points to }
  1258.           cbmxctrl: DWORD;         { size in bytes of _one_ MIXERCONTROL }
  1259.           pamxctrl: PMixerControlW);   { pointer to first MIXERCONTROL array }
  1260.   end;
  1261.   TMixerLineControls = TMixerLineControlsA;
  1262.  
  1263. function mixerGetLineControlsA(hmxobj: HMIXEROBJ; pmxlc: PMixerLineControlsA; fdwControls: DWORD): MMRESULT; stdcall;
  1264. function mixerGetLineControlsW(hmxobj: HMIXEROBJ; pmxlc: PMixerLineControlsW; fdwControls: DWORD): MMRESULT; stdcall;
  1265. function mixerGetLineControls(hmxobj: HMIXEROBJ; pmxlc: PMixerLineControls; fdwControls: DWORD): MMRESULT; stdcall;
  1266.  
  1267. const
  1268.   MIXER_GETLINECONTROLSF_ALL          = $00000000;
  1269.   MIXER_GETLINECONTROLSF_ONEBYID      = $00000001;
  1270.   MIXER_GETLINECONTROLSF_ONEBYTYPE    = $00000002;
  1271.  
  1272.   MIXER_GETLINECONTROLSF_QUERYMASK    = $0000000F;
  1273.  
  1274. type
  1275.   PMixerControlDetails = ^TMixerControlDetails;
  1276.   TMixerControlDetails = record
  1277.     cbStruct: DWORD;       { size in bytes of MIXERCONTROLDETAILS }
  1278.     dwControlID: DWORD;    { control id to get/set details on }
  1279.     cChannels: DWORD;      { number of channels in paDetails array }
  1280.     case Integer of
  1281.        0: (hwndOwner: HWND);        { for MIXER_SETCONTROLDETAILSF_CUSTOM }
  1282.        1: (cMultipleItems: DWORD;   { if _MULTIPLE, the number of items per channel }
  1283.            cbDetails: DWORD;        { size of _one_ details_XX struct }
  1284.            paDetails: Pointer);     { pointer to array of details_XX structs }
  1285.   end;
  1286.  
  1287.   PMixerControlDetailsListTextA = ^TMixerControlDetailsListTextA;
  1288.   PMixerControlDetailsListTextW = ^TMixerControlDetailsListTextW;
  1289.   PMixerControlDetailsListText = PMixerControlDetailsListTextA;
  1290.   TMixerControlDetailsListTextA = record
  1291.     dwParam1: DWORD;
  1292.     dwParam2: DWORD;
  1293.     szName: array[0..MIXER_LONG_NAME_CHARS - 1] of AnsiChar;
  1294.   end;
  1295.   TMixerControlDetailsListTextW = record
  1296.     dwParam1: DWORD;
  1297.     dwParam2: DWORD;
  1298.     szName: array[0..MIXER_LONG_NAME_CHARS - 1] of WideChar;
  1299.   end;
  1300.   TMixerControlDetailsListText = TMixerControlDetailsListTextA;
  1301.  
  1302.   PMixerControlDetailsBoolean = ^TMixerControlDetailsBoolean;
  1303.   TMixerControlDetailsBoolean = record
  1304.     fValue: Longint;
  1305.   end;
  1306.  
  1307.   PMixerControlDetailsSigned = ^TMixerControlDetailsSigned;
  1308.   TMixerControlDetailsSigned = record
  1309.     lValue: Longint;
  1310.   end;
  1311.  
  1312.   PMixerControlDetailsUnsigned = ^TMixerControlDetailsUnsigned;
  1313.   TMixerControlDetailsUnsigned = record
  1314.     dwValue: DWORD;
  1315.   end;
  1316.  
  1317. function mixerGetControlDetailsA(hmxobj: HMIXEROBJ; pmxcd: PMixerControlDetails; fdwDetails: DWORD): MMRESULT; stdcall;
  1318. function mixerGetControlDetailsW(hmxobj: HMIXEROBJ; pmxcd: PMixerControlDetails; fdwDetails: DWORD): MMRESULT; stdcall;
  1319. function mixerGetControlDetails(hmxobj: HMIXEROBJ; pmxcd: PMixerControlDetails; fdwDetails: DWORD): MMRESULT; stdcall;
  1320.  
  1321. const
  1322.   MIXER_GETCONTROLDETAILSF_VALUE      = $00000000;
  1323.   MIXER_GETCONTROLDETAILSF_LISTTEXT   = $00000001;
  1324.  
  1325.   MIXER_GETCONTROLDETAILSF_QUERYMASK  = $0000000F;
  1326.  
  1327. function mixerSetControlDetails(hmxobj: HMIXEROBJ; pmxcd: PMixerControlDetails; fdwDetails: DWORD): MMRESULT; stdcall;
  1328.  
  1329. const
  1330.   MIXER_SETCONTROLDETAILSF_VALUE      = $00000000;
  1331.   MIXER_SETCONTROLDETAILSF_CUSTOM     = $00000001;
  1332.  
  1333.   MIXER_SETCONTROLDETAILSF_QUERYMASK  = $0000000F;
  1334.  
  1335. {***************************************************************************
  1336.  
  1337.                             Timer support
  1338.  
  1339. ***************************************************************************}
  1340.  
  1341. { timer error return values }
  1342. const
  1343.   TIMERR_NOERROR        = 0;                  { no error }
  1344.   TIMERR_NOCANDO        = TIMERR_BASE+1;      { request not completed }
  1345.   TIMERR_STRUCT         = TIMERR_BASE+33;     { time struct size }
  1346.  
  1347. { timer data types }
  1348. type
  1349.   TFNTimeCallBack = procedure(uTimerID, uMessage: UINT; dwUser, dw1, dw2: DWORD);
  1350.  
  1351.  
  1352. { flags for wFlags parameter of timeSetEvent() function }
  1353. const
  1354.   TIME_ONESHOT    = 0;   { program timer for single event }
  1355.   TIME_PERIODIC   = 1;   { program for continuous periodic event }
  1356.   TIME_CALLBACK_FUNCTION    = $0000;  { callback is function }
  1357.   TIME_CALLBACK_EVENT_SET   = $0010;  { callback is event - use SetEvent }
  1358.   TIME_CALLBACK_EVENT_PULSE = $0020;  { callback is event - use PulseEvent }
  1359.  
  1360. { timer device capabilities data structure }
  1361. type
  1362.   PTimeCaps = ^TTimeCaps;
  1363.   TTimeCaps = record
  1364.     wPeriodMin: UINT;     { minimum period supported  }
  1365.     wPeriodMax: UINT;     { maximum period supported  }
  1366.   end;
  1367.  
  1368. { timer function prototypes }
  1369. function timeGetSystemTime(lpTime: PMMTime; uSize: Word): MMRESULT; stdcall;
  1370.  
  1371. function timeGetTime: DWORD; stdcall;
  1372. function timeSetEvent(uDelay, uResolution: UINT;
  1373.   lpFunction: TFNTimeCallBack; dwUser: DWORD; uFlags: UINT): MMRESULT; stdcall;
  1374. function timeKillEvent(uTimerID: UINT): MMRESULT; stdcall;
  1375. function timeGetDevCaps(lpTimeCaps: PTimeCaps; uSize: UINT): MMRESULT; stdcall;
  1376. function timeBeginPeriod(uPeriod: UINT): MMRESULT; stdcall;
  1377. function timeEndPeriod(uPeriod: UINT): MMRESULT; stdcall;
  1378.  
  1379.  
  1380. {***************************************************************************
  1381.  
  1382.                             Joystick support
  1383.  
  1384. ***************************************************************************}
  1385.  
  1386. { joystick error return values }
  1387. const
  1388.   JOYERR_NOERROR        = 0;                  { no error }
  1389.   JOYERR_PARMS          = JOYERR_BASE+5;      { bad parameters }
  1390.   JOYERR_NOCANDO        = JOYERR_BASE+6;      { request not completed }
  1391.   JOYERR_UNPLUGGED      = JOYERR_BASE+7;      { joystick is unplugged }
  1392.  
  1393. { constants used with TJoyInfo and TJoyInfoEx structure and MM_JOY* messages }
  1394. const
  1395.   JOY_BUTTON1         = $0001;
  1396.   JOY_BUTTON2         = $0002;
  1397.   JOY_BUTTON3         = $0004;
  1398.   JOY_BUTTON4         = $0008;
  1399.   JOY_BUTTON1CHG      = $0100;
  1400.   JOY_BUTTON2CHG      = $0200;
  1401.   JOY_BUTTON3CHG      = $0400;
  1402.   JOY_BUTTON4CHG      = $0800;
  1403.  
  1404. { constants used with TJoyInfoEx }
  1405.   JOY_BUTTON5         = $00000010;
  1406.   JOY_BUTTON6         = $00000020;
  1407.   JOY_BUTTON7         = $00000040;
  1408.   JOY_BUTTON8         = $00000080;
  1409.   JOY_BUTTON9         = $00000100;
  1410.   JOY_BUTTON10        = $00000200;
  1411.   JOY_BUTTON11        = $00000400;
  1412.   JOY_BUTTON12        = $00000800;
  1413.   JOY_BUTTON13        = $00001000;
  1414.   JOY_BUTTON14        = $00002000;
  1415.   JOY_BUTTON15        = $00004000;
  1416.   JOY_BUTTON16        = $00008000;
  1417.   JOY_BUTTON17        = $00010000;
  1418.   JOY_BUTTON18        = $00020000;
  1419.   JOY_BUTTON19        = $00040000;
  1420.   JOY_BUTTON20        = $00080000;
  1421.   JOY_BUTTON21        = $00100000;
  1422.   JOY_BUTTON22        = $00200000;
  1423.   JOY_BUTTON23        = $00400000;
  1424.   JOY_BUTTON24        = $00800000;
  1425.   JOY_BUTTON25        = $01000000;
  1426.   JOY_BUTTON26        = $02000000;
  1427.   JOY_BUTTON27        = $04000000;
  1428.   JOY_BUTTON28        = $08000000;
  1429.   JOY_BUTTON29        = $10000000;
  1430.   JOY_BUTTON30        = $20000000;
  1431.   JOY_BUTTON31        = $40000000;
  1432.   JOY_BUTTON32        = $80000000;
  1433.  
  1434. { constants used with TJoyInfoEx }
  1435.   JOY_POVCENTERED    = -1;
  1436.   JOY_POVFORWARD    = 0;
  1437.   JOY_POVRIGHT        = 9000;
  1438.   JOY_POVBACKWARD    = 18000;
  1439.   JOY_POVLEFT        = 27000;
  1440.  
  1441.   JOY_RETURNX        = $00000001;
  1442.   JOY_RETURNY        = $00000002;
  1443.   JOY_RETURNZ        = $00000004;
  1444.   JOY_RETURNR        = $00000008;
  1445.   JOY_RETURNU        = $00000010; { axis 5 }
  1446.   JOY_RETURNV        = $00000020; { axis 6 }
  1447.   JOY_RETURNPOV        = $00000040;
  1448.   JOY_RETURNBUTTONS    = $00000080;
  1449.   JOY_RETURNRAWDATA    = $00000100;
  1450.   JOY_RETURNPOVCTS    = $00000200;
  1451.   JOY_RETURNCENTERED    = $00000400;
  1452.   JOY_USEDEADZONE        = $00000800;
  1453.   JOY_RETURNALL  = (JOY_RETURNX or JOY_RETURNY or JOY_RETURNZ or
  1454.     JOY_RETURNR or JOY_RETURNU or JOY_RETURNV or
  1455.     JOY_RETURNPOV or JOY_RETURNBUTTONS);
  1456.   JOY_CAL_READALWAYS    = $00010000;
  1457.   JOY_CAL_READXYONLY    = $00020000;
  1458.   JOY_CAL_READ3        = $00040000;
  1459.   JOY_CAL_READ4        = $00080000;
  1460.   JOY_CAL_READXONLY    = $00100000;
  1461.   JOY_CAL_READYONLY    = $00200000;
  1462.   JOY_CAL_READ5        = $00400000;
  1463.   JOY_CAL_READ6        = $00800000;
  1464.   JOY_CAL_READZONLY    = $01000000;
  1465.   JOY_CAL_READRONLY    = $02000000;
  1466.   JOY_CAL_READUONLY    = $04000000;
  1467.   JOY_CAL_READVONLY    = $08000000;
  1468.  
  1469. { joystick ID constants }
  1470. const
  1471.   JOYSTICKID1         = 0;
  1472.   JOYSTICKID2         = 1;
  1473.  
  1474. { joystick driver capabilites }
  1475.   JOYCAPS_HASZ        = $000;
  1476.   JOYCAPS_HASR        = $0002;
  1477.   JOYCAPS_HASU        = $0004;
  1478.   JOYCAPS_HASV        = $0008;
  1479.   JOYCAPS_HASPOV        = $0010;
  1480.   JOYCAPS_POV4DIR        = $0020;
  1481.   JOYCAPS_POVCTS        = $0040;
  1482.  
  1483. { joystick device capabilities data structure }
  1484. type
  1485.   PJoyCapsA = ^TJoyCapsA;
  1486.   PJoyCapsW = ^TJoyCapsW;
  1487.   PJoyCaps = PJoyCapsA;
  1488.   TJoyCapsA = record
  1489.     wMid: Word;                  { manufacturer ID }
  1490.     wPid: Word;                  { product ID }
  1491.     szPname: array[0..MAXPNAMELEN-1] of AnsiChar;  { product name (NULL terminated string) }
  1492.     wXmin: UINT;                 { minimum x position value }
  1493.     wXmax: UINT;                 { maximum x position value }
  1494.     wYmin: UINT;                 { minimum y position value }
  1495.     wYmax: UINT;                 { maximum y position value }
  1496.     wZmin: UINT;                 { minimum z position value }
  1497.     wZmax: UINT;                 { maximum z position value }
  1498.     wNumButtons: UINT;           { number of buttons }
  1499.     wPeriodMin: UINT;            { minimum message period when captured }
  1500.     wPeriodMax: UINT;            { maximum message period when captured }
  1501.     wRmin: UINT;                 { minimum r position value }
  1502.     wRmax: UINT;                 { maximum r position value }
  1503.     wUmin: UINT;                 { minimum u (5th axis) position value }
  1504.     wUmax: UINT;                 { maximum u (5th axis) position value }
  1505.     wVmin: UINT;                 { minimum v (6th axis) position value }
  1506.     wVmax: UINT;                 { maximum v (6th axis) position value }
  1507.     wCaps: UINT;                 { joystick capabilites }
  1508.     wMaxAxes: UINT;         { maximum number of axes supported }
  1509.     wNumAxes: UINT;         { number of axes in use }
  1510.     wMaxButtons: UINT;         { maximum number of buttons supported }
  1511.     szRegKey: array[0..MAXPNAMELEN - 1] of AnsiChar; { registry key }
  1512.     szOEMVxD: array[0..MAX_JOYSTICKOEMVXDNAME - 1] of AnsiChar; { OEM VxD in use }
  1513.   end;
  1514.   TJoyCapsW = record
  1515.     wMid: Word;                  { manufacturer ID }
  1516.     wPid: Word;                  { product ID }
  1517.     szPname: array[0..MAXPNAMELEN-1] of WideChar;  { product name (NULL terminated string) }
  1518.     wXmin: UINT;                 { minimum x position value }
  1519.     wXmax: UINT;                 { maximum x position value }
  1520.     wYmin: UINT;                 { minimum y position value }
  1521.     wYmax: UINT;                 { maximum y position value }
  1522.     wZmin: UINT;                 { minimum z position value }
  1523.     wZmax: UINT;                 { maximum z position value }
  1524.     wNumButtons: UINT;           { number of buttons }
  1525.     wPeriodMin: UINT;            { minimum message period when captured }
  1526.     wPeriodMax: UINT;            { maximum message period when captured }
  1527.     wRmin: UINT;                 { minimum r position value }
  1528.     wRmax: UINT;                 { maximum r position value }
  1529.     wUmin: UINT;                 { minimum u (5th axis) position value }
  1530.     wUmax: UINT;                 { maximum u (5th axis) position value }
  1531.     wVmin: UINT;                 { minimum v (6th axis) position value }
  1532.     wVmax: UINT;                 { maximum v (6th axis) position value }
  1533.     wCaps: UINT;                 { joystick capabilites }
  1534.     wMaxAxes: UINT;         { maximum number of axes supported }
  1535.     wNumAxes: UINT;         { number of axes in use }
  1536.     wMaxButtons: UINT;         { maximum number of buttons supported }
  1537.     szRegKey: array[0..MAXPNAMELEN - 1] of WideChar; { registry key }
  1538.     szOEMVxD: array[0..MAX_JOYSTICKOEMVXDNAME - 1] of WideChar; { OEM VxD in use }
  1539.   end;
  1540.   TJoyCaps = TJoyCapsA;
  1541.  
  1542. { joystick information data structure }
  1543. type
  1544.   PJoyInfo = ^TJoyInfo;
  1545.   TJoyInfo = record
  1546.     wXpos: UINT;                 { x position }
  1547.     wYpos: UINT;                 { y position }
  1548.     wZpos: UINT;                 { z position }
  1549.     wButtons: UINT;              { button states }
  1550.   end;
  1551.  
  1552.   PJoyInfoEx = ^TJoyInfoEx;
  1553.   TJoyInfoEx = record
  1554.     dwSize: DWORD;         { size of structure }
  1555.     dwFlags: DWORD;         { flags to indicate what to return }
  1556.     wXpos: UINT;         { x position }
  1557.     wYpos: UINT;         { y position }
  1558.     wZpos: UINT;         { z position }
  1559.     dwRpos: DWORD;         { rudder/4th axis position }
  1560.     dwUpos: DWORD;         { 5th axis position }
  1561.     dwVpos: DWORD;         { 6th axis position }
  1562.     wButtons: UINT;      { button states }
  1563.     dwButtonNumber: DWORD;  { current button number pressed }
  1564.     dwPOV: DWORD;           { point of view state }
  1565.     dwReserved1: DWORD;         { reserved for communication between winmm & driver }
  1566.     dwReserved2: DWORD;         { reserved for future expansion }
  1567.   end;
  1568.  
  1569. { joystick function prototypes }
  1570. function joyGetNumDevs: UINT; stdcall;
  1571. function joyGetDevCapsA(uJoyID: UINT; lpCaps: PJoyCapsA; uSize: UINT): MMRESULT; stdcall;
  1572. function joyGetDevCapsW(uJoyID: UINT; lpCaps: PJoyCapsW; uSize: UINT): MMRESULT; stdcall;
  1573. function joyGetDevCaps(uJoyID: UINT; lpCaps: PJoyCaps; uSize: UINT): MMRESULT; stdcall;
  1574. function joyGetPos(uJoyID: UINT; lpInfo: PJoyInfo): MMRESULT; stdcall;
  1575. function joyGetPosEx(uJoyID: UINT; lpInfo: PJoyInfoEx): MMRESULT; stdcall;
  1576. function joyGetThreshold(uJoyID: UINT; lpuThreshold: PUINT): MMRESULT; stdcall;
  1577. function joyReleaseCapture(uJoyID: UINT): MMRESULT; stdcall;
  1578. function joySetCapture(Handle: HWND; uJoyID, uPeriod: UINT; bChanged: BOOL): MMRESULT; stdcall;
  1579. function joySetThreshold(uJoyID, uThreshold: UINT): MMRESULT; stdcall;
  1580.  
  1581. {***************************************************************************
  1582.  
  1583.                         Multimedia File I/O support
  1584.  
  1585. ***************************************************************************}
  1586.  
  1587. { MMIO error return values }
  1588. const
  1589.   MMIOERR_BASE            = 256;
  1590.   MMIOERR_FILENOTFOUND    = MMIOERR_BASE + 1;  { file not found }
  1591.   MMIOERR_OUTOFMEMORY     = MMIOERR_BASE + 2;  { out of memory }
  1592.   MMIOERR_CANNOTOPEN      = MMIOERR_BASE + 3;  { cannot open }
  1593.   MMIOERR_CANNOTCLOSE     = MMIOERR_BASE + 4;  { cannot close }
  1594.   MMIOERR_CANNOTREAD      = MMIOERR_BASE + 5;  { cannot read }
  1595.   MMIOERR_CANNOTWRITE     = MMIOERR_BASE + 6;  { cannot write }
  1596.   MMIOERR_CANNOTSEEK      = MMIOERR_BASE + 7;  { cannot seek }
  1597.   MMIOERR_CANNOTEXPAND    = MMIOERR_BASE + 8;  { cannot expand file }
  1598.   MMIOERR_CHUNKNOTFOUND   = MMIOERR_BASE + 9;  { chunk not found }
  1599.   MMIOERR_UNBUFFERED      = MMIOERR_BASE + 10; { file is unbuffered }
  1600.   MMIOERR_PATHNOTFOUND        = MMIOERR_BASE + 11;  { path incorrect }
  1601.   MMIOERR_ACCESSDENIED        = MMIOERR_BASE + 12;  { file was protected }
  1602.   MMIOERR_SHARINGVIOLATION    = MMIOERR_BASE + 13;  { file in use }
  1603.   MMIOERR_NETWORKERROR        = MMIOERR_BASE + 14;  { network not responding }
  1604.   MMIOERR_TOOMANYOPENFILES    = MMIOERR_BASE + 15;  { no more file handles  }
  1605.   MMIOERR_INVALIDFILE         = MMIOERR_BASE + 16;  { default error file error }
  1606.  
  1607. { MMIO constants }
  1608. const
  1609.   CFSEPCHAR       = '+';             { compound file name separator char. }
  1610.  
  1611. type
  1612. { MMIO data types }
  1613.   FOURCC = DWORD;                    { a four character code }
  1614.  
  1615.   PHMMIO = ^HMMIO;
  1616.   HMMIO = Integer;      { a handle to an open file }
  1617.  
  1618.   TFNMMIOProc = function(lpmmioinfo: PChar; uMessage: UINT; lParam1, lParam2: LPARAM): Longint stdcall;
  1619.  
  1620. { general MMIO information data structure }
  1621. type
  1622.   PMMIOInfo = ^TMMIOInfo;
  1623.   TMMIOInfo = record
  1624.     { general fields }
  1625.     dwFlags: DWORD;        { general status flags }
  1626.     fccIOProc: FOURCC;      { pointer to I/O procedure }
  1627.     pIOProc: TFNMMIOProc;        { pointer to I/O procedure }
  1628.     wErrorRet: UINT;      { place for error to be returned }
  1629.     hTask: HTASK;          { alternate local task }
  1630.  
  1631.     { fields maintained by MMIO functions during buffered I/O }
  1632.     cchBuffer: Longint;      { size of I/O buffer (or 0L) }
  1633.     pchBuffer: PChar;      { start of I/O buffer (or NULL) }
  1634.     pchNext: PChar;        { pointer to next byte to read/write }
  1635.     pchEndRead: PChar;     { pointer to last valid byte to read }
  1636.     pchEndWrite: PChar;    { pointer to last byte to write }
  1637.     lBufOffset: Longint;     { disk offset of start of buffer }
  1638.  
  1639.     { fields maintained by I/O procedure }
  1640.     lDiskOffset: Longint;    { disk offset of next read or write }
  1641.     adwInfo: array[0..2] of DWORD;     { data specific to type of MMIOPROC }
  1642.  
  1643.     { other fields maintained by MMIO }
  1644.     dwReserved1: DWORD;    { reserved for MMIO use }
  1645.     dwReserved2: DWORD;    { reserved for MMIO use }
  1646.     hmmio: HMMIO;          { handle to open file }
  1647.   end;
  1648.  
  1649.  
  1650. { RIFF chunk information data structure }
  1651. type
  1652.  
  1653.   PMMCKInfo = ^TMMCKInfo;
  1654.   TMMCKInfo = record
  1655.     ckid: FOURCC;           { chunk ID }
  1656.     cksize: DWORD;         { chunk size }
  1657.     fccType: FOURCC;        { form type or list type }
  1658.     dwDataOffset: DWORD;   { offset of data portion of chunk }
  1659.     dwFlags: DWORD;        { flags used by MMIO functions }
  1660.   end;
  1661.  
  1662. { bit field masks }
  1663. const
  1664.   MMIO_RWMODE     = $00000003;      { open file for reading/writing/both }
  1665.   MMIO_SHAREMODE  = $00000070;      { file sharing mode number }
  1666.  
  1667. { constants for dwFlags field of MMIOINFO }
  1668. const
  1669.   MMIO_CREATE    = $00001000;     { create new file (or truncate file) }
  1670.   MMIO_PARSE     = $00000100;     { parse new file returning path }
  1671.   MMIO_DELETE    = $00000200;     { create new file (or truncate file) }
  1672.   MMIO_EXIST     = $00004000;     { checks for existence of file }
  1673.   MMIO_ALLOCBUF  = $00010000;     { mmioOpen() should allocate a buffer }
  1674.   MMIO_GETTEMP   = $00020000;     { mmioOpen() should retrieve temp name }
  1675.  
  1676. const
  1677.   MMIO_DIRTY     = $10000000;     { I/O buffer is dirty }
  1678.  
  1679. { read/write mode numbers (bit field MMIO_RWMODE) }
  1680. const
  1681.   MMIO_READ       = $00000000;      { open file for reading only }
  1682.   MMIO_WRITE      = $00000001;      { open file for writing only }
  1683.   MMIO_READWRITE  = $00000002;      { open file for reading and writing }
  1684.  
  1685. { share mode numbers (bit field MMIO_SHAREMODE) }
  1686. const
  1687.   MMIO_COMPAT     = $00000000;      { compatibility mode }
  1688.   MMIO_EXCLUSIVE  = $00000010;      { exclusive-access mode }
  1689.   MMIO_DENYWRITE  = $00000020;      { deny writing to other processes }
  1690.   MMIO_DENYREAD   = $00000030;      { deny reading to other processes }
  1691.   MMIO_DENYNONE   = $00000040;      { deny nothing to other processes }
  1692.  
  1693. { various MMIO flags }
  1694. const
  1695.   MMIO_FHOPEN             = $0010;  { mmioClose: keep file handle open }
  1696.   MMIO_EMPTYBUF           = $0010;  { mmioFlush: empty the I/O buffer }
  1697.   MMIO_TOUPPER            = $0010;  { mmioStringToFOURCC: to u-case }
  1698.   MMIO_INSTALLPROC    = $00010000;  { mmioInstallIOProc: install MMIOProc }
  1699.   MMIO_GLOBALPROC     = $10000000;  { mmioInstallIOProc: install globally }
  1700.   MMIO_REMOVEPROC     = $00020000;  { mmioInstallIOProc: remove MMIOProc }
  1701.   MMIO_UNICODEPROC    = $01000000;  { mmioInstallIOProc: Unicode MMIOProc }
  1702.   MMIO_FINDPROC       = $00040000;  { mmioInstallIOProc: find an MMIOProc }
  1703.   MMIO_FINDCHUNK          = $0010;  { mmioDescend: find a chunk by ID }
  1704.   MMIO_FINDRIFF           = $0020;  { mmioDescend: find a LIST chunk }
  1705.   MMIO_FINDLIST           = $0040;  { mmioDescend: find a RIFF chunk }
  1706.   MMIO_CREATERIFF         = $0020;  { mmioCreateChunk: make a LIST chunk }
  1707.   MMIO_CREATELIST         = $0040;  { mmioCreateChunk: make a RIFF chunk }
  1708.  
  1709.  
  1710. { message numbers for MMIOPROC I/O procedure functions }
  1711. const
  1712.   MMIOM_READ      = MMIO_READ;       { read }
  1713.   MMIOM_WRITE    = MMIO_WRITE;       { write }
  1714.   MMIOM_SEEK              = 2;       { seek to a new position in file }
  1715.   MMIOM_OPEN              = 3;       { open file }
  1716.   MMIOM_CLOSE             = 4;       { close file }
  1717.   MMIOM_WRITEFLUSH        = 5;       { write and flush }
  1718.  
  1719. const
  1720.   MMIOM_RENAME            = 6;       { rename specified file }
  1721.  
  1722.   MMIOM_USER         = $8000;       { beginning of user-defined messages }
  1723.  
  1724. { standard four character codes }
  1725. const
  1726.   FOURCC_RIFF = $46464952;   { 'RIFF' }
  1727.   FOURCC_LIST = $5453494C;   { 'LIST' }
  1728.  
  1729. { four character codes used to identify standard built-in I/O procedures }
  1730. const
  1731.   FOURCC_DOS  = $20532F44;   { 'DOS '}
  1732.   FOURCC_MEM  = $204D454D;   { 'MEM '}
  1733.  
  1734. { flags for mmioSeek() }
  1735. const
  1736.   SEEK_SET        = 0;               { seek to an absolute position }
  1737.   SEEK_CUR        = 1;               { seek relative to current position }
  1738.   SEEK_END        = 2;               { seek relative to end of file }
  1739.  
  1740. { other constants }
  1741. const
  1742.   MMIO_DEFAULTBUFFER      = 8192;    { default buffer size }
  1743.  
  1744. { MMIO function prototypes }
  1745. function mmioStringToFOURCCA(sz: PAnsiChar; uFlags: UINT): FOURCC; stdcall;
  1746. function mmioStringToFOURCCW(sz: PWideChar; uFlags: UINT): FOURCC; stdcall;
  1747. function mmioStringToFOURCC(sz: PChar; uFlags: UINT): FOURCC; stdcall;
  1748. function mmioInstallIOProcA(fccIOProc: FOURCC; pIOProc: TFNMMIOProc;
  1749.   dwFlags: DWORD): TFNMMIOProc; stdcall;
  1750. function mmioInstallIOProcW(fccIOProc: FOURCC; pIOProc: TFNMMIOProc;
  1751.   dwFlags: DWORD): TFNMMIOProc; stdcall;
  1752. function mmioInstallIOProc(fccIOProc: FOURCC; pIOProc: TFNMMIOProc;
  1753.   dwFlags: DWORD): TFNMMIOProc; stdcall;
  1754. function mmioOpenA(szFileName: PChar; lpmmioinfo: PMMIOInfo;
  1755.   dwOpenFlags: DWORD): HMMIO; stdcall;
  1756. function mmioOpenW(szFileName: PChar; lpmmioinfo: PMMIOInfo;
  1757.   dwOpenFlags: DWORD): HMMIO; stdcall;
  1758. function mmioOpen(szFileName: PChar; lpmmioinfo: PMMIOInfo;
  1759.   dwOpenFlags: DWORD): HMMIO; stdcall;
  1760. function mmioRenameA(szFileName, szNewFileName: PAnsiChar;
  1761.   lpmmioinfo: PMMIOInfo; dwRenameFlags: DWORD): MMRESULT; stdcall;
  1762. function mmioRenameW(szFileName, szNewFileName: PWideChar;
  1763.   lpmmioinfo: PMMIOInfo; dwRenameFlags: DWORD): MMRESULT; stdcall;
  1764. function mmioRename(szFileName, szNewFileName: PChar;
  1765.   lpmmioinfo: PMMIOInfo; dwRenameFlags: DWORD): MMRESULT; stdcall;
  1766. function mmioClose(hmmio: HMMIO; uFlags: UINT): MMRESULT; stdcall;
  1767. function mmioRead(hmmio: HMMIO; pch: PChar; cch: Longint): Longint; stdcall;
  1768. function mmioWrite(hmmio: HMMIO; pch: PChar; cch: Longint): Longint; stdcall;
  1769. function mmioSeek(hmmio: HMMIO; lOffset: Longint; 
  1770.   iOrigin: Integer): Longint; stdcall;
  1771. function mmioGetInfo(hmmio: HMMIO; lpmmioinfo: PMMIOInfo; uFlags: UINT): MMRESULT; stdcall;
  1772. function mmioSetInfo(hmmio: HMMIO; lpmmioinfo: PMMIOInfo; uFlags: UINT): MMRESULT; stdcall;
  1773. function mmioSetBuffer(hmmio: HMMIO; pchBuffer: PChar; cchBuffer: Longint;
  1774.   uFlags: Word): MMRESULT; stdcall;
  1775. function mmioFlush(hmmio: HMMIO; uFlags: UINT): MMRESULT; stdcall;
  1776. function mmioAdvance(hmmio: HMMIO; lpmmioinfo: PMMIOInfo; uFlags: UINT): MMRESULT; stdcall;
  1777. function mmioSendMessage(hmmio: HMMIO; uMessage: UINT;
  1778.   lParam1, lParam2: DWORD): Longint; stdcall;
  1779. function mmioDescend(hmmio: HMMIO; lpck: PMMCKInfo;
  1780.   lpckParent: PMMCKInfo; uFlags: UINT): MMRESULT; stdcall;
  1781. function mmioAscend(hmmio: HMMIO; lpck: PMMCKInfo; uFlags: UINT): MMRESULT; stdcall;
  1782. function mmioCreateChunk(hmmio: HMMIO; lpck: PMMCKInfo; uFlags: UINT): MMRESULT; stdcall;
  1783.  
  1784.  
  1785. {***************************************************************************
  1786.  
  1787.                             MCI support
  1788.  
  1789. ***************************************************************************}
  1790.  
  1791. type
  1792.   MCIERROR = DWORD;     { error return code, 0 means no error }
  1793.   MCIDEVICEID = UINT;   { MCI device ID type }
  1794.  
  1795.   TFNYieldProc = function(mciId: MCIDEVICEID; dwYieldData: DWORD): UINT stdcall;
  1796.  
  1797. { MCI function prototypes }
  1798. function mciSendCommandA(mciId: MCIDEVICEID; uMessage: UINT;
  1799.   dwParam1, dwParam2: DWORD): MCIERROR; stdcall;
  1800. function mciSendCommandW(mciId: MCIDEVICEID; uMessage: UINT;
  1801.   dwParam1, dwParam2: DWORD): MCIERROR; stdcall;
  1802. function mciSendCommand(mciId: MCIDEVICEID; uMessage: UINT;
  1803.   dwParam1, dwParam2: DWORD): MCIERROR; stdcall;
  1804. function mciSendStringA(lpstrCommand, lpstrReturnString: PAnsiChar;
  1805.   uReturnLength: UINT; hWndCallback: HWND): MCIERROR; stdcall;
  1806. function mciSendStringW(lpstrCommand, lpstrReturnString: PWideChar;
  1807.   uReturnLength: UINT; hWndCallback: HWND): MCIERROR; stdcall;
  1808. function mciSendString(lpstrCommand, lpstrReturnString: PChar;
  1809.   uReturnLength: UINT; hWndCallback: HWND): MCIERROR; stdcall;
  1810. function mciGetDeviceIDA(pszDevice: PAnsiChar): MCIDEVICEID; stdcall;
  1811. function mciGetDeviceIDW(pszDevice: PWideChar): MCIDEVICEID; stdcall;
  1812. function mciGetDeviceID(pszDevice: PChar): MCIDEVICEID; stdcall;
  1813. function mciGetDeviceIDFromElementIDA(dwElementID: DWORD; lpstrType: PAnsiChar): MCIDEVICEID; stdcall;
  1814. function mciGetDeviceIDFromElementIDW(dwElementID: DWORD; lpstrType: PWideChar): MCIDEVICEID; stdcall;
  1815. function mciGetDeviceIDFromElementID(dwElementID: DWORD; lpstrType: PChar): MCIDEVICEID; stdcall;
  1816. function mciGetErrorStringA(mcierr: MCIERROR; pszText: PAnsiChar; uLength: UINT): BOOL; stdcall;
  1817. function mciGetErrorStringW(mcierr: MCIERROR; pszText: PWideChar; uLength: UINT): BOOL; stdcall;
  1818. function mciGetErrorString(mcierr: MCIERROR; pszText: PChar; uLength: UINT): BOOL; stdcall;
  1819. function mciSetYieldProc(mcierr: MCIERROR; fpYieldProc: TFNYieldProc;
  1820.   dwYieldData: DWORD): BOOL; stdcall;
  1821. function mciGetCreatorTask(mcierr: MCIERROR): HTASK; stdcall;
  1822. function mciGetYieldProc(mcierr: MCIERROR; lpdwYieldData: PDWORD): TFNYieldProc; stdcall;
  1823. function mciExecute(pszCommand: LPCSTR): BOOL; stdcall;
  1824.  
  1825.  
  1826. { MCI error return values }
  1827. const
  1828.   MCIERR_INVALID_DEVICE_ID        = MCIERR_BASE + 1;
  1829.   MCIERR_UNRECOGNIZED_KEYWORD     = MCIERR_BASE + 3;
  1830.   MCIERR_UNRECOGNIZED_COMMAND     = MCIERR_BASE + 5;
  1831.   MCIERR_HARDWARE                 = MCIERR_BASE + 6;
  1832.   MCIERR_INVALID_DEVICE_NAME      = MCIERR_BASE + 7;
  1833.   MCIERR_OUT_OF_MEMORY            = MCIERR_BASE + 8;
  1834.   MCIERR_DEVICE_OPEN              = MCIERR_BASE + 9;
  1835.   MCIERR_CANNOT_LOAD_DRIVER       = MCIERR_BASE + 10;
  1836.   MCIERR_MISSING_COMMAND_STRING   = MCIERR_BASE + 11;
  1837.   MCIERR_PARAM_OVERFLOW           = MCIERR_BASE + 12;
  1838.   MCIERR_MISSING_STRING_ARGUMENT  = MCIERR_BASE + 13;
  1839.   MCIERR_BAD_INTEGER              = MCIERR_BASE + 14;
  1840.   MCIERR_PARSER_INTERNAL          = MCIERR_BASE + 15;
  1841.   MCIERR_DRIVER_INTERNAL          = MCIERR_BASE + 16;
  1842.   MCIERR_MISSING_PARAMETER        = MCIERR_BASE + 17;
  1843.   MCIERR_UNSUPPORTED_FUNCTION     = MCIERR_BASE + 18;
  1844.   MCIERR_FILE_NOT_FOUND           = MCIERR_BASE + 19;
  1845.   MCIERR_DEVICE_NOT_READY         = MCIERR_BASE + 20;
  1846.   MCIERR_INTERNAL                 = MCIERR_BASE + 21;
  1847.   MCIERR_DRIVER                   = MCIERR_BASE + 22;
  1848.   MCIERR_CANNOT_USE_ALL           = MCIERR_BASE + 23;
  1849.   MCIERR_MULTIPLE                 = MCIERR_BASE + 24;
  1850.   MCIERR_EXTENSION_NOT_FOUND      = MCIERR_BASE + 25;
  1851.   MCIERR_OUTOFRANGE               = MCIERR_BASE + 26;
  1852.   MCIERR_FLAGS_NOT_COMPATIBLE     = MCIERR_BASE + 28;
  1853.   MCIERR_FILE_NOT_SAVED           = MCIERR_BASE + 30;
  1854.   MCIERR_DEVICE_TYPE_REQUIRED     = MCIERR_BASE + 31;
  1855.   MCIERR_DEVICE_LOCKED            = MCIERR_BASE + 32;
  1856.   MCIERR_DUPLICATE_ALIAS          = MCIERR_BASE + 33;
  1857.   MCIERR_BAD_CONSTANT             = MCIERR_BASE + 34;
  1858.   MCIERR_MUST_USE_SHAREABLE       = MCIERR_BASE + 35;
  1859.   MCIERR_MISSING_DEVICE_NAME      = MCIERR_BASE + 36;
  1860.   MCIERR_BAD_TIME_FORMAT          = MCIERR_BASE + 37;
  1861.   MCIERR_NO_CLOSING_QUOTE         = MCIERR_BASE + 38;
  1862.   MCIERR_DUPLICATE_FLAGS          = MCIERR_BASE + 39;
  1863.   MCIERR_INVALID_FILE             = MCIERR_BASE + 40;
  1864.   MCIERR_NULL_PARAMETER_BLOCK     = MCIERR_BASE + 41;
  1865.   MCIERR_UNNAMED_RESOURCE         = MCIERR_BASE + 42;
  1866.   MCIERR_NEW_REQUIRES_ALIAS       = MCIERR_BASE + 43;
  1867.   MCIERR_NOTIFY_ON_AUTO_OPEN      = MCIERR_BASE + 44;
  1868.   MCIERR_NO_ELEMENT_ALLOWED       = MCIERR_BASE + 45;
  1869.   MCIERR_NONAPPLICABLE_FUNCTION   = MCIERR_BASE + 46;
  1870.   MCIERR_ILLEGAL_FOR_AUTO_OPEN    = MCIERR_BASE + 47;
  1871.   MCIERR_FILENAME_REQUIRED        = MCIERR_BASE + 48;
  1872.   MCIERR_EXTRA_CHARACTERS         = MCIERR_BASE + 49;
  1873.   MCIERR_DEVICE_NOT_INSTALLED     = MCIERR_BASE + 50;
  1874.   MCIERR_GET_CD                   = MCIERR_BASE + 51;
  1875.   MCIERR_SET_CD                   = MCIERR_BASE + 52;
  1876.   MCIERR_SET_DRIVE                = MCIERR_BASE + 53;
  1877.   MCIERR_DEVICE_LENGTH            = MCIERR_BASE + 54;
  1878.   MCIERR_DEVICE_ORD_LENGTH        = MCIERR_BASE + 55;
  1879.   MCIERR_NO_INTEGER               = MCIERR_BASE + 56;
  1880.  
  1881. const
  1882.   MCIERR_WAVE_OUTPUTSINUSE        = MCIERR_BASE + 64;
  1883.   MCIERR_WAVE_SETOUTPUTINUSE      = MCIERR_BASE + 65;
  1884.   MCIERR_WAVE_INPUTSINUSE         = MCIERR_BASE + 66;
  1885.   MCIERR_WAVE_SETINPUTINUSE       = MCIERR_BASE + 67;
  1886.   MCIERR_WAVE_OUTPUTUNSPECIFIED   = MCIERR_BASE + 68;
  1887.   MCIERR_WAVE_INPUTUNSPECIFIED    = MCIERR_BASE + 69;
  1888.   MCIERR_WAVE_OUTPUTSUNSUITABLE   = MCIERR_BASE + 70;
  1889.   MCIERR_WAVE_SETOUTPUTUNSUITABLE = MCIERR_BASE + 71;
  1890.   MCIERR_WAVE_INPUTSUNSUITABLE    = MCIERR_BASE + 72;
  1891.   MCIERR_WAVE_SETINPUTUNSUITABLE  = MCIERR_BASE + 73;
  1892.  
  1893.   MCIERR_SEQ_DIV_INCOMPATIBLE     = MCIERR_BASE + 80;
  1894.   MCIERR_SEQ_PORT_INUSE           = MCIERR_BASE + 81;
  1895.   MCIERR_SEQ_PORT_NONEXISTENT     = MCIERR_BASE + 82;
  1896.   MCIERR_SEQ_PORT_MAPNODEVICE     = MCIERR_BASE + 83;
  1897.   MCIERR_SEQ_PORT_MISCERROR       = MCIERR_BASE + 84;
  1898.   MCIERR_SEQ_TIMER                = MCIERR_BASE + 85;
  1899.   MCIERR_SEQ_PORTUNSPECIFIED      = MCIERR_BASE + 86;
  1900.   MCIERR_SEQ_NOMIDIPRESENT        = MCIERR_BASE + 87;
  1901.  
  1902.   MCIERR_NO_WINDOW                = MCIERR_BASE + 90;
  1903.   MCIERR_CREATEWINDOW             = MCIERR_BASE + 91;
  1904.   MCIERR_FILE_READ                = MCIERR_BASE + 92;
  1905.   MCIERR_FILE_WRITE               = MCIERR_BASE + 93;
  1906.  
  1907.   MCIERR_NO_IDENTITY              = MCIERR_BASE + 94;
  1908.  
  1909. { all custom device driver errors must be >= this value }
  1910. const
  1911.   MCIERR_CUSTOM_DRIVER_BASE       = mcierr_Base + 256;
  1912.  
  1913. { MCI command message identifiers }
  1914. const
  1915.   MCI_OPEN       = $0803;
  1916.   MCI_CLOSE      = $0804;
  1917.   MCI_ESCAPE     = $0805;
  1918.   MCI_PLAY       = $0806;
  1919.   MCI_SEEK       = $0807;
  1920.   MCI_STOP       = $0808;
  1921.   MCI_PAUSE      = $0809;
  1922.   MCI_INFO       = $080A;
  1923.   MCI_GETDEVCAPs = $080B;
  1924.   MCI_SPIN       = $080C;
  1925.   MCI_SET        = $080D;
  1926.   MCI_STEP       = $080E;
  1927.   MCI_RECORD     = $080F;
  1928.   MCI_SYSINFO    = $0810;
  1929.   MCI_BREAK      = $0811;
  1930.   MCI_SOUND      = $0812;
  1931.   MCI_SAVE       = $0813;
  1932.   MCI_STATUS     = $0814;
  1933.   MCI_CUE        = $0830;
  1934.   MCI_REALIZE    = $0840;
  1935.   MCI_WINDOW     = $0841;
  1936.   MCI_PUT        = $0842;
  1937.   MCI_WHERE      = $0843;
  1938.   MCI_FREEZE     = $0844;
  1939.   MCI_UNFREEZE   = $0845;
  1940.   MCI_LOAD       = $0850;
  1941.   MCI_CUT        = $0851;
  1942.   MCI_COPY       = $0852;
  1943.   MCI_PASTE      = $0853;
  1944.   MCI_UPDATE     = $0854;
  1945.   MCI_RESUME     = $0855;
  1946.   MCI_DELETE     = $0856;
  1947.  
  1948. { all custom MCI command messages must be >= this value }
  1949. const
  1950.   MCI_USER_MESSAGES               = $400 + drv_MCI_First;
  1951.   MCI_LAST                        = $0FFF;
  1952.  
  1953. { device ID for "all devices" }
  1954. const
  1955.   MCI_ALL_DEVICE_ID               = UINT(-1);
  1956.  
  1957. { constants for predefined MCI device types }
  1958. const
  1959.   MCI_DEVTYPE_VCR                 = MCI_STRING_OFFSET + 1;
  1960.   MCI_DEVTYPE_VIDEODISC           = MCI_STRING_OFFSET + 2;
  1961.   MCI_DEVTYPE_OVERLAY             = MCI_STRING_OFFSET + 3;
  1962.   MCI_DEVTYPE_CD_AUDIO            = MCI_STRING_OFFSET + 4;
  1963.   MCI_DEVTYPE_DAT                 = MCI_STRING_OFFSET + 5;
  1964.   MCI_DEVTYPE_SCANNER             = MCI_STRING_OFFSET + 6;
  1965.   MCI_DEVTYPE_ANIMATION           = MCI_STRING_OFFSET + 7;
  1966.   MCI_DEVTYPE_DIGITAL_VIDEO       = MCI_STRING_OFFSET + 8;
  1967.   MCI_DEVTYPE_OTHER               = MCI_STRING_OFFSET + 9;
  1968.   MCI_DEVTYPE_WAVEFORM_AUDIO      = MCI_STRING_OFFSET + 10;
  1969.   MCI_DEVTYPE_SEQUENCER           = MCI_STRING_OFFSET + 11;
  1970.  
  1971.   MCI_DEVTYPE_FIRST              = MCI_DEVTYPE_VCR;
  1972.   MCI_DEVTYPE_LAST               = MCI_DEVTYPE_SEQUENCER;
  1973.  
  1974.   MCI_DEVTYPE_FIRST_USER         = 1000;
  1975.  
  1976. { return values for 'status mode' command }
  1977. const
  1978.   MCI_MODE_NOT_READY              = MCI_STRING_OFFSET + 12;
  1979.   MCI_MODE_STOP                   = MCI_STRING_OFFSET + 13;
  1980.   MCI_MODE_PLAY                   = MCI_STRING_OFFSET + 14;
  1981.   MCI_MODE_RECORD                 = MCI_STRING_OFFSET + 15;
  1982.   MCI_MODE_SEEK                   = MCI_STRING_OFFSET + 16;
  1983.   MCI_MODE_PAUSE                  = MCI_STRING_OFFSET + 17;
  1984.   MCI_MODE_OPEN                   = MCI_STRING_OFFSET + 18;
  1985.  
  1986. { constants used in 'set time format' and 'status time format' commands }
  1987. const
  1988.   MCI_FORMAT_MILLISECONDS         = 0;
  1989.   MCI_FORMAT_HMS                  = 1;
  1990.   MCI_FORMAT_MSF                  = 2;
  1991.   MCI_FORMAT_FRAMES               = 3;
  1992.   MCI_FORMAT_SMPTE_24             = 4;
  1993.   MCI_FORMAT_SMPTE_25             = 5;
  1994.   MCI_FORMAT_SMPTE_30             = 6;
  1995.   MCI_FORMAT_SMPTE_30DROP         = 7;
  1996.   MCI_FORMAT_BYTES                = 8;
  1997.   MCI_FORMAT_SAMPLES              = 9;
  1998.   MCI_FORMAT_TMSF                 = 10;
  1999.  
  2000. { MCI time format conversion macros }
  2001.  
  2002. function mci_MSF_Minute(msf: Longint): Byte;
  2003. function mci_MSF_Second(msf: Longint): Byte;
  2004. function mci_MSF_Frame(msf: Longint): Byte;
  2005. function mci_Make_MSF(m, s, f: Byte): Longint;
  2006. function mci_TMSF_Track(tmsf: Longint): Byte;
  2007. function mci_TMSF_Minute(tmsf: Longint): Byte;
  2008. function mci_TMSF_Second(tmsf: Longint): Byte;
  2009. function mci_TMSF_Frame(tmsf: Longint): Byte;
  2010. function mci_Make_TMSF(t, m, s, f: Byte): Longint;
  2011. function mci_HMS_Hour(hms: Longint): Byte;
  2012. function mci_HMS_Minute(hms: Longint): Byte;
  2013. function mci_HMS_Second(hms: Longint): Byte;
  2014. function mci_Make_HMS(h, m, s: Byte): Longint;
  2015.  
  2016. { flags for wParam of MM_MCINOTIFY message }
  2017. const
  2018.   MCI_NOTIFY_SUCCESSFUL           = $0001;
  2019.   MCI_NOTIFY_SUPERSEDED           = $0002;
  2020.   MCI_NOTIFY_ABORTED              = $0004;
  2021.   MCI_NOTIFY_FAILURE              = $0008;
  2022.  
  2023. { common flags for dwFlags parameter of MCI command messages }
  2024. const
  2025.   MCI_NOTIFY                      = $00000001;
  2026.   MCI_WAIT                        = $00000002;
  2027.   MCI_FROM                        = $00000004;
  2028.   MCI_TO                          = $00000008;
  2029.   MCI_TRACK                       = $00000010;
  2030.  
  2031. { flags for dwFlags parameter of MCI_OPEN command message }
  2032. const
  2033.   MCI_OPEN_SHAREABLE              = $00000100;
  2034.   MCI_OPEN_ELEMENT                = $00000200;
  2035.   MCI_OPEN_ALIAS                  = $00000400;
  2036.   MCI_OPEN_ELEMENT_ID             = $00000800;
  2037.   MCI_OPEN_TYPE_ID                = $00001000;
  2038.   MCI_OPEN_TYPE                   = $00002000;
  2039.  
  2040. { flags for dwFlags parameter of MCI_SEEK command message }
  2041. const
  2042.   MCI_SEEK_TO_START               = $00000100;
  2043.   MCI_SEEK_TO_END                 = $00000200;
  2044.  
  2045. { flags for dwFlags parameter of MCI_STATUS command message }
  2046. const
  2047.   MCI_STATUS_ITEM                 = $00000100;
  2048.   MCI_STATUS_START                = $00000200;
  2049.  
  2050. { flags for dwItem field of the MCI_STATUS_PARMS parameter block }
  2051. const
  2052.   MCI_STATUS_LENGTH               = $00000001;
  2053.   MCI_STATUS_POSITION             = $00000002;
  2054.   MCI_STATUS_NUMBER_OF_TRACKS     = $00000003;
  2055.   MCI_STATUS_MODE                 = $00000004;
  2056.   MCI_STATUS_MEDIA_PRESENT        = $00000005;
  2057.   MCI_STATUS_TIME_FORMAT          = $00000006;
  2058.   MCI_STATUS_READY                = $00000007;
  2059.   MCI_STATUS_CURRENT_TRACK        = $00000008;
  2060.  
  2061. { flags for dwFlags parameter of MCI_INFO command message }
  2062. const
  2063.   MCI_INFO_PRODUCT                = $00000100;
  2064.   MCI_INFO_FILE                   = $00000200;
  2065.   MCI_INFO_MEDIA_UPC              = $00000400;
  2066.   MCI_INFO_MEDIA_IDENTITY         = $00000800;
  2067.   MCI_INFO_NAME                   = $00001000;
  2068.   MCI_INFO_COPYRIGHT              = $00002000;
  2069.  
  2070. { flags for dwFlags parameter of MCI_GETDEVCAPS command message }
  2071. const
  2072.   MCI_GETDEVCAPS_ITEM             = $00000100;
  2073.  
  2074. { flags for dwItem field of the MCI_GETDEVCAPS_PARMS parameter block }
  2075. const
  2076.   MCI_GETDEVCAPS_CAN_RECORD       = $00000001;
  2077.   MCI_GETDEVCAPS_HAS_AUDIO        = $00000002;
  2078.   MCI_GETDEVCAPS_HAS_VIDEO        = $00000003;
  2079.   MCI_GETDEVCAPS_DEVICE_TYPE      = $00000004;
  2080.   MCI_GETDEVCAPS_USES_FILES       = $00000005;
  2081.   MCI_GETDEVCAPS_COMPOUND_DEVICE  = $00000006;
  2082.   MCI_GETDEVCAPS_CAN_EJECT        = $00000007;
  2083.   MCI_GETDEVCAPS_CAN_PLAY         = $00000008;
  2084.   MCI_GETDEVCAPS_CAN_SAVE         = $00000009;
  2085.  
  2086. { flags for dwFlags parameter of MCI_SYSINFO command message }
  2087. const
  2088.   MCI_SYSINFO_QUANTITY            = $00000100;
  2089.   MCI_SYSINFO_OPEN                = $00000200;
  2090.   MCI_SYSINFO_NAME                = $00000400;
  2091.   MCI_SYSINFO_INSTALLNAME         = $00000800;
  2092.  
  2093. { flags for dwFlags parameter of MCI_SET command message }
  2094. const
  2095.   MCI_SET_DOOR_OPEN               = $00000100;
  2096.   MCI_SET_DOOR_CLOSED             = $00000200;
  2097.   MCI_SET_TIME_FORMAT             = $00000400;
  2098.   MCI_SET_AUDIO                   = $00000800;
  2099.   MCI_SET_VIDEO                   = $00001000;
  2100.   MCI_SET_ON                      = $00002000;
  2101.   MCI_SET_OFF                     = $00004000;
  2102.  
  2103. { flags for dwAudio field of MCI_SET_PARMS or MCI_SEQ_SET_PARMS }
  2104. const
  2105.   MCI_SET_AUDIO_ALL               = $00000000;
  2106.   MCI_SET_AUDIO_LEFT              = $00000001;
  2107.   MCI_SET_AUDIO_RIGHT             = $00000002;
  2108.  
  2109. { flags for dwFlags parameter of MCI_BREAK command message }
  2110. const
  2111.   MCI_BREAK_KEY                   = $00000100;
  2112.   MCI_BREAK_HWND                  = $00000200;
  2113.   MCI_BREAK_OFF                   = $00000400;
  2114.  
  2115. { flags for dwFlags parameter of MCI_RECORD command message }
  2116. const
  2117.   MCI_RECORD_INSERT               = $00000100;
  2118.   MCI_RECORD_OVERWRITE            = $00000200;
  2119.  
  2120. { flags for dwFlags parameter of MCI_SOUND command message }
  2121. const
  2122.   MCI_SOUND_NAME                  = $00000100;
  2123.  
  2124. { flags for dwFlags parameter of MCI_SAVE command message }
  2125. const
  2126.   MCI_SAVE_FILE                   = $00000100;
  2127.  
  2128. { flags for dwFlags parameter of MCI_LOAD command message }
  2129. const
  2130.   MCI_LOAD_FILE                   = $00000100;
  2131.  
  2132. { generic parameter block for MCI command messages with no special parameters }
  2133. type
  2134.   PMCI_Generic_Parms = ^TMCI_Generic_Parms;
  2135.   TMCI_Generic_Parms = record
  2136.     dwCallback: DWORD;
  2137.   end;
  2138.  
  2139. { parameter block for MCI_OPEN command message }
  2140. type
  2141.   PMCI_Open_ParmsA = ^TMCI_Open_ParmsA;
  2142.   PMCI_Open_ParmsW = ^TMCI_Open_ParmsW;
  2143.   PMCI_Open_Parms = PMCI_Open_ParmsA;
  2144.   TMCI_Open_ParmsA = record
  2145.     dwCallback: DWORD;
  2146.     wDeviceID: MCIDEVICEID;
  2147.     lpstrDeviceType: PAnsiChar;
  2148.     lpstrElementName: PAnsiChar;
  2149.     lpstrAlias: PAnsiChar;
  2150.   end;
  2151.   TMCI_Open_ParmsW = record
  2152.     dwCallback: DWORD;
  2153.     wDeviceID: MCIDEVICEID;
  2154.     lpstrDeviceType: PWideChar;
  2155.     lpstrElementName: PWideChar;
  2156.     lpstrAlias: PWideChar;
  2157.   end;
  2158.   TMCI_Open_Parms = TMCI_Open_ParmsA;
  2159.  
  2160. { parameter block for MCI_PLAY command message }
  2161. type
  2162.   PMCI_Play_Parms = ^TMCI_Play_Parms;
  2163.   TMCI_Play_Parms = record
  2164.     dwCallback: DWORD;
  2165.     dwFrom: DWORD;
  2166.     dwTo: DWORD;
  2167.   end;
  2168.  
  2169. { parameter block for MCI_SEEK command message }
  2170. type
  2171.   PMCI_Seek_Parms = ^TMCI_Seek_Parms;
  2172.   TMCI_Seek_Parms = record
  2173.     dwCallback: DWORD;
  2174.     dwTo: DWORD;
  2175.   end;
  2176.  
  2177.  
  2178. { parameter block for MCI_STATUS command message }
  2179. type
  2180.   PMCI_Status_Parms = ^TMCI_Status_Parms;
  2181.   TMCI_Status_Parms = record
  2182.     dwCallback: DWORD;
  2183.     dwReturn: DWORD;
  2184.     dwItem: DWORD;
  2185.     dwTrack: DWORD;
  2186.   end;
  2187.  
  2188. { parameter block for MCI_INFO command message }
  2189. type
  2190.   PMCI_Info_ParmsA = ^TMCI_Info_ParmsA;
  2191.   PMCI_Info_ParmsW = ^TMCI_Info_ParmsW;
  2192.   PMCI_Info_Parms = PMCI_Info_ParmsA;
  2193.   TMCI_Info_ParmsA = record
  2194.     dwCallback: DWORD;
  2195.     lpstrReturn: PAnsiChar;
  2196.     dwRetSize: DWORD;
  2197.   end;
  2198.   TMCI_Info_ParmsW = record
  2199.     dwCallback: DWORD;
  2200.     lpstrReturn: PWideChar;
  2201.     dwRetSize: DWORD;
  2202.   end;
  2203.   TMCI_Info_Parms = TMCI_Info_ParmsA;
  2204.  
  2205. { parameter block for MCI_GETDEVCAPS command message }
  2206. type
  2207.   PMCI_GetDevCaps_Parms = ^TMCI_GetDevCaps_Parms;
  2208.   TMCI_GetDevCaps_Parms = record
  2209.     dwCallback: DWORD;
  2210.     dwReturn: DWORD;
  2211.     dwItem: DWORD;
  2212.   end;
  2213.  
  2214. { parameter block for MCI_SYSINFO command message }
  2215. type
  2216.   PMCI_SysInfo_ParmsA = ^TMCI_SysInfo_ParmsA;
  2217.   PMCI_SysInfo_ParmsW = ^TMCI_SysInfo_ParmsW;
  2218.   PMCI_SysInfo_Parms = PMCI_SysInfo_ParmsA;
  2219.   TMCI_SysInfo_ParmsA = record
  2220.     dwCallback: DWORD;
  2221.     lpstrReturn: PAnsiChar;
  2222.     dwRetSize: DWORD;
  2223.     dwNumber: DWORD;
  2224.     wDeviceType: UINT;
  2225.   end;
  2226.   TMCI_SysInfo_ParmsW = record
  2227.     dwCallback: DWORD;
  2228.     lpstrReturn: PWideChar;
  2229.     dwRetSize: DWORD;
  2230.     dwNumber: DWORD;
  2231.     wDeviceType: UINT;
  2232.   end;
  2233.   TMCI_SysInfo_Parms = TMCI_SysInfo_ParmsA;
  2234.  
  2235. { parameter block for MCI_SET command message }
  2236. type
  2237.   PMCI_Set_Parms = ^TMCI_Set_Parms;
  2238.   TMCI_Set_Parms = record
  2239.     dwCallback: DWORD;
  2240.     dwTimeFormat: DWORD;
  2241.     dwAudio: DWORD;
  2242.   end;
  2243.  
  2244.  
  2245. { parameter block for MCI_BREAK command message }
  2246. type
  2247.   PMCI_Break_Parms = ^TMCI_BReak_Parms;
  2248.   TMCI_BReak_Parms = record
  2249.     dwCallback: DWORD;
  2250.     nVirtKey: Integer;
  2251.     hWndBreak: HWND;
  2252.   end;
  2253.  
  2254. { parameter block for MCI_SOUND command message }
  2255. type
  2256.   PMCI_Sound_Parms = ^TMCI_Sound_Parms;
  2257.   TMCI_Sound_Parms = record
  2258.     dwCallback: Longint;
  2259.     lpstrSoundName: PChar;
  2260.   end;
  2261.  
  2262. { parameter block for MCI_SAVE command message }
  2263. type
  2264.   PMCI_Save_ParmsA = ^TMCI_SaveParmsA;
  2265.   PMCI_Save_ParmsW = ^TMCI_SaveParmsW;
  2266.   PMCI_Save_Parms = PMCI_Save_ParmsA;
  2267.   TMCI_SaveParmsA = record
  2268.     dwCallback: DWORD;
  2269.     lpfilename: PAnsiChar;
  2270.   end;
  2271.   TMCI_SaveParmsW = record
  2272.     dwCallback: DWORD;
  2273.     lpfilename: PWideChar;
  2274.   end;
  2275.   TMCI_SaveParms = TMCI_SaveParmsA;
  2276.  
  2277. { parameter block for MCI_LOAD command message }
  2278. type
  2279.   PMCI_Load_ParmsA = ^TMCI_Load_ParmsA;
  2280.   PMCI_Load_ParmsW = ^TMCI_Load_ParmsW;
  2281.   PMCI_Load_Parms = PMCI_Load_ParmsA;
  2282.   TMCI_Load_ParmsA = record
  2283.     dwCallback: DWORD;
  2284.     lpfilename: PAnsiChar;
  2285.   end;
  2286.   TMCI_Load_ParmsW = record
  2287.     dwCallback: DWORD;
  2288.     lpfilename: PWideChar;
  2289.   end;
  2290.   TMCI_Load_Parms = TMCI_Load_ParmsA;
  2291.  
  2292. { parameter block for MCI_RECORD command message }
  2293. type
  2294.   PMCI_Record_Parms = ^TMCI_Record_Parms;
  2295.   TMCI_Record_Parms = record
  2296.     dwCallback: DWORD;
  2297.     dwFrom: DWORD;
  2298.     dwTo: DWORD;
  2299.   end;
  2300.  
  2301.  
  2302. { MCI extensions for videodisc devices }
  2303.  
  2304. { flag for dwReturn field of MCI_STATUS_PARMS }
  2305. { MCI_STATUS command, (dwItem == MCI_STATUS_MODE) }
  2306. const
  2307.   MCI_VD_MODE_PARK                = MCI_VD_OFFSET + 1;
  2308.  
  2309. { flag for dwReturn field of MCI_STATUS_PARMS }
  2310. { MCI_STATUS command, (dwItem == MCI_VD_STATUS_MEDIA_TYPE) }
  2311. const
  2312.   MCI_VD_MEDIA_CLV                = MCI_VD_OFFSET + 2;
  2313.   MCI_VD_MEDIA_CAV                = MCI_VD_OFFSET + 3;
  2314.   MCI_VD_MEDIA_OTHER              = MCI_VD_OFFSET + 4;
  2315.  
  2316. const
  2317.   MCI_VD_FORMAT_TRACK             = $4001;
  2318.  
  2319. { flags for dwFlags parameter of MCI_PLAY command message }
  2320. const
  2321.   MCI_VD_PLAY_REVERSE             = $00010000;
  2322.   MCI_VD_PLAY_FAST                = $00020000;
  2323.   MCI_VD_PLAY_SPEED               = $00040000;
  2324.   MCI_VD_PLAY_SCAN                = $00080000;
  2325.   MCI_VD_PLAY_SLOW                = $00100000;
  2326.  
  2327. { flag for dwFlags parameter of MCI_SEEK command message }
  2328. const
  2329.   MCI_VD_SEEK_REVERSE             = $00010000;
  2330.  
  2331. { flags for dwItem field of MCI_STATUS_PARMS parameter block }
  2332. const
  2333.   MCI_VD_STATUS_SPEED             = $00004002;
  2334.   MCI_VD_STATUS_FORWARD           = $00004003;
  2335.   MCI_VD_STATUS_MEDIA_TYPE        = $00004004;
  2336.   MCI_VD_STATUS_SIDE              = $00004005;
  2337.   MCI_VD_STATUS_DISC_SIZE         = $00004006;
  2338.  
  2339. { flags for dwFlags parameter of MCI_GETDEVCAPS command message }
  2340. const
  2341.   MCI_VD_GETDEVCAPS_CLV           = $00010000;
  2342.   MCI_VD_GETDEVCAPS_CAV           = $00020000;
  2343.  
  2344.   MCI_VD_SPIN_UP                  = $00010000;
  2345.   MCI_VD_SPIN_DOWN                = $00020000;
  2346.  
  2347. { flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block }
  2348. const
  2349.   MCI_VD_GETDEVCAPS_CAN_REVERSE   = $00004002;
  2350.   MCI_VD_GETDEVCAPS_FAST_RATE     = $00004003;
  2351.   MCI_VD_GETDEVCAPS_SLOW_RATE     = $00004004;
  2352.   MCI_VD_GETDEVCAPS_NORMAL_RATE   = $00004005;
  2353.  
  2354. { flags for the dwFlags parameter of MCI_STEP command message }
  2355. const
  2356.   MCI_VD_STEP_FRAMES              = $00010000;
  2357.   MCI_VD_STEP_REVERSE             = $00020000;
  2358.  
  2359. { flag for the MCI_ESCAPE command message }
  2360. const
  2361.   MCI_VD_ESCAPE_STRING            = $00000100;
  2362.  
  2363. { parameter block for MCI_PLAY command message }
  2364. type
  2365.   PMCI_VD_Play_Parms = ^TMCI_VD_Play_Parms;
  2366.   TMCI_VD_Play_Parms = record
  2367.     dwCallback: DWORD;
  2368.     dwFrom: DWORD;
  2369.     dwTo: DWORD;
  2370.     dwSpeed: DWORD;
  2371.   end;
  2372.  
  2373. { parameter block for MCI_STEP command message }
  2374. type
  2375.   PMCI_VD_Step_Parms = ^TMCI_VD_Step_Parms;
  2376.   TMCI_VD_Step_Parms = record
  2377.     dwCallback: DWORD;
  2378.     dwFrames: DWORD;
  2379.   end;
  2380.  
  2381. { parameter block for MCI_ESCAPE command message }
  2382. type
  2383.   PMCI_VD_Escape_ParmsA = ^TMCI_VD_Escape_ParmsA;
  2384.   PMCI_VD_Escape_ParmsW = ^TMCI_VD_Escape_ParmsW;
  2385.   PMCI_VD_Escape_Parms = PMCI_VD_Escape_ParmsA;
  2386.   TMCI_VD_Escape_ParmsA = record
  2387.     dwCallback: DWORD;
  2388.     lpstrCommand: PAnsiChar;
  2389.   end;
  2390.   TMCI_VD_Escape_ParmsW = record
  2391.     dwCallback: DWORD;
  2392.     lpstrCommand: PWideChar;
  2393.   end;
  2394.   TMCI_VD_Escape_Parms = TMCI_VD_Escape_ParmsA;
  2395.  
  2396. { MCI extensions for CD audio devices }
  2397.  
  2398. { flags for the dwItem field of the MCI_STATUS_PARMS parameter block }
  2399. const
  2400.   MCI_CDA_STATUS_TYPE_TRACK       = 00004001;
  2401.  
  2402. { flags for the dwReturn field of MCI_STATUS_PARMS parameter block }
  2403. { MCI_STATUS command, (dwItem == MCI_CDA_STATUS_TYPE_TRACK) }
  2404.   MCI_CDA_TRACK_AUDIO             = MCI_CD_OFFSET + 0;
  2405.   MCI_CDA_TRACK_OTHER             = MCI_CD_OFFSET + 1;
  2406.  
  2407. { MCI extensions for waveform audio devices }
  2408.   MCI_WAVE_PCM                    = MCI_WAVE_OFFSET + 0;
  2409.   MCI_WAVE_MAPPER                 = MCI_WAVE_OFFSET + 1;
  2410.  
  2411. { flags for the dwFlags parameter of MCI_OPEN command message }
  2412. const
  2413.   MCI_WAVE_OPEN_BUFFER            = $00010000;
  2414.  
  2415. { flags for the dwFlags parameter of MCI_SET command message }
  2416. const
  2417.   MCI_WAVE_SET_FORMATTAG          = $00010000;
  2418.   MCI_WAVE_SET_CHANNELS           = $00020000;
  2419.   MCI_WAVE_SET_SAMPLESPERSEC      = $00040000;
  2420.   MCI_WAVE_SET_AVGBYTESPERSEC     = $00080000;
  2421.   MCI_WAVE_SET_BLOCKALIGN         = $00100000;
  2422.   MCI_WAVE_SET_BITSPERSAMPLE      = $00200000;
  2423.  
  2424. { flags for the dwFlags parameter of MCI_STATUS, MCI_SET command messages }
  2425. const
  2426.   MCI_WAVE_INPUT                  = $00400000;
  2427.   MCI_WAVE_OUTPUT                 = $00800000;
  2428.  
  2429. { flags for the dwItem field of MCI_STATUS_PARMS parameter block }
  2430. const
  2431.   MCI_WAVE_STATUS_FORMATTAG       = $00004001;
  2432.   MCI_WAVE_STATUS_CHANNELS        = $00004002;
  2433.   MCI_WAVE_STATUS_SAMPLESPERSEC   = $00004003;
  2434.   MCI_WAVE_STATUS_AVGBYTESPERSEC  = $00004004;
  2435.   MCI_WAVE_STATUS_BLOCKALIGN      = $00004005;
  2436.   MCI_WAVE_STATUS_BITSPERSAMPLE   = $00004006;
  2437.   MCI_WAVE_STATUS_LEVEL           = $00004007;
  2438.  
  2439. { flags for the dwFlags parameter of MCI_SET command message }
  2440. const
  2441.   MCI_WAVE_SET_ANYINPUT           = $04000000;
  2442.   MCI_WAVE_SET_ANYOUTPUT          = $08000000;
  2443.  
  2444. { flags for the dwFlags parameter of MCI_GETDEVCAPS command message }
  2445. const
  2446.   MCI_WAVE_GETDEVCAPS_INPUTS      = $00004001;
  2447.   MCI_WAVE_GETDEVCAPS_OUTPUTS     = $00004002;
  2448.  
  2449. { parameter block for MCI_OPEN command message }
  2450. type
  2451.   PMCI_Wave_Open_ParmsA = ^TMCI_Wave_Open_ParmsA;
  2452.   PMCI_Wave_Open_ParmsW = ^TMCI_Wave_Open_ParmsW;
  2453.   PMCI_Wave_Open_Parms = PMCI_Wave_Open_ParmsA;
  2454.   TMCI_Wave_Open_ParmsA = record
  2455.     dwCallback: DWORD;
  2456.     wDeviceID: MCIDEVICEID;
  2457.     lpstrDeviceType: PAnsiChar;
  2458.     lpstrElementName: PAnsiChar;
  2459.     lpstrAlias: PAnsiChar;
  2460.     dwBufferSeconds: DWORD;
  2461.   end;
  2462.   TMCI_Wave_Open_ParmsW = record
  2463.     dwCallback: DWORD;
  2464.     wDeviceID: MCIDEVICEID;
  2465.     lpstrDeviceType: PWideChar;
  2466.     lpstrElementName: PWideChar;
  2467.     lpstrAlias: PWideChar;
  2468.     dwBufferSeconds: DWORD;
  2469.   end;
  2470.   TMCI_Wave_Open_Parms = TMCI_Wave_Open_ParmsA;
  2471.  
  2472. { parameter block for MCI_DELETE command message }
  2473. type
  2474.   PMCI_Wave_Delete_Parms = ^TMCI_Wave_Delete_Parms;
  2475.   TMCI_Wave_Delete_Parms = record
  2476.     dwCallback: DWORD;
  2477.     dwFrom: DWORD;
  2478.     dwTo: DWORD;
  2479.   end;
  2480.  
  2481. { parameter block for MCI_SET command message }
  2482. type
  2483.   PMCI_Wave_Set_Parms = ^TMCI_Wave_Set_Parms;
  2484.   TMCI_Wave_Set_Parms = record
  2485.     dwCallback: DWORD;
  2486.     dwTimeFormat: DWORD;
  2487.     dwAudio: DWORD;
  2488.     wInput: UINT;
  2489.     wOutput: UINT;
  2490.     wFormatTag: Word;
  2491.     wReserved2: Word;
  2492.     nChannels: Word;
  2493.     wReserved3: Word;
  2494.     nSamplesPerSec: DWORD;
  2495.     nAvgBytesPerSec: DWORD;
  2496.     nBlockAlign: Word;
  2497.     wReserved4: Word;
  2498.     wBitsPerSample: Word;
  2499.     wReserved5: Word;
  2500.   end;
  2501.  
  2502.  
  2503. { MCI extensions for MIDI sequencer devices }
  2504.  
  2505. { flags for the dwReturn field of MCI_STATUS_PARMS parameter block }
  2506. { MCI_STATUS command, (dwItem == MCI_SEQ_STATUS_DIVTYPE) }
  2507. const
  2508.   MCI_SEQ_DIV_PPQN            = 0 + MCI_SEQ_OFFSET;
  2509.   MCI_SEQ_DIV_SMPTE_24        = 1 + MCI_SEQ_OFFSET;
  2510.   MCI_SEQ_DIV_SMPTE_25        = 2 + MCI_SEQ_OFFSET;
  2511.   MCI_SEQ_DIV_SMPTE_30DROP    = 3 + MCI_SEQ_OFFSET;
  2512.   MCI_SEQ_DIV_SMPTE_30        = 4 + MCI_SEQ_OFFSET;
  2513.  
  2514. { flags for the dwMaster field of MCI_SEQ_SET_PARMS parameter block }
  2515. { MCI_SET command, (dwFlags == MCI_SEQ_SET_MASTER) }
  2516. const
  2517.   MCI_SEQ_FORMAT_SONGPTR      = $4001;
  2518.   MCI_SEQ_FILE                = $4002;
  2519.   MCI_SEQ_MIDI                = $4003;
  2520.   MCI_SEQ_SMPTE               = $4004;
  2521.   MCI_SEQ_NONE                = 65533;
  2522.   MCI_SEQ_MAPPER              = 65535;
  2523.  
  2524. { flags for the dwItem field of MCI_STATUS_PARMS parameter block }
  2525. const
  2526.   MCI_SEQ_STATUS_TEMPO            = $00004002;
  2527.   MCI_SEQ_STATUS_PORT             = $00004003;
  2528.   MCI_SEQ_STATUS_SLAVE            = $00004007;
  2529.   MCI_SEQ_STATUS_MASTER           = $00004008;
  2530.   MCI_SEQ_STATUS_OFFSET           = $00004009;
  2531.   MCI_SEQ_STATUS_DIVTYPE          = $0000400A;
  2532.   MCI_SEQ_STATUS_NAME             = $0000400B;
  2533.   MCI_SEQ_STATUS_COPYRIGHT        = $0000400C;
  2534.  
  2535. { flags for the dwFlags parameter of MCI_SET command message }
  2536. const
  2537.   MCI_SEQ_SET_TEMPO               = $00010000;
  2538.   MCI_SEQ_SET_PORT                = $00020000;
  2539.   MCI_SEQ_SET_SLAVE               = $00040000;
  2540.   MCI_SEQ_SET_MASTER              = $00080000;
  2541.   MCI_SEQ_SET_OFFSET              = $01000000;
  2542.  
  2543. { parameter block for MCI_SET command message }
  2544. type
  2545.   PMCI_Seq_Set_Parms = ^TMCI_Seq_Set_Parms;
  2546.   TMCI_Seq_Set_Parms = record
  2547.     dwCallback: DWORD;
  2548.     dwTimeFormat: DWORD;
  2549.     dwAudio: DWORD;
  2550.     dwTempo: DWORD;
  2551.     dwPort: DWORD;
  2552.     dwSlave: DWORD;
  2553.     dwMaster: DWORD;
  2554.     dwOffset: DWORD;
  2555.   end;
  2556.  
  2557. { MCI extensions for animation devices }
  2558.  
  2559. { flags for dwFlags parameter of MCI_OPEN command message }
  2560. const
  2561.   MCI_ANIM_OPEN_WS                = $00010000;
  2562.   MCI_ANIM_OPEN_PARENT            = $00020000;
  2563.   MCI_ANIM_OPEN_NOSTATIC          = $00040000;
  2564.  
  2565. { flags for dwFlags parameter of MCI_PLAY command message }
  2566. const
  2567.   MCI_ANIM_PLAY_SPEED             = $00010000;
  2568.   MCI_ANIM_PLAY_REVERSE           = $00020000;
  2569.   MCI_ANIM_PLAY_FAST              = $00040000;
  2570.   MCI_ANIM_PLAY_SLOW              = $00080000;
  2571.   MCI_ANIM_PLAY_SCAN              = $00100000;
  2572.  
  2573. { flags for dwFlags parameter of MCI_STEP command message }
  2574. const
  2575.   MCI_ANIM_STEP_REVERSE           = $00010000;
  2576.   MCI_ANIM_STEP_FRAMES            = $00020000;
  2577.  
  2578. { flags for dwItem field of MCI_STATUS_PARMS parameter block }
  2579. const
  2580.   MCI_ANIM_STATUS_SPEED           = $00004001;
  2581.   MCI_ANIM_STATUS_FORWARD         = $00004002;
  2582.   MCI_ANIM_STATUS_HWND            = $00004003;
  2583.   MCI_ANIM_STATUS_HPAL            = $00004004;
  2584.   MCI_ANIM_STATUS_STRETCH         = $00004005;
  2585.  
  2586. { flags for the dwFlags parameter of MCI_INFO command message }
  2587. const
  2588.   MCI_ANIM_INFO_TEXT              = $00010000;
  2589.  
  2590. { flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block }
  2591. const
  2592.   MCI_ANIM_GETDEVCAPS_CAN_REVERSE = $00004001;
  2593.   MCI_ANIM_GETDEVCAPS_FAST_RATE   = $00004002;
  2594.   MCI_ANIM_GETDEVCAPS_SLOW_RATE   = $00004003;
  2595.   MCI_ANIM_GETDEVCAPS_NORMAL_RATE = $00004004;
  2596.   MCI_ANIM_GETDEVCAPS_PALETTES    = $00004006;
  2597.   MCI_ANIM_GETDEVCAPS_CAN_STRETCH = $00004007;
  2598.   MCI_ANIM_GETDEVCAPS_MAX_WINDOWS = $00004008;
  2599.  
  2600. { flags for the MCI_REALIZE command message }
  2601. const
  2602.   MCI_ANIM_REALIZE_NORM           = $00010000;
  2603.   MCI_ANIM_REALIZE_BKGD           = $00020000;
  2604.  
  2605. { flags for dwFlags parameter of MCI_WINDOW command message }
  2606. const
  2607.   MCI_ANIM_WINDOW_HWND            = $00010000;
  2608.   MCI_ANIM_WINDOW_STATE           = $00040000;
  2609.   MCI_ANIM_WINDOW_TEXT            = $00080000;
  2610.   MCI_ANIM_WINDOW_ENABLE_STRETCH  = $00100000;
  2611.   MCI_ANIM_WINDOW_DISABLE_STRETCH = $00200000;
  2612.  
  2613. { flags for hWnd field of MCI_ANIM_WINDOW_PARMS parameter block }
  2614. { MCI_WINDOW command message, (dwFlags == MCI_ANIM_WINDOW_HWND) }
  2615. const
  2616.   MCI_ANIM_WINDOW_DEFAULT         = $00000000;
  2617.  
  2618. { flags for dwFlags parameter of MCI_PUT command message }
  2619. const
  2620.   MCI_ANIM_RECT                   = $00010000;
  2621.   MCI_ANIM_PUT_SOURCE             = $00020000;
  2622.   MCI_ANIM_PUT_DESTINATION        = $00040000;
  2623.  
  2624. { flags for dwFlags parameter of MCI_WHERE command message }
  2625. const
  2626.   MCI_ANIM_WHERE_SOURCE           = $00020000;
  2627.   MCI_ANIM_WHERE_DESTINATION      = $00040000;
  2628.  
  2629. { flags for dwFlags parameter of MCI_UPDATE command message }
  2630. const
  2631.   MCI_ANIM_UPDATE_HDC             = $00020000;
  2632.  
  2633. { parameter block for MCI_OPEN command message }
  2634. type
  2635.   PMCI_Anim_Open_ParmsA = ^TMCI_Anim_Open_ParmsA;
  2636.   PMCI_Anim_Open_ParmsW = ^TMCI_Anim_Open_ParmsW;
  2637.   PMCI_Anim_Open_Parms = PMCI_Anim_Open_ParmsA;
  2638.   TMCI_Anim_Open_ParmsA = record
  2639.     dwCallback: DWORD;
  2640.     wDeviceID: MCIDEVICEID;
  2641.     lpstrDeviceType: PAnsiChar;
  2642.     lpstrElementName: PAnsiChar;
  2643.     lpstrAlias: PAnsiChar;
  2644.     dwStyle: DWORD;
  2645.     hWndParent: HWND;
  2646.   end;
  2647.   TMCI_Anim_Open_ParmsW = record
  2648.     dwCallback: DWORD;
  2649.     wDeviceID: MCIDEVICEID;
  2650.     lpstrDeviceType: PWideChar;
  2651.     lpstrElementName: PWideChar;
  2652.     lpstrAlias: PWideChar;
  2653.     dwStyle: DWORD;
  2654.     hWndParent: HWND;
  2655.   end;
  2656.   TMCI_Anim_Open_Parms = TMCI_Anim_Open_ParmsA;
  2657.  
  2658. { parameter block for MCI_PLAY command message }
  2659. type
  2660.   PMCI_Anim_Play_Parms = ^TMCI_Anim_Play_Parms;
  2661.   TMCI_Anim_Play_Parms = record
  2662.     dwCallback: DWORD;
  2663.     dwFrom: DWORD;
  2664.     dwTo: DWORD;
  2665.     dwSpeed: DWORD;
  2666.   end;
  2667.  
  2668. { parameter block for MCI_STEP command message }
  2669. type
  2670.   PMCI_Anim_Step_Parms = ^TMCI_Anim_Step_Parms;
  2671.   TMCI_Anim_Step_Parms = record
  2672.     dwCallback: DWORD;
  2673.     dwFrames: DWORD;
  2674.   end;
  2675.  
  2676. { parameter block for MCI_WINDOW command message }
  2677. type
  2678.   PMCI_Anim_Window_ParmsA = ^TMCI_Anim_Window_ParmsA;
  2679.   PMCI_Anim_Window_ParmsW = ^TMCI_Anim_Window_ParmsW;
  2680.   PMCI_Anim_Window_Parms = PMCI_Anim_Window_ParmsA;
  2681.   TMCI_Anim_Window_ParmsA = record
  2682.     dwCallback: DWORD;
  2683.     Wnd: HWND;  { formerly "hWnd" }
  2684.     nCmdShow: UINT;
  2685.     lpstrText: PAnsiChar;
  2686.   end;
  2687.   TMCI_Anim_Window_ParmsW = record
  2688.     dwCallback: DWORD;
  2689.     Wnd: HWND;  { formerly "hWnd" }
  2690.     nCmdShow: UINT;
  2691.     lpstrText: PWideChar;
  2692.   end;
  2693.   TMCI_Anim_Window_Parms = TMCI_Anim_Window_ParmsA;
  2694.  
  2695. { parameter block for MCI_PUT, MCI_UPDATE, MCI_WHERE command messages }
  2696. type
  2697.   PMCI_Anim_Rect_Parms = ^ TMCI_Anim_Rect_Parms;
  2698.   TMCI_Anim_Rect_Parms = record
  2699.     dwCallback: DWORD;
  2700.     rc: TRect;
  2701.   end;
  2702.  
  2703. { parameter block for MCI_UPDATE PARMS }
  2704. type
  2705.   PMCI_Anim_Update_Parms = ^TMCI_Anim_Update_Parms;
  2706.   TMCI_Anim_Update_Parms = record
  2707.     dwCallback: DWORD;
  2708.     rc: TRect;
  2709.     hDC: HDC;
  2710.   end;
  2711.  
  2712. { MCI extensions for video overlay devices }
  2713.  
  2714. { flags for dwFlags parameter of MCI_OPEN command message }
  2715. const
  2716.   MCI_OVLY_OPEN_WS                = $00010000;
  2717.   MCI_OVLY_OPEN_PARENT            = $00020000;
  2718.  
  2719. { flags for dwFlags parameter of MCI_STATUS command message }
  2720. const
  2721.   MCI_OVLY_STATUS_HWND            = $00004001;
  2722.   MCI_OVLY_STATUS_STRETCH         = $00004002;
  2723.  
  2724. { flags for dwFlags parameter of MCI_INFO command message }
  2725. const
  2726.   MCI_OVLY_INFO_TEXT              = $00010000;
  2727.  
  2728. { flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block }
  2729. const
  2730.   MCI_OVLY_GETDEVCAPS_CAN_STRETCH = $00004001;
  2731.   MCI_OVLY_GETDEVCAPS_CAN_FREEZE  = $00004002;
  2732.   MCI_OVLY_GETDEVCAPS_MAX_WINDOWS = $00004003;
  2733.  
  2734. { flags for dwFlags parameter of MCI_WINDOW command message }
  2735. const
  2736.   MCI_OVLY_WINDOW_HWND            = $00010000;
  2737.   MCI_OVLY_WINDOW_STATE           = $00040000;
  2738.   MCI_OVLY_WINDOW_TEXT            = $00080000;
  2739.   MCI_OVLY_WINDOW_ENABLE_STRETCH  = $00100000;
  2740.   MCI_OVLY_WINDOW_DISABLE_STRETCH = $00200000;
  2741.  
  2742. { flags for hWnd parameter of MCI_OVLY_WINDOW_PARMS parameter block }
  2743. const
  2744.   MCI_OVLY_WINDOW_DEFAULT         = $00000000;
  2745.  
  2746. { flags for dwFlags parameter of MCI_PUT command message }
  2747. const
  2748.   MCI_OVLY_RECT                   = $00010000;
  2749.   MCI_OVLY_PUT_SOURCE             = $00020000;
  2750.   MCI_OVLY_PUT_DESTINATION        = $00040000;
  2751.   MCI_OVLY_PUT_FRAME              = $00080000;
  2752.   MCI_OVLY_PUT_VIDEO              = $00100000;
  2753.  
  2754. { flags for dwFlags parameter of MCI_WHERE command message }
  2755. const
  2756.   MCI_OVLY_WHERE_SOURCE           = $00020000;
  2757.   MCI_OVLY_WHERE_DESTINATION      = $00040000;
  2758.   MCI_OVLY_WHERE_FRAME            = $00080000;
  2759.   MCI_OVLY_WHERE_VIDEO            = $00100000;
  2760.  
  2761. { parameter block for MCI_OPEN command message }
  2762. type
  2763.   PMCI_Ovly_Open_ParmsA = ^TMCI_Ovly_Open_ParmsA;
  2764.   PMCI_Ovly_Open_ParmsW = ^TMCI_Ovly_Open_ParmsW;
  2765.   PMCI_Ovly_Open_Parms = PMCI_Ovly_Open_ParmsA;
  2766.   TMCI_Ovly_Open_ParmsA = record
  2767.     dwCallback: DWORD;
  2768.     wDeviceID: MCIDEVICEID;
  2769.     lpstrDeviceType: PAnsiChar;
  2770.     lpstrElementName: PAnsiChar;
  2771.     lpstrAlias: PAnsiChar;
  2772.     dwStyle: DWORD;
  2773.     hWndParent: HWND;
  2774.   end;
  2775.   TMCI_Ovly_Open_ParmsW = record
  2776.     dwCallback: DWORD;
  2777.     wDeviceID: MCIDEVICEID;
  2778.     lpstrDeviceType: PWideChar;
  2779.     lpstrElementName: PWideChar;
  2780.     lpstrAlias: PWideChar;
  2781.     dwStyle: DWORD;
  2782.     hWndParent: HWND;
  2783.   end;
  2784.   TMCI_Ovly_Open_Parms = TMCI_Ovly_Open_ParmsA;
  2785.  
  2786. { parameter block for MCI_WINDOW command message }
  2787. type
  2788.   PMCI_Ovly_Window_ParmsA = ^TMCI_Ovly_Window_ParmsA;
  2789.   PMCI_Ovly_Window_ParmsW = ^TMCI_Ovly_Window_ParmsW;
  2790.   PMCI_Ovly_Window_Parms = PMCI_Ovly_Window_ParmsA;
  2791.   TMCI_Ovly_Window_ParmsA = record
  2792.     dwCallback: DWORD;
  2793.     WHandle: HWND; { formerly "hWnd"}
  2794.     nCmdShow: UINT;
  2795.     lpstrText: PAnsiChar;
  2796.   end;
  2797.   TMCI_Ovly_Window_ParmsW = record
  2798.     dwCallback: DWORD;
  2799.     WHandle: HWND; { formerly "hWnd"}
  2800.     nCmdShow: UINT;
  2801.     lpstrText: PWideChar;
  2802.   end;
  2803.   TMCI_Ovly_Window_Parms = TMCI_Ovly_Window_ParmsA;
  2804.  
  2805. { parameter block for MCI_PUT, MCI_UPDATE, and MCI_WHERE command messages }
  2806. type
  2807.   PMCI_Ovly_Rect_Parms = ^ TMCI_Ovly_Rect_Parms;
  2808.   TMCI_Ovly_Rect_Parms = record
  2809.     dwCallback: DWORD;
  2810.     rc: TRect;
  2811.   end;
  2812.  
  2813. { parameter block for MCI_SAVE command message }
  2814. type
  2815.   PMCI_Ovly_Save_ParmsA = ^TMCI_Ovly_Save_ParmsA;
  2816.   PMCI_Ovly_Save_ParmsW = ^TMCI_Ovly_Save_ParmsW;
  2817.   PMCI_Ovly_Save_Parms = PMCI_Ovly_Save_ParmsA;
  2818.   TMCI_Ovly_Save_ParmsA = record
  2819.     dwCallback: DWORD;
  2820.     lpfilename: PAnsiChar;
  2821.     rc: TRect;
  2822.   end;
  2823.   TMCI_Ovly_Save_ParmsW = record
  2824.     dwCallback: DWORD;
  2825.     lpfilename: PWideChar;
  2826.     rc: TRect;
  2827.   end;
  2828.   TMCI_Ovly_Save_Parms = TMCI_Ovly_Save_ParmsA;
  2829.  
  2830. { parameter block for MCI_LOAD command message }
  2831. type
  2832.   PMCI_Ovly_Load_ParmsA = ^TMCI_Ovly_Load_ParmsA;
  2833.   PMCI_Ovly_Load_ParmsW = ^TMCI_Ovly_Load_ParmsW;
  2834.   PMCI_Ovly_Load_Parms = PMCI_Ovly_Load_ParmsA;
  2835.   TMCI_Ovly_Load_ParmsA = record
  2836.     dwCallback: DWORD;
  2837.     lpfilename: PAnsiChar;
  2838.     rc: TRect;
  2839.   end;
  2840.   TMCI_Ovly_Load_ParmsW = record
  2841.     dwCallback: DWORD;
  2842.     lpfilename: PWideChar;
  2843.     rc: TRect;
  2844.   end;
  2845.   TMCI_Ovly_Load_Parms = TMCI_Ovly_Load_ParmsA;
  2846.  
  2847.  
  2848. {***************************************************************************
  2849.  
  2850.                         DISPLAY Driver extensions
  2851.  
  2852. ***************************************************************************}
  2853.  
  2854. const
  2855.   NEWTRANSPARENT  = 3;           { use with SetBkMode() }
  2856.   QUERYROPSUPPORT = 40;          { use to determine ROP support }
  2857.  
  2858. {***************************************************************************
  2859.  
  2860.                         DIB Driver extensions
  2861.  
  2862. ***************************************************************************}
  2863. const
  2864.   SELECTDIB       = 41;                      { DIB.DRV select dib escape }
  2865.  
  2866. function DIBIndex(N: Integer): Longint;
  2867.  
  2868. {***************************************************************************
  2869.  
  2870.                         ScreenSaver support
  2871.  
  2872.     The current application will receive a syscommand of SC_SCREENSAVE just
  2873.     before the screen saver is invoked.  If the app wishes to prevent a
  2874.     screen save, return a non-zero value, otherwise call DefWindowProc().
  2875.  
  2876. ***************************************************************************}
  2877.  
  2878. const
  2879.   SC_SCREENSAVE   = $F140;
  2880.  
  2881.   mmsyst = 'winmm.dll';
  2882.  
  2883. implementation
  2884.  
  2885. function auxGetDevCapsA; external mmsyst name 'auxGetDevCapsA';
  2886. function auxGetDevCapsW; external mmsyst name 'auxGetDevCapsW';
  2887. function auxGetDevCaps; external mmsyst name 'auxGetDevCapsA';
  2888. function auxGetNumDevs; external mmsyst name 'auxGetNumDevs';
  2889. function auxGetVolume; external mmsyst name 'auxGetVolume';
  2890. function auxOutMessage; external mmsyst name 'auxOutMessage';
  2891. function auxSetVolume; external mmsyst name 'auxSetVolume';
  2892. function CloseDriver; external mmsyst name 'CloseDriver';
  2893. function DefDriverProc; external mmsyst name 'DefDriverProc';
  2894. function DrvGetModuleHandle; external mmsyst name 'DrvGetModuleHandle';
  2895. function erMessage; external mmsyst name 'erMessage';
  2896. function GetDriverModuleHandle; external mmsyst name 'GetDriverModuleHandle';
  2897. function joyGetDevCapsA; external mmsyst name 'joyGetDevCapsA';
  2898. function joyGetDevCapsW; external mmsyst name 'joyGetDevCapsW';
  2899. function joyGetDevCaps; external mmsyst name 'joyGetDevCapsA';
  2900. function joyGetNumDevs; external mmsyst name 'joyGetNumDevs';
  2901. function joyGetPos; external mmsyst name 'joyGetPos';
  2902. function joyGetPosEx; external mmsyst name 'joyGetPosEx';
  2903. function joyGetThreshold; external mmsyst name 'joyGetThreshold';
  2904. function joyReleaseCapture; external mmsyst name 'joyReleaseCapture';
  2905. function joySetCapture; external mmsyst name 'joySetCapture';
  2906. function joySetThreshold; external mmsyst name 'joySetThreshold';
  2907. function mciExecute; external mmsyst name 'mciExecute';
  2908. function mciGetCreatorTask; external mmsyst name 'mciGetCreatorTask';
  2909. function mciGetDeviceIDA; external mmsyst name 'mciGetDeviceIDA';
  2910. function mciGetDeviceIDW; external mmsyst name 'mciGetDeviceIDW';
  2911. function mciGetDeviceID; external mmsyst name 'mciGetDeviceIDA';
  2912. function mciGetDeviceIDFromElementIDA; external mmsyst name 'mciGetDeviceIDFromElementIDA';
  2913. function mciGetDeviceIDFromElementIDW; external mmsyst name 'mciGetDeviceIDFromElementIDW';
  2914. function mciGetDeviceIDFromElementID; external mmsyst name 'mciGetDeviceIDFromElementIDA';
  2915. function mciGetErrorStringA; external mmsyst name 'mciGetErrorStringA';
  2916. function mciGetErrorStringW; external mmsyst name 'mciGetErrorStringW';
  2917. function mciGetErrorString; external mmsyst name 'mciGetErrorStringA';
  2918. function mciGetYieldProc; external mmsyst name 'mciGetYieldProc';
  2919. function mciSendCommandA; external mmsyst name 'mciSendCommandA';
  2920. function mciSendCommandW; external mmsyst name 'mciSendCommandW';
  2921. function mciSendCommand; external mmsyst name 'mciSendCommandA';
  2922. function mciSendStringA; external mmsyst name 'mciSendStringA';
  2923. function mciSendStringW; external mmsyst name 'mciSendStringW';
  2924. function mciSendString; external mmsyst name 'mciSendStringA';
  2925. function mciSetYieldProc; external mmsyst name 'mciSetYieldProc';
  2926. function midiConnect; external mmsyst name 'midiConnect';
  2927. function midiDisconnect; external mmsyst name 'midiDisconnect';
  2928. function midiInAddBuffer; external mmsyst name 'midiInAddBuffer';
  2929. function midiInClose; external mmsyst name 'midiInClose';
  2930. function midiInGetDevCapsA; external mmsyst name 'midiInGetDevCapsA';
  2931. function midiInGetDevCapsW; external mmsyst name 'midiInGetDevCapsW';
  2932. function midiInGetDevCaps; external mmsyst name 'midiInGetDevCapsA';
  2933. function midiInGetErrorTextA; external mmsyst name 'midiInGetErrorTextA';
  2934. function midiInGetErrorTextW; external mmsyst name 'midiInGetErrorTextW';
  2935. function midiInGetErrorText; external mmsyst name 'midiInGetErrorTextA';
  2936. function midiInGetID; external mmsyst name 'midiInGetID';
  2937. function midiInGetNumDevs; external mmsyst name 'midiInGetNumDevs';
  2938. function midiInMessage; external mmsyst name 'midiInMessage';
  2939. function midiInOpen; external mmsyst name 'midiInOpen';
  2940. function midiInPrepareHeader; external mmsyst name 'midiInPrepareHeader';
  2941. function midiInReset; external mmsyst name 'midiInReset';
  2942. function midiInStart; external mmsyst name 'midiInStart';
  2943. function midiInStop; external mmsyst name 'midiInStop';
  2944. function midiInUnprepareHeader; external mmsyst name 'midiInUnprepareHeader';
  2945. function midiOutCacheDrumPatches; external mmsyst name 'midiOutCacheDrumPatches';
  2946. function midiOutCachePatches; external mmsyst name 'midiOutCachePatches';
  2947. function midiOutClose; external mmsyst name 'midiOutClose';
  2948. function midiOutGetDevCapsA; external mmsyst name 'midiOutGetDevCapsA';
  2949. function midiOutGetDevCapsW; external mmsyst name 'midiOutGetDevCapsW';
  2950. function midiOutGetDevCaps; external mmsyst name 'midiOutGetDevCapsA';
  2951. function midiOutGetErrorTextA; external mmsyst name 'midiOutGetErrorTextA';
  2952. function midiOutGetErrorTextW; external mmsyst name 'midiOutGetErrorTextW';
  2953. function midiOutGetErrorText; external mmsyst name 'midiOutGetErrorTextA';
  2954. function midiOutGetID; external mmsyst name 'midiOutGetID';
  2955. function midiOutGetNumDevs; external mmsyst name 'midiOutGetNumDevs';
  2956. function midiOutGetVolume; external mmsyst name 'midiOutGetVolume';
  2957. function midiOutLongMsg; external mmsyst name 'midiOutLongMsg';
  2958. function midiOutMessage; external mmsyst name 'midiOutMessage';
  2959. function midiOutOpen; external mmsyst name 'midiOutOpen';
  2960. function midiOutPrepareHeader; external mmsyst name 'midiOutPrepareHeader';
  2961. function midiOutReset; external mmsyst name 'midiOutReset';
  2962. function midiOutSetVolume; external mmsyst name 'midiOutSetVolume';
  2963. function midiOutShortMsg; external mmsyst name 'midiOutShortMsg';
  2964. function midiOutUnprepareHeader; external mmsyst name 'midiOutUnprepareHeader';
  2965. function midiStreamClose; external mmsyst name 'midiStreamClose';
  2966. function midiStreamOpen; external mmsyst name 'midiStreamOpen';
  2967. function midiStreamOut; external mmsyst name 'midiStreamOut';
  2968. function midiStreamPause; external mmsyst name 'midiStreamPause';
  2969. function midiStreamPosition; external mmsyst name 'midiStreamPosition';
  2970. function midiStreamProperty; external mmsyst name 'midiStreamProperty';
  2971. function midiStreamRestart; external mmsyst name 'midiStreamRestart';
  2972. function midiStreamStop; external mmsyst name 'midiStreamStop';
  2973. function mixerClose; external mmsyst name 'mixerClose';
  2974. function mixerGetControlDetailsA; external mmsyst name 'mixerGetControlDetailsA';
  2975. function mixerGetControlDetailsW; external mmsyst name 'mixerGetControlDetailsW';
  2976. function mixerGetControlDetails; external mmsyst name 'mixerGetControlDetailsA';
  2977. function mixerGetDevCapsA; external mmsyst name 'mixerGetDevCapsA';
  2978. function mixerGetDevCapsW; external mmsyst name 'mixerGetDevCapsW';
  2979. function mixerGetDevCaps; external mmsyst name 'mixerGetDevCapsA';
  2980. function mixerGetID; external mmsyst name 'mixerGetID';
  2981. function mixerGetLineControlsA; external mmsyst name 'mixerGetLineControlsA';
  2982. function mixerGetLineControlsW; external mmsyst name 'mixerGetLineControlsW';
  2983. function mixerGetLineControls; external mmsyst name 'mixerGetLineControlsA';
  2984. function mixerGetLineInfoA; external mmsyst name 'mixerGetLineInfoA';
  2985. function mixerGetLineInfoW; external mmsyst name 'mixerGetLineInfoW';
  2986. function mixerGetLineInfo; external mmsyst name 'mixerGetLineInfoA';
  2987. function mixerGetNumDevs; external mmsyst name 'mixerGetNumDevs';
  2988. function mixerOpen; external mmsyst name 'mixerOpen';
  2989. function mixerSetControlDetails; external mmsyst name 'mixerSetControlDetails';
  2990. function mmioAdvance; external mmsyst name 'mmioAdvance';
  2991. function mmioAscend; external mmsyst name 'mmioAscend';
  2992. function mmioClose; external mmsyst name 'mmioClose';
  2993. function mmioCreateChunk; external mmsyst name 'mmioCreateChunk';
  2994. function mmioDescend; external mmsyst name 'mmioDescend';
  2995. function mmioFlush; external mmsyst name 'mmioFlush';
  2996. function mmioGetInfo; external mmsyst name 'mmioGetInfo';
  2997. function mmioInstallIOProcA; external mmsyst name 'mmioInstallIOProcA';
  2998. function mmioInstallIOProcW; external mmsyst name 'mmioInstallIOProcW';
  2999. function mmioInstallIOProc; external mmsyst name 'mmioInstallIOProcA';
  3000. function mmioOpenA; external mmsyst name 'mmioOpenA';
  3001. function mmioOpenW; external mmsyst name 'mmioOpenW';
  3002. function mmioOpen; external mmsyst name 'mmioOpenA';
  3003. function mmioRead; external mmsyst name 'mmioRead';
  3004. function mmioRenameA; external mmsyst name 'mmioRenameA';
  3005. function mmioRenameW; external mmsyst name 'mmioRenameW';
  3006. function mmioRename; external mmsyst name 'mmioRenameA';
  3007. function mmioSeek; external mmsyst name 'mmioSeek';
  3008. function mmioSendMessage; external mmsyst name 'mmioSendMessage';
  3009. function mmioSetBuffer; external mmsyst name 'mmioSetBuffer';
  3010. function mmioSetInfo; external mmsyst name 'mmioSetInfo';
  3011. function mmioStringToFOURCCA; external mmsyst name 'mmioStringToFOURCCA';
  3012. function mmioStringToFOURCCW; external mmsyst name 'mmioStringToFOURCCW';
  3013. function mmioStringToFOURCC; external mmsyst name 'mmioStringToFOURCCA';
  3014. function mmioWrite; external mmsyst name 'mmioWrite';
  3015. function mmsystemGetVersion; external mmsyst name 'mmsystemGetVersion';
  3016. function OpenDriver; external mmsyst name 'OpenDriver';
  3017. function PlaySoundA; external mmsyst name 'PlaySoundA';
  3018. function PlaySoundW; external mmsyst name 'PlaySoundW';
  3019. function PlaySound; external mmsyst name 'PlaySoundA';
  3020. function SendDriverMessage; external mmsyst name 'SendDriverMessage';
  3021. function sndPlaySoundA; external mmsyst name 'sndPlaySoundA';
  3022. function sndPlaySoundW; external mmsyst name 'sndPlaySoundW';
  3023. function sndPlaySound; external mmsyst name 'sndPlaySoundA';
  3024. function timeBeginPeriod; external mmsyst name 'timeBeginPeriod';
  3025. function timeEndPeriod; external mmsyst name 'timeEndPeriod';
  3026. function timeGetDevCaps; external mmsyst name 'timeGetDevCaps';
  3027. function timeGetSystemTime; external mmsyst name 'timeGetSystemTime';
  3028. function timeGetTime; external mmsyst name 'timeGetTime';
  3029. function timeKillEvent; external mmsyst name 'timeKillEvent';
  3030. function timeSetEvent; external mmsyst name 'timeSetEvent';
  3031. function waveInAddBuffer; external mmsyst name 'waveInAddBuffer';
  3032. function waveInClose; external mmsyst name 'waveInClose';
  3033. function waveInGetDevCapsA; external mmsyst name 'waveInGetDevCapsA';
  3034. function waveInGetDevCapsW; external mmsyst name 'waveInGetDevCapsW';
  3035. function waveInGetDevCaps; external mmsyst name 'waveInGetDevCapsA';
  3036. function waveInGetErrorTextA; external mmsyst name 'waveInGetErrorTextA';
  3037. function waveInGetErrorTextW; external mmsyst name 'waveInGetErrorTextW';
  3038. function waveInGetErrorText; external mmsyst name 'waveInGetErrorTextA';
  3039. function waveInGetID; external mmsyst name 'waveInGetID';
  3040. function waveInGetNumDevs; external mmsyst name 'waveInGetNumDevs';
  3041. function waveInGetPosition; external mmsyst name 'waveInGetPosition';
  3042. function waveInMessage; external mmsyst name 'waveInMessage';
  3043. function waveInOpen; external mmsyst name 'waveInOpen';
  3044. function waveInPrepareHeader; external mmsyst name 'waveInPrepareHeader';
  3045. function waveInReset; external mmsyst name 'waveInReset';
  3046. function waveInStart; external mmsyst name 'waveInStart';
  3047. function waveInStop; external mmsyst name 'waveInStop';
  3048. function waveInUnprepareHeader; external mmsyst name 'waveInUnprepareHeader';
  3049. function waveOutBreakLoop; external mmsyst name 'waveOutBreakLoop';
  3050. function waveOutClose; external mmsyst name 'waveOutClose';
  3051. function waveOutGetDevCapsA; external mmsyst name 'waveOutGetDevCapsA';
  3052. function waveOutGetDevCapsW; external mmsyst name 'waveOutGetDevCapsW';
  3053. function waveOutGetDevCaps; external mmsyst name 'waveOutGetDevCapsA';
  3054. function waveOutGetErrorTextA; external mmsyst name 'waveOutGetErrorTextA';
  3055. function waveOutGetErrorTextW; external mmsyst name 'waveOutGetErrorTextW';
  3056. function waveOutGetErrorText; external mmsyst name 'waveOutGetErrorTextA';
  3057. function waveOutGetID; external mmsyst name 'waveOutGetID';
  3058. function waveOutGetNumDevs; external mmsyst name 'waveOutGetNumDevs';
  3059. function waveOutGetPitch; external mmsyst name 'waveOutGetPitch';
  3060. function waveOutGetPlaybackRate; external mmsyst name 'waveOutGetPlaybackRate';
  3061. function waveOutGetPosition; external mmsyst name 'waveOutGetPosition';
  3062. function waveOutGetVolume; external mmsyst name 'waveOutGetVolume';
  3063. function waveOutMessage; external mmsyst name 'waveOutMessage';
  3064. function waveOutOpen; external mmsyst name 'waveOutOpen';
  3065. function waveOutPause; external mmsyst name 'waveOutPause';
  3066. function waveOutPrepareHeader; external mmsyst name 'waveOutPrepareHeader';
  3067. function waveOutReset; external mmsyst name 'waveOutReset';
  3068. function waveOutRestart; external mmsyst name 'waveOutRestart';
  3069. function waveOutSetPitch; external mmsyst name 'waveOutSetPitch';
  3070. function waveOutSetPlaybackRate; external mmsyst name 'waveOutSetPlaybackRate';
  3071. function waveOutSetVolume; external mmsyst name 'waveOutSetVolume';
  3072. function waveOutUnprepareHeader; external mmsyst name 'waveOutUnprepareHeader';
  3073. function waveOutWrite; external mmsyst name 'waveOutWrite';
  3074.  
  3075. function mci_MSF_Minute(msf: Longint): Byte;
  3076. begin
  3077.   Result := LoByte(LoWord(msf));
  3078. end;
  3079.  
  3080. function mci_MSF_Second(msf: Longint): Byte;
  3081. begin
  3082.   Result := HiByte(LoWord(msf));
  3083. end;
  3084.  
  3085. function mci_MSF_Frame(msf: Longint): Byte;
  3086. begin
  3087.   Result := LoByte(HiWord(msf));
  3088. end;
  3089.  
  3090. function mci_Make_MSF(m, s, f: Byte): Longint;
  3091. begin
  3092.   Result := Longint(m or (s shl 8) or (f shl 16));
  3093. end;
  3094.  
  3095. function mci_TMSF_Track(tmsf: Longint): Byte;
  3096. begin
  3097.   Result := LoByte(LoWord(tmsf));
  3098. end;
  3099.  
  3100. function mci_TMSF_Minute(tmsf: Longint): Byte;
  3101. begin
  3102.   Result := HiByte(LoWord(tmsf));
  3103. end;
  3104.  
  3105. function mci_TMSF_Second(tmsf: Longint): Byte;
  3106. begin
  3107.   Result := LoByte(HiWord(tmsf));
  3108. end;
  3109.  
  3110. function mci_TMSF_Frame(tmsf: Longint): Byte;
  3111. begin
  3112.   Result := HiByte(HiWord(tmsf));
  3113. end;
  3114.  
  3115. function mci_Make_TMSF(t, m, s, f: Byte): Longint;
  3116. begin
  3117.   Result := Longint(t or (m shl 8) or (s shl 16) or (f shl 24));
  3118. end;
  3119.  
  3120. function mci_HMS_Hour(hms: Longint): Byte;
  3121. begin
  3122.   Result := LoByte(LoWord(hms));
  3123. end;
  3124.  
  3125. function mci_HMS_Minute(hms: Longint): Byte;
  3126. begin
  3127.   Result := HiByte(LoWord(hms));
  3128. end;
  3129.  
  3130. function mci_HMS_Second(hms: Longint): Byte;
  3131. begin
  3132.   Result := LoByte(HiWord(hms));
  3133. end;
  3134.  
  3135. function mci_Make_HMS(h, m, s: Byte): Longint;
  3136. begin
  3137.   Result := Longint(h or (m shl 8) or (s shl 16));
  3138. end;
  3139.  
  3140. function DIBIndex(N: Integer): Longint;
  3141. begin
  3142.   Result := MakeLong(N, $10FF);
  3143. end;
  3144.  
  3145. end.
  3146.