home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l040 / 13.ddi / RTLW31.ZIP / MMSYSTEM.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-10-28  |  76.6 KB  |  2,120 lines

  1. {*******************************************************}
  2. {                                                       }
  3. {       Turbo Pascal for Windows Run-time Library       }
  4. {       Windows 3.1 API Interface Unit                  }
  5. {       Multimedia Interface unit                       }
  6. {                                                       }
  7. {       Copyright (c) 1992 Borland International        }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit MMSystem;
  12.  
  13. interface
  14.  
  15. uses WinTypes, WinProcs, Win31;
  16.  
  17.  
  18. {***************************************************************************
  19.  
  20.                     General constants and data types
  21.  
  22. ***************************************************************************}
  23.  
  24. { general constants }
  25. const
  26.   MaxPNameLen      =  32;    { max product name length (including NULL) }
  27.   MaxErrorLength   = 128;    { max error text length (including NULL) }
  28.  
  29. { general data types }
  30. type
  31.   Version = Word;             { major (high byte), minor (low byte) }
  32.  
  33. { types for wType field in MMTIME struct }
  34. const
  35.   time_MS         = $0001;  { time in milliseconds }
  36.   time_Samples    = $0002;  { number of wave samples }
  37.   time_Bytes      = $0004;  { current byte offset }
  38.   time_SMPTE      = $0008;  { SMPTE time }
  39.   time_MIDI       = $0010;  { MIDI time }
  40.  
  41. { MMTIME data structure }
  42. type
  43.   PMMTime = ^TMMTime;
  44.   TMMTime = record
  45.     case wType: Word of        { indicates the contents of the variant record }
  46.      time_MS : (ms: Longint);
  47.      time_Samples : (sample: Longint);
  48.      time_Bytes : (cb: Longint);
  49.      time_SMPTE : (
  50.         hour: Byte;
  51.         min: Byte;
  52.         sec: Byte;
  53.         frame: Byte;
  54.         fps: Byte;
  55.         dummy: Byte);
  56.       time_MIDI : (songptrpos: Longint);
  57.   end;
  58.  
  59.  
  60. {***************************************************************************
  61.  
  62.                     Multimedia Extensions Window Messages
  63.  
  64. ***************************************************************************}
  65.  
  66. { joystick }
  67. const
  68.   mm_Joy1Move         = $3A0;
  69.   mm_Joy2Move         = $3A1;
  70.   mm_Joy1ZMove        = $3A2;
  71.   mm_Joy2ZMove        = $3A3;
  72.   mm_Joy1ButtonDown   = $3B5;
  73.   mm_Joy2ButtonDown   = $3B6;
  74.   mm_Joy1ButtonUp     = $3B7;
  75.   mm_Joy2ButtonUp     = $3B8;
  76.  
  77. { MCI }
  78.   mm_MCINotify        = $3B9;
  79.  
  80. { waveform output }
  81.   mm_WOM_Open         = $3BB;
  82.   mm_WOM_Close        = $3BC;
  83.   mm_WOM_Done         = $3BD;
  84.  
  85. { waveform input }
  86.   mm_WIM_Open         = $3BE;
  87.   mm_WIM_Close        = $3BF;
  88.   mm_WIM_Data         = $3C0;
  89.  
  90. { MIDI input }
  91.   mm_MIM_Open         = $3C1;
  92.   mm_MIM_Close        = $3C2;
  93.   mm_MIM_Data         = $3C3;
  94.   mm_MIM_LongData     = $3C4;
  95.   mm_MIM_Error        = $3C5;
  96.   mm_MIM_LongError    = $3C6;
  97.  
  98. { MIDI output }
  99.   mm_MOM_Open         = $3C7;
  100.   mm_MOM_Close        = $3C8;
  101.   mm_MOM_Done         = $3C9;
  102.  
  103.  
  104. {***************************************************************************
  105.  
  106.                 String resource number bases (internal use)
  107.  
  108. ***************************************************************************}
  109.  
  110. const
  111.   mmsyserr_Base          = 0;
  112.   waverr_Base            = 32;
  113.   midierr_Base           = 64;
  114.   timerr_Base            = 96;
  115.   joyerr_Base            = 160;
  116.   mcierr_Base            = 256;
  117.  
  118.   mci_String_Offset      = 512;
  119.   mci_VD_Offset          = 1024;
  120.   mci_CD_Offset          = 1088;
  121.   mci_Wave_Offset        = 1152;
  122.   mci_Seq_Offset         = 1216;
  123.  
  124. {***************************************************************************
  125.  
  126.                         General error return values
  127.  
  128. ***************************************************************************}
  129.  
  130. { general error return values }
  131. const
  132.   mmsyserr_NoError      = 0;                  { no error }
  133.   mmsyserr_Error        = mmsyserr_Base + 1;  { unspecified error }
  134.   mmsyserr_BadDeviceID  = mmsyserr_Base + 2;  { device ID out of range }
  135.   mmsyserr_NotEnabled   = mmsyserr_Base + 3;  { driver failed enable }
  136.   mmsyserr_Allocated    = mmsyserr_Base + 4;  { device already allocated }
  137.   mmsyserr_InvalHandle  = mmsyserr_Base + 5;  { device handle is invalid }
  138.   mmsyserr_NoDriver     = mmsyserr_Base + 6;  { no device driver present }
  139.   mmsyserr_NoMem        = mmsyserr_Base + 7;  { memory allocation error }
  140.   mmsyserr_NotSupported = mmsyserr_Base + 8;  { function isn't supported }
  141.   mmsyserr_BadErrNum    = mmsyserr_Base + 9;  { error value out of range }
  142.   mmsyserr_InvalFlag    = mmsyserr_Base + 10; { invalid flag passed }
  143.   mmsyserr_InvalParam   = mmsyserr_Base + 11; { invalid parameter passed }
  144.   mmsyserr_LastError    = mmsyserr_Base + 11; { last error in range }
  145.  
  146. {***************************************************************************
  147.  
  148.                         Installable driver support
  149.  
  150. ***************************************************************************}
  151.  
  152.  
  153. { return values from DriverProc() function }
  154. const
  155.   drv_Cancel             = drvcnf_Cancel;
  156.   drv_OK                 = drvcnf_OK;
  157.   drv_Restart            = drvcnf_Restart;
  158.  
  159.   drv_MCI_First          = drv_Reserved;
  160.   drv_MCI_Last           = drv_Reserved + $FFF;
  161.  
  162.  
  163. {***************************************************************************
  164.  
  165.                           Driver callback support
  166.  
  167. ***************************************************************************}
  168.  
  169. { flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and }
  170. { midiOutOpen() to specify the type of the dwCallback parameter. }
  171.  
  172. const
  173.   CallBack_TypeMask   = $00070000;    { callback type mask }
  174.   CallBack_Null       = $00000000;    { no callback }
  175.   CallBack_Window     = $00010000;    { dwCallback is a HWND }
  176.   CallBack_Task       = $00020000;    { dwCallback is a HTASK }
  177.   CallBack_Function   = $00030000;    { dwCallback is a FARPROC }
  178.  
  179. { driver callback prototypes }
  180.  
  181.  
  182. type
  183.   TDrvCallBack = procedure(h: Word; uMessage: Word; dwUser: Longint;
  184.     dw1: Longint; dw2: Longint);
  185.  
  186.  
  187. {***************************************************************************
  188.  
  189.                          Manufacturer and product IDs
  190.  
  191.     Used with wMid and wPid fields in WAVEOUTCAPS, WAVEINCAPS,
  192.     MIDIOUTCAPS, MIDIINCAPS, AUXCAPS, JOYCAPS structures.
  193.  
  194. ***************************************************************************}
  195.  
  196. { manufacturer IDs }
  197. const
  198.   mm_Microsoft            = 1;       { Microsoft Corp. }
  199.  
  200. { product IDs }
  201.   mm_MIDI_Mapper          = 1;       { MIDI Mapper }
  202.   mm_Wave_Mapper          = 2;       { Wave Mapper }
  203.  
  204.   mm_SndBlst_MidiOut      = 3;       { Sound Blaster MIDI output port }
  205.   mm_SndBlst_MidiIn       = 4;       { Sound Blaster MIDI input port  }
  206.   mm_SndBlst_Synth        = 5;       { Sound Blaster internal synthesizer }
  207.   mm_SndBlst_WaveOut      = 6;       { Sound Blaster waveform output }
  208.   mm_SndBlst_WaveIn       = 7;       { Sound Blaster waveform input }
  209.  
  210.   mm_Adlib                = 9;       { Ad Lib-compatible synthesizer }
  211.  
  212.   mm_MPU401_MidiOut       = 10;      { MPU401-compatible MIDI output port }
  213.   mm_MPU401_MidiIn        = 11;      { MPU401-compatible MIDI input port }
  214.  
  215.   mm_PC_Joystick          = 12;      { Joystick adapter }
  216.  
  217.  
  218. {***************************************************************************
  219.  
  220.                     General MMSYSTEM support
  221.  
  222. ***************************************************************************}
  223.  
  224. function mmsystemGetVersion: Word;
  225. procedure OutputDebugStr(P: PChar);
  226.  
  227.  
  228. {***************************************************************************
  229.  
  230.                             Sound support
  231.  
  232. ***************************************************************************}
  233.  
  234. function sndPlaySound(lpszSoundName: PChar; uFlags: Word): Bool;
  235.  
  236. { flag values for wFlags parameter }
  237. const
  238.   snd_Sync            = $0000;  { play synchronously (default) }
  239.   snd_Async           = $0001;  { play asynchronously }
  240.   snd_NoDefault       = $0002;  { don't use default sound }
  241.   snd_Memory          = $0004;  { lpszSoundName points to a memory file }
  242.   snd_Loop            = $0008;  { loop the sound until next sndPlaySound }
  243.   snd_NoStop          = $0010;  { don't stop any currently playing sound }
  244.  
  245.  
  246. {***************************************************************************
  247.  
  248.                         Waveform audio support
  249.  
  250. ***************************************************************************}
  251.  
  252. { waveform audio error return values }
  253. const
  254.   waverr_BadFormat      = waverr_Base + 0;    { unsupported wave format }
  255.   waverr_StillPlaying   = waverr_Base + 1;    { still something playing }
  256.   waverr_Unprepared     = waverr_Base + 2;    { header not prepared }
  257.   waverr_Sync           = waverr_Base + 3;    { device is synchronous }
  258.   waverr_LastError      = waverr_Base + 3;    { last error in range }
  259.  
  260. { waveform audio data types }
  261. type
  262.   PHWave = ^HWave;
  263.   HWave = Word;
  264.  
  265.   PHWaveIn = ^HWaveIn;
  266.   HWaveIn = Word;
  267.  
  268.   PHWaveOut = ^HWaveOut;
  269.   HWaveOut = Word;
  270.  
  271. type
  272.   TWaveCallBack = TDrvCallBack;
  273.  
  274. { wave callback messages }
  275. const
  276.   wom_Open        = mm_WOM_Open;
  277.   wom_Close       = mm_WOM_Close;
  278.   wom_Done        = mm_WOM_Done;
  279.   wim_OPEN        = mm_WIM_Open;
  280.   wim_CLOSE       = mm_WIM_Close;
  281.   wim_DATA        = mm_WIM_Data;
  282.  
  283. { device ID for wave device mapper }
  284.   wave_Mapper     = -1;
  285.  
  286. { flags for dwFlags parameter in waveOutOpen() and waveInOpen() }
  287.   wave_Format_Query     = $0001;
  288.   wave_AllowSync        = $0002;
  289.  
  290. { wave data block header }
  291. type
  292.   PWaveHdr = ^TWaveHdr;
  293.   TWaveHdr = record
  294.     lpData: PChar;                 { pointer to locked data buffer }
  295.     dwBufferLength: Longint;         { length of data buffer }
  296.     dwBytesRecorded: Longint;     { used for input only }
  297.     dwUser: Longint;              { for client's use }
  298.     dwFlags: Longint;             { assorted flags (see defines) }
  299.     dwLoops: Longint;             { loop control counter }
  300.     lpNext: PWaveHdr;             { reserved for driver }
  301.     reserved: Longint;            { reserved for driver }
  302.   end;
  303.  
  304.  
  305. { flags for dwFlags field of WAVEHDR }
  306. const
  307.   whdr_Done       = $00000001;  { done bit }
  308.   whdr_Prepared   = $00000002;  { set if this header has been prepared }
  309.   whdr_BeginLoop  = $00000004;  { loop start block }
  310.   whdr_EndLoop    = $00000008;  { loop end block }
  311.   whdr_InQueue    = $00000010;  { reserved for driver }
  312.  
  313. { waveform output device capabilities structure }
  314. type
  315.  
  316.   PWaveOutCaps = ^TWaveOutCaps;
  317.   TWaveOutCaps = record
  318.     wMid: Word;                 { manufacturer ID }
  319.     wPid: Word;                 { product ID }
  320.     vDriverVersion: Version;       { version of the driver }
  321.     szPname: array[0..MaxPNameLen-1] of Char;  { product name (NULL terminated string) }
  322.     dwFormats: Longint;          { formats supported }
  323.     wChannels: Word;            { number of sources supported }
  324.     dwSupport: Longint;          { functionality supported by driver }
  325.   end;
  326.  
  327.  
  328. { flags for dwSupport field of WAVEOUTCAPS }
  329. const
  330.   wavecaps_Pitch          = $0001;   { supports pitch control }
  331.   wavecaps_PlaybackRate   = $0002;   { supports playback rate control }
  332.   wavecaps_Volume         = $0004;   { supports volume control }
  333.   wavecaps_LRVolume       = $0008;   { separate left-right volume control }
  334.   wavecaps_Sync           = $0010;
  335.  
  336. { waveform input device capabilities structure }
  337. type
  338.   PWaveInCaps = ^TWaveInCaps;
  339.   TWaveInCaps = record
  340.     wMid: Word;                   { manufacturer ID }
  341.     wPid: Word;                   { product ID }
  342.     vDriverVersion: Version;         { version of the driver }
  343.     szPname: array[0..MaxPNameLen-1] of Char;    { product name (NULL terminated string) }
  344.     dwFormats: Longint;            { formats supported }
  345.     wChannels: Word;              { number of channels supported }
  346.   end;
  347.  
  348.  
  349. { defines for dwFormat field of WAVEINCAPS and WAVEOUTCAPS }
  350. const
  351.   wave_InvalidFormat     = $00000000;       { invalid format }
  352.   wave_Format_1M08       = $00000001;       { 11.025 kHz, Mono,   8-bit  }
  353.   wave_Format_1S08       = $00000002;       { 11.025 kHz, Stereo, 8-bit  }
  354.   wave_Format_1M16       = $00000004;       { 11.025 kHz, Mono,   16-bit }
  355.   wave_Format_1S16       = $00000008;       { 11.025 kHz, Stereo, 16-bit }
  356.   wave_Format_2M08       = $00000010;       { 22.05  kHz, Mono,   8-bit  }
  357.   wave_Format_2S08       = $00000020;       { 22.05  kHz, Stereo, 8-bit  }
  358.   wave_Format_2M16       = $00000040;       { 22.05  kHz, Mono,   16-bit }
  359.   wave_Format_2S16       = $00000080;       { 22.05  kHz, Stereo, 16-bit }
  360.   wave_Format_4M08       = $00000100;       { 44.1   kHz, Mono,   8-bit  }
  361.   wave_Format_4S08       = $00000200;       { 44.1   kHz, Stereo, 8-bit  }
  362.   wave_Format_4M16       = $00000400;       { 44.1   kHz, Mono,   16-bit }
  363.   wave_Format_4S16       = $00000800;       { 44.1   kHz, Stereo, 16-bit }
  364.  
  365. { general waveform format structure (information common to all formats) }
  366. type
  367.   PWaveFormat = ^TWaveFormat;
  368.   TWaveFormat = record
  369.     wFormatTag: Word;         { format type }
  370.     nChannels: Word;          { number of channels (i.e. mono, stereo, etc.) }
  371.     nSamplesPerSec: Longint;  { sample rate }
  372.     nAvgBytesPerSec: Longint; { for buffer estimation }
  373.     nBlockAlign: Word;      { block size of data }
  374.   end;
  375.  
  376. { flags for wFormatTag field of WAVEFORMAT }
  377. const
  378.   wave_Format_PCM     = 1;
  379.  
  380. { specific waveform format structure for PCM data }
  381. type
  382.   PPCMWaveFormat = ^TPCMWaveFormat;
  383.   TPCMWaveFormat = record
  384.       wf: TWaveFormat;
  385.       wBitsPerSample: Word;
  386.    end;
  387.  
  388. { waveform audio function prototypes }
  389. function waveOutGetNumDevs: Word;
  390.  
  391. function waveOutGetDevCaps(uDeviceID: Word; lpCaps: PWaveOutCaps;
  392.                            uSize: Word): Word;
  393.  
  394. function waveOutGetVolume(uDeviceID: Word; lpdwVolume: PLongint): Word;
  395. function waveOutSetVolume(uDeviceID: Word; dwVolume: Longint): Word;
  396. function waveOutGetErrorText(uError: Word; lpText: PChar; uSize: Word): Word;
  397. function waveOutOpen(lphWaveOut: PHWaveOut; uDeviceID: Word;
  398.   lpFormat: PWaveFormat; dwCallback, dwInstance, dwFlags: Longint): Word;
  399. function waveOutClose(hWaveOut: HWaveOut): Word;
  400. function waveOutPrepareHeader(hWaveOut: HWaveOut; lpWaveOutHdr: PWaveHdr;
  401.   uSize: Word): Word;
  402. function waveOutUnprepareHeader(hWaveOut: HWaveOut; lpWaveOutHdr: PWaveHdr;
  403.   uSize: Word): Word;
  404. function waveOutWrite(hWaveOut: HWaveOut; lpWaveOutHdr: PWaveHdr;
  405.   uSize: Word): Word;
  406. function waveOutPause(hWaveOut: HWaveOut): Word;
  407. function waveOutRestart(hWaveOut: HWaveOut): Word;
  408. function waveOutReset(hWaveOut: HWaveOut): Word;
  409. function waveOutBreakLoop(hWaveOut: HWaveOut): Word;
  410. function waveOutGetPosition(hWaveOut: HWaveOut; lpInfo: PMMTime;
  411.   uSize: Word): Word;
  412. function waveOutGetPitch(hWaveOut: HWaveOut; lpdwPitch: PLongint): Word;
  413. function waveOutSetPitch(hWaveOut: HWaveOut; dwPitch: Longint): Word;
  414. function waveOutGetPlaybackRate(hWaveOut: HWaveOut;
  415.   lpdwRate: PLongint): Word;
  416. function waveOutSetPlaybackRate(hWaveOut: HWaveOut; dwRate: Longint): Word;
  417. function waveOutGetID(hWaveOut: HWaveOut; lpuDeviceID: PWord): Word;
  418.  
  419. function waveOutMessage(hWaveOut: HWaveOut; uMessage: Word;
  420.   dw1, dw2: Longint): Longint;
  421.  
  422. function waveInGetNumDevs: Word;
  423. function waveInGetDevCaps(uDeviceID: Word; lpCaps: PWaveInCaps;
  424.     uSize: Word): Word;
  425. function waveInGetErrorText(uError: Word; lpText: PChar; uSize: Word): Word;
  426. function waveInOpen(lphWaveIn: PHWaveIn; uDeviceID: Word;
  427.   lpFormat: PWaveFormat; dwCallback, dwInstance, dwFlags: Longint): Word;
  428. function waveInClose(hWaveIn: PHWaveIn): Word;
  429. function waveInPrepareHeader(hWaveIn: HWaveIn; lpWaveInHdr: PWaveHdr;
  430.   uSize: Word): Word;
  431. function waveInUnprepareHeader(hWaveIn: HWaveIn; lpWaveInHdr: PWaveHdr;
  432.   uSize: Word): Word;
  433. function waveInAddBuffer(hWaveIn: HWaveIn; lpWaveInHdr: PWaveHdr;
  434.   uSize: Word): Word;
  435. function waveInStart(hWaveIn: HWaveIn): Word;
  436. function waveInStop(hWaveIn: HWaveIn): Word;
  437. function waveInReset(hWaveIn: HWaveIn): Word;
  438. function waveInGetPosition(hWaveIn: HWaveIn; lpInfo: PMMTime;
  439.   uSize: Word): Word;
  440. function waveInGetID(hWaveIn: HWaveIn; lpuDeviceID: PWord): Word;
  441. function waveInMessage(hWaveIn: HWaveIn; uMessage: Word;
  442.   dw1, dw2: Longint): Longint;
  443.  
  444. {***************************************************************************
  445.  
  446.                             MIDI audio support
  447.  
  448. ***************************************************************************}
  449.  
  450. { MIDI error return values }
  451. const
  452.   midierr_Unprepared    = midierr_Base + 0;   { header not prepared }
  453.   midierr_StillPlaying  = midierr_Base + 1;   { still something playing }
  454.   midierr_NoMap         = midierr_Base + 2;   { no current map }
  455.   midierr_NotReady      = midierr_Base + 3;   { hardware is still busy }
  456.   midierr_NoDevice      = midierr_Base + 4;   { port no longer connected }
  457.   midierr_InvalidSetup  = midierr_Base + 5;   { invalid setup }
  458.   midierr_LastError     = midierr_Base + 5;   { last error in range }
  459.  
  460. { MIDI audio data types }
  461. type
  462.   PHMidi = ^HMidi;
  463.   HMidi = Word;
  464.  
  465.   PHMidiIn = ^HMidiIn;
  466.   HMidiIn = Word;
  467.  
  468.   PHMidiOut = ^HMidiOut;
  469.   HMidiOut = Word;
  470.  
  471. type
  472.   TMidiCallBack = TDrvCallBack;
  473.  
  474. const
  475.   MidiPatchSize   = 128;
  476.  
  477. type
  478.   PPatchArray = ^TPatchArray;
  479.   TPatchArray = array[0..MidiPatchSize-1] of Word;
  480.  
  481.   PKeyArray = ^TKeyArray;
  482.   TKeyArray = array[0..MidiPatchSize-1] of Word;
  483.  
  484.  
  485. { MIDI callback messages }
  486. const
  487.   mim_Open        = mm_MIM_Open;
  488.   mim_Close       = mm_MIM_Close;
  489.   mim_Data        = mm_MIM_Data;
  490.   mim_LongData    = mm_MIM_LongData;
  491.   mim_Error       = mm_MIM_Error;
  492.   mim_LongError   = mm_MIM_LongError;
  493.   mom_Open        = mm_MOM_Open;
  494.   mom_Close       = mm_MOM_Close;
  495.   mom_Done        = mm_MOM_Done;
  496.  
  497. { device ID for MIDI mapper }
  498. const
  499.   MidiMapper     = -1;
  500.   midi_Mapper    = -1;
  501.  
  502. { flags for wFlags parm of midiOutCachePatches(), midiOutCacheDrumPatches() }
  503. const
  504.   midi_Cache_All      = 1;
  505.   midi_Cache_BestFit  = 2;
  506.   midi_Cache_Query    = 3;
  507.   midi_Uncache        = 4;
  508.  
  509. { MIDI output device capabilities structure }
  510. type
  511.   PMidiOutCaps = ^TMidiOutCaps;
  512.   TMidiOutCaps = record
  513.     wMid: Word;                  { manufacturer ID }
  514.     wPid: Word;                  { product ID }
  515.     vDriverVersion: Version;        { version of the driver }
  516.     szPname: array[0..MaxPNameLen-1] of Char;  { product name (NULL terminated string) }
  517.     wTechnology: Word;           { type of device }
  518.     wVoices: Word;               { # of voices (internal synth only) }
  519.     wNotes: Word;                { max # of notes (internal synth only) }
  520.     wChannelMask: Word;          { channels used (internal synth only) }
  521.     dwSupport: Longint;           { functionality supported by driver }
  522.   end;
  523.  
  524.  
  525. { flags for wTechnology field of MIDIOUTCAPS structure }
  526. const
  527.   mod_MidiPort    = 1;  { output port }
  528.   mod_Synth       = 2;  { generic internal synth }
  529.   mod_SQSynth     = 3;  { square wave internal synth }
  530.   mod_FMSynth     = 4;  { FM internal synth }
  531.   mod_Mapper      = 5;  { MIDI mapper }
  532.  
  533. { flags for dwSupport field of MIDIOUTCAPS structure }
  534. const
  535.   midicaps_Volume          = $0001;  { supports volume control }
  536.   midicaps_LRVolume        = $0002;  { separate left-right volume control }
  537.   midicaps_Cache           = $0004;
  538.  
  539. { MIDI output device capabilities structure }
  540.  
  541. type
  542.   PMidiInCaps = ^TMidiInCaps;
  543.   TMidiInCaps = record
  544.     wMid: Word;                  { manufacturer ID }
  545.     wPid: Word;                  { product ID }
  546.     vDriverVersion: Version;        { version of the driver }
  547.     szPname: array[0..MaxPNameLen-1] of Char;  { product name (NULL terminated string) }
  548.   end;
  549.  
  550. { MIDI data block header }
  551. type
  552.   PMidiHdr = ^TMidiHdr;
  553.   TMidiHdr = record
  554.     lpData: PChar;                 { pointer to locked data block }
  555.     dwBufferLength: Longint;       { length of data in data block }
  556.     dwBytesRecorded: Longint;      { used for input only }
  557.     dwUser: Longint;               { for client's use }
  558.     dwFlags: Longint;              { assorted flags (see defines) }
  559.     lpNext: PMidiHdr;              { reserved for driver }
  560.     reserved: Longint;             { reserved for driver }
  561.   end;
  562.  
  563.  
  564. { flags for dwFlags field of MIDIHDR structure }
  565. const
  566.   mhdr_Done       = $00000001;       { done bit }
  567.   mhdr_Prepared   = $00000002;       { set if header prepared }
  568.   mhdr_InQueue    = $00000004;       { reserved for driver }
  569.  
  570. { MIDI function prototypes }
  571.  
  572. function midiOutGetNumDevs: Word;
  573. function midiOutGetDevCaps(uDeviceID: Word; lpCaps: PMidiOutCaps;
  574.   uSize: Word): Word;
  575. function midiOutGetVolume(uDeviceID: Word; lpdwVolume: PLongint): Word;
  576. function midiOutSetVolume(uDeviceID: Word; dwVolume: Longint): Word;
  577. function midiOutGetErrorText(uError: Word; lpText: PChar; uSize: Word): Word;
  578. function midiOutOpen(lphMidiOut: PHMidiOut; uDeviceID: Word;
  579.   dwCallback, dwInstance, dwFlags: Longint): Word;
  580. function midiOutClose(hMidiOut: HMidiOut): Word;
  581. function midiOutPrepareHeader(hMidiOut: HMidiOut; lpMidiOutHdr: PMidiHdr;
  582.   uSize: Word): Word;
  583. function midiOutUnprepareHeader(hMidiOut: HMidiOut; lpMidiOutHdr: PMidiHdr;
  584.   uSize: Word): Word;
  585. function midiOutShortMsg(hMidiOut: HMidiOut; dwMsg: Longint): Word;
  586. function midiOutLongMsg(hMidiOut: HMidiOut; lpMidiOutHdr: PMidiHdr;
  587.   uSize: Word): Word;
  588. function midiOutReset(hMidiOut: HMidiOut): Word;
  589. function midiOutCachePatches(hMidiOut: HMidiOut;
  590.   uBank: Word; lpwPatchArray: PWord; uFlags: Word): Word;
  591. function midiOutCacheDrumPatches(hMidiOut: HMidiOut;
  592.   uPatch: Word; lpwKeyArray: PWord; uFlags: Word): Word;
  593. function midiOutGetID(hMidiOut: HMidiOut; lpuDeviceID: Word): Word;
  594. function midiOutMessage(hMidiOut: HMidiOut; uMessage: Word;
  595.   dw1, dw2: Longint): Longint;
  596. function midiInGetNumDevs: Word;
  597. function midiInGetDevCaps(DeviceID: Word; lpCaps: PMidiInCaps;
  598.   uSize: Word): Word;
  599. function midiInGetErrorText(uError: Word; lpText: PChar; uSize: Word): Word;
  600. function midiInOpen(lphMidiIn: PHMidiIn; uDeviceID: Word;
  601.   dwCallback, dwInstance, dwFlags: Longint): Word;
  602. function midiInClose(hMidiIn: HMidiIn): Word;
  603. function midiInPrepareHeader(hMidiIn: HMidiIn; lpMidiInHdr: PMidiHdr;
  604.   uSize: Word): Word;
  605. function midiInUnprepareHeader(hMidiIn: HMidiIn; lpMidiInHdr: PMidiHdr;
  606.   uSize: Word): Word;
  607. function midiInAddBuffer(hMidiIn: HMidiIn; lpMidiInHdr: PMidiHdr;
  608.   uSize: Word): Word;
  609. function midiInStart(hMidiIn: HMidiIn): Word;
  610. function midiInStop(hMidiIn: HMidiIn): Word;
  611. function midiInReset(hMidiIn: HMidiIn): Word;
  612. function midiInGetID(hMidiIn: HMidiIn; lpuDeviceID: PWord): Word;
  613. function midiInMessage(hMidiIn: HMidiIn; uMessage: Word;
  614.   dw1, dw2: Longint): Longint;
  615.  
  616.  
  617. {***************************************************************************
  618.  
  619.                         Auxiliary audio support
  620.  
  621. ***************************************************************************}
  622.  
  623. { device ID for aux device mapper }
  624. const
  625.   aux_Mapper     = -1;
  626.  
  627. { Auxiliary audio device capabilities structure }
  628. type
  629.   PAuxCaps = ^TAuxCaps;
  630.   TAuxCaps = record
  631.     wMid: Word;                  { manufacturer ID }
  632.     wPid: Word;                  { product ID }
  633.     vDriverVersion: Version;        { version of the driver }
  634.     szPname: array[0..MaxPNameLen-1] of Char;  { product name (NULL terminated string) }
  635.     wTechnology: Word;           { type of device }
  636.     dwSupport: Longint;             { functionality supported by driver }
  637.   end;
  638.  
  639. { flags for wTechnology field in AUXCAPS structure }
  640. const
  641.   auxcaps_CDAudio    = 1;       { audio from internal CD-ROM drive }
  642.   auxcaps_AuxIn      = 2;       { audio from auxiliary input jacks }
  643.  
  644. { flags for dwSupport field in AUXCAPS structure }
  645. const
  646.   auxcaps_Volume     = $0001;  { supports volume control }
  647.   auxcaps_LRVolume   = $0002;  { separate left-right volume control }
  648.  
  649. { auxiliary audio function prototypes }
  650. function auxGetNumDevs: Word;
  651. function auxGetDevCaps(uDeviceID: Word; lpCaps: PAuxCaps; uSize: Word): Word;
  652. function auxSetVolume(uDeviceID: Word; dwVolume: Longint): Word;
  653. function auxGetVolume(uDeviceID: Word; lpdwVolume: PLongint): Word;
  654. function auxOutMessage(uDeviceID, uMessage: Word; dw1, dw2: Longint): Longint;
  655.  
  656.  
  657. {***************************************************************************
  658.  
  659.                             Timer support
  660.  
  661. ***************************************************************************}
  662.  
  663. { timer error return values }
  664. const
  665.   timerr_NoError        = 0;                  { no error }
  666.   timerr_NoCanDo        = timerr_Base+1;      { request not completed }
  667.   timerr_Struct         = timerr_Base+33;     { time struct size }
  668.  
  669. { timer data types }
  670. type
  671.   TTimeCallBack = procedure(uTimerID, uMessage: Word; dwUser, dw1, dw2: Longint);
  672.  
  673.  
  674. { flags for wFlags parameter of timeSetEvent() function }
  675. const
  676.   time_OneShot    = 0;   { program timer for single event }
  677.   time_Periodic   = 1;   { program for continuous periodic event }
  678.  
  679. { timer device capabilities data structure }
  680. type
  681.   PTimeCaps = ^TTimeCaps;
  682.   TTimeCaps = record
  683.     wPeriodMin: Word;     { minimum period supported  }
  684.     wPeriodMax: Word;     { maximum period supported  }
  685.   end;
  686.  
  687.  
  688. { timer function prototypes }
  689. function timeGetSystemTime(lpTime: PMMTime; uSize: Word): Word;
  690.  
  691. function timeGetTime: Longint;
  692. function timeSetEvent(uDelay, uResolution: Word;
  693.   lpFunction: TTimeCallBack; dwUser: Longint; uFlags: Word): Word;
  694. function timeKillEvent(uTimerID: Word): Word;
  695. function timeGetDevCaps(lpTimeCaps: PTimeCaps; uSize: Word): Word;
  696. function timeBeginPeriod(uPeriod: Word): Word;
  697.  
  698. function timeEndPeriod(uPeriod: Word): Word;
  699.  
  700.  
  701. {***************************************************************************
  702.  
  703.                             Joystick support
  704.  
  705. ***************************************************************************}
  706.  
  707. { joystick error return values }
  708. const
  709.   joyerr_NoError        = 0;                  { no error }
  710.   joyerr_Parms          = joyerr_Base+5;      { bad parameters }
  711.   joyerr_NoCanDo        = joyerr_Base+6;      { request not completed }
  712.   joyerr_Unplugged      = joyerr_Base+7;      { joystick is unplugged }
  713.  
  714. { constants used with JOYINFO structure and MM_JOY* messages }
  715. const
  716.   joy_Button1         = $0001;
  717.   joy_Button2         = $0002;
  718.   joy_Button3         = $0004;
  719.   joy_Button4         = $0008;
  720.   joy_Button1Chg      = $0100;
  721.   joy_Button2Chg      = $0200;
  722.   joy_Button3Chg      = $0400;
  723.   joy_Button4Chg      = $0800;
  724.  
  725. { joystick ID constants }
  726. const
  727.   joystickID1         = 0;
  728.   joystickID2         = 1;
  729.  
  730. { joystick device capabilities data structure }
  731. type
  732.   PJoyCaps = ^TJoyCaps;
  733.   TJoyCaps = record
  734.     wMid: Word;                  { manufacturer ID }
  735.     wPid: Word;                  { product ID }
  736.     szPname: array[0..MaxPNameLen-1] of Char;  { product name (NULL terminated string) }
  737.     wXmin: Word;                 { minimum x position value }
  738.     wXmax: Word;                 { maximum x position value }
  739.     wYmin: Word;                 { minimum y position value }
  740.     wYmax: Word;                 { maximum y position value }
  741.     wZmin: Word;                 { minimum z position value }
  742.     wZmax: Word;                 { maximum z position value }
  743.     wNumButtons: Word;           { number of buttons }
  744.     wPeriodMin: Word;            { minimum message period when captured }
  745.     wPeriodMax: Word;            { maximum message period when captured }
  746.   end;
  747.  
  748. { joystick information data structure }
  749. type
  750.   PJoyInfo = ^TJoyInfo;
  751.   TJoyInfo = record
  752.      wXpos: Word;                 { x position }
  753.      wYpos: Word;                 { y position }
  754.      wZpos: Word;                 { z position }
  755.      wButtons: Word;              { button states }
  756.   end;
  757.  
  758. { joystick function prototypes }
  759. function joyGetDevCaps(uJoyID: Word; lpCaps: PJoyCaps; uSize: Word): Word;
  760. function joyGetNumDevs: Word;
  761.  
  762. function joyGetPos(uJoyID: Word; lpInfo: PJoyInfo): Word;
  763.  
  764. function joyGetThreshold(uJoyID: Word; lpuThreshold: PWord): Word;
  765.  
  766. function joyReleaseCapture(uJoyID: Word): Word;
  767.  
  768. { Changed first parameter name from "hwnd" to "Handle" }
  769. function joySetCapture(Handle: HWnd; uJoyID, uPeriod: Word;
  770.   bChanged: Bool): Word;
  771.  
  772. function joySetThreshold(uJoyID, uThreshold: Word): Word;
  773.  
  774. {***************************************************************************
  775.  
  776.                         Multimedia File I/O support
  777.  
  778. ***************************************************************************}
  779.  
  780. { MMIO error return values }
  781. const
  782.   mmioerr_Base            = 256;
  783.   mmioerr_FileNotFound    = mmioerr_Base + 1;  { file not found }
  784.   mmioerr_OutOfMemory     = mmioerr_Base + 2;  { out of memory }
  785.   mmioerr_CannotOpen      = mmioerr_Base + 3;  { cannot open }
  786.   mmioerr_CannotClose     = mmioerr_Base + 4;  { cannot close }
  787.   mmioerr_CannotRead      = mmioerr_Base + 5;  { cannot read }
  788.   mmioerr_CannotWrite     = mmioerr_Base + 6;  { cannot write }
  789.   mmioerr_CannotSeek      = mmioerr_Base + 7;  { cannot seek }
  790.   mmioerr_CannotExpand    = mmioerr_Base + 8;  { cannot expand file }
  791.   mmioerr_ChunkNotFound   = mmioerr_Base + 9;  { chunk not found }
  792.   mmioerr_Unbuffered      = mmioerr_Base + 10; { file is unbuffered }
  793.  
  794. { MMIO constants }
  795. const
  796.   CFSepChar       = '+';             { compound file name separator char. }
  797.  
  798. { MMIO data types }
  799. type
  800.   FourCC = Longint;                     { a four character code }
  801.  
  802. type
  803.   PHMMIO = ^THMMIO;
  804.   THMMIO = Word;      { a handle to an open file }
  805.  
  806. type
  807.   TMMIOProc = function(lpmmioinfo: PChar; uMessage: Word;
  808.                 lParam1, lParam2: Longint): Longint;
  809.  
  810. { general MMIO information data structure }
  811. type
  812.   PMMIOInfo = ^TMMIOInfo;
  813.   TMMIOInfo = record
  814.     { general fields }
  815.     dwFlags: Longint;        { general status flags }
  816.     fccIOProc: FourCC;      { pointer to I/O procedure }
  817.     pIOProc: TMMIOProc;        { pointer to I/O procedure }
  818.     wErrorRet: Word;      { place for error to be returned }
  819.     hTask: TTask;          { alternate local task }
  820.  
  821.     { fields maintained by MMIO functions during buffered I/O }
  822.     cchBuffer: Longint;      { size of I/O buffer (or 0L) }
  823.     pchBuffer: PChar;      { start of I/O buffer (or NULL) }
  824.     pchNext: PChar;        { pointer to next byte to read/write }
  825.     pchEndRead: PChar;     { pointer to last valid byte to read }
  826.     pchEndWrite: PChar;    { pointer to last byte to write }
  827.     lBufOffset: Longint;     { disk offset of start of buffer }
  828.  
  829.     { fields maintained by I/O procedure }
  830.     lDiskOffset: Longint;    { disk offset of next read or write }
  831.     adwInfo: array[0..2] of Longint;     { data specific to type of MMIOPROC }
  832.  
  833.     { other fields maintained by MMIO }
  834.     dwReserved1: Longint;    { reserved for MMIO use }
  835.     dwReserved2: Longint;    { reserved for MMIO use }
  836.     hmmio: THMMIO;          { handle to open file }
  837.   end;
  838.  
  839.  
  840. { RIFF chunk information data structure }
  841. type
  842.  
  843.   PMMCKInfo = ^TMMCKInfo;
  844.   TMMCKInfo = record
  845.     ckid: FourCC;           { chunk ID }
  846.     cksize: Longint;         { chunk size }
  847.     fccType: FourCC;        { form type or list type }
  848.     dwDataOffset: Longint;   { offset of data portion of chunk }
  849.     dwFlags: Longint;        { flags used by MMIO functions }
  850.   end;
  851.  
  852. { bit field masks }
  853. const
  854.   mmio_RWMode     = $00000003;      { open file for reading/writing/both }
  855.   mmio_ShareMode  = $00000070;      { file sharing mode number }
  856.  
  857. { constants for dwFlags field of MMIOINFO }
  858. const
  859.   mmio_Create    = $00001000;     { create new file (or truncate file) }
  860.   mmio_Parse     = $00000100;     { parse new file returning path }
  861.   mmio_Delete    = $00000200;     { create new file (or truncate file) }
  862.   mmio_Exist     = $00004000;     { checks for existence of file }
  863.   mmio_AllocBuf  = $00010000;     { mmioOpen() should allocate a buffer }
  864.   mmio_GetTemp   = $00020000;     { mmioOpen() should retrieve temp name }
  865.  
  866. const
  867.   mmio_Dirty     = $10000000;     { I/O buffer is dirty }
  868.  
  869.  
  870. { read/write mode numbers (bit field MMIO_RWMODE) }
  871. const
  872.   mmio_Read       = $00000000;      { open file for reading only }
  873.   mmio_Write      = $00000001;      { open file for writing only }
  874.   mmio_ReadWrite  = $00000002;      { open file for reading and writing }
  875.  
  876. { share mode numbers (bit field MMIO_SHAREMODE) }
  877. const
  878.   mmio_Compat     = $00000000;      { compatibility mode }
  879.   mmio_Exclusive  = $00000010;      { exclusive-access mode }
  880.   mmio_DenyWrite  = $00000020;      { deny writing to other processes }
  881.   mmio_DenyRead   = $00000030;      { deny reading to other processes }
  882.   mmio_DenyNone   = $00000040;      { deny nothing to other processes }
  883.  
  884. { various MMIO flags }
  885. const
  886.   mmio_FHOpen             = $0010;  { mmioClose: keep file handle open }
  887.   mmio_EmptyBuf           = $0010;  { mmioFlush: empty the I/O buffer }
  888.   mmio_ToUpper            = $0010;  { mmioStringToFOURCC: to u-case }
  889.   mmio_InstallProc    = $00010000;  { mmioInstallIOProc: install MMIOProc }
  890.   mmio_GlobalProc     = $10000000;  { mmioInstallIOProc: install globally }
  891.   mmio_RemoveProc     = $00020000;  { mmioInstallIOProc: remove MMIOProc }
  892.   mmio_FindProc       = $00040000;  { mmioInstallIOProc: find an MMIOProc }
  893.   MMIO_FindChunk          = $0010;  { mmioDescend: find a chunk by ID }
  894.   mmio_FindRIFF           = $0020;  { mmioDescend: find a LIST chunk }
  895.   mmio_FindList           = $0040;  { mmioDescend: find a RIFF chunk }
  896.   mmio_CreateRIFF         = $0020;  { mmioCreateChunk: make a LIST chunk }
  897.   mmio_CreateList         = $0040;  { mmioCreateChunk: make a RIFF chunk }
  898.  
  899.  
  900. { message numbers for MMIOPROC I/O procedure functions }
  901. const
  902.   mmiom_Read      = mmio_Read;       { read }
  903.   mmiom_Write    = mmio_Write;       { write }
  904.   mmiom_Seek              = 2;       { seek to a new position in file }
  905.   mmiom_Open              = 3;       { open file }
  906.   mmiom_Close             = 4;       { close file }
  907.   mmiom_WriteFlush        = 5;       { write and flush }
  908.  
  909. const
  910.   mmiom_Rename            = 6;       { rename specified file }
  911.  
  912. const
  913.   mmiom_User         = $8000;       { beginning of user-defined messages }
  914.  
  915. { standard four character codes }
  916. const
  917.   FourCC_RIFF = $46464952;   { 'RIFF' }
  918.   FourCC_List = $5453494C;   { 'LIST' }
  919.  
  920. { four character codes used to identify standard built-in I/O procedures }
  921. const
  922.   FourCC_DOS  = $20532F44;   { 'DOS '}
  923.   FourCC_MEM  = $204D454D;   { 'MEM '}
  924.  
  925. { flags for mmioSeek() }
  926. const
  927.   seek_Set        = 0;               { seek to an absolute position }
  928.   seek_Cur        = 1;               { seek relative to current position }
  929.   seek_End        = 2;               { seek relative to end of file }
  930.  
  931. { other constants }
  932. const
  933.   mmio_DefaultBuffer      = 8192;    { default buffer size }
  934.  
  935. { MMIO function prototypes }
  936. function mmioStringToFOURCC(sz: PChar; uFlags: Word): FourCC;
  937.  
  938. { should return a TMMIOProc }
  939. function mmioInstallIOProc(fccIOProc: FourCC; pIOProc: TMMIOProc;
  940.   dwFlags: Longint): Pointer;
  941.  
  942. function mmioOpen(szFileName: PChar; lpmmioinfo: PMMIOInfo;
  943.   dwOpenFlags: Longint): THMMIO;
  944. function mmioRename(szFileName: PChar; szNewFileName: PChar;
  945.   lpmmioinfo: PMMIOInfo; dwRenameFlags: Longint): Word;
  946. function mmioClose(hmmio: THMMIO; uFlags: Word): Word;
  947. function mmioRead(hmmio: THMMIO; pch: PChar; cch: Longint): Longint;
  948.  
  949. function mmioWrite(hmmio: THMMIO; pch: PChar; cch: Longint): Longint;
  950. function mmioSeek(hmmio: THMMIO; lOffset: Longint; iOrigin: Integer): Longint;
  951. function mmioGetInfo(hmmio: THMMIO; lpmmioinfo: PMMIOInfo; uFlags: Word): Word;
  952. function mmioSetInfo(hmmio: THMMIO; lpmmioinfo: PMMIOInfo; uFlags: Word): Word;
  953. function mmioSetBuffer(hmmio: THMMIO; pchBuffer: PChar; cchBuffer: Longint;
  954.   uFlags: Word): Word;
  955. function mmioFlush(hmmio: THMMIO; uFlags: Word): Word;
  956. function mmioAdvance(hmmio: THMMIO; lpmmioinfo: PMMIOInfo; uFlags: Word): Word;
  957. function mmioSendMessage(hmmio: THMMIO; uMessage: Word;
  958.   lParam1, lParam2: Longint): Longint;
  959. function mmioDescend(hmmio: THMMIO; lpck: PMMCKInfo;
  960.   lpckParent: PMMCKInfo; uFlags: Word): Word;
  961. function mmioAscend(hmmio: THMMIO; lpck: PMMCKInfo; uFlags: Word): Word;
  962. function mmioCreateChunk(hmmio: THMMIO; lpck: PMMCKInfo; uFlags: Word): Word;
  963.  
  964.  
  965. {***************************************************************************
  966.  
  967.                             MCI support
  968.  
  969. ***************************************************************************}
  970.  
  971. type
  972.   TYieldProc = function(uDeviceID: Word; dwYieldData: Longint): Word;
  973.  
  974. { MCI function prototypes }
  975. function mciSendCommand(uDeviceID, uMessage: Word;
  976.   dwParam1, dwParam2: Longint): Longint;
  977.  
  978. function mciSendString(lpstrCommand: PChar; lpstrReturnString: PChar;
  979.   uReturnLength: Word; hWndCallback: HWnd): Longint;
  980.  
  981. function mciGetDeviceID(lpstrName: PChar): Word;
  982.  
  983. function mciGetDeviceIDFromElementID(dwElementID: Longint;
  984.   lpstrType: PChar): Word;
  985.  
  986. function mciGetErrorString(wError: Longint; lpstrBuffer: PChar;
  987.   uLength: Word): Bool;
  988.  
  989. function mciSetYieldProc(uDeviceID: Word; fpYieldProc: TYieldProc;
  990.   dwYieldData: Longint): Bool;
  991.  
  992. function mciGetCreatorTask(uDeviceID: Word): TTask;
  993.  
  994. (* Returns a TYieldProc *)
  995. function mciGetYieldProc(uDeviceID: Word; lpdwYieldData: PLongint): Pointer;
  996.  
  997.  
  998. { MCI error return values }
  999. const
  1000.   mcierr_Invalid_Device_ID        = mcierr_Base + 1;
  1001.   mcierr_Unrecognized_Keyword     = mcierr_Base + 3;
  1002.   mcierr_Unrecognized_Command     = mcierr_Base + 5;
  1003.   mcierr_Hardware                 = mcierr_Base + 6;
  1004.   mcierr_Invalid_Device_Name      = mcierr_Base + 7;
  1005.   mcierr_Out_Of_Memory            = mcierr_Base + 8;
  1006.   mcierr_Device_Open              = mcierr_Base + 9;
  1007.   mcierr_Cannot_Load_Driver       = mcierr_Base + 10;
  1008.   mcierr_Missing_Command_String   = mcierr_Base + 11;
  1009.   mcierr_Param_Overflow           = mcierr_Base + 12;
  1010.   mcierr_Missing_String_Argument  = mcierr_Base + 13;
  1011.   mcierr_Bad_Integer              = mcierr_Base + 14;
  1012.   mcierr_Parser_Internal          = mcierr_Base + 15;
  1013.   mcierr_Driver_Internal          = mcierr_Base + 16;
  1014.   mcierr_Missing_Parameter        = mcierr_Base + 17;
  1015.   mcierr_Unsupported_Function     = mcierr_Base + 18;
  1016.   mcierr_File_Not_Found           = mcierr_Base + 19;
  1017.   mcierr_Device_Not_Ready         = mcierr_Base + 20;
  1018.   mcierr_Internal                 = mcierr_Base + 21;
  1019.   mcierr_Driver                   = mcierr_Base + 22;
  1020.   mcierr_Cannot_Use_All           = mcierr_Base + 23;
  1021.   mcierr_Multiple                 = mcierr_Base + 24;
  1022.   mcierr_Extension_Not_Found      = mcierr_Base + 25;
  1023.   mcierr_OutOfRange               = mcierr_Base + 26;
  1024.   mcierr_Flags_Not_Compatible     = mcierr_Base + 28;
  1025.   mcierr_File_Not_Saved           = mcierr_Base + 30;
  1026.   mcierr_Device_Type_Required     = mcierr_Base + 31;
  1027.   mcierr_Device_Locked            = mcierr_Base + 32;
  1028.   mcierr_Duplicate_Alias          = mcierr_Base + 33;
  1029.   mcierr_Bad_Constant             = mcierr_Base + 34;
  1030.   mcierr_Must_Use_Shareable       = mcierr_Base + 35;
  1031.   mcierr_Missing_Device_Name      = mcierr_Base + 36;
  1032.   mcierr_Bad_Time_Format          = mcierr_Base + 37;
  1033.   mcierr_No_Closing_Quote         = mcierr_Base + 38;
  1034.   mcierr_Duplicate_Flags          = mcierr_Base + 39;
  1035.   mcierr_Invalid_File             = mcierr_Base + 40;
  1036.   mcierr_Null_Parameter_Block     = mcierr_Base + 41;
  1037.   mcierr_Unnamed_Resource         = mcierr_Base + 42;
  1038.   mcierr_New_Requires_Alias       = mcierr_Base + 43;
  1039.   mcierr_Notify_On_Auto_Open      = mcierr_Base + 44;
  1040.   mcierr_No_Element_Allowed       = mcierr_Base + 45;
  1041.   mcierr_NONAPPLICABLE_Function   = mcierr_Base + 46;
  1042.   mcierr_Illegal_For_Auto_Open    = mcierr_Base + 47;
  1043.   mcierr_Filename_Required        = mcierr_Base + 48;
  1044.   mcierr_Extra_Characters         = mcierr_Base + 49;
  1045.   mcierr_Device_Not_Installed     = mcierr_Base + 50;
  1046.   mcierr_Get_CD                   = mcierr_Base + 51;
  1047.   mcierr_Set_CD                   = mcierr_Base + 52;
  1048.   mcierr_Set_Drive                = mcierr_Base + 53;
  1049.   mcierr_Device_Length            = mcierr_Base + 54;
  1050.   mcierr_Device_ORD_Length        = mcierr_Base + 55;
  1051.   mcierr_No_Integer               = mcierr_Base + 56;
  1052.  
  1053. const
  1054.   mcierr_Wave_OutputsInUse        = mcierr_Base + 64;
  1055.   mcierr_Wave_SetOutputInUse      = mcierr_Base + 65;
  1056.   mcierr_Wave_InputsInUse         = mcierr_Base + 66;
  1057.   mcierr_Wave_SetInputInUse       = mcierr_Base + 67;
  1058.   mcierr_Wave_OutputUnspecified   = mcierr_Base + 68;
  1059.   mcierr_Wave_InputUnspecified    = mcierr_Base + 69;
  1060.   mcierr_Wave_OutputsUnsuitable   = mcierr_Base + 70;
  1061.   mcierr_Wave_SetOutputUnsuitable = mcierr_Base + 71;
  1062.   mcierr_Wave_InputsUnsuitable    = mcierr_Base + 72;
  1063.   mcierr_Wave_SetInputUnsuitable  = mcierr_Base + 73;
  1064.  
  1065.   mcierr_Seq_Div_Incompatible     = mcierr_Base + 80;
  1066.   mcierr_Seq_Port_InUse           = mcierr_Base + 81;
  1067.   mcierr_Seq_Port_Nonexistent     = mcierr_Base + 82;
  1068.   mcierr_Seq_Port_MapNoDevice     = mcierr_Base + 83;
  1069.   mcierr_Seq_Port_MiscError       = mcierr_Base + 84;
  1070.   mcierr_Seq_Timer                = mcierr_Base + 85;
  1071.   mcierr_Seq_PortUnspecified      = mcierr_Base + 86;
  1072.   mcierr_Seq_NoMIDIPresent        = mcierr_Base + 87;
  1073.  
  1074.   mcierr_No_Window                = mcierr_Base + 90;
  1075.   mcierr_CreateWindow             = mcierr_Base + 91;
  1076.   mcierr_File_Read                = mcierr_Base + 92;
  1077.   mcierr_File_Write               = mcierr_Base + 93;
  1078.  
  1079. { all custom device driver errors must be >= this value }
  1080. const
  1081.   mcierr_Custom_Driver_Base       = mcierr_Base + 256;
  1082.  
  1083. { MCI command message identifiers }
  1084. const
  1085.   mci_Open       = $0803;
  1086.   mci_Close      = $0804;
  1087.   mci_Escape     = $0805;
  1088.   mci_Play       = $0806;
  1089.   mci_Seek       = $0807;
  1090.   mci_Stop       = $0808;
  1091.   mci_Pause      = $0809;
  1092.   mci_Info       = $080A;
  1093.   mci_GetDevCaps = $080B;
  1094.   mci_Spin       = $080C;
  1095.   mci_Set        = $080D;
  1096.   mci_Step       = $080E;
  1097.   mci_Record     = $080F;
  1098.   mci_SysInfo    = $0810;
  1099.   mci_Break      = $0811;
  1100.   mci_Sound      = $0812;
  1101.   mci_Save       = $0813;
  1102.   mci_Status     = $0814;
  1103.   mci_Cue        = $0830;
  1104.   mci_Realize    = $0840;
  1105.   mci_Window     = $0841;
  1106.   mci_Put        = $0842;
  1107.   mci_Where      = $0843;
  1108.   mci_Freeze     = $0844;
  1109.   mci_Unfreeze   = $0845;
  1110.   mci_Load       = $0850;
  1111.   mci_Cut        = $0851;
  1112.   mci_Copy       = $0852;
  1113.   mci_Paste      = $0853;
  1114.   mci_Update     = $0854;
  1115.   mci_Resume     = $0855;
  1116.   mci_Delete     = $0856;
  1117.  
  1118. { all custom MCI command messages must be >= this value }
  1119. const
  1120.   mci_User_Messages               = $400 + drv_MCI_First;
  1121.  
  1122. { device ID for "all devices" }
  1123. const
  1124.   mci_All_Device_ID               = $FFFF;
  1125.  
  1126. { constants for predefined MCI device types }
  1127. const
  1128.   mci_DevType_VCR                 = mci_String_Offset + 1;
  1129.   mci_DevType_Videodisc           = mci_String_Offset + 2;
  1130.   mci_DevType_Overlay             = mci_String_Offset + 3;
  1131.   mci_DevType_CD_Audio            = mci_String_Offset + 4;
  1132.   mci_DevType_DAT                 = mci_String_Offset + 5;
  1133.   mci_DevType_Scanner             = mci_String_Offset + 6;
  1134.   mci_DevType_Animation           = mci_String_Offset + 7;
  1135.   mci_DevType_Digital_Video       = mci_String_Offset + 8;
  1136.   mci_DevType_Other               = mci_String_Offset + 9;
  1137.   mci_DevType_Waveform_Audio      = mci_String_Offset + 10;
  1138.   mci_DevType_Sequencer           = mci_String_Offset + 11;
  1139.  
  1140.   mci_DevType_First              = mci_DevType_VCR;
  1141.   mci_DevType_Last               = mci_DevType_Sequencer;
  1142.  
  1143. { return values for 'status mode' command }
  1144. const
  1145.   mci_Mode_Not_Ready              = mci_String_Offset + 12;
  1146.   mci_Mode_Stop                   = mci_String_Offset + 13;
  1147.   mci_Mode_Play                   = mci_String_Offset + 14;
  1148.   mci_Mode_Record                 = mci_String_Offset + 15;
  1149.   mci_Mode_Seek                   = mci_String_Offset + 16;
  1150.   mci_Mode_Pause                  = mci_String_Offset + 17;
  1151.   mci_Mode_Open                   = mci_String_Offset + 18;
  1152.  
  1153. { constants used in 'set time format' and 'status time format' commands }
  1154. const
  1155.   mci_Format_Milliseconds         = 0;
  1156.   mci_Format_HMS                  = 1;
  1157.   mci_Format_MSF                  = 2;
  1158.   mci_Format_Frames               = 3;
  1159.   mci_Format_SMPTE_24             = 4;
  1160.   mci_Format_SMPTE_25             = 5;
  1161.   mci_Format_SMPTE_30             = 6;
  1162.   mci_Format_SMPTE_30Drop         = 7;
  1163.   mci_Format_Bytes                = 8;
  1164.   mci_Format_Samples              = 9;
  1165.   mci_Format_TMSF                 = 10;
  1166.  
  1167. { MCI time format conversion macros }
  1168.  
  1169. function mci_MSF_Minute(msf: Longint): Byte;
  1170. inline(
  1171.   $58/      { POP AX }
  1172.   $5A);     { POP DX }
  1173.  
  1174. function mci_MSF_Second(msf: Longint): Byte;
  1175. inline(
  1176.   $58/      { POP AX }
  1177.   $5A/      { POP DX }
  1178.   $86/$C4); { XCHG AH,AL }
  1179.  
  1180. function mci_MSF_Frame(msf: Longint): Byte;
  1181. inline(
  1182.   $5A/       { POP DX - reverse order to get hi word in AX }
  1183.   $58);      { POP AX }
  1184.  
  1185. function mci_Make_MSF(m, s, f: Byte): Longint;
  1186. inline(
  1187.   $5A/      { POP DX    (f) }
  1188.   $32/$F6/  { XOR DH,DH     }
  1189.   $5B/      { POP BX    (s) }
  1190.   $58/      { POP AX    (m) }
  1191.   $8A/$E3); { MOV AH,BL     }
  1192.  
  1193. function mci_TMSF_Track(tmsf: Longint): Byte;
  1194. inline(
  1195.   $58/      { POP AX }
  1196.   $5A);     { POP DX }
  1197.  
  1198. function mci_TMSF_Minute(msf: Longint): Byte;
  1199. inline(
  1200.   $58/      { POP AX }
  1201.   $5A/      { POP DX }
  1202.   $86/$C4); { XCHG AH,AL }
  1203.  
  1204. function mci_TMSF_Second(msf: Longint): Byte;
  1205. inline(
  1206.   $5A/       { POP DX - reverse order to get hi word in AX }
  1207.   $58);      { POP AX }
  1208.  
  1209. function mci_TMSF_Frame(msf: Longint): Byte;
  1210. inline(
  1211.   $5A/       { POP DX - reverse order to get hi word in AX }
  1212.   $58/       { POP AX }
  1213.   $86/$C4);  { XCHG AH,AL }
  1214.  
  1215. function mci_Make_TMSF(t, m, s, f: Byte): Longint;
  1216. inline(
  1217.   $5A/      { POP  DX }
  1218.   $86/$D6/  { XCHG DH,DL }
  1219.   $5B/      { POP  BX }
  1220.   $8A/$D3/  { MOV  DL, BL }
  1221.   $58/      { POP  AX }
  1222.   $86/$C4/  { XCHG AH,AL }
  1223.   $5B/      { POP  BX }
  1224.   $8A/$C3); { MOV  AL,BL }
  1225.  
  1226.  
  1227. function mci_HMS_Hour(hms: Longint): Byte;
  1228. inline(
  1229.   $58/      { POP AX }
  1230.   $5A);     { POP DX }
  1231.  
  1232. function mci_HMS_Minute(hms: Longint): Byte;
  1233. inline(
  1234.   $58/      { POP AX }
  1235.   $5A/      { POP DX }
  1236.   $86/$C4); { XCHG AH,AL }
  1237.  
  1238. function mci_HMS_Second(hms: Longint): Byte;
  1239. inline(
  1240.   $5A/       { POP DX - reverse order to get hi word in AX }
  1241.   $58);      { POP AX }
  1242.  
  1243. function mci_Make_HMS(h, m, s: Byte): Longint;
  1244. inline(
  1245.   $5A/      { POP DX    (s) }
  1246.   $32/$F6/  { XOR DH,DH     }
  1247.   $5B/      { POP BX    (m) }
  1248.   $58/      { POP AX    (h) }
  1249.   $8A/$E3); { MOV AH,BL     }
  1250.  
  1251.  
  1252.  
  1253. { flags for wParam of MM_MCINOTIFY message }
  1254. const
  1255.   mci_Notify_Successful           = $0001;
  1256.   mci_Notify_Superseded           = $0002;
  1257.   mci_Notify_Aborted              = $0004;
  1258.   mci_Notify_Failure              = $0008;
  1259.  
  1260.  
  1261. { common flags for dwFlags parameter of MCI command messages }
  1262. const
  1263.   mci_Notify                      = $00000001;
  1264.   mci_Wait                        = $00000002;
  1265.   mci_From                        = $00000004;
  1266.   mci_To                          = $00000008;
  1267.   mci_Track                       = $00000010;
  1268.  
  1269. { flags for dwFlags parameter of MCI_OPEN command message }
  1270. const
  1271.   mci_Open_Shareable              = $00000100;
  1272.   mci_Open_Element                = $00000200;
  1273.   mci_Open_Alias                  = $00000400;
  1274.   mci_Open_Element_ID             = $00000800;
  1275.   mci_Open_Type_ID                = $00001000;
  1276.   mci_Open_Type                   = $00002000;
  1277.  
  1278. { flags for dwFlags parameter of MCI_SEEK command message }
  1279. const
  1280.   mci_Seek_To_Start               = $00000100;
  1281.   mci_Seek_To_End                 = $00000200;
  1282.  
  1283. { flags for dwFlags parameter of MCI_STATUS command message }
  1284. const
  1285.   mci_Status_Item                 = $00000100;
  1286.   mci_Status_Start                = $00000200;
  1287.  
  1288. { flags for dwItem field of the MCI_STATUS_PARMS parameter block }
  1289. const
  1290.   mci_Status_Length               = $00000001;
  1291.   mci_Status_Position             = $00000002;
  1292.   mci_Status_Number_Of_Tracks     = $00000003;
  1293.   mci_Status_Mode                 = $00000004;
  1294.   mci_Status_Media_Present        = $00000005;
  1295.   mci_Status_Time_Format          = $00000006;
  1296.   mci_Status_Ready                = $00000007;
  1297.   mci_Status_Current_Track        = $00000008;
  1298.  
  1299. { flags for dwFlags parameter of MCI_INFO command message }
  1300. const
  1301.   mci_Info_Product                = $00000100;
  1302.   mci_Info_File                   = $00000200;
  1303.  
  1304. { flags for dwFlags parameter of MCI_GETDEVCAPS command message }
  1305. const
  1306.   mci_GetDevCaps_Item             = $00000100;
  1307.  
  1308. { flags for dwItem field of the MCI_GETDEVCAPS_PARMS parameter block }
  1309. const
  1310.   mci_GetDevCaps_Can_Record       = $00000001;
  1311.   mci_GetDevCaps_Has_Audio        = $00000002;
  1312.   mci_GetDevCaps_Has_Video        = $00000003;
  1313.   mci_GetDevCaps_Device_Type      = $00000004;
  1314.   mci_GetDevCaps_Uses_Files       = $00000005;
  1315.   mci_GetDevCaps_Compound_Device  = $00000006;
  1316.   mci_GetDevCaps_Can_Eject        = $00000007;
  1317.   mci_GetDevCaps_Can_Play         = $00000008;
  1318.   mci_GetDevCaps_Can_Save         = $00000009;
  1319.  
  1320. { flags for dwFlags parameter of MCI_SYSINFO command message }
  1321. const
  1322.   mci_SysInfo_Quantity            = $00000100;
  1323.   mci_SysInfo_Open                = $00000200;
  1324.   mci_SysInfo_Name                = $00000400;
  1325.   mci_SysInfo_InstallName         = $00000800;
  1326.  
  1327. { flags for dwFlags parameter of MCI_SET command message }
  1328. const
  1329.   mci_Set_Door_Open               = $00000100;
  1330.   mci_Set_Door_Closed             = $00000200;
  1331.   mci_Set_Time_Format             = $00000400;
  1332.   mci_Set_Audio                   = $00000800;
  1333.   mci_Set_Video                   = $00001000;
  1334.   mci_Set_On                      = $00002000;
  1335.   mci_Set_Off                     = $00004000;
  1336.  
  1337. { flags for dwAudio field of MCI_SET_PARMS or MCI_SEQ_SET_PARMS }
  1338. const
  1339.   mci_Set_Audio_All               = $00000000;
  1340.   mci_Set_Audio_Left              = $00000001;
  1341.   mci_Set_Audio_Right             = $00000002;
  1342.  
  1343. { flags for dwFlags parameter of MCI_BREAK command message }
  1344. const
  1345.   mci_Break_Key                   = $00000100;
  1346.   mci_Break_HWnd                  = $00000200;
  1347.   mci_Break_Off                   = $00000400;
  1348.  
  1349. { flags for dwFlags parameter of MCI_RECORD command message }
  1350. const
  1351.   mci_Record_Insert               = $00000100;
  1352.   mci_Record_Overwrite            = $00000200;
  1353.  
  1354. { flags for dwFlags parameter of MCI_SOUND command message }
  1355. const
  1356.   mci_Sound_Name                  = $00000100;
  1357.  
  1358. { flags for dwFlags parameter of MCI_SAVE command message }
  1359. const
  1360.   mci_Save_File                   = $00000100;
  1361.  
  1362. { flags for dwFlags parameter of MCI_LOAD command message }
  1363. const
  1364.   mci_Load_File                   = $00000100;
  1365.  
  1366. { generic parameter block for MCI command messages with no special parameters }
  1367. type
  1368.   PMCI_Generic_Parms = ^TMCI_Generic_Parms;
  1369.   TMCI_Generic_Parms = record
  1370.     dwCallback: Longint;
  1371.   end;
  1372.  
  1373. { parameter block for MCI_OPEN command message }
  1374. type
  1375.   PMCI_Open_Parms = ^TMCI_Open_Parms;
  1376.   TMCI_Open_Parms = record
  1377.     dwCallback: Longint;
  1378.     wDeviceID: Word;
  1379.     wReserved0: Word;
  1380.     lpstrDeviceType: PChar;
  1381.     lpstrElementName: PChar;
  1382.     lpstrAlias: PChar;
  1383.   end;
  1384.  
  1385. { parameter block for MCI_PLAY command message }
  1386. type
  1387.   PMCI_Play_Parms = ^TMCI_Play_Parms;
  1388.   TMCI_Play_Parms = record
  1389.     dwCallback: Longint;
  1390.     dwFrom: Longint;
  1391.     dwTo: Longint;
  1392.   end;
  1393.  
  1394. { parameter block for MCI_SEEK command message }
  1395. type
  1396.   PMCI_Seek_Parms = ^TMCI_Seek_Parms;
  1397.   TMCI_Seek_Parms = record
  1398.     dwCallback: Longint;
  1399.     dwTo: Longint;
  1400.   end;
  1401.  
  1402.  
  1403. { parameter block for MCI_STATUS command message }
  1404. type
  1405.   PMCI_Status_Parms = ^TMCI_Status_Parms;
  1406.   TMCI_Status_Parms = record
  1407.     dwCallback: Longint;
  1408.     dwReturn: Longint;
  1409.     dwItem: Longint;
  1410.     dwTrack: Longint;
  1411.   end;
  1412.  
  1413. { parameter block for MCI_INFO command message }
  1414. type
  1415.   PMCI_Info_Parms = ^TMCI_Info_Parms;
  1416.   TMCI_Info_Parms = record
  1417.     dwCallback: Longint;
  1418.     lpstrReturn: PChar;
  1419.     dwRetSize: Longint;
  1420.   end;
  1421.  
  1422. { parameter block for MCI_GETDEVCAPS command message }
  1423. type
  1424.   PMCI_GetDevCaps_Parms = ^TMCI_GetDevCaps_Parms;
  1425.   TMCI_GetDevCaps_Parms = record
  1426.     dwCallback: Longint;
  1427.     dwReturn: Longint;
  1428.     dwItem: Longint;
  1429.   end;
  1430.  
  1431.  
  1432. { parameter block for MCI_SYSINFO command message }
  1433. type
  1434.   PMCI_SysInfo_Parms = ^TMCI_SysInfo_Parms;
  1435.   TMCI_SysInfo_Parms = record
  1436.     dwCallback: Longint;
  1437.     lpstrReturn: PChar;
  1438.     dwRetSize: Longint;
  1439.     dwNumber: Longint;
  1440.     wDeviceType: Word;
  1441.     wReserved0: Word;
  1442.   end;
  1443.  
  1444. { parameter block for MCI_SET command message }
  1445. type
  1446.   PMCI_Set_Parms = ^TMCI_Set_Parms;
  1447.   TMCI_Set_Parms = record
  1448.     dwCallback: Longint;
  1449.     dwTimeFormat: Longint;
  1450.     dwAudio: Longint;
  1451.   end;
  1452.  
  1453.  
  1454. { parameter block for MCI_BREAK command message }
  1455. type
  1456.   PMCI_Break_Parms = ^TMCI_BReak_Parms;
  1457.   TMCI_BReak_Parms = record
  1458.     dwCallback: Longint;
  1459.     nVirtKey: Integer;
  1460.     wReserved0: Word;
  1461.     hWndBreak: HWnd;
  1462.     wReserved1: Word;
  1463.   end;
  1464.  
  1465. { parameter block for MCI_SOUND command message }
  1466. type
  1467.   PMCI_Sound_Parms = ^TMCI_Sound_Parms;
  1468.   TMCI_Sound_Parms = record
  1469.     dwCallback: Longint;
  1470.     lpstrSoundName: PChar;
  1471.   end;
  1472.  
  1473. { parameter block for MCI_SAVE command message }
  1474. type
  1475.   PMCI_Save_Parms = ^TMCI_SaveParms;
  1476.   TMCI_SaveParms = record
  1477.     dwCallback: Longint;
  1478.     lpfilename: PChar;
  1479.   end;
  1480.  
  1481. { parameter block for MCI_LOAD command message }
  1482. type
  1483.   PMCI_Load_Parms = ^TMCI_Load_Parms;
  1484.   TMCI_Load_Parms = record
  1485.     dwCallback: Longint;
  1486.     lpfilename: PChar;
  1487.   end;
  1488.  
  1489. { parameter block for MCI_RECORD command message }
  1490. type
  1491.   PMCI_Record_Parms = ^TMCI_Record_Parms;
  1492.   TMCI_Record_Parms = record
  1493.     dwCallback: Longint;
  1494.     dwFrom: Longint;
  1495.     dwTo: Longint;
  1496.   end;
  1497.  
  1498.  
  1499. { MCI extensions for videodisc devices }
  1500.  
  1501. { flag for dwReturn field of MCI_STATUS_PARMS }
  1502. { MCI_STATUS command, (dwItem == MCI_STATUS_MODE) }
  1503. const
  1504.   mci_VD_Mode_Park                = mci_VD_Offset + 1;
  1505.  
  1506. { flag for dwReturn field of MCI_STATUS_PARMS }
  1507. { MCI_STATUS command, (dwItem == MCI_VD_STATUS_MEDIA_TYPE) }
  1508. const
  1509.   mci_VD_Media_CLV                = mci_VD_Offset + 2;
  1510.   mci_VD_Media_CAV                = mci_VD_Offset + 3;
  1511.   mci_VD_Media_Other              = mci_VD_Offset + 4;
  1512.  
  1513. const
  1514.   mci_VD_Format_Track             = $4001;
  1515.  
  1516. { flags for dwFlags parameter of MCI_PLAY command message }
  1517. const
  1518.   mci_VD_Play_Reverse             = $00010000;
  1519.   mci_VD_Play_Fast                = $00020000;
  1520.   mci_VD_Play_Speed               = $00040000;
  1521.   mci_VD_Play_Scan                = $00080000;
  1522.   mci_VD_Play_Slow                = $00100000;
  1523.  
  1524. { flag for dwFlags parameter of MCI_SEEK command message }
  1525. const
  1526.   mci_VD_Seek_Reverse             = $00010000;
  1527.  
  1528. { flags for dwItem field of MCI_STATUS_PARMS parameter block }
  1529. const
  1530.   mci_VD_Status_Speed             = $00004002;
  1531.   mci_VD_Status_Forward           = $00004003;
  1532.   mci_VD_Status_Media_Type        = $00004004;
  1533.   mci_VD_Status_Side              = $00004005;
  1534.   mci_VD_Status_Disc_Size         = $00004006;
  1535.  
  1536. { flags for dwFlags parameter of MCI_GETDEVCAPS command message }
  1537. const
  1538.   mci_VD_GetDevCaps_CLV           = $00010000;
  1539.   mci_VD_GetDevCaps_CAV           = $00020000;
  1540.  
  1541.   mci_VD_Spin_Up                  = $00010000;
  1542.   mci_VD_Spin_Down                = $00020000;
  1543.  
  1544. { flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block }
  1545. const
  1546.   mci_VD_GetDevCaps_Can_Reverse   = $00004002;
  1547.   mci_VD_GetDevCaps_Fast_Rate     = $00004003;
  1548.   mci_VD_GetDevCaps_Slow_Rate     = $00004004;
  1549.   mci_VD_GetDevCaps_Normal_Rate   = $00004005;
  1550.  
  1551. { flags for the dwFlags parameter of MCI_STEP command message }
  1552. const
  1553.   mci_VD_Step_Frames              = $00010000;
  1554.   mci_VD_Step_Reverse             = $00020000;
  1555.  
  1556. { flag for the MCI_ESCAPE command message }
  1557. const
  1558.   mci_VD_Escape_String            = $00000100;
  1559.  
  1560. { parameter block for MCI_PLAY command message }
  1561. type
  1562.   PMCI_VD_Play_Parms = ^TMCI_VD_Play_Parms;
  1563.   TMCI_VD_Play_Parms = record
  1564.     dwCallback: Longint;
  1565.     dwFrom: Longint;
  1566.     dwTo: Longint;
  1567.     dwSpeed: Longint;
  1568.   end;
  1569.  
  1570. { parameter block for MCI_STEP command message }
  1571. type
  1572.   PMCI_VD_Step_Parms = ^TMCI_VD_Step_Parms;
  1573.   TMCI_VD_Step_Parms = record
  1574.     dwCallback: Longint;
  1575.     dwFrames: Longint;
  1576.   end;
  1577.  
  1578. { parameter block for MCI_ESCAPE command message }
  1579. type
  1580.   PMCI_VD_Escape_Parms = ^TMCI_VD_Escape_Parms;
  1581.   TMCI_VD_Escape_Parms = record
  1582.     dwCallback: Longint;
  1583.     lpstrCommand: PChar;
  1584.   end;
  1585.  
  1586.  
  1587. { MCI extensions for waveform audio devices }
  1588.  
  1589. { flags for the dwFlags parameter of MCI_OPEN command message }
  1590. const
  1591.   mci_Wave_Open_Buffer            = $00010000;
  1592.  
  1593. { flags for the dwFlags parameter of MCI_SET command message }
  1594. const
  1595.   mci_Wave_Set_FormatTag          = $00010000;
  1596.   mci_Wave_Set_Channels           = $00020000;
  1597.   mci_Wave_Set_SamplesPerSec      = $00040000;
  1598.   mci_Wave_Set_AvgBytesPerSec     = $00080000;
  1599.   mci_Wave_Set_BlockAlign         = $00100000;
  1600.   mci_Wave_Set_BitsPerSample      = $00200000;
  1601.  
  1602. { flags for the dwFlags parameter of MCI_STATUS, MCI_SET command messages }
  1603. const
  1604.   mci_Wave_Input                  = $00400000;
  1605.   mci_Wave_Output                 = $00800000;
  1606.  
  1607. { flags for the dwItem field of MCI_STATUS_PARMS parameter block }
  1608. const
  1609.   mci_Wave_Status_FormatTag       = $00004001;
  1610.   mci_Wave_Status_Channels        = $00004002;
  1611.   mci_Wave_Status_SamplesPerSec   = $00004003;
  1612.   mci_Wave_Status_AvgBytesPerSec  = $00004004;
  1613.   mci_Wave_Status_BlockAlign      = $00004005;
  1614.   mci_Wave_Status_BitsPerSample   = $00004006;
  1615.   mci_Wave_Status_Level           = $00004007;
  1616.  
  1617. { flags for the dwFlags parameter of MCI_SET command message }
  1618. const
  1619.   mci_Wave_Set_AnyInput           = $04000000;
  1620.   mci_Wave_Set_AnyOutput          = $08000000;
  1621.  
  1622. { flags for the dwFlags parameter of MCI_GETDEVCAPS command message }
  1623. const
  1624.   mci_Wave_GetDevCaps_Inputs      = $00004001;
  1625.   mci_Wave_GetDevCaps_Outputs     = $00004002;
  1626.  
  1627. { parameter block for MCI_OPEN command message }
  1628. type
  1629.   PMCI_Wave_Open_Parms = ^TMCI_Wave_Open_Parms;
  1630.   TMCI_Wave_Open_Parms = record
  1631.     dwCallback: Longint;
  1632.     wDeviceID: Word;
  1633.     wReserved0: Word;
  1634.     lpstrDeviceType: PChar;
  1635.     lpstrElementName: PChar;
  1636.     lpstrAlias: PChar;
  1637.     dwBufferSeconds: Longint;
  1638.   end;
  1639.  
  1640. { parameter block for MCI_DELETE command message }
  1641. type
  1642.   PMCI_Wave_Delete_Parms = ^TMCI_Wave_Delete_Parms;
  1643.   TMCI_Wave_Delete_Parms = record
  1644.     dwCallback: Longint;
  1645.     dwFrom: Longint;
  1646.     dwTo: Longint;
  1647.   end;
  1648.  
  1649. { parameter block for MCI_SET command message }
  1650. type
  1651.   PMCI_Wave_Set_Parms = ^TMCI_Wave_Set_Parms;
  1652.   TMCI_Wave_Set_Parms = record
  1653.     dwCallback: Longint;
  1654.     dwTimeFormat: Longint;
  1655.     dwAudio: Longint;
  1656.     wInput: Word;
  1657.     wReserved0: Word;
  1658.     wOutput: Word;
  1659.     wReserved1: Word;
  1660.     wFormatTag: Word;
  1661.     wReserved2: Word;
  1662.     nChannels: Word;
  1663.     wReserved3: Word;
  1664.     nSamplesPerSec: Longint;
  1665.     nAvgBytesPerSec: Longint;
  1666.     nBlockAlign: Word;
  1667.     wReserved4: Word;
  1668.     wBitsPerSample: Word;
  1669.     wReserved5: Word;
  1670.   end;
  1671.  
  1672.  
  1673. { MCI extensions for MIDI sequencer devices }
  1674.  
  1675. { flags for the dwReturn field of MCI_STATUS_PARMS parameter block }
  1676. { MCI_STATUS command, (dwItem == MCI_SEQ_STATUS_DIVTYPE) }
  1677. const
  1678.   mci_Seq_Div_PPQN            = 0 + mci_Seq_Offset;
  1679.   mci_Seq_Div_SMPTE_24        = 1 + mci_Seq_Offset;
  1680.   mci_Seq_Div_SMPTE_25        = 2 + mci_Seq_Offset;
  1681.   mci_Seq_Div_SMPTE_30Drop    = 3 + mci_Seq_Offset;
  1682.   mci_Seq_Div_SMPTE_30        = 4 + mci_Seq_Offset;
  1683.  
  1684. { flags for the dwMaster field of MCI_SEQ_SET_PARMS parameter block }
  1685. { MCI_SET command, (dwFlags == MCI_SEQ_SET_MASTER) }
  1686. const
  1687.   mci_Seq_Format_SongPtr      = $4001;
  1688.   mci_Seq_File                = $4002;
  1689.   mci_Seq_MIDI                = $4003;
  1690.   mci_Seq_SMPTE               = $4004;
  1691.   mci_Seq_None                = 65533;
  1692.  
  1693. { flags for the dwItem field of MCI_STATUS_PARMS parameter block }
  1694. const
  1695.   mci_Seq_Status_Tempo            = $00004002;
  1696.   mci_Seq_Status_Port             = $00004003;
  1697.   mci_Seq_Status_Slave            = $00004007;
  1698.   mci_Seq_Status_Master           = $00004008;
  1699.   mci_Seq_Status_Offset           = $00004009;
  1700.   mci_Seq_Status_DivType          = $0000400A;
  1701.  
  1702. { flags for the dwFlags parameter of MCI_SET command message }
  1703. const
  1704.   mci_Seq_Set_Tempo               = $00010000;
  1705.   mci_Seq_Set_Port                = $00020000;
  1706.   mci_Seq_Set_Slave               = $00040000;
  1707.   mci_Seq_Set_Master              = $00080000;
  1708.   mci_Seq_Set_Offset              = $01000000;
  1709.  
  1710. { parameter block for MCI_SET command message }
  1711. type
  1712.   PMCI_Seq_Set_Parms = ^TMCI_Seq_Set_Parms;
  1713.   TMCI_Seq_Set_Parms = record
  1714.     dwCallback: Longint;
  1715.     dwTimeFormat: Longint;
  1716.     dwAudio: Longint;
  1717.     dwTempo: Longint;
  1718.     dwPort: Longint;
  1719.     dwSlave: Longint;
  1720.     dwMaster: Longint;
  1721.     dwOffset: Longint;
  1722.   end;
  1723.  
  1724.  
  1725. { MCI extensions for animation devices }
  1726.  
  1727. { flags for dwFlags parameter of MCI_OPEN command message }
  1728. const
  1729.   mci_Anim_Open_WS                = $00010000;
  1730.   mci_Anim_Open_Parent            = $00020000;
  1731.   mci_Anim_Open_NoStatic          = $00040000;
  1732.  
  1733. { flags for dwFlags parameter of MCI_PLAY command message }
  1734. const
  1735.   mci_Anim_Play_Speed             = $00010000;
  1736.   mci_Anim_Play_Reverse           = $00020000;
  1737.   mci_Anim_Play_Fast              = $00040000;
  1738.   mci_Anim_Play_Slow              = $00080000;
  1739.   mci_Anim_Play_Scan              = $00100000;
  1740.  
  1741. { flags for dwFlags parameter of MCI_STEP command message }
  1742. const
  1743.   mci_Anim_Step_Reverse           = $00010000;
  1744.   mci_Anim_Step_Frames            = $00020000;
  1745.  
  1746. { flags for dwItem field of MCI_STATUS_PARMS parameter block }
  1747. const
  1748.   mci_Anim_Status_Speed           = $00004001;
  1749.   mci_Anim_Status_Forward         = $00004002;
  1750.   mci_Anim_Status_HWnd            = $00004003;
  1751.   mci_Anim_Status_HPal            = $00004004;
  1752.   mci_Anim_Status_Stretch         = $00004005;
  1753.  
  1754. { flags for the dwFlags parameter of MCI_INFO command message }
  1755. const
  1756.   mci_Anim_Info_Text              = $00010000;
  1757.  
  1758. { flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block }
  1759. const
  1760.   mci_Anim_GetDevCaps_Can_Reverse = $00004001;
  1761.   mci_Anim_GetDevCaps_Fast_Rate   = $00004002;
  1762.   mci_Anim_GetDevCaps_Slow_Rate   = $00004003;
  1763.   mci_Anim_GetDevCaps_Normal_Rate = $00004004;
  1764.   mci_Anim_GetDevCaps_Palettes    = $00004006;
  1765.   mci_Anim_GetDevCaps_Can_Stretch = $00004007;
  1766.   mci_Anim_GetDevCaps_Max_Windows = $00004008;
  1767.  
  1768. { flags for the MCI_REALIZE command message }
  1769. const
  1770.   mci_Anim_Realize_Norm           = $00010000;
  1771.   mci_Anim_Realize_Bkgd           = $00020000;
  1772.  
  1773. { flags for dwFlags parameter of MCI_WINDOW command message }
  1774. const
  1775.   mci_Anim_Window_HWnd            = $00010000;
  1776.   mci_Anim_Window_State           = $00040000;
  1777.   mci_Anim_Window_Text            = $00080000;
  1778.   mci_Anim_Window_Enable_Stretch  = $00100000;
  1779.   mci_Anim_Window_Disable_Stretch = $00200000;
  1780.  
  1781. { flags for hWnd field of MCI_ANIM_WINDOW_PARMS parameter block }
  1782. { MCI_WINDOW command message, (dwFlags == MCI_ANIM_WINDOW_HWND) }
  1783. const
  1784.   mci_Anim_Window_Default         = $00000000;
  1785.  
  1786. { flags for dwFlags parameter of MCI_PUT command message }
  1787. const
  1788.   mci_Anim_RECT                   = $00010000;
  1789.   mci_Anim_Put_Source             = $00020000;
  1790.   mci_Anim_Put_Destination        = $00040000;
  1791.  
  1792. { flags for dwFlags parameter of MCI_WHERE command message }
  1793. const
  1794.   mci_Anim_Where_Source           = $00020000;
  1795.   mci_Anim_Where_Destination      = $00040000;
  1796.  
  1797. { flags for dwFlags parameter of MCI_UPDATE command message }
  1798. const
  1799.   mci_Anim_Update_HDC             = $00020000;
  1800.  
  1801. { parameter block for MCI_OPEN command message }
  1802. type
  1803.   PMCI_Anim_Open_Parms = ^TMCI_Anim_Open_Parms;
  1804.   TMCI_Anim_Open_Parms = record
  1805.     dwCallback: Longint;
  1806.     wDeviceID: Word;
  1807.     wReserved0: Word;
  1808.     lpstrDeviceType: PChar;
  1809.     lpstrElementName: PChar;
  1810.     lpstrAlias: PChar;
  1811.     dwStyle: Longint;
  1812.     hWndParent: HWnd;
  1813.     wReserved1: Word;
  1814.   end;
  1815.  
  1816. { parameter block for MCI_PLAY command message }
  1817. type
  1818.   PMCI_Anim_Play_Parms = ^TMCI_Anim_Play_Parms;
  1819.   TMCI_Anim_Play_Parms = record
  1820.     dwCallback: Longint;
  1821.     dwFrom: Longint;
  1822.     dwTo: Longint;
  1823.     dwSpeed: Longint;
  1824.   end;
  1825.  
  1826. { parameter block for MCI_STEP command message }
  1827. type
  1828.   PMCI_Anim_Step_Parms = ^TMCI_Anim_Step_Parms;
  1829.   TMCI_Anim_Step_Parms = record
  1830.     dwCallback: Longint;
  1831.     dwFrames: Longint;
  1832.   end;
  1833.  
  1834. { parameter block for MCI_WINDOW command message }
  1835. type
  1836.   PMCI_Anim_Window_Parms = ^TMCI_Anim_Window_Parms;
  1837.   TMCI_Anim_Window_Parms = record
  1838.     dwCallback: Longint;
  1839.     Wnd: HWnd;  { formerly "hWnd" }
  1840.     wReserved1: Word;
  1841.     nCmdShow: Word;
  1842.     wReserved2: Word;
  1843.     lpstrText: PChar;
  1844.   end;
  1845.  
  1846. { parameter block for MCI_PUT, MCI_UPDATE, MCI_WHERE command messages }
  1847. type
  1848.   PMCI_Anim_Rect_Parms = ^ TMCI_Anim_Rect_Parms;
  1849.   TMCI_Anim_Rect_Parms = record
  1850.     dwCallback: Longint;
  1851.     rc: TRect;
  1852.   end;
  1853.  
  1854. { parameter block for MCI_UPDATE PARMS }
  1855. type
  1856.   PMCI_Anim_Update_Parms = ^TMCI_Anim_Update_Parms;
  1857.   TMCI_Anim_Update_Parms = record
  1858.     dwCallback: Longint;
  1859.     rc: TRect;
  1860.     hDC: HDC;
  1861.   end;
  1862.  
  1863.  
  1864. { MCI extensions for video overlay devices }
  1865.  
  1866. { flags for dwFlags parameter of MCI_OPEN command message }
  1867. const
  1868.   mci_Ovly_Open_WS                = $00010000;
  1869.   mci_Ovly_Open_Parent            = $00020000;
  1870.  
  1871. { flags for dwFlags parameter of MCI_STATUS command message }
  1872. const
  1873.   mci_Ovly_Status_HWnd            = $00004001;
  1874.   mci_Ovly_Status_Stretch         = $00004002;
  1875.  
  1876. { flags for dwFlags parameter of MCI_INFO command message }
  1877. const
  1878.   mci_Ovly_Info_Text              = $00010000;
  1879.  
  1880. { flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block }
  1881. const
  1882.   mci_Ovly_GetDevCaps_Can_Stretch = $00004001;
  1883.   mci_Ovly_GetDevCaps_Can_Freeze  = $00004002;
  1884.   mci_Ovly_GetDevCaps_Max_Windows = $00004003;
  1885.  
  1886. { flags for dwFlags parameter of MCI_WINDOW command message }
  1887. const
  1888.   mci_Ovly_Window_HWnd            = $00010000;
  1889.   mci_Ovly_Window_State           = $00040000;
  1890.   mci_Ovly_Window_Text            = $00080000;
  1891.   mci_Ovly_Window_Enable_Stretch  = $00100000;
  1892.   mci_Ovly_Window_Disable_Stretch = $00200000;
  1893.  
  1894. { flags for hWnd parameter of MCI_OVLY_WINDOW_PARMS parameter block }
  1895. const
  1896.   mci_Ovly_Window_Default         = $00000000;
  1897.  
  1898. { flags for dwFlags parameter of MCI_PUT command message }
  1899. const
  1900.   mci_Ovly_Rect                   = $00010000;
  1901.   mci_Ovly_Put_Source             = $00020000;
  1902.   mci_Ovly_Put_Destination        = $00040000;
  1903.   mci_Ovly_Put_Frame              = $00080000;
  1904.   mci_Ovly_Put_Video              = $00100000;
  1905.  
  1906. { flags for dwFlags parameter of MCI_WHERE command message }
  1907. const
  1908.   mci_Ovly_Where_Source           = $00020000;
  1909.   mci_Ovly_Where_Destination      = $00040000;
  1910.   mci_Ovly_Where_Frame            = $00080000;
  1911.   mci_Ovly_Where_Video            = $00100000;
  1912.  
  1913. { parameter block for MCI_OPEN command message }
  1914. type
  1915.   PMCI_Ovly_Open_Parms = ^TMCI_Ovly_Open_Parms;
  1916.   TMCI_Ovly_Open_Parms = record
  1917.     dwCallback: Longint;
  1918.     wDeviceID: Word;
  1919.     wReserved0: Word;
  1920.     lpstrDeviceType: PChar;
  1921.     lpstrElementName: PChar;
  1922.     lpstrAlias: PChar;
  1923.     dwStyle: Longint;
  1924.     hWndParent: HWnd;
  1925.     wReserved1: Word;
  1926.   end;
  1927.  
  1928. { parameter block for MCI_WINDOW command message }
  1929. type
  1930.   PMCI_Ovly_Window_Parms = ^TMCI_Ovly_Window_Parms;
  1931.   TMCI_Ovly_Window_Parms = record
  1932.     dwCallback: Longint;
  1933.     WHandle: HWnd; { formerly "hWnd"}
  1934.     wReserved1: Word;
  1935.     nCmdShow: Word;
  1936.     wReserved2: Word;
  1937.     lpstrText: PChar;
  1938.   end;
  1939.  
  1940. { parameter block for MCI_PUT, MCI_UPDATE, and MCI_WHERE command messages }
  1941. type
  1942.   PMCI_Ovly_Rect_Parms = ^ TMCI_Ovly_Rect_Parms;
  1943.   TMCI_Ovly_Rect_Parms = record
  1944.     dwCallback: Longint;
  1945.     rc: TRect;
  1946.   end;
  1947.  
  1948. { parameter block for MCI_SAVE command message }
  1949. type
  1950.   PMCI_Ovly_Save_Parms = ^TMCI_Ovly_Save_Parms;
  1951.   TMCI_Ovly_Save_Parms = record
  1952.     dwCallback: Longint;
  1953.     lpfilename: PChar;
  1954.     rc: TRect;
  1955.   end;
  1956.  
  1957. { parameter block for MCI_LOAD command message }
  1958. type
  1959.   PMCI_Ovly_Load_Parms = ^TMCI_Ovly_Load_Parms;
  1960.   TMCI_Ovly_Load_Parms = record
  1961.     dwCallback: Longint;
  1962.     lpfilename: PChar;
  1963.     rc: TRect;
  1964.   end;
  1965.  
  1966.  
  1967. {***************************************************************************
  1968.  
  1969.                         DISPLAY Driver extensions
  1970.  
  1971. ***************************************************************************}
  1972.  
  1973. const
  1974.   Caps1           = 94;          { other caps }
  1975.   c1_Transparent  = $0001;       { new raster cap }
  1976.   NewTransparent  = 3;           { use with SetBkMode() }
  1977.   QueryrOPSupport = 40;          { use to determine ROP support }
  1978.  
  1979. {***************************************************************************
  1980.  
  1981.                         DIB Driver extensions
  1982.  
  1983. ***************************************************************************}
  1984. const
  1985.   SelectDIB       = 41;                      { DIB.DRV select dib escape }
  1986.  
  1987. function DIBIndex(N: Integer): LongInt;
  1988. inline(
  1989.   $58/          { POP   AX }
  1990.   $BA/$FF/$10); { MOV   DX,10FFH }
  1991.  
  1992. {***************************************************************************
  1993.  
  1994.                         ScreenSaver support
  1995.  
  1996.     The current application will receive a syscommand of SC_SCREENSAVE just
  1997.     before the screen saver is invoked.  If the app wishes to prevent a
  1998.     screen save, return a non-zero value, otherwise call DefWindowProc().
  1999.  
  2000. ***************************************************************************}
  2001.  
  2002. const
  2003.   sc_ScreenSave   = $F140;
  2004.  
  2005. implementation
  2006.  
  2007. function mmsystemGetVersion;                 external 'MMSYSTEM' index 5;
  2008. procedure OutputDebugStr;                    external 'MMSYSTEM' index 30;
  2009. function sndPlaySound;                       external 'MMSYSTEM' index 2;
  2010. function waveOutGetNumDevs;                  external 'MMSYSTEM' index 401;
  2011. function waveOutGetDevCaps;                  external 'MMSYSTEM' index 402;
  2012. function waveOutGetVolume;                   external 'MMSYSTEM' index 415;
  2013. function waveOutSetVolume;                   external 'MMSYSTEM' index 416;
  2014. function waveOutGetErrorText;                external 'MMSYSTEM' index 403;
  2015. function waveOutOpen;                        external 'MMSYSTEM' index 404;
  2016. function waveOutClose;                       external 'MMSYSTEM' index 405;
  2017. function waveOutPrepareHeader;               external 'MMSYSTEM' index 406;
  2018. function waveOutUnprepareHeader;             external 'MMSYSTEM' index 407;
  2019. function waveOutWrite;                       external 'MMSYSTEM' index 408;
  2020. function waveOutPause;                       external 'MMSYSTEM' index 409;
  2021. function waveOutRestart;                     external 'MMSYSTEM' index 410;
  2022. function waveOutReset;                       external 'MMSYSTEM' index 411;
  2023. function waveOutBreakLoop;                   external 'MMSYSTEM' index 419;
  2024. function waveOutGetPosition;                 external 'MMSYSTEM' index 412;
  2025. function waveOutGetPitch;                    external 'MMSYSTEM' index 413;
  2026. function waveOutSetPitch;                    external 'MMSYSTEM' index 414;
  2027. function waveOutGetPlaybackRate;             external 'MMSYSTEM' index 417;
  2028. function waveOutSetPlaybackRate;             external 'MMSYSTEM' index 418;
  2029. function waveOutGetID;                       external 'MMSYSTEM' index 420;
  2030. function waveOutMessage;                     external 'MMSYSTEM' index 421;
  2031. function waveInGetNumDevs;                   external 'MMSYSTEM' index 501;
  2032. function waveInGetDevCaps;                   external 'MMSYSTEM' index 502;
  2033. function waveInGetErrorText;                 external 'MMSYSTEM' index 503;
  2034. function waveInOpen;                         external 'MMSYSTEM' index 504;
  2035. function waveInClose;                        external 'MMSYSTEM' index 505;
  2036. function waveInPrepareHeader;                external 'MMSYSTEM' index 506;
  2037. function waveInUnprepareHeader;              external 'MMSYSTEM' index 507;
  2038. function waveInAddBuffer;                    external 'MMSYSTEM' index 508;
  2039. function waveInStart;                        external 'MMSYSTEM' index 509;
  2040. function waveInStop;                         external 'MMSYSTEM' index 510;
  2041. function waveInReset;                        external 'MMSYSTEM' index 511;
  2042. function waveInGetPosition;                  external 'MMSYSTEM' index 512;
  2043. function waveInGetID;                        external 'MMSYSTEM' index 513;
  2044. function waveInMessage;                      external 'MMSYSTEM' index 514;
  2045. function midiOutGetNumDevs;                  external 'MMSYSTEM' index 201;
  2046. function midiOutGetDevCaps;                  external 'MMSYSTEM' index 202;
  2047. function midiOutGetVolume;                   external 'MMSYSTEM' index 211;
  2048. function midiOutSetVolume;                   external 'MMSYSTEM' index 212;
  2049. function midiOutGetErrorText;                external 'MMSYSTEM' index 203;
  2050. function midiOutOpen;                        external 'MMSYSTEM' index 204;
  2051. function midiOutClose;                       external 'MMSYSTEM' index 205;
  2052. function midiOutPrepareHeader;               external 'MMSYSTEM' index 206;
  2053. function midiOutUnprepareHeader;             external 'MMSYSTEM' index 207;
  2054. function midiOutShortMsg;                    external 'MMSYSTEM' index 208;
  2055. function midiOutLongMsg;                     external 'MMSYSTEM' index 209;
  2056. function midiOutReset;                       external 'MMSYSTEM' index 210;
  2057. function midiOutCachePatches;                external 'MMSYSTEM' index 213;
  2058. function midiOutCacheDrumPatches;            external 'MMSYSTEM' index 214;
  2059. function midiOutGetID;                       external 'MMSYSTEM' index 215;
  2060. function midiOutMessage;                     external 'MMSYSTEM' index 216;
  2061. function midiInGetNumDevs;                   external 'MMSYSTEM' index 301;
  2062. function midiInGetDevCaps;                   external 'MMSYSTEM' index 302;
  2063. function midiInGetErrorText;                 external 'MMSYSTEM' index 303;
  2064. function midiInOpen;                         external 'MMSYSTEM' index 304;
  2065. function midiInClose;                        external 'MMSYSTEM' index 305;
  2066. function midiInPrepareHeader;                external 'MMSYSTEM' index 306;
  2067. function midiInUnprepareHeader;              external 'MMSYSTEM' index 307;
  2068. function midiInAddBuffer;                    external 'MMSYSTEM' index 308;
  2069. function midiInStart;                        external 'MMSYSTEM' index 309;
  2070. function midiInStop;                         external 'MMSYSTEM' index 310;
  2071. function midiInReset;                        external 'MMSYSTEM' index 311;
  2072. function midiInGetID;                        external 'MMSYSTEM' index 312;
  2073. function midiInMessage;                      external 'MMSYSTEM' index 313;
  2074. function auxGetNumDevs;                      external 'MMSYSTEM' index 350;
  2075. function auxGetDevCaps;                      external 'MMSYSTEM' index 351;
  2076. function auxSetVolume;                       external 'MMSYSTEM' index 353;
  2077. function auxGetVolume;                       external 'MMSYSTEM' index 352;
  2078. function auxOutMessage;                      external 'MMSYSTEM' index 354;
  2079. function timeGetSystemTime;                  external 'MMSYSTEM' index 601;
  2080. function timeGetTime;                        external 'MMSYSTEM' index 607;
  2081. function timeSetEvent;                       external 'MMSYSTEM' index 602;
  2082. function timeKillEvent;                      external 'MMSYSTEM' index 603;
  2083. function timeGetDevCaps;                     external 'MMSYSTEM' index 604;
  2084. function timeBeginPeriod;                    external 'MMSYSTEM' index 605;
  2085. function timeEndPeriod;                      external 'MMSYSTEM' index 606;
  2086. function joyGetDevCaps;                      external 'MMSYSTEM' index 102;
  2087. function joyGetNumDevs;                      external 'MMSYSTEM' index 101;
  2088. function joyGetPos;                          external 'MMSYSTEM' index 103;
  2089. function joyGetThreshold;                    external 'MMSYSTEM' index 104;
  2090. function joyReleaseCapture;                  external 'MMSYSTEM' index 105;
  2091. function joySetCapture;                      external 'MMSYSTEM' index 106;
  2092. function joySetThreshold;                    external 'MMSYSTEM' index 107;
  2093. function mmioStringToFOURCC;                 external 'MMSYSTEM' index 1220;
  2094. function mmioInstallIOProc;                  external 'MMSYSTEM' index 1221;
  2095. function mmioOpen;                           external 'MMSYSTEM' index 1210;
  2096. function mmioRename;                         external 'MMSYSTEM' index 1226;
  2097. function mmioClose;                          external 'MMSYSTEM' index 1211;
  2098. function mmioRead;                           external 'MMSYSTEM' index 1212;
  2099. function mmioWrite;                          external 'MMSYSTEM' index 1213;
  2100. function mmioSeek;                           external 'MMSYSTEM' index 1214;
  2101. function mmioGetInfo;                        external 'MMSYSTEM' index 1215;
  2102. function mmioSetInfo;                        external 'MMSYSTEM' index 1216;
  2103. function mmioSetBuffer;                      external 'MMSYSTEM' index 1217;
  2104. function mmioFlush;                          external 'MMSYSTEM' index 1218;
  2105. function mmioAdvance;                        external 'MMSYSTEM' index 1219;
  2106. function mmioSendMessage;                    external 'MMSYSTEM' index 1222;
  2107. function mmioDescend;                        external 'MMSYSTEM' index 1223;
  2108. function mmioAscend;                         external 'MMSYSTEM' index 1224;
  2109. function mmioCreateChunk;                    external 'MMSYSTEM' index 1225;
  2110. function mciSendCommand;                     external 'MMSYSTEM' index 701;
  2111. function mciSendString;                      external 'MMSYSTEM' index 702;
  2112. function mciGetDeviceID;                     external 'MMSYSTEM' index 703;
  2113. function mciGetDeviceIDFromElementID;        external 'MMSYSTEM' index 715;
  2114. function mciGetErrorString;                  external 'MMSYSTEM' index 706;
  2115. function mciSetYieldProc;                    external 'MMSYSTEM' index 714;
  2116. function mciGetCreatorTask;                  external 'MMSYSTEM' index 717;
  2117. function mciGetYieldProc;                    external 'MMSYSTEM' index 716;
  2118.  
  2119. end.
  2120.