{*********************************} (*********************************)
{ Generated by c2pas32  v0.9b     } (*     Fixed by P.V.Ozerski      *)
{ (c) 2001 Oleg Bulychov          } (*     Original C header file    *)
{ Gladiators Software             } (*     (created at Dec-03-1998)  *)
{ http://www.astonshell.com/      } (*   from LCC-win32 is used      *)
{*********************************} (*   LCC-win32 (c) Jacob Navia   *)
                                    (*********************************)

Unit MMSystem;
{$ifndef NO_SMART_LINK}
  {$smartlink on}
{$endif}
{$MODE DELPHI}

{$ifdef FPC_OS_UNICODE}
  {$define UNICODE}
{$endif}
interface
uses
 windows;

Type
    MMRESULT   = UINT;
    MMVERSION  = UINT;
    HWAVEOUT   = THandle;
    LPHWAVEOUT = ^HWAVEOUT;
    HWAVEIN    = THandle;
    LPHWAVEIN  = ^HWAVEOUT;
    HWAVE      = THandle;
    LPHWAVE    = ^THandle;
    LPUINT     = ^UINT;

Const
    MAXPNAMELEN = 32;
    MAXERRORLENGTH = 256;
    MAX_JOYSTICKOEMVXDNAME = 260;
    MM_MIDI_MAPPER = 1;
    MM_WAVE_MAPPER = 2;
    MM_SNDBLST_MIDIOUT = 3;
    MM_SNDBLST_MIDIIN = 4;
    MM_SNDBLST_SYNTH = 5;
    MM_SNDBLST_WAVEOUT = 6;
    MM_SNDBLST_WAVEIN = 7;
    MM_ADLIB = 9;
    MM_MPU401_MIDIOUT = 10;
    MM_MPU401_MIDIIN = 11;
    MM_PC_JOYSTICK = 12;
    TIME_MS = 1;
    TIME_SAMPLES = 2;
    TIME_BYTES = 4;
    TIME_SMPTE = 8;
    TIME_MIDI = 16;
    TIME_TICKS = 32;

    MM_MCINOTIFY = $3B9;
    MM_WOM_OPEN = $3BB;
    MM_WOM_CLOSE = $3BC;
    MM_WOM_DONE = $3BD;
    MM_WIM_OPEN = $3BE;
    MM_WIM_CLOSE = $3BF;
    MM_WIM_DATA = $3C0;
    MM_MIM_OPEN = $3C1;
    MM_MIM_CLOSE = $3C2;
    MM_MIM_DATA = $3C3;
    MM_MIM_LONGDATA = $3C4;
    MM_MIM_ERROR = $3C5;
    MM_MIM_LONGERROR = $3C6;
    MM_MOM_OPEN = $3C7;
    MM_MOM_CLOSE = $3C8;
    MM_MOM_DONE = $3C9;
    MM_DRVM_OPEN = $3D0;
    MM_DRVM_CLOSE = $3D1;
    MM_DRVM_DATA = $3D2;
    MM_DRVM_ERROR = $3D3;
    MM_STREAM_OPEN = $3D4;
    MM_STREAM_CLOSE = $3D5;
    MM_STREAM_DONE = $3D6;
    MM_STREAM_ERROR = $3D7;
    MM_MOM_POSITIONCB = $3CA;
    MM_MCISIGNAL = $3CB;
    WAVE_INVALIDFORMAT = 0;
    WAVE_FORMAT_1M08 = 1;
    WAVE_FORMAT_1S08 = 2;
    WAVE_FORMAT_1M16 = 4;
    WAVE_FORMAT_1S16 = 8;
    WAVE_FORMAT_2M08 = 16;
    WAVE_FORMAT_2S08 = 32;
    WAVE_FORMAT_2M16 = 64;
    WAVE_FORMAT_2S16 = 128;
    WAVE_FORMAT_4M08 = 256;
    WAVE_FORMAT_4S08 = 512;
    WAVE_FORMAT_4M16 = $400;
    WAVE_FORMAT_4S16 = $800;
    MM_MIM_MOREDATA = $3CC;
    MM_MIXM_LINE_CHANGE = $3D0;
    MM_MIXM_CONTROL_CHANGE = $3D1;
    MMSYSERR_BASE = 0;
    WAVERR_BASE = 32;
    MIDIERR_BASE = 64;
    TIMERR_BASE = 96;
    JOYERR_BASE = 160;
    MCIERR_BASE = 256;
    MIXERR_BASE = 1024;
    MCI_STRING_OFFSET = 512;
    MCI_VD_OFFSET = 1024;
    MCI_CD_OFFSET = 1088;
    MCI_WAVE_OFFSET = 1152;
    MCI_SEQ_OFFSET = 1216;
    MMSYSERR_NOERROR = 0;
    MMSYSERR_ERROR = (MMSYSERR_BASE+1);
    MMSYSERR_BADDEVICEID = (MMSYSERR_BASE+2);
    MMSYSERR_NOTENABLED = (MMSYSERR_BASE+3);
    MMSYSERR_ALLOCATED = (MMSYSERR_BASE+4);
    MMSYSERR_INVALHANDLE = (MMSYSERR_BASE+5);
    MMSYSERR_NODRIVER = (MMSYSERR_BASE+6);
    MMSYSERR_NOMEM = (MMSYSERR_BASE+7);
    MMSYSERR_NOTSUPPORTED = (MMSYSERR_BASE+8);
    MMSYSERR_BADERRNUM = (MMSYSERR_BASE+9);
    MMSYSERR_INVALFLAG = (MMSYSERR_BASE+10);
    MMSYSERR_INVALPARAM = (MMSYSERR_BASE+11);
    MMSYSERR_HANDLEBUSY = (MMSYSERR_BASE+12);
    MMSYSERR_INVALIDALIAS = (MMSYSERR_BASE+13);
    MMSYSERR_BADDB = (MMSYSERR_BASE+14);
    MMSYSERR_KEYNOTFOUND = (MMSYSERR_BASE+15);
    MMSYSERR_READERROR = (MMSYSERR_BASE+16);
    MMSYSERR_WRITEERROR = (MMSYSERR_BASE+17);
    MMSYSERR_DELETEERROR = (MMSYSERR_BASE+18);
    MMSYSERR_VALNOTFOUND = (MMSYSERR_BASE+19);
    MMSYSERR_NODRIVERCB = (MMSYSERR_BASE+20);
    MMSYSERR_LASTERROR = (MMSYSERR_BASE+20);
    MM_JOY1MOVE = $3A0;
    MM_JOY2MOVE = $3A1;
    MM_JOY1ZMOVE = $3A2;
    MM_JOY2ZMOVE = $3A3;
    MM_JOY1BUTTONDOWN = $3B5;
    MM_JOY2BUTTONDOWN = $3B6;
    MM_JOY1BUTTONUP = $3B7;
    MM_JOY2BUTTONUP = $3B8;
    CALLBACK_TYPEMASK = $70000;
    CALLBACK_NULL = 0;
    CALLBACK_EVENT = $50000;
    CALLBACK_WINDOW = $10000;
    CALLBACK_TASK = $20000;
    CALLBACK_THREAD = CALLBACK_TASK;
    CALLBACK_FUNCTION = $30000;

Type
  HDRVR = THandle;

Const
    DRV_LOAD = 1;
    DRV_ENABLE = 2;
    DRV_OPEN = $3;
    DRV_CLOSE = 4;
    DRV_DISABLE = $5;
    DRV_FREE = $6;
    DRV_CONFIGURE = $7;
    DRV_QUERYCONFIGURE = 8;
    DRV_INSTALL = $9;
    DRV_REMOVE = $A;
    DRV_EXITSESSION = $B;
    DRV_POWER = $F;
    DRV_RESERVED = $800;
    DRV_USER = $4000;
    DRVCNF_CANCEL = 0;
    DRVCNF_OK = 1;
    DRVCNF_RESTART = 2;
    DRV_CANCEL = DRVCNF_CANCEL;
    DRV_OK = DRVCNF_OK;
    DRV_RESTART = DRVCNF_RESTART;
    DRV_MCI_FIRST = DRV_RESERVED;
    DRV_MCI_LAST = (DRV_RESERVED+$FFF);

Type
  PDRVCALLBACK = Procedure (hdrvr: tHandle; uMsg: UINT; dwUser, dw1, dw2: DWORD_PTR);  stdcall;

Function sndPlaySoundA(Name: LPCSTR; flags: UINT): BOOL; stdcall; external 'winmm.dll' name 'sndPlaySoundA';

Function sndPlaySoundW(Name: LPCWSTR; flags: UINT): BOOL;stdcall; external 'winmm.dll' name 'sndPlaySoundW';

Function sndPlaySound(Name: PChar; flags: UINT): BOOL;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'sndPlaySoundW' {$else}'sndPlaySoundA'{$endif};

Const
    SND_NODEFAULT = 2;
    SND_MEMORY = 4;
    SND_LOOP = 8;
    SND_NOSTOP = 16;
    SND_SYNC = 0;
    SND_ASYNC = 1;
    SND_PURGE = 64;
    SND_APPLICATION = 128;
    SND_ALIAS_START = 0;
    SND_ALIAS_SYSTEMHAND = 18515;
    SND_ALIAS_SYSTEMEXCLAMATION = 8531;
    SND_ALIAS_SYSTEMASTERISK = 10835;
    SND_ALIAS_SYSTEMQUESTION = 16211;
    SND_ALIAS_SYSTEMDEFAULT = 17491;
    SND_ALIAS_SYSTEMEXIT = 17747;
    SND_ALIAS_SYSTEMSTART = 21331;
    SND_ALIAS_SYSTEMWELCOME = 22355;
    SND_NOWAIT = $2000;
    SND_ALIAS = $10000;
    SND_ALIAS_ID = $110000;
    SND_FILENAME = $20000;
    SND_RESOURCE = $40004;
    WAVERR_BADFORMAT = (WAVERR_BASE+0);
    WAVERR_STILLPLAYING = (WAVERR_BASE+1);
    WAVERR_UNPREPARED = (WAVERR_BASE+2);
    WAVERR_SYNC = (WAVERR_BASE+3);
    WAVERR_LASTERROR = (WAVERR_BASE+3);
    WOM_OPEN = MM_WOM_OPEN;
    WOM_CLOSE = MM_WOM_CLOSE;
    WOM_DONE = MM_WOM_DONE;
    WIM_OPEN = MM_WIM_OPEN;
    WIM_CLOSE = MM_WIM_CLOSE;
    WIM_DATA = MM_WIM_DATA;
    WAVE_MAPPER = UINT(-1);
    WAVE_FORMAT_QUERY = 1;
    WAVE_ALLOWSYNC = 2;
    WAVE_MAPPED = 4;
    WAVE_FORMAT_DIRECT = 8;
    WAVE_FORMAT_DIRECT_QUERY = (WAVE_FORMAT_QUERY Or WAVE_FORMAT_DIRECT);
    WAVE_MAPPED_DEFAULT_COMMUNICATION_DEVICE = $10;
    MIM_OPEN = MM_MIM_OPEN;
    MIM_CLOSE = MM_MIM_CLOSE;
    MIM_DATA = MM_MIM_DATA;
    MIM_LONGDATA = MM_MIM_LONGDATA;
    MIM_ERROR = MM_MIM_ERROR;
    MIM_LONGERROR = MM_MIM_LONGERROR;
    MOM_OPEN = MM_MOM_OPEN;
    MOM_CLOSE = MM_MOM_CLOSE;
    MOM_DONE = MM_MOM_DONE;
    MIM_MOREDATA = MM_MIM_MOREDATA;
    MOM_POSITIONCB = MM_MOM_POSITIONCB;
    MIDIMAPPER = UINT(-1);
    MIDI_MAPPER = UINT(-1);
    MIDI_IO_STATUS = 32;
    MIDI_CACHE_ALL = 1;
    MIDI_CACHE_BESTFIT = 2;
    MIDI_CACHE_QUERY = 3;
    MIDI_UNCACHE = 4;
    WHDR_DONE = 1;
    WHDR_PREPARED = 2;
    WHDR_BEGINLOOP = $4;
    WHDR_ENDLOOP = $8;
    WHDR_INQUEUE = $10;
    MOD_MIDIPORT = 1;
    MOD_SYNTH = 2;
    MOD_SQSYNTH = 3;
    MOD_FMSYNTH = 4;
    MOD_MAPPER = 5;
    MOD_WAVETABLE =  6;  { hardware wavetable synth }
    MOD_SWSYNTH   =  7;  { software synth }
    MIDICAPS_VOLUME = 1;
    MIDICAPS_LRVOLUME = 2;
    MIDICAPS_CACHE = 4;
    MIDICAPS_STREAM = 8;
    MHDR_DONE = 1;
    MHDR_PREPARED = 2;
    MHDR_INQUEUE = $4;
    MHDR_ISSTRM = $8;
    MEVT_F_SHORT = 0;
    MEVT_F_LONG = $80000000;
    MEVT_F_CALLBACK = $40000000;

Function MEVT_EVENTTYPE(x: byte): byte;inline;
Function MEVT_EVENTPARM(x: DWORD): DWORD;inline;

Const
    MEVT_SHORTMSG = 0;
    MEVT_TEMPO = $1;
    MEVT_NOP = $2;
    MEVT_LONGMSG = $80;
    MEVT_COMMENT = $82;
    MEVT_VERSION = $84;
    MIDISTRM_ERROR = -2;
    MIDIPROP_SET = $80000000;
    MIDIPROP_GET = $40000000;
    MIDIPROP_TIMEDIV = 1;
    MIDIPROP_TEMPO = 2;
    MIXERLINE_LINEF_ACTIVE = 1;
    MIXERLINE_LINEF_DISCONNECTED = $8000;
    MIXERLINE_LINEF_SOURCE = $80000000;
    MIXERLINE_COMPONENTTYPE_DST_FIRST = 0;
    MIXERLINE_COMPONENTTYPE_DST_UNDEFINED = (MIXERLINE_COMPONENTTYPE_DST_FIRST);
    MIXERLINE_COMPONENTTYPE_DST_DIGITAL = (MIXERLINE_COMPONENTTYPE_DST_FIRST+1);
    MIXERLINE_COMPONENTTYPE_DST_LINE = (MIXERLINE_COMPONENTTYPE_DST_FIRST+2);
    MIXERLINE_COMPONENTTYPE_DST_MONITOR = (MIXERLINE_COMPONENTTYPE_DST_FIRST+3);
    MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = (MIXERLINE_COMPONENTTYPE_DST_FIRST+4);
    MIXERLINE_COMPONENTTYPE_DST_HEADPHONES = (MIXERLINE_COMPONENTTYPE_DST_FIRST+5);
    MIXERLINE_COMPONENTTYPE_DST_TELEPHONE = (MIXERLINE_COMPONENTTYPE_DST_FIRST+6);
    MIXERLINE_COMPONENTTYPE_DST_WAVEIN = (MIXERLINE_COMPONENTTYPE_DST_FIRST+7);
    MIXERLINE_COMPONENTTYPE_DST_VOICEIN = (MIXERLINE_COMPONENTTYPE_DST_FIRST+8);
    MIXERLINE_COMPONENTTYPE_DST_LAST = (MIXERLINE_COMPONENTTYPE_DST_FIRST+8);
    MIXERLINE_COMPONENTTYPE_SRC_FIRST = $1000;
    MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED = (MIXERLINE_COMPONENTTYPE_SRC_FIRST+0);
    MIXERLINE_COMPONENTTYPE_SRC_DIGITAL = (MIXERLINE_COMPONENTTYPE_SRC_FIRST+1);
    MIXERLINE_COMPONENTTYPE_SRC_LINE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST+2);
    MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST+3);
    MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER = (MIXERLINE_COMPONENTTYPE_SRC_FIRST+4);
    MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC = (MIXERLINE_COMPONENTTYPE_SRC_FIRST+5);
    MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST+6);
    MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER = (MIXERLINE_COMPONENTTYPE_SRC_FIRST+7);
    MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT = (MIXERLINE_COMPONENTTYPE_SRC_FIRST+8);
    MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY = (MIXERLINE_COMPONENTTYPE_SRC_FIRST+9);
    MIXERLINE_COMPONENTTYPE_SRC_ANALOG = (MIXERLINE_COMPONENTTYPE_SRC_FIRST+10);
    MIXERLINE_COMPONENTTYPE_SRC_LAST = (MIXERLINE_COMPONENTTYPE_SRC_FIRST+10);
    MIXERLINE_TARGETTYPE_UNDEFINED = 0;
    MIXERLINE_TARGETTYPE_WAVEOUT = 1;
    MIXERLINE_TARGETTYPE_WAVEIN = 2;
    MIXERLINE_TARGETTYPE_MIDIOUT = 3;
    MIXERLINE_TARGETTYPE_MIDIIN = 4;
    MIXERLINE_TARGETTYPE_AUX = 5;
    MIDIERR_UNPREPARED = (MIDIERR_BASE+0);
    MIDIERR_STILLPLAYING = (MIDIERR_BASE+1);
    MIDIERR_NOMAP = (MIDIERR_BASE+2);
    MIDIERR_NOTREADY = (MIDIERR_BASE+3);
    MIDIERR_NODEVICE = (MIDIERR_BASE+4);
    MIDIERR_INVALIDSETUP = (MIDIERR_BASE+5);
    MIDIERR_BADOPENMODE = (MIDIERR_BASE+6);
    MIDIERR_DONT_CONTINUE = (MIDIERR_BASE+7);
    MIDIERR_LASTERROR = (MIDIERR_BASE+7);
    MIXERCONTROL_CONTROLF_UNIFORM = 1;
    MIXERCONTROL_CONTROLF_MULTIPLE = 2;
    MIXERCONTROL_CONTROLF_DISABLED = $80000000;
    MIXERCONTROL_CT_CLASS_MASK = $F0000000;
    MIXERCONTROL_CT_CLASS_CUSTOM = 0;
    MIXERCONTROL_CT_CLASS_METER = $10000000;
    MIXERCONTROL_CT_CLASS_SWITCH = $20000000;
    MIXERCONTROL_CT_CLASS_NUMBER = $30000000;
    MIXERCONTROL_CT_CLASS_SLIDER = $40000000;
    MIXERCONTROL_CT_CLASS_FADER = $50000000;
    MIXERCONTROL_CT_CLASS_TIME = $60000000;
    MIXERCONTROL_CT_CLASS_LIST = $70000000;
    MIXERCONTROL_CT_SUBCLASS_MASK = $0F000000;
    MIXERCONTROL_CT_SC_SWITCH_BOOLEAN = 0;
    MIXERCONTROL_CT_SC_SWITCH_BUTTON = $1000000;
    MIXERCONTROL_CT_SC_METER_POLLED = 0;
    MIXERCONTROL_CT_SC_TIME_MICROSECS = 0;
    MIXERCONTROL_CT_SC_TIME_MILLISECS = $1000000;
    MIXERCONTROL_CT_SC_LIST_SINGLE = 0;
    MIXERCONTROL_CT_SC_LIST_MULTIPLE = $1000000;
    MIXERCONTROL_CT_UNITS_MASK = $0FF0000;
    MIXERCONTROL_CT_UNITS_CUSTOM = 0;
    MIXERCONTROL_CT_UNITS_BOOLEAN = $10000;
    MIXERCONTROL_CT_UNITS_SIGNED = $20000;
    MIXERCONTROL_CT_UNITS_UNSIGNED = $30000;
    MIXERCONTROL_CT_UNITS_DECIBELS = $40000;
    MIXERCONTROL_CT_UNITS_PERCENT = $50000;
    MIXERCONTROL_CONTROLTYPE_CUSTOM = (MIXERCONTROL_CT_CLASS_CUSTOM Or
                                       MIXERCONTROL_CT_UNITS_CUSTOM);
    MIXERCONTROL_CONTROLTYPE_BOOLEANMETER = (MIXERCONTROL_CT_CLASS_METER Or
                                             MIXERCONTROL_CT_SC_METER_POLLED Or
                                             MIXERCONTROL_CT_UNITS_BOOLEAN);
    MIXERCONTROL_CONTROLTYPE_SIGNEDMETER = (MIXERCONTROL_CT_CLASS_METER Or
                                            MIXERCONTROL_CT_SC_METER_POLLED Or
                                            MIXERCONTROL_CT_UNITS_SIGNED);
    MIXERCONTROL_CONTROLTYPE_PEAKMETER = (MIXERCONTROL_CONTROLTYPE_SIGNEDMETER+1);
    MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER = (MIXERCONTROL_CT_CLASS_METER Or
                                              MIXERCONTROL_CT_SC_METER_POLLED Or
                                              MIXERCONTROL_CT_UNITS_UNSIGNED);
    MIXERCONTROL_CONTROLTYPE_BOOLEAN = (MIXERCONTROL_CT_CLASS_SWITCH Or
                                        MIXERCONTROL_CT_SC_SWITCH_BOOLEAN Or
                                        MIXERCONTROL_CT_UNITS_BOOLEAN);
    MIXERCONTROL_CONTROLTYPE_ONOFF = (MIXERCONTROL_CONTROLTYPE_BOOLEAN+1);
    MIXERCONTROL_CONTROLTYPE_MUTE = (MIXERCONTROL_CONTROLTYPE_BOOLEAN+2);
    MIXERCONTROL_CONTROLTYPE_MONO = (MIXERCONTROL_CONTROLTYPE_BOOLEAN+3);
    MIXERCONTROL_CONTROLTYPE_LOUDNESS = (MIXERCONTROL_CONTROLTYPE_BOOLEAN+4);
    MIXERCONTROL_CONTROLTYPE_STEREOENH = (MIXERCONTROL_CONTROLTYPE_BOOLEAN+5);
    MIXERCONTROL_CONTROLTYPE_BUTTON = (MIXERCONTROL_CT_CLASS_SWITCH Or
                                       MIXERCONTROL_CT_SC_SWITCH_BUTTON Or
                                       MIXERCONTROL_CT_UNITS_BOOLEAN);
    MIXERCONTROL_CONTROLTYPE_DECIBELS = (MIXERCONTROL_CT_CLASS_NUMBER Or
                                         MIXERCONTROL_CT_UNITS_DECIBELS);
    MIXERCONTROL_CONTROLTYPE_SIGNED = (MIXERCONTROL_CT_CLASS_NUMBER Or
                                       MIXERCONTROL_CT_UNITS_SIGNED);
    MIXERCONTROL_CONTROLTYPE_UNSIGNED = (MIXERCONTROL_CT_CLASS_NUMBER Or
                                         MIXERCONTROL_CT_UNITS_UNSIGNED);
    MIXERCONTROL_CONTROLTYPE_PERCENT = (MIXERCONTROL_CT_CLASS_NUMBER Or
                                        MIXERCONTROL_CT_UNITS_PERCENT);
    MIXERCONTROL_CONTROLTYPE_SLIDER = (MIXERCONTROL_CT_CLASS_SLIDER Or
                                       MIXERCONTROL_CT_UNITS_SIGNED);
    MIXERCONTROL_CONTROLTYPE_PAN = (MIXERCONTROL_CONTROLTYPE_SLIDER+1);
    MIXERCONTROL_CONTROLTYPE_QSOUNDPAN = (MIXERCONTROL_CONTROLTYPE_SLIDER+2);
    MIXERCONTROL_CONTROLTYPE_FADER = (MIXERCONTROL_CT_CLASS_FADER Or
                                      MIXERCONTROL_CT_UNITS_UNSIGNED);
    MIXERCONTROL_CONTROLTYPE_VOLUME = (MIXERCONTROL_CONTROLTYPE_FADER+1);
    MIXERCONTROL_CONTROLTYPE_BASS = (MIXERCONTROL_CONTROLTYPE_FADER+2);
    MIXERCONTROL_CONTROLTYPE_TREBLE = (MIXERCONTROL_CONTROLTYPE_FADER+3);
    MIXERCONTROL_CONTROLTYPE_EQUALIZER = (MIXERCONTROL_CONTROLTYPE_FADER+4);
    MIXERCONTROL_CONTROLTYPE_SINGLESELECT = (MIXERCONTROL_CT_CLASS_LIST Or
                                             MIXERCONTROL_CT_SC_LIST_SINGLE Or
                                             MIXERCONTROL_CT_UNITS_BOOLEAN);
    MIXERCONTROL_CONTROLTYPE_MUX = (MIXERCONTROL_CONTROLTYPE_SINGLESELECT+1);
    MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT = (MIXERCONTROL_CT_CLASS_LIST Or
                                               MIXERCONTROL_CT_SC_LIST_MULTIPLE Or
                                               MIXERCONTROL_CT_UNITS_BOOLEAN);
    MIXERCONTROL_CONTROLTYPE_MIXER = (MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT+1);
    MIXERCONTROL_CONTROLTYPE_MICROTIME = (MIXERCONTROL_CT_CLASS_TIME Or
                                          MIXERCONTROL_CT_SC_TIME_MICROSECS Or
                                          MIXERCONTROL_CT_UNITS_UNSIGNED);
    MIXERCONTROL_CONTROLTYPE_MILLITIME = (MIXERCONTROL_CT_CLASS_TIME Or
                                          MIXERCONTROL_CT_SC_TIME_MILLISECS Or
                                          MIXERCONTROL_CT_UNITS_UNSIGNED);
    MIXER_SHORT_NAME_CHARS = 16;
    MIXER_LONG_NAME_CHARS = 64;
    MIXERR_INVALLINE = (MIXERR_BASE+0);
    MIXERR_INVALCONTROL = (MIXERR_BASE+1);
    MIXERR_INVALVALUE = (MIXERR_BASE+2);
    MIXERR_LASTERROR = (MIXERR_BASE+2);
    MIXER_OBJECTF_HANDLE = $80000000;
    MIXER_OBJECTF_MIXER = 0;
    MIXER_OBJECTF_HMIXER = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIXER);
    MIXER_OBJECTF_WAVEOUT = $10000000;
    MIXER_OBJECTF_HWAVEOUT = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEOUT);
    MIXER_OBJECTF_WAVEIN = $20000000;
    MIXER_OBJECTF_HWAVEIN = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEIN);
    MIXER_OBJECTF_MIDIOUT = $30000000;
    MIXER_OBJECTF_HMIDIOUT = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIOUT);
    MIXER_OBJECTF_MIDIIN = $40000000;
    MIXER_OBJECTF_HMIDIIN = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIIN);
    MIXER_OBJECTF_AUX = $50000000;
    MIXER_GETCONTROLDETAILSF_VALUE = 0;
    MIXER_GETCONTROLDETAILSF_LISTTEXT = 1;
    MIXER_GETCONTROLDETAILSF_QUERYMASK = $F;
    MIXER_SETCONTROLDETAILSF_VALUE = 0;
    MIXER_SETCONTROLDETAILSF_CUSTOM = 1;
    MIXER_SETCONTROLDETAILSF_QUERYMASK = $F;
    JOYERR_NOERROR = (0);
    JOYERR_PARMS = (JOYERR_BASE+5);
    JOYERR_NOCANDO = (JOYERR_BASE+6);
    JOYERR_UNPLUGGED = (JOYERR_BASE+7);
    JOY_BUTTON1 = 1;
    JOY_BUTTON2 = 2;
    JOY_BUTTON3 = 4;
    JOY_BUTTON4 = 8;
    JOY_BUTTON1CHG = 256;
    JOY_BUTTON2CHG = 512;
    JOY_BUTTON3CHG = $400;
    JOY_BUTTON4CHG = $800;
    JOY_BUTTON5 = 16;
    JOY_BUTTON6 = 32;
    JOY_BUTTON7 = 64;
    JOY_BUTTON8 = 128;
    JOY_BUTTON9 = 256;
    JOY_BUTTON10 = 512;
    JOY_BUTTON11 = $400;
    JOY_BUTTON12 = $800;
    JOY_BUTTON13 = $1000;
    JOY_BUTTON14 = $2000;
    JOY_BUTTON15 = $4000;
    JOY_BUTTON16 = $8000;
    JOY_BUTTON17 = $10000;
    JOY_BUTTON18 = $20000;
    JOY_BUTTON19 = $40000;
    JOY_BUTTON20 = $80000;
    JOY_BUTTON21 = $100000;
    JOY_BUTTON22 = $200000;
    JOY_BUTTON23 = $400000;
    JOY_BUTTON24 = $800000;
    JOY_BUTTON25 = $1000000;
    JOY_BUTTON26 = $2000000;
    JOY_BUTTON27 = $4000000;
    JOY_BUTTON28 = $8000000;
    JOY_BUTTON29 = $10000000;
    JOY_BUTTON30 = $20000000;
    JOY_BUTTON31 = $40000000;
    JOY_BUTTON32 = $80000000;
    JOY_POVCENTERED = -1;
    JOY_POVFORWARD = 0;
    JOY_POVRIGHT = 9000;
    JOY_POVBACKWARD = 18000;
    JOY_POVLEFT = 27000;
    JOY_RETURNX = 1;
    JOY_RETURNY = 2;
    JOY_RETURNZ = 4;
    JOY_RETURNR = 8;
    JOY_RETURNU = 16;
    JOY_RETURNV = 32;
    JOY_RETURNPOV = 64;
    JOY_RETURNBUTTONS = 128;
    JOY_RETURNRAWDATA = 256;
    JOY_RETURNPOVCTS = 512;
    JOY_RETURNCENTERED = $400;
    JOY_USEDEADZONE = $800;
    JOY_RETURNALL = (JOY_RETURNX Or JOY_RETURNY Or JOY_RETURNZ Or JOY_RETURNR Or
                     JOY_RETURNU Or JOY_RETURNV Or JOY_RETURNPOV Or JOY_RETURNBUTTONS);
    JOY_CAL_READALWAYS = $10000;
    JOY_CAL_READXYONLY = $20000;
    JOY_CAL_READ3 = $40000;
    JOY_CAL_READ4 = $80000;
    JOY_CAL_READXONLY = $100000;
    JOY_CAL_READYONLY = $200000;
    JOY_CAL_READ5 = $400000;
    JOY_CAL_READ6 = $800000;
    JOY_CAL_READZONLY = $1000000;
    JOY_CAL_READRONLY = $2000000;
    JOY_CAL_READUONLY = $4000000;
    JOY_CAL_READVONLY = $8000000;
    JOYSTICKID1 = 0;
    JOYSTICKID2 = 1;
    JOYCAPS_HASZ = 1;
    JOYCAPS_HASR = 2;
    JOYCAPS_HASU = 4;
    JOYCAPS_HASV = 8;
    JOYCAPS_HASPOV = 16;
    JOYCAPS_POV4DIR = 32;
    JOYCAPS_POVCTS = 64;
    MMIOERR_BASE = 256;
    MMIOERR_FILENOTFOUND = (MMIOERR_BASE+1);
    MMIOERR_OUTOFMEMORY = (MMIOERR_BASE+2);
    MMIOERR_CANNOTOPEN = (MMIOERR_BASE+3);
    MMIOERR_CANNOTCLOSE = (MMIOERR_BASE+4);
    MMIOERR_CANNOTREAD = (MMIOERR_BASE+5);
    MMIOERR_CANNOTWRITE = (MMIOERR_BASE+6);
    MMIOERR_CANNOTSEEK = (MMIOERR_BASE+7);
    MMIOERR_CANNOTEXPAND = (MMIOERR_BASE+8);
    MMIOERR_CHUNKNOTFOUND = (MMIOERR_BASE+9);
    MMIOERR_UNBUFFERED = (MMIOERR_BASE+10);
    MMIOERR_PATHNOTFOUND = (MMIOERR_BASE+11);
    MMIOERR_ACCESSDENIED = (MMIOERR_BASE+12);
    MMIOERR_SHARINGVIOLATION = (MMIOERR_BASE+13);
    MMIOERR_NETWORKERROR = (MMIOERR_BASE+14);
    MMIOERR_TOOMANYOPENFILES = (MMIOERR_BASE+15);
    MMIOERR_INVALIDFILE = (MMIOERR_BASE+16);
    CFSEPCHAR = '+';
    WAVECAPS_PITCH = 1;
    WAVECAPS_PLAYBACKRATE = 2;
    WAVECAPS_VOLUME = 4;
    WAVECAPS_LRVOLUME = 8;
    WAVECAPS_SYNC = 16;
    WAVECAPS_SAMPLEACCURATE = 32;
    WAVECAPS_DIRECTSOUND = 64;
    MIXER_GETLINEINFOF_DESTINATION = 0;
    MIXER_GETLINEINFOF_SOURCE = 1;
    MIXER_GETLINEINFOF_LINEID = 2;
    MIXER_GETLINEINFOF_COMPONENTTYPE = 3;
    MIXER_GETLINEINFOF_TARGETTYPE = 4;
    MIXER_GETLINEINFOF_QUERYMASK = $F;
    MMIO_RWMODE = 3;
    MMIO_SHAREMODE = $70;
    MMIO_CREATE = $1000;
    MMIO_PARSE = 256;
    MMIO_DELETE = 512;
    MMIO_EXIST = $4000;
    MMIO_ALLOCBUF = $10000;
    MMIO_GETTEMP = $20000;
    MMIO_DIRTY = $10000000;
    MMIO_READ = 0;
    MMIO_WRITE = 1;
    MMIO_READWRITE = 2;
    MMIO_COMPAT = 0;
    MMIO_EXCLUSIVE = 16;
    MMIO_DENYWRITE = 32;
    MMIO_DENYREAD = $30;
    MMIO_DENYNONE = 64;
    MMIO_FHOPEN = 16;
    MMIO_EMPTYBUF = 16;
    MMIO_TOUPPER = 16;
    MMIO_INSTALLPROC = $10000;
    MMIO_GLOBALPROC = $10000000;
    MMIO_REMOVEPROC = $20000;
    MMIO_UNICODEPROC = $1000000;
    MMIO_FINDPROC = $40000;
    MMIO_FINDCHUNK = 16;
    MMIO_FINDRIFF = 32;
    MMIO_FINDLIST = 64;
    MMIO_CREATERIFF = 32;
    MMIO_CREATELIST = 64;
    MMIOM_READ = MMIO_READ;
    MMIOM_WRITE = MMIO_WRITE;
    MMIOM_SEEK = 2;
    MMIOM_OPEN = 3;
    MMIOM_CLOSE = 4;
    MMIOM_WRITEFLUSH = 5;
    MMIOM_RENAME = 6;
    MMIOM_USER = $8000;
    FOURCC_RIFF = $46464952; {'R','I','F','F'}
    FOURCC_LIST = $5453494C; {'L','I','S','T'}
    FOURCC_DOS  = $20532F44; {'D','O','S',' '}
    FOURCC_MEM  = $204D454D; {'M','E','M',' '}
    SEEK_SET = 0;
    SEEK_CUR = 1;
    SEEK_END = 2;
    MMIO_DEFAULTBUFFER = 8192;
    MCIERR_INVALID_DEVICE_ID = (MCIERR_BASE+1);
    MCIERR_UNRECOGNIZED_KEYWORD = (MCIERR_BASE+3);
    MCIERR_UNRECOGNIZED_COMMAND = (MCIERR_BASE+5);
    MCIERR_HARDWARE = (MCIERR_BASE+6);
    MCIERR_INVALID_DEVICE_NAME = (MCIERR_BASE+7);
    MCIERR_OUT_OF_MEMORY = (MCIERR_BASE+8);
    MCIERR_DEVICE_OPEN = (MCIERR_BASE+9);
    MCIERR_CANNOT_LOAD_DRIVER = (MCIERR_BASE+10);
    MCIERR_MISSING_COMMAND_STRING = (MCIERR_BASE+11);
    MCIERR_PARAM_OVERFLOW = (MCIERR_BASE+12);
    MCIERR_MISSING_STRING_ARGUMENT = (MCIERR_BASE+13);
    MCIERR_BAD_INTEGER = (MCIERR_BASE+14);
    MCIERR_PARSER_INTERNAL = (MCIERR_BASE+15);
    MCIERR_DRIVER_INTERNAL = (MCIERR_BASE+16);
    MCIERR_MISSING_PARAMETER = (MCIERR_BASE+17);
    MCIERR_UNSUPPORTED_FUNCTION = (MCIERR_BASE+18);
    MCIERR_FILE_NOT_FOUND = (MCIERR_BASE+19);
    MCIERR_DEVICE_NOT_READY = (MCIERR_BASE+20);
    MCIERR_INTERNAL = (MCIERR_BASE+21);
    MCIERR_DRIVER = (MCIERR_BASE+22);
    MCIERR_CANNOT_USE_ALL = (MCIERR_BASE+23);
    MCIERR_MULTIPLE = (MCIERR_BASE+24);
    MCIERR_EXTENSION_NOT_FOUND = (MCIERR_BASE+25);
    MCIERR_OUTOFRANGE = (MCIERR_BASE+26);
    MCIERR_FLAGS_NOT_COMPATIBLE = (MCIERR_BASE+28);
    MCIERR_FILE_NOT_SAVED = (MCIERR_BASE+30);
    MCIERR_DEVICE_TYPE_REQUIRED = (MCIERR_BASE+31);
    MCIERR_DEVICE_LOCKED = (MCIERR_BASE+32);
    MCIERR_DUPLICATE_ALIAS = (MCIERR_BASE+33);
    MCIERR_BAD_CONSTANT = (MCIERR_BASE+34);
    MCIERR_MUST_USE_SHAREABLE = (MCIERR_BASE+35);
    MCIERR_MISSING_DEVICE_NAME = (MCIERR_BASE+36);
    MCIERR_BAD_TIME_FORMAT = (MCIERR_BASE+37);
    MCIERR_NO_CLOSING_QUOTE = (MCIERR_BASE+38);
    MCIERR_DUPLICATE_FLAGS = (MCIERR_BASE+39);
    MCIERR_INVALID_FILE = (MCIERR_BASE+40);
    MCIERR_NULL_PARAMETER_BLOCK = (MCIERR_BASE+41);
    MCIERR_UNNAMED_RESOURCE = (MCIERR_BASE+42);
    MCIERR_NEW_REQUIRES_ALIAS = (MCIERR_BASE+43);
    MCIERR_NOTIFY_ON_AUTO_OPEN = (MCIERR_BASE+44);
    MCIERR_NO_ELEMENT_ALLOWED = (MCIERR_BASE+45);
    MCIERR_NONAPPLICABLE_FUNCTION = (MCIERR_BASE+46);
    MCIERR_ILLEGAL_FOR_AUTO_OPEN = (MCIERR_BASE+47);
    MCIERR_FILENAME_REQUIRED = (MCIERR_BASE+48);
    MCIERR_EXTRA_CHARACTERS = (MCIERR_BASE+49);
    MCIERR_DEVICE_NOT_INSTALLED = (MCIERR_BASE+50);
    MCIERR_GET_CD = (MCIERR_BASE+51);
    MCIERR_SET_CD = (MCIERR_BASE+52);
    MCIERR_SET_DRIVE = (MCIERR_BASE+53);
    MCIERR_DEVICE_LENGTH = (MCIERR_BASE+54);
    MCIERR_DEVICE_ORD_LENGTH = (MCIERR_BASE+55);
    MCIERR_NO_INTEGER = (MCIERR_BASE+56);
    MCIERR_WAVE_OUTPUTSINUSE = (MCIERR_BASE+64);
    MCIERR_WAVE_SETOUTPUTINUSE = (MCIERR_BASE+65);
    MCIERR_WAVE_INPUTSINUSE = (MCIERR_BASE+66);
    MCIERR_WAVE_SETINPUTINUSE = (MCIERR_BASE+67);
    MCIERR_WAVE_OUTPUTUNSPECIFIED = (MCIERR_BASE+68);
    MCIERR_WAVE_INPUTUNSPECIFIED = (MCIERR_BASE+69);
    MCIERR_WAVE_OUTPUTSUNSUITABLE = (MCIERR_BASE+70);
    MCIERR_WAVE_SETOUTPUTUNSUITABLE = (MCIERR_BASE+71);
    MCIERR_WAVE_INPUTSUNSUITABLE = (MCIERR_BASE+72);
    MCIERR_WAVE_SETINPUTUNSUITABLE = (MCIERR_BASE+73);
    MCIERR_SEQ_DIV_INCOMPATIBLE = (MCIERR_BASE+80);
    MCIERR_SEQ_PORT_INUSE = (MCIERR_BASE+81);
    MCIERR_SEQ_PORT_NONEXISTENT = (MCIERR_BASE+82);
    MCIERR_SEQ_PORT_MAPNODEVICE = (MCIERR_BASE+83);
    MCIERR_SEQ_PORT_MISCERROR = (MCIERR_BASE+84);
    MCIERR_SEQ_TIMER = (MCIERR_BASE+85);
    MCIERR_SEQ_PORTUNSPECIFIED = (MCIERR_BASE+86);
    MCIERR_SEQ_NOMIDIPRESENT = (MCIERR_BASE+87);
    MCIERR_NO_WINDOW = (MCIERR_BASE+90);
    MCIERR_CREATEWINDOW = (MCIERR_BASE+91);
    MCIERR_FILE_READ = (MCIERR_BASE+92);
    MCIERR_FILE_WRITE = (MCIERR_BASE+93);
    MCIERR_NO_IDENTITY = (MCIERR_BASE+94);
    MCIERR_CUSTOM_DRIVER_BASE = (MCIERR_BASE+256);
    MCI_FIRST = DRV_MCI_FIRST;
    MCI_ESCAPE = $805;
    MCI_PLAY = $806;
    MCI_SEEK = $807;
    MCI_STOP = $808;
    MCI_PAUSE = $809;
    MCI_INFO = $80A;
    MCI_GETDEVCAPS = $80B;
    MCI_BREAK = $811;
    MCI_WHERE = $843;
    MCI_FREEZE = $844;
    MCI_UNFREEZE = $845;
    MCI_LOAD = $850;
    MCI_CUT = $851;
    MCI_COPY = $852;
    MCI_PASTE = $853;
    MCI_UPDATE = $854;
    MCI_RESUME = $855;
    MCI_DELETE = $856;
    MCI_SET = $80D;
    MCI_STEP = $80E;
    MCI_SAVE = $813;
    MCI_SPIN = $80C;
    MCI_STATUS = $814;
    MCI_CUE = $830;
    MCI_REALIZE = $840;
    MCI_WINDOW = $841;
    MCI_PUT = $842;
    MCI_RECORD = $80F;
    MCI_SYSINFO = $810;
    MCI_OPEN = $803;
    MCI_CLOSE = $804;
    MCI_USER_MESSAGES = (DRV_MCI_FIRST+$400);
    MCI_LAST = $0FFF;
    MCI_ALL_DEVICE_ID = -1;
    MCI_DEVTYPE_VCR = 513;
    MCI_DEVTYPE_VIDEODISC = 514;
    MCI_DEVTYPE_OVERLAY = 515;
    MCI_DEVTYPE_CD_AUDIO = 516;
    MCI_DEVTYPE_DAT = 517;
    MCI_DEVTYPE_SCANNER = 518;
    MCI_DEVTYPE_ANIMATION = 519;
    MCI_DEVTYPE_DIGITAL_VIDEO = 520;
    MCI_DEVTYPE_OTHER = 521;
    MCI_DEVTYPE_WAVEFORM_AUDIO = 522;
    MCI_DEVTYPE_SEQUENCER = 523;
    MCI_DEVTYPE_FIRST = MCI_DEVTYPE_VCR;
    MCI_DEVTYPE_LAST = MCI_DEVTYPE_SEQUENCER;
    MCI_DEVTYPE_FIRST_USER = $1000;
    MCI_MODE_NOT_READY = (MCI_STRING_OFFSET+12);
    MCI_MODE_STOP = (MCI_STRING_OFFSET+13);
    MCI_MODE_PLAY = (MCI_STRING_OFFSET+14);
    MCI_MODE_RECORD = (MCI_STRING_OFFSET+15);
    MCI_MODE_SEEK = (MCI_STRING_OFFSET+16);
    MCI_MODE_PAUSE = (MCI_STRING_OFFSET+17);
    MCI_MODE_OPEN = (MCI_STRING_OFFSET+18);
    MCI_FORMAT_MILLISECONDS = 0;
    MCI_FORMAT_HMS = 1;
    MCI_FORMAT_MSF = 2;
    MCI_FORMAT_FRAMES = 3;
    MCI_FORMAT_SMPTE_24 = 4;
    MCI_FORMAT_SMPTE_25 = 5;
    MCI_FORMAT_SMPTE_30 = 6;
    MCI_FORMAT_SMPTE_30DROP = 7;
    MCI_FORMAT_BYTES = 8;
    MCI_FORMAT_SAMPLES = 9;
    MCI_FORMAT_TMSF = 10;

Function MCI_MSF_MINUTE(msf: longint): byte;inline;
Function MCI_MSF_SECOND(msf: longint): byte;inline;
Function MCI_MSF_FRAME(msf: longint): byte;inline;
Function MCI_MAKE_MSF(m, s, f: byte): longint;inline;

Const
    MCI_SET_DOOR_OPEN = 256;
    MCI_SET_DOOR_CLOSED = 512;
    MCI_SET_TIME_FORMAT = $400;
    MCI_SET_AUDIO = $800;
    MCI_SET_VIDEO = $1000;
    MCI_SET_ON = $2000;
    MCI_SET_OFF = $4000;
    MCI_SET_AUDIO_ALL = 0;
    MCI_SET_AUDIO_LEFT = 1;
    MCI_SET_AUDIO_RIGHT = 2;

Function MCI_TMSF_TRACK(tmsf: longint): byte;inline;
Function MCI_TMSF_MINUTE(tmsf: longint): byte;inline;
Function MCI_TMSF_SECOND(tmsf: longint): byte;inline;
Function MCI_TMSF_FRAME(tmsf: longint): byte;inline;
Function MCI_HMS_HOUR(h: longint): byte;inline;
Function MCI_HMS_MINUTE(h: longint): byte;inline;
Function MCI_HMS_SECOND(h: longint): byte;inline;
Function MCI_MAKE_HMS(h, m, s: byte): longint;inline;

Const
    MCI_INFO_PRODUCT = 256;
    MCI_INFO_FILE = 512;
    MCI_INFO_MEDIA_UPC = $400;
    MCI_INFO_MEDIA_IDENTITY = $800;
    MCI_INFO_NAME = $1000;
    MCI_INFO_COPYRIGHT = $2000;

Function MCI_MAKE_TMSF(t, m, s, f: byte): longint;inline;

Const
    MCI_WAIT = 2;
    MCI_FROM = 4;
    MCI_TO = 8;
    MCI_TRACK = 16;
    MCI_SEEK_TO_START = 256;
    MCI_SEEK_TO_END = 512;
    MCI_STATUS_ITEM = 256;
    MCI_STATUS_START = 512;
    MCI_STATUS_LENGTH = 1;
    MCI_STATUS_POSITION = 2;
    MCI_STATUS_NUMBER_OF_TRACKS = 3;
    MCI_STATUS_MODE = 4;
    MCI_STATUS_MEDIA_PRESENT = 5;
    MCI_STATUS_TIME_FORMAT = 6;
    MCI_STATUS_READY = 7;
    MCI_STATUS_CURRENT_TRACK = 8;
    MCI_OPEN_SHAREABLE = 256;
    MCI_OPEN_ELEMENT = 512;
    MCI_OPEN_ALIAS = $400;
    MCI_OPEN_ELEMENT_ID = $800;
    MCI_OPEN_TYPE_ID = $1000;
    MCI_OPEN_TYPE = $2000;
    MCI_GETDEVCAPS_ITEM = 256;
    MCI_GETDEVCAPS_CAN_RECORD = 1;
    MCI_GETDEVCAPS_HAS_AUDIO = 2;
    MCI_GETDEVCAPS_HAS_VIDEO = 3;
    MCI_GETDEVCAPS_DEVICE_TYPE = 4;
    MCI_GETDEVCAPS_USES_FILES = 5;
    MCI_GETDEVCAPS_COMPOUND_DEVICE = 6;
    MCI_GETDEVCAPS_CAN_EJECT = 7;
    MCI_GETDEVCAPS_CAN_PLAY = 8;
    MCI_GETDEVCAPS_CAN_SAVE = 9;
    MCI_SYSINFO_QUANTITY = 256;
    MCI_SYSINFO_OPEN = 512;
    MCI_SYSINFO_NAME = $400;
    MCI_SYSINFO_INSTALLNAME = $800;
    MCI_NOTIFY_SUCCESSFUL = 1;
    MCI_NOTIFY_SUPERSEDED = 2;
    MCI_NOTIFY_ABORTED = 4;
    MCI_NOTIFY_FAILURE = 8;
    MCI_NOTIFY = 1;
    MCI_BREAK_KEY = 256;
    MCI_BREAK_HWND = 512;
    MCI_BREAK_OFF = $400;
    MCI_RECORD_INSERT = 256;
    MCI_RECORD_OVERWRITE = 512;
    MCI_SAVE_FILE = 256;
    MCI_LOAD_FILE = 256;
    MCI_VD_GETDEVCAPS_FAST_RATE = $4003;
    MCI_VD_GETDEVCAPS_SLOW_RATE = $4004;
    MCI_VD_GETDEVCAPS_NORMAL_RATE = $4005;
    MCI_VD_STEP_FRAMES = $10000;
    MCI_VD_STEP_REVERSE = $20000;
    MCI_VD_ESCAPE_STRING = 256;
    MCI_VD_FORMAT_TRACK = $4001;
    MCI_VD_PLAY_REVERSE = $10000;
    MCI_VD_PLAY_FAST = $20000;
    MCI_VD_MODE_PARK = (MCI_VD_OFFSET+1);
    MCI_VD_GETDEVCAPS_CAV = $20000;
    MCI_VD_SPIN_UP = $10000;
    MCI_VD_SPIN_DOWN = $20000;
    MCI_VD_SEEK_REVERSE = $10000;
    MCI_VD_STATUS_SPEED = $4002;
    MCI_VD_STATUS_FORWARD = $4003;
    MCI_VD_STATUS_MEDIA_TYPE = $4004;
    MCI_VD_STATUS_SIDE = $4005;
    MCI_VD_GETDEVCAPS_CAN_REVERSE = $4002;
    MCI_VD_MEDIA_CLV = (MCI_VD_OFFSET+2);
    MCI_VD_MEDIA_CAV = (MCI_VD_OFFSET+3);
    MCI_VD_MEDIA_OTHER = (MCI_VD_OFFSET+4);
    MCI_VD_STATUS_DISC_SIZE = $4006;
    MCI_VD_GETDEVCAPS_CLV = $10000;
    MCI_VD_PLAY_SPEED = $40000;
    MCI_VD_PLAY_SCAN = $80000;
    MCI_VD_PLAY_SLOW = $100000;
    MCI_WAVE_STATUS_CHANNELS = $4002;
    MCI_WAVE_STATUS_SAMPLESPERSEC = $4003;
    MCI_WAVE_PCM = MCI_WAVE_OFFSET;
    MCI_WAVE_MAPPER = (MCI_WAVE_OFFSET+1);
    MCI_WAVE_OPEN_BUFFER = $10000;
    MCI_WAVE_STATUS_BITSPERSAMPLE = $4006;
    MCI_WAVE_STATUS_LEVEL = $4007;
    MCI_WAVE_SET_FORMATTAG = $10000;
    MCI_WAVE_SET_CHANNELS = $20000;
    MCI_WAVE_SET_SAMPLESPERSEC = $40000;
    MCI_WAVE_SET_AVGBYTESPERSEC = $80000;
    MCI_WAVE_SET_BLOCKALIGN = $100000;
    MCI_WAVE_SET_BITSPERSAMPLE = $200000;
    MCI_WAVE_INPUT = $400000;
    MCI_WAVE_OUTPUT = $800000;
    MCI_WAVE_STATUS_FORMATTAG = $4001;
    MCI_WAVE_SET_ANYINPUT = $4000000;
    MCI_WAVE_SET_ANYOUTPUT = $8000000;
    MCI_WAVE_GETDEVCAPS_INPUTS = $4001;
    MCI_WAVE_GETDEVCAPS_OUTPUTS = $4002;
    MCI_WAVE_STATUS_AVGBYTESPERSEC = $4004;
    MCI_WAVE_STATUS_BLOCKALIGN = $4005;
    MCI_CDA_STATUS_TYPE_TRACK = $4001;
    MCI_CDA_TRACK_AUDIO = (MCI_CD_OFFSET);
    MCI_CDA_TRACK_OTHER = (MCI_CD_OFFSET+1);
    MCI_SEQ_DIV_PPQN = (MCI_SEQ_OFFSET);
    MCI_SEQ_DIV_SMPTE_24 = (MCI_SEQ_OFFSET+1);
    MCI_SEQ_DIV_SMPTE_25 = (MCI_SEQ_OFFSET+2);
    MCI_SEQ_DIV_SMPTE_30DROP = (MCI_SEQ_OFFSET+3);
    MCI_SEQ_DIV_SMPTE_30 = (MCI_SEQ_OFFSET+4);
    MCI_SEQ_FORMAT_SONGPTR = $4001;
    MCI_SEQ_FILE = $4002;
    MCI_SEQ_MIDI = $4003;
    MCI_SEQ_SMPTE = $4004;
    MCI_SEQ_NONE = 65533;
    MCI_SEQ_MAPPER = 65535;
    MCI_SEQ_STATUS_TEMPO = $4002;
    MCI_SEQ_STATUS_PORT = $4003;
    MCI_SEQ_STATUS_SLAVE = $4007;
    MCI_SEQ_STATUS_MASTER = $4008;
    MCI_SEQ_STATUS_OFFSET = $4009;
    MCI_SEQ_STATUS_DIVTYPE = $400A;
    MCI_SEQ_STATUS_NAME = $400B;
    MCI_SEQ_STATUS_COPYRIGHT = $400C;
    MCI_SEQ_SET_TEMPO = $10000;
    MCI_SEQ_SET_PORT = $20000;
    MCI_SEQ_SET_SLAVE = $40000;
    MCI_SEQ_SET_MASTER = $80000;
    MCI_SEQ_SET_OFFSET = $1000000;
    MCI_ANIM_PLAY_SLOW = $80000;
    MCI_ANIM_PLAY_SCAN = $100000;
    MCI_ANIM_GETDEVCAPS_SLOW_RATE = $4003;
    MCI_ANIM_GETDEVCAPS_NORMAL_RATE = $4004;
    MCI_ANIM_STEP_REVERSE = $10000;
    MCI_ANIM_STEP_FRAMES = $20000;
    MCI_ANIM_STATUS_SPEED = $4001;
    MCI_ANIM_GETDEVCAPS_PALETTES = $4006;
    MCI_ANIM_OPEN_WS = $10000;
    MCI_ANIM_OPEN_PARENT = $20000;
    MCI_ANIM_OPEN_NOSTATIC = $40000;
    MCI_ANIM_GETDEVCAPS_FAST_RATE = $4002;
    MCI_ANIM_PLAY_SPEED = $10000;
    MCI_ANIM_PLAY_REVERSE = $20000;
    MCI_ANIM_PLAY_FAST = $40000;
    MCI_ANIM_STATUS_FORWARD = $4002;
    MCI_ANIM_STATUS_HWND = $4003;
    MCI_ANIM_STATUS_HPAL = $4004;
    MCI_ANIM_STATUS_STRETCH = $4005;
    MCI_ANIM_INFO_TEXT = $10000;
    MCI_ANIM_GETDEVCAPS_CAN_REVERSE = $4001;
    MCI_ANIM_WINDOW_TEXT = $80000;
    MCI_ANIM_WINDOW_ENABLE_STRETCH = $100000;
    MCI_ANIM_WINDOW_DISABLE_STRETCH = $200000;
    MCI_ANIM_WINDOW_DEFAULT = 0;
    MCI_ANIM_RECT = $10000;
    MCI_ANIM_PUT_SOURCE = $20000;
    MCI_ANIM_PUT_DESTINATION = $40000;
    MCI_ANIM_WHERE_SOURCE = $20000;
    MCI_ANIM_WHERE_DESTINATION = $40000;
    MCI_ANIM_UPDATE_HDC = $20000;
    MCI_ANIM_GETDEVCAPS_CAN_STRETCH = $4007;
    MCI_ANIM_GETDEVCAPS_MAX_WINDOWS = $4008;
    MCI_ANIM_REALIZE_NORM = $10000;
    MCI_ANIM_REALIZE_BKGD = $20000;
    MCI_ANIM_WINDOW_HWND = $10000;
    MCI_ANIM_WINDOW_STATE = $40000;
    TIMERR_NOERROR = 0;
    TIMERR_NOCANDO = (TIMERR_BASE+1);
    TIMERR_STRUCT = (TIMERR_BASE+33);
    TIME_ONESHOT = 0;
    TIME_PERIODIC = 1;
    TIME_CALLBACK_FUNCTION = 0;
    TIME_CALLBACK_EVENT_SET = 16;
    TIME_CALLBACK_EVENT_PULSE = 32;
    MCI_OVLY_OPEN_WS = $10000;
    MCI_OVLY_OPEN_PARENT = $20000;
    MCI_OVLY_STATUS_HWND = $4001;
    MCI_OVLY_STATUS_STRETCH = $4002;
    MCI_OVLY_INFO_TEXT = $10000;
    MCI_OVLY_GETDEVCAPS_CAN_STRETCH = $4001;
    MCI_OVLY_GETDEVCAPS_CAN_FREEZE = $4002;
    MCI_OVLY_GETDEVCAPS_MAX_WINDOWS = $4003;
    MCI_OVLY_WINDOW_HWND = $10000;
    MCI_OVLY_WINDOW_STATE = $40000;
    MCI_OVLY_WINDOW_TEXT = $80000;
    MCI_OVLY_WINDOW_ENABLE_STRETCH = $100000;
    MCI_OVLY_WINDOW_DISABLE_STRETCH = $200000;
    MCI_OVLY_WINDOW_DEFAULT = 0;
    MCI_OVLY_RECT = $10000;
    MCI_OVLY_PUT_SOURCE = $20000;
    MCI_OVLY_PUT_DESTINATION = $40000;
    MCI_OVLY_PUT_FRAME = $80000;
    MCI_OVLY_PUT_VIDEO = $100000;
    MCI_OVLY_WHERE_SOURCE = $20000;
    MCI_OVLY_WHERE_DESTINATION = $40000;
    MCI_OVLY_WHERE_FRAME = $80000;
    MCI_OVLY_WHERE_VIDEO = $100000;
    AUX_MAPPER = -1;
    MIXER_GETLINECONTROLSF_ONEBYID = 1;
    MIXER_GETLINECONTROLSF_ONEBYTYPE = 2;
    MIXER_GETLINECONTROLSF_ALL = 0;
    MIXER_GETLINECONTROLSF_QUERYMASK = $F;
    NEWTRANSPARENT = 3;
    QUERYROPSUPPORT = 40;
    SELECTDIB = 41;
Function DIBINDEX(n: longint): longint;inline;

Const
    SC_SCREENSAVE = $F140;
    AUXCAPS_CDAUDIO = 1;
    AUXCAPS_AUXIN = 2;
    AUXCAPS_VOLUME = 1;
    AUXCAPS_LRVOLUME = 2;

(*/////////////////////////////////////////////////////////*)
(* Structures and typedefs*)
(*/////////////////////////////////////////////////////////*)

Type
  _mmtime = packed Record
                     wType: UINT;
                     Case integer Of
                       0: (ms: DWORD);
                       1: (sample: DWORD);
                       2: (cb: DWORD);
                       3: (ticks: DWORD);
                       4: (smpte: packed Record
                           hour, min, sec, frame, fps, dummy: byte;
                           pad: Array[0..1] Of byte
                           End);
                       5: (songptrpos: DWORD);
                     End;
 MMTIME = _mmtime;
 PMMTIME = ^_mmtime;
 NPMMTIME = ^_mmtime;
 LPMMTIME = ^_mmtime;
 PWAVEHDR = ^_wavehdr;
 TMMTime  = _mmtime;

 _wavehdr = packed Record
                            lpData: PChar;
                            dwBufferLength: DWORD;
                            dwBytesRecorded: DWORD;
                            dwUser: DWORD_PTR;
                            dwFlags: DWORD;
                            dwLoops: DWORD;
                            lpNext: PWAVEHDR;
                            reserved: DWORD_PTR;
          End;
 WAVEHDR = _wavehdr;
 TWAVEHDR=  WAVEHDR;
 NPWAVEHDR = ^_wavehdr;
 LPWAVEHDR = ^_wavehdr;

 _WAVEOUTCAPSA = packed Record
                          wMid: WORD;
                          wPid: WORD;
                          vDriverVersion: MMVERSION;
                          szPname: array [0..Pred(MAXPNAMELEN)] Of CHAR;
                          dwFormats: DWORD;
                          wChannels: WORD;
                          wReserved1: WORD;
                          dwSupport: DWORD;
   End;
 WAVEOUTCAPSA   = _WAVEOUTCAPSA;
 TWAVEOUTCAPSA  = WAVEOUTCAPSA;
 PWAVEOUTCAPSA  = ^_WAVEOUTCAPSA;
 NPWAVEOUTCAPSA = ^_WAVEOUTCAPSA;
 LPWAVEOUTCAPSA = ^_WAVEOUTCAPSA;

 _WAVEOUTCAPSW = packed Record
                          wMid: WORD;
                          wPid: WORD;
                          vDriverVersion: MMVERSION;
                          szPname: array [0..Pred(MAXPNAMELEN)] Of WCHAR;
                          dwFormats: DWORD;
                          wChannels: WORD;
                          wReserved1: WORD;
                          dwSupport: DWORD;
                        End;

 WAVEOUTCAPSW   = _WAVEOUTCAPSW;
 PWAVEOUTCAPSW  = ^_WAVEOUTCAPSW;
 NPWAVEOUTCAPSW = ^_WAVEOUTCAPSW;
 LPWAVEOUTCAPSW = ^_WAVEOUTCAPSW;
 TWAVEOUTCAPSW  = _WAVEOUTCAPSW;
 {$ifdef UNICODE}
   WAVEOUTCAPS = WAVEOUTCAPSW;
   PWAVEOUTCAPS = PWAVEOUTCAPSW;
   NPWAVEOUTCAPS = NPWAVEOUTCAPSW;
   LPWAVEOUTCAPS = LPWAVEOUTCAPSW;
 {$else}
   WAVEOUTCAPS = WAVEOUTCAPSA;
   PWAVEOUTCAPS = PWAVEOUTCAPSA;
   NPWAVEOUTCAPS = NPWAVEOUTCAPSA;
   LPWAVEOUTCAPS = LPWAVEOUTCAPSA;
 {$endif}
 TWAVEOUTCAPS = WAVEOUTCAPS;

 _WAVEINCAPSA = packed Record
                         wMid: WORD;
                         wPid: WORD;
                         vDriverVersion: MMVERSION;
                         szPname: array [0..Pred(MAXPNAMELEN)] Of CHAR;
                         dwFormats: DWORD;
                         wChannels: WORD;
                         wReserved1: WORD;
			End;
 WAVEINCAPSA   = _WAVEINCAPSA;
 PWAVEINCAPSA  = ^_WAVEINCAPSA;
 NPWAVEINCAPSA = ^_WAVEINCAPSA;
 LPWAVEINCAPSA = ^_WAVEINCAPSA;
 TWAVEINCAPSA  = WAVEINCAPSA;

 _WAVEINCAPSW  = packed Record
                        wMid: WORD;
                        wPid: WORD;
                        vDriverVersion: MMVERSION;
                        szPname: array [0..Pred(MAXPNAMELEN)] Of WCHAR;
                        dwFormats: DWORD;
                        wChannels: WORD;
                        wReserved1: WORD;
			End;
 WAVEINCAPSW   = _WAVEINCAPSW;
 PWAVEINCAPSW  = ^_WAVEINCAPSW;
 NPWAVEINCAPSW = ^_WAVEINCAPSW;
 LPWAVEINCAPSW = ^_WAVEINCAPSW;
 TWAVEINCAPSW  = WAVEINCAPSW;
 {$ifdef UNICODE}
  WAVEINCAPS   = WAVEINCAPSW;
  PWAVEINCAPS  = PWAVEINCAPSW;
  NPWAVEINCAPS = NPWAVEINCAPSW;
  LPWAVEINCAPS = LPWAVEINCAPSW;
 {$else}
  WAVEINCAPS   = WAVEINCAPSA;
  PWAVEINCAPS  = PWAVEINCAPSA;
  NPWAVEINCAPS = NPWAVEINCAPSA;
  LPWAVEINCAPS = LPWAVEINCAPSA;
 {$endif}
 TWAVEINCAPS   = WAVEINCAPS;

 _waveformat = packed Record
                       wFormatTag: WORD;
                       nChannels: WORD;
                       nSamplesPerSec: DWORD;
                       nAvgBytesPerSec: DWORD;
                       nBlockAlign: WORD;
		      End;
 WAVEFORMAT   = _waveformat;
 PWAVEFORMAT  = ^_waveformat;
 NPWAVEFORMAT = ^_waveformat;
 LPWAVEFORMAT = ^_waveformat;
 TWAVEFORMAT  = _waveformat;

Const
  WAVE_FORMAT_PCM = 1;

Type
  _pcmwaveformat = packed Record
                            wf: WAVEFORMAT;
                            wBitsPerSample: WORD;
		   	  End;
  PCMWAVEFORMAT   = _pcmwaveformat;
  PPCMWAVEFORMAT  = ^_pcmwaveformat;
  NPPCMWAVEFORMAT = ^_pcmwaveformat;
  LPPCMWAVEFORMAT = ^_pcmwaveformat;
  TPCMWAVEFORMAT  = _PCMWAVEFORMAT;
  _WAVEFORMATEX   = packed Record
                         wFormatTag: WORD;
                         nChannels: WORD;
                         nSamplesPerSec: DWORD;
                         nAvgBytesPerSec: DWORD;
                         nBlockAlign: WORD;
                         wBitsPerSample: WORD;
                         cbSize: WORD;
		 End;
 WAVEFORMATEX    = _WAVEFORMATEX;
 PWAVEFORMATEX   = ^_WAVEFORMATEX;
 NPWAVEFORMATEX  = ^_WAVEFORMATEX;
 LPWAVEFORMATEX  = ^_WAVEFORMATEX;
 LPCWAVEFORMATEX = ^WAVEFORMATEX;
 TWAVEFORMATEX   = WAVEFORMATEX;
 HMIDI = THandle;
 HMIDIIN = THandle;
 HMIDIOUT = THandle;
 HMIDISTRM = THandle;
 LPHMIDI = ^HMIDI;
 LPHMIDIIN = ^HMIDIIN;
 PHMIDIIN = LPHMIDIIN;
 LPHMIDIOUT = ^HMIDIOUT;
 PHMIDIOUT =  LPHMIDIOUT;
 LPHMIDISTRM = ^HMIDISTRM;
 LPMIDICALLBACK = PDRVCALLBACK;

Const
  MIDIPATCHSIZE = 128;

Type
  PATCHARRAY = array [0..Pred(MIDIPATCHSIZE)] Of WORD;
  LPPATCHARRAY = ^WORD;
  KEYARRAY = array [0..Pred(MIDIPATCHSIZE)] Of WORD;
  LPKEYARRAY = ^WORD;
  _MIDIOUTCAPSA = packed Record
                           wMid: WORD;
                           wPid: WORD;
                           vDriverVersion: MMVERSION;
                           szPname: array [0..Pred(MAXPNAMELEN)] Of CHAR;
                           wTechnology: WORD;
                           wVoices: WORD;
                           wNotes: WORD;
                           wChannelMask: WORD;
                           dwSupport: DWORD;
			End;
 MIDIOUTCAPSA   = _MIDIOUTCAPSA;
 PMIDIOUTCAPSA  = ^_MIDIOUTCAPSA;
 NPMIDIOUTCAPSA = ^_MIDIOUTCAPSA;
 LPMIDIOUTCAPSA = ^_MIDIOUTCAPSA;
 TMIDIOUTCAPSA  = _MIDIOUTCAPSA;
 _MIDIOUTCAPSW  = packed Record
                         wMid: WORD;
                         wPid: WORD;
                         vDriverVersion: MMVERSION;
                         szPname: array [0..Pred(MAXPNAMELEN)] Of WCHAR;
                         wTechnology: WORD;
                         wVoices: WORD;
                         wNotes: WORD;
                         wChannelMask: WORD;
                         dwSupport: DWORD;
 		End;
 MIDIOUTCAPSW   = _MIDIOUTCAPSW;
 PMIDIOUTCAPSW  = ^_MIDIOUTCAPSW;
 NPMIDIOUTCAPSW = ^_MIDIOUTCAPSW;
 LPMIDIOUTCAPSW = ^_MIDIOUTCAPSW;
 TMIDIOUTCAPSW  = MIDIOUTCAPSW;
 _MIDIINCAPSA = packed Record
                        wMid: WORD;
                        wPid: WORD;
                        vDriverVersion: MMVERSION;
                        szPname: array [0..Pred(MAXPNAMELEN)] Of CHAR;
                        dwSupport: DWORD;
 		End;
 MIDIINCAPSA = _MIDIINCAPSA;
 PMIDIINCAPSA = ^_MIDIINCAPSA;
 NPMIDIINCAPSA = ^_MIDIINCAPSA;
 LPMIDIINCAPSA = ^_MIDIINCAPSA;
 TMIDIINCAPSA  = MIDIINCAPSA;

 _MIDIINCAPSW = packed Record
                        wMid: WORD;
                        wPid: WORD;
                        vDriverVersion: MMVERSION;
                        szPname: array [0..Pred(MAXPNAMELEN)] Of WCHAR;
                        dwSupport: DWORD;
 		End;
 MIDIINCAPSW = _MIDIINCAPSW;
 PMIDIINCAPSW = ^_MIDIINCAPSW;
 NPMIDIINCAPSW = ^_MIDIINCAPSW;
 LPMIDIINCAPSW = ^_MIDIINCAPSW;
 TMIDIINCAPSW  = MIDIINCAPSW;

 {$ifdef UNICODE}
  MIDIINCAPS    = MIDIINCAPSW;
  PMIDIINCAPS   = PMIDIINCAPSW;
  NPMIDIINCAPS  = NPMIDIINCAPSW;
  LPMIDIINCAPS  = LPMIDIINCAPSW;
  MIDIOUTCAPS   = MIDIOUTCAPSW;
  PMIDIOUTCAPS  = PMIDIOUTCAPSW;
  NPMIDIOUTCAPS = NPMIDIOUTCAPSW;
  LPMIDIOUTCAPS = LPMIDIOUTCAPSW;
 {$else}
  MIDIOUTCAPS   = MIDIOUTCAPSA;
  PMIDIOUTCAPS  = PMIDIOUTCAPSA;
  NPMIDIOUTCAPS = NPMIDIOUTCAPSA;
  LPMIDIOUTCAPS = LPMIDIOUTCAPSA;
  MIDIINCAPS    = MIDIINCAPSA;
  PMIDIINCAPS   = PMIDIINCAPSA;
  NPMIDIINCAPS  = NPMIDIINCAPSA;
  LPMIDIINCAPS  = LPMIDIINCAPSA;
 {$endif}
 TMIDIINCAPS  = MIDIINCAPS;
 TMIDIOUTCAPS = MIDIOUTCAPS;

 PMIDIHDR = ^_midihdr;
 _midihdr = packed Record
                    lpData: PChar;
                    dwBufferLength: DWORD;
                    dwBytesRecorded: DWORD;
                    dwUser: DWORD_PTR;
                    dwFlags: DWORD;
                    lpNext: PMIDIHDR;
                    reserved: DWORD_PTR;
                    dwOffset: DWORD;
                    dwReserved: array [0..Pred(8)] Of DWORD_PTR;
	    End;
 MIDIHDR   = _midihdr;
 NPMIDIHDR = ^_midihdr;
 LPMIDIHDR = ^_midihdr;
 TMIDIHDR  = MIDIHDR;

 _midievent = packed Record
                      dwDeltaTime: DWORD;
                      dwStreamID: DWORD;
                      dwEvent: DWORD;
                      dwParms: array [0..Pred(1)] Of DWORD;
		End;
 MIDIEVENT = _midievent;
 TMIDIEVENT= MIDIEVENT;

 _midistrmbuffver = packed Record
                            dwVersion: DWORD;
                            dwMid: DWORD;
                            dwOEMVersion: DWORD;
 		    End;
 MIDISTRMBUFFVER = _midistrmbuffver;
 TMIDISTRMBUFFVER = MIDISTRMBUFFVER;

 _midiproptimediv = packed Record
                            cbStruct: DWORD;
                            dwTimeDiv: DWORD;
		    End;
 MIDIPROPTIMEDIV = _midiproptimediv;
 LPMIDIPROPTIMEDIV = ^_midiproptimediv;
 TMIDIPROPTIMEDIV =  MIDIPROPTIMEDIV;

 _midiproptempo = packed Record
                          cbStruct: DWORD;
                          dwTempo: DWORD;
		  End;
 MIDIPROPTEMPO = _midiproptempo;
 LPMIDIPROPTEMPO = ^_midiproptempo;
 TMIDIPROPTEMPO = MIDIPROPTEMPO;

 _AUXCAPSA = packed Record
                     wMid: WORD;
                     wPid: WORD;
                     vDriverVersion: MMVERSION;
                     szPname: array [0..Pred(MAXPNAMELEN)] Of CHAR;
                     wTechnology: WORD;
                     wReserved1: WORD;
                     dwSupport: DWORD;
		End;
 AUXCAPSA   = _AUXCAPSA;
 PAUXCAPSA  = ^_AUXCAPSA;
 NPAUXCAPSA = ^_AUXCAPSA;
 LPAUXCAPSA = ^_AUXCAPSA;
 TAUXCAPSA  = AUXCAPSA;
 _AUXCAPSW  = packed Record
                     wMid: WORD;
                     wPid: WORD;
                     vDriverVersion: MMVERSION;
                     szPname: array [0..Pred(MAXPNAMELEN)] Of WCHAR;
                     wTechnology: WORD;
                     wReserved1: WORD;
                     dwSupport: DWORD;
		End;
 AUXCAPSW  = _AUXCAPSW;
 PAUXCAPSW  = ^_AUXCAPSW;
 NPAUXCAPSW = ^_AUXCAPSW;
 LPAUXCAPSW = ^_AUXCAPSW;
 TAUXCAPSW  = AUXCAPSW;
 {$ifdef UNICODE}
  AUXCAPS = AUXCAPSW;
  PAUXCAPS = PAUXCAPSW;
  NPAUXCAPS = NPAUXCAPSW;
  LPAUXCAPS = LPAUXCAPSW;
 {$else}
  AUXCAPS = AUXCAPSA;
  PAUXCAPS = PAUXCAPSA;
  NPAUXCAPS = NPAUXCAPSA;
  LPAUXCAPS = LPAUXCAPSA;
  {$endif}
  TAUXCAPS  = AUXCAPS;

 HMIXEROBJ = THandle;
 LPHMIXEROBJ = ^HMIXEROBJ;
 HMIXER = THandle;
 LPHMIXER = ^HMIXER;

Function mixerGetNumDevs: UINT;stdcall; external 'winmm.dll' name 'mixerGetNumDevs';

Type
  _MIXERCAPSA = packed Record
                         wMid: WORD;
                         wPid: WORD;
                         vDriverVersion: MMVERSION;
                         szPname: array [0..Pred(MAXPNAMELEN)] Of CHAR;
                         fdwSupport: DWORD;
                         cDestinations: DWORD;
		   End;
 MIXERCAPSA   = _MIXERCAPSA;
 PMIXERCAPSA  = ^_MIXERCAPSA;
 LPMIXERCAPSA = ^_MIXERCAPSA;
 TMIXERCAPSA  = MIXERCAPSA;

 _MIXERCAPSW  = packed Record
                       wMid: WORD;
                       wPid: WORD;
                       vDriverVersion: MMVERSION;
                       szPname: array [0..Pred(MAXPNAMELEN)] Of WCHAR;
                       fdwSupport: DWORD;
                       cDestinations: DWORD;
		End;
 MIXERCAPSW   = _MIXERCAPSW;
 PMIXERCAPSW  = ^_MIXERCAPSW;
 LPMIXERCAPSW = ^_MIXERCAPSW;
 TMIXERCAPSW  = MIXERCAPSW;

 {$ifdef UNICODE}
  MIXERCAPS   = MIXERCAPSW;
  PMIXERCAPS  = PMIXERCAPSW;
  LPMIXERCAPS = LPMIXERCAPSW;
 {$else}
  MIXERCAPS   = MIXERCAPSA;
  PMIXERCAPS  = PMIXERCAPSA;
  LPMIXERCAPS = LPMIXERCAPSA;
 {$endif}
  TMIXERCAPS = MIXERCAPS;

  _MIXERLINEA = packed Record
                       cbStruct: DWORD;
                       dwDestination: DWORD;
                       dwSource: DWORD;
                       dwLineID: DWORD;
                       fdwLine: DWORD;
                       dwUser: DWORD_PTR;
                       dwComponentType: DWORD;
                       cChannels: DWORD;
                       cConnections: DWORD;
                       cControls: DWORD;
                       szShortName: array [0..Pred(MIXER_SHORT_NAME_CHARS)] Of CHAR;
                       szName: array [0..Pred(MIXER_LONG_NAME_CHARS)] Of CHAR;
                       Target: packed Record
                                dwType,dwDeviceID: DWORD;
                                wMid,wPid: WORD;
                                vDriverVersion: MMVERSION;
                                szPname: array[0..pred(MAXPNAMELEN)] Of Char;
				End;
		       End;
 MIXERLINEA   = _MIXERLINEA;
 PMIXERLINEA  = ^_MIXERLINEA;
 LPMIXERLINEA = ^_MIXERLINEA;
 TMIXERLINEA  = MIXERLINEA;

 _MIXERLINEW  = packed Record
                       cbStruct: DWORD;
                       dwDestination: DWORD;
                       dwSource: DWORD;
                       dwLineID: DWORD;
                       fdwLine: DWORD;
                       dwUser: DWORD_PTR;
                       dwComponentType: DWORD;
                       cChannels: DWORD;
                       cConnections: DWORD;
                       cControls: DWORD;
                       szShortName: array [0..Pred(MIXER_SHORT_NAME_CHARS)] Of WCHAR;
                       szName: array [0..Pred(MIXER_LONG_NAME_CHARS)] Of WCHAR;
                       Target: packed Record
                                        dwType,dwDeviceID: DWORD;
                                        wMid,wPid: WORD;
                                        vDriverVersion: MMVERSION;
                                        szPname: array[0..pred(MAXPNAMELEN)] Of WChar;
				End;
			End;
 MIXERLINEW   = _MIXERLINEW;
 TMIXERLINEW  = MIXERLINEW;
 PMIXERLINEW  = ^_MIXERLINEW;
 LPMIXERLINEW = ^_MIXERLINEW;
 {$ifdef UNICODE}
  MIXERLINE   = MIXERLINEW;
  PMIXERLINE  = PMIXERLINEW;
  LPMIXERLINE = LPMIXERLINEW;
 {$else}
  MIXERLINE   = MIXERLINEA;
  PMIXERLINE  = PMIXERLINEA;
  LPMIXERLINE = LPMIXERLINEA;
 {$endif}
 TMIXERLINE = MIXERLINE;

 _MIXERCONTROLA = packed Record
                          cbStruct: DWORD;
                          dwControlID: DWORD;
                          dwControlType: DWORD;
                          fdwControl: DWORD;
                          cMultipleItems: DWORD;
                          szShortName: array [0..Pred(MIXER_SHORT_NAME_CHARS)] Of CHAR;
                          szName: array [0..Pred(MIXER_LONG_NAME_CHARS)] Of CHAR;
                          Bounds: packed Record
                                           Case integer Of
                                             0: (lMinimum, lMaximum: longint);
                                             1: (dwMinimum, dwMaximum: DWORD);
                                             2: (dwReserved: Array[0..5] Of DWORD);
					   End;
			  Metrics: packed Record
                                            Case Integer Of
                                              0: (cSteps: DWORD);
                                              1: (cbCustomData: DWORD);
                                              2: (dwReserved: Array[0..5] Of DWORD);
                                            End;
			  End;
 MIXERCONTROLA   = _MIXERCONTROLA;
 PMIXERCONTROLA  = ^_MIXERCONTROLA;
 LPMIXERCONTROLA = ^_MIXERCONTROLA;
 TMIXERCONTROLA  = MIXERCONTROLA;

 _MIXERCONTROLW = packed Record
                          cbStruct: DWORD;
                          dwControlID: DWORD;
                          dwControlType: DWORD;
                          fdwControl: DWORD;
                          cMultipleItems: DWORD;
                          szShortName: array [0..Pred(MIXER_SHORT_NAME_CHARS)] Of WCHAR;
                          szName: array [0..Pred(MIXER_LONG_NAME_CHARS)] Of WCHAR;
                          Bounds: packed Record
                                           Case integer Of
                                             0: (lMinimum, lMaximum: longint);
                                             1: (dwMinimum, dwMaximum: DWORD);
                                             2: (dwReserved: Array[0..5] Of DWORD);
					   End;
			  Metrics: packed Record
                                           Case Integer Of
                                             0: (cSteps: DWORD);
                                             1: (cbCustomData: DWORD);
                                             2: (dwReserved: Array[0..5] Of DWORD);
		                           End;
			  End;
 MIXERCONTROLW   = _MIXERCONTROLW;
 PMIXERCONTROLW  = ^_MIXERCONTROLW;
 LPMIXERCONTROLW = ^_MIXERCONTROLW;
 TMIXERCONTROLW  = MIXERCONTROLW;
 {$ifdef UNICODE}
  MIXERCONTROL   = MIXERCONTROLW;
  PMIXERCONTROL  = PMIXERCONTROLW;
  LPMIXERCONTROL = LPMIXERCONTROLW;
 {$else}
  MIXERCONTROL   = MIXERCONTROLA;
  PMIXERCONTROL  = PMIXERCONTROLA;
  LPMIXERCONTROL = LPMIXERCONTROLA;
 {$endif}
 TMIXERCONTROL   = MIXERCONTROL;


 _MIXERLINECONTROLSA  = packed Record
                               cbStruct: DWORD;
                               dwLineID: DWORD;
                               Case Integer Of
                                 0: (dwControlID: DWORD);
                                 1: (dwControlType, cControls, cbmxctrl: DWORD; pamxctrl:PMIXERCONTROLA);
				End;
 MIXERLINECONTROLSA   = _MIXERLINECONTROLSA;
 PMIXERLINECONTROLSA  = ^_MIXERLINECONTROLSA;
 LPMIXERLINECONTROLSA = ^_MIXERLINECONTROLSA;
 TMIXERLINECONTROLSA  = MIXERLINECONTROLSA;

 _MIXERLINECONTROLSW  = packed Record
                               cbStruct: DWORD;
                               dwLineID: DWORD;
                               Case Integer Of
                                 0: (dwControlID: DWORD);
                                 1: (dwControlType, cControls, cbmxctrl: DWORD; pamxctrl:PMIXERCONTROLW);
				End;
 MIXERLINECONTROLSW   = _MIXERLINECONTROLSW;
 PMIXERLINECONTROLSW  = ^_MIXERLINECONTROLSW;
 LPMIXERLINECONTROLSW = ^_MIXERLINECONTROLSW;
 TMIXERLINECONTROLSW  = MIXERLINECONTROLSW;

{$ifdef UNICODE}
 MIXERLINECONTROLS = MIXERLINECONTROLSW;
 PMIXERLINECONTROLS = PMIXERLINECONTROLSW;
 LPMIXERLINECONTROLS = LPMIXERLINECONTROLSW;
{$else}
 MIXERLINECONTROLS = MIXERLINECONTROLSA;
 PMIXERLINECONTROLS = PMIXERLINECONTROLSA;
 LPMIXERLINECONTROLS = LPMIXERLINECONTROLSA;
{$endif}
 TMIXERLINECONTROLS  = MIXERLINECONTROLS;

 TMIXERCONTROLDETAILS = packed Record
                                cbStruct: DWORD;
                                dwControlID: DWORD;
                                cChannels: DWORD;
                                Case Integer Of
                                  0: (hwndOwner: tHandle; cbDetails: DWORD;
                                      paDetails: Pointer);
                                  1: (cMultipleItems:DWORD);
				 End;
 MIXERCONTROLDETAILS   = tMIXERCONTROLDETAILS;
 PMIXERCONTROLDETAILS  = ^tMIXERCONTROLDETAILS;
 LPMIXERCONTROLDETAILS = ^tMIXERCONTROLDETAILS;

 _MIXERCONTROLDETAILS_LISTTEXTA = packed Record
                                          dwParam1: DWORD;
                                          dwParam2: DWORD;
                                          szName: array [0..Pred(MIXER_LONG_NAME_CHARS)] Of CHAR;
					  End;
 MIXERCONTROLDETAILS_LISTTEXTA   = _MIXERCONTROLDETAILS_LISTTEXTA;
 PMIXERCONTROLDETAILS_LISTTEXTA  = ^_MIXERCONTROLDETAILS_LISTTEXTA;
 LPMIXERCONTROLDETAILS_LISTTEXTA = ^_MIXERCONTROLDETAILS_LISTTEXTA;
 TMIXERCONTROLDETAILS_LISTTEXTA  = MIXERCONTROLDETAILS_LISTTEXTA;

 _MIXERCONTROLDETAILS_LISTTEXTW  = packed Record
                                          dwParam1: DWORD;
                                          dwParam2: DWORD;
                                          szName: array [0..Pred(MIXER_LONG_NAME_CHARS)] Of WCHAR;
				   End;
 MIXERCONTROLDETAILS_LISTTEXTW   = _MIXERCONTROLDETAILS_LISTTEXTW;
 PMIXERCONTROLDETAILS_LISTTEXTW  = ^_MIXERCONTROLDETAILS_LISTTEXTW;
 LPMIXERCONTROLDETAILS_LISTTEXTW = ^_MIXERCONTROLDETAILS_LISTTEXTW;
 TMIXERCONTROLDETAILS_LISTTEXTW  = MIXERCONTROLDETAILS_LISTTEXTW;

 {$ifdef UNICODE}
  MIXERCONTROLDETAILS_LISTTEXT   = MIXERCONTROLDETAILS_LISTTEXTW;
  PMIXERCONTROLDETAILS_LISTTEXT  = PMIXERCONTROLDETAILS_LISTTEXTW;
  LPMIXERCONTROLDETAILS_LISTTEXT = LPMIXERCONTROLDETAILS_LISTTEXTW;
 {$else}
  MIXERCONTROLDETAILS_LISTTEXT   = MIXERCONTROLDETAILS_LISTTEXTA;
  PMIXERCONTROLDETAILS_LISTTEXT  = PMIXERCONTROLDETAILS_LISTTEXTA;
  LPMIXERCONTROLDETAILS_LISTTEXT = LPMIXERCONTROLDETAILS_LISTTEXTA;
 {$endif}
 TMIXERCONTROLDETAILS_LISTTEXT  = MIXERCONTROLDETAILS_LISTTEXT;

_MIXERCONTROLDETAILS_BOOLEAN = packed Record
                                        fValue: longint;
					End;
 MIXERCONTROLDETAILS_BOOLEAN   = _MIXERCONTROLDETAILS_BOOLEAN;
 PMIXERCONTROLDETAILS_BOOLEAN  = ^_MIXERCONTROLDETAILS_BOOLEAN;
 LPMIXERCONTROLDETAILS_BOOLEAN = ^_MIXERCONTROLDETAILS_BOOLEAN;
 TMIXERCONTROLDETAILS_BOOLEAN  = MIXERCONTROLDETAILS_BOOLEAN;

 _MIXERCONTROLDETAILS_SIGNED = packed Record
                                       lValue: longint;
				       End;
 MIXERCONTROLDETAILS_SIGNED   = _MIXERCONTROLDETAILS_SIGNED;
 PMIXERCONTROLDETAILS_SIGNED  = ^_MIXERCONTROLDETAILS_SIGNED;
 LPMIXERCONTROLDETAILS_SIGNED = ^_MIXERCONTROLDETAILS_SIGNED;
 TMIXERCONTROLDETAILS_SIGNED  = _MIXERCONTROLDETAILS_SIGNED;

 _MIXERCONTROLDETAILS_UNSIGNED = packed Record
                                         dwValue: DWORD;
					 End;
 MIXERCONTROLDETAILS_UNSIGNED   = _MIXERCONTROLDETAILS_UNSIGNED;
 PMIXERCONTROLDETAILS_UNSIGNED  = ^_MIXERCONTROLDETAILS_UNSIGNED;
 LPMIXERCONTROLDETAILS_UNSIGNED = ^_MIXERCONTROLDETAILS_UNSIGNED;
 TMIXERCONTROLDETAILS_UNSIGNED  = _MIXERCONTROLDETAILS_UNSIGNED;

 LPTIMECALLBACK =
    Procedure (uTimerID, uMsg: UINT; dwUser, dw1, dw2: DWORD_PTR);stdcall;
 TTIMECALLBACK=LPTIMECALLBACK;

 TFNTimeCallBack = TTimeCallback; // delphi compat

 _timecaps = packed Record
                     wPeriodMin: UINT;
                     wPeriodMax: UINT;
		    End;
 TIMECAPS   = _timecaps;
 PTIMECAPS  = ^_timecaps;
 NPTIMECAPS = ^_timecaps;
 LPTIMECAPS = ^_timecaps;
 TTIMECAPS  = TIMECAPS;

 _JOYCAPSA = packed Record
                     wMid: WORD;
                     wPid: WORD;
                     szPname: array [0..Pred(MAXPNAMELEN)] Of CHAR;
                     wXmin: UINT;
                     wXmax: UINT;
                     wYmin: UINT;
                     wYmax: UINT;
                     wZmin: UINT;
                     wZmax: UINT;
                     wNumButtons: UINT;
                     wPeriodMin: UINT;
                     wPeriodMax: UINT;
                     wRmin: UINT;
                     wRmax: UINT;
                     wUmin: UINT;
                     wUmax: UINT;
                     wVmin: UINT;
                     wVmax: UINT;
                     wCaps: UINT;
                     wMaxAxes: UINT;
                     wNumAxes: UINT;
                     wMaxButtons: UINT;
                     szRegKey: array [0..Pred(MAXPNAMELEN)] Of CHAR;
                     szOEMVxD: array [0..Pred(MAX_JOYSTICKOEMVXDNAME)] Of CHAR;
		   End;
 JOYCAPSA   = _JOYCAPSA;
 PJOYCAPSA  = ^_JOYCAPSA;
 NPJOYCAPSA = ^_JOYCAPSA;
 LPJOYCAPSA = ^_JOYCAPSA;
 TJOYCAPSA  = _JOYCAPSA;

 _JOYCAPSW = packed Record
                     wMid: WORD;
                     wPid: WORD;
                     szPname: array [0..Pred(MAXPNAMELEN)] Of WCHAR;
                     wXmin: UINT;
                     wXmax: UINT;
                     wYmin: UINT;
                     wYmax: UINT;
                     wZmin: UINT;
                     wZmax: UINT;
                     wNumButtons: UINT;
                     wPeriodMin: UINT;
                     wPeriodMax: UINT;
                     wRmin: UINT;
                     wRmax: UINT;
                     wUmin: UINT;
                     wUmax: UINT;
                     wVmin: UINT;
                     wVmax: UINT;
                     wCaps: UINT;
                     wMaxAxes: UINT;
                     wNumAxes: UINT;
                     wMaxButtons: UINT;
                     szRegKey: array [0..Pred(MAXPNAMELEN)] Of WCHAR;
                     szOEMVxD: array [0..Pred(MAX_JOYSTICKOEMVXDNAME)] Of WCHAR;
		   End;
 JOYCAPSW   = _JOYCAPSW;
 PJOYCAPSW  = ^_JOYCAPSW;
 NPJOYCAPSW = ^_JOYCAPSW;
 LPJOYCAPSW = ^_JOYCAPSW;
 TJOYCAPSW  = _JOYCAPSW;

 {$ifdef UNICODE}
  JOYCAPS   = JOYCAPSW;
  PJOYCAPS  = PJOYCAPSW;
  NPJOYCAPS = NPJOYCAPSW;
  LPJOYCAPS = LPJOYCAPSW;
 {$else}
  JOYCAPS  = JOYCAPSA;
  PJOYCAPS  = PJOYCAPSA;
  NPJOYCAPS = NPJOYCAPSA;
  LPJOYCAPS = LPJOYCAPSA;
 {$endif}
 TJOYCAPS   = JOYCAPS;

 _joyinfo = packed Record
                    wXpos: UINT;
                    wYpos: UINT;
                    wZpos: UINT;
                    wButtons: UINT;
		   End;
 JOYINFO   = _joyinfo;
 PJOYINFO  = ^_joyinfo;
 NPJOYINFO = ^_joyinfo;
 LPJOYINFO = ^_joyinfo;
 TJOYINFO  = JOYINFO;

 _joyinfoex = packed Record
                      dwSize: DWORD;
                      dwFlags: DWORD;
                      wXpos: UINT;
                      wYpos: UINT;
                      wZpos: UINT;
                      dwRpos: DWORD;
                      dwUpos: DWORD;
                      dwVpos: DWORD;
                      wButtons: UINT;
                      dwButtonNumber: DWORD;
                      dwPOV: DWORD;
                      dwReserved1: DWORD;
                      dwReserved2: DWORD;
		     End;
 JOYINFOEX   = _joyinfoex;
 PJOYINFOEX  = ^_joyinfoex;
 NPJOYINFOEX = ^_joyinfoex;
 LPJOYINFOEX = ^_joyinfoex;
 TJOYINFOEX  = JOYINFOEX;

 FOURCC = DWORD;
 HPSTR = ^char;
 HMMIO = THandle;
 LPMMIOPROC =
     Function (x1: LPSTR; x2: UINT; x3, x4: LPARAM): LRESULT;stdcall;
 TMMIOPROC = LPMMIOPROC;

 _MMIOINFO = packed Record
                     dwFlags: DWORD;
                     fccIOProc: FOURCC;
                     pIOProc: LPMMIOPROC;
                     wErrorRet: UINT;
                     htask: HTASK;
                     cchBuffer: longint;
                     pchBuffer: HPSTR;
                     pchNext: HPSTR;
                     pchEndRead: HPSTR;
                     pchEndWrite: HPSTR;
                     lBufOffset: longint;
                     lDiskOffset: longint;
                     adwInfo: array [0..Pred(3)] Of DWORD;
                     dwReserved1: DWORD;
                     dwReserved2: DWORD;
                     hmmio: HMMIO;
		    End;
 MMIOINFO    = _MMIOINFO;
 PMMIOINFO   = ^_MMIOINFO;
 NPMMIOINFO  = ^_MMIOINFO;
 LPMMIOINFO  = ^_MMIOINFO;
 LPCMMIOINFO = ^MMIOINFO;
 TMMIOINFO   = MMIOINFO;

 _MMCKINFO = packed Record
                     ckid: FOURCC;
                     cksize: DWORD;
                     fccType: FOURCC;
                     dwDataOffset: DWORD;
                     dwFlags: DWORD;
		   End;
 MMCKINFO    = _MMCKINFO;
 PMMCKINFO   = ^_MMCKINFO;
 NPMMCKINFO  = ^_MMCKINFO;
 LPMMCKINFO  = ^_MMCKINFO;
 LPCMMCKINFO = ^MMCKINFO;
 TMMCKINFO   = MMCKINFO;

 MCIERROR = DWORD;
 MCIDEVICEID = UINT;
 YIELDPROC =
     Function (mciId: MCIDEVICEID;  dwYieldData: DWORD): UINT;stdcall;
  TYIELDPROC = YIELDPROC;

 _MCI_GENERIC_PARMS = packed Record
                              dwCallback: DWORD_PTR;
			     End;
 MCI_GENERIC_PARMS   = _MCI_GENERIC_PARMS;
 PMCI_GENERIC_PARMS  = ^_MCI_GENERIC_PARMS;
 LPMCI_GENERIC_PARMS = ^_MCI_GENERIC_PARMS;
 TMCI_GENERIC_PARMS  = MCI_GENERIC_PARMS;

 _MCI_OPEN_PARMSA = packed Record
                            dwCallback: DWORD_PTR;
                            wDeviceID: MCIDEVICEID;
                            lpstrDeviceType: LPCSTR;
                            lpstrElementName: LPCSTR;
                            lpstrAlias: LPCSTR;
		            End;
 MCI_OPEN_PARMSA   = _MCI_OPEN_PARMSA;
 PMCI_OPEN_PARMSA  = ^_MCI_OPEN_PARMSA;
 LPMCI_OPEN_PARMSA = ^_MCI_OPEN_PARMSA;
 TMCI_OPEN_PARMSA  = MCI_OPEN_PARMSA;

 _MCI_OPEN_PARMSW = packed Record
                            dwCallback: DWORD_PTR;
                            wDeviceID: MCIDEVICEID;
                            lpstrDeviceType: LPCWSTR;
                            lpstrElementName: LPCWSTR;
                            lpstrAlias: LPCWSTR;
			  End;
 MCI_OPEN_PARMSW   = _MCI_OPEN_PARMSW;
 PMCI_OPEN_PARMSW  = ^_MCI_OPEN_PARMSW;
 LPMCI_OPEN_PARMSW = ^_MCI_OPEN_PARMSW;
 TMCI_OPEN_PARMSW  = _MCI_OPEN_PARMSW;
 {$ifdef UNICODE}
  MCI_OPEN_PARMS   = MCI_OPEN_PARMSW;
  PMCI_OPEN_PARMS  = PMCI_OPEN_PARMSW;
  LPMCI_OPEN_PARMS = LPMCI_OPEN_PARMSW;
 {$else}
  MCI_OPEN_PARMS   = MCI_OPEN_PARMSA;
  PMCI_OPEN_PARMS  = PMCI_OPEN_PARMSA;
  LPMCI_OPEN_PARMS = LPMCI_OPEN_PARMSA;
 {$endif}
  TMCI_OPEN_PARMS = MCI_OPEN_PARMS;

 _MCI_PLAY_PARMS = packed Record
                           dwCallback: DWORD_PTR;
                           dwFrom: DWORD;
                           dwTo: DWORD;
			 End;
 MCI_PLAY_PARMS   = _MCI_PLAY_PARMS;
 PMCI_PLAY_PARMS  = ^_MCI_PLAY_PARMS;
 LPMCI_PLAY_PARMS = ^_MCI_PLAY_PARMS;
 TMCI_PLAY_PARMS  = _MCI_PLAY_PARMS;

 _MCI_SEEK_PARMS = packed Record
                           dwCallback: DWORD_PTR;
                           dwTo: DWORD;
			  End;
 MCI_SEEK_PARMS   = _MCI_SEEK_PARMS;
 PMCI_SEEK_PARMS  = ^_MCI_SEEK_PARMS;
 LPMCI_SEEK_PARMS = ^_MCI_SEEK_PARMS;
 TMCI_SEEK_PARMS  = _MCI_SEEK_PARMS;

 _MCI_STATUS_PARMS = packed Record
                             dwCallback: DWORD_PTR;
                             dwReturn: DWORD_PTR;
                             dwItem: DWORD;
                             dwTrack: DWORD;
			    End;
 MCI_STATUS_PARMS   = _MCI_STATUS_PARMS;
 PMCI_STATUS_PARMS  = ^_MCI_STATUS_PARMS;
 LPMCI_STATUS_PARMS = ^_MCI_STATUS_PARMS;
 TMCI_STATUS_PARMS  = _MCI_STATUS_PARMS;

 _MCI_INFO_PARMSA = packed Record
                            dwCallback: DWORD_PTR;
                            lpstrReturn: PChar;
                            dwRetSize: DWORD;
			  End;
 MCI_INFO_PARMSA   = _MCI_INFO_PARMSA;
 LPMCI_INFO_PARMSA = ^_MCI_INFO_PARMSA;
 TMCI_INFO_PARMSA  = _MCI_INFO_PARMSA;

 _MCI_INFO_PARMSW  = packed Record
                            dwCallback: DWORD_PTR;
                            lpstrReturn: LPWSTR;
                            dwRetSize: DWORD;
			End;
 MCI_INFO_PARMSW   = _MCI_INFO_PARMSW;
 LPMCI_INFO_PARMSW = ^_MCI_INFO_PARMSW;
 TMCI_INFO_PARMSW  = _MCI_INFO_PARMSW;

 {$ifdef UNICODE}
  MCI_INFO_PARMS   = MCI_INFO_PARMSW;
  LPMCI_INFO_PARMS = LPMCI_INFO_PARMSW;
 {$else}
  MCI_INFO_PARMS   = MCI_INFO_PARMSA;
  LPMCI_INFO_PARMS = LPMCI_INFO_PARMSA;
 {$endif}
  TMCI_INFO_PARMS = MCI_INFO_PARMS;

 _MCI_GETDEVCAPS_PARMS = packed Record
                                 dwCallback: DWORD_PTR;
                                 dwReturn: DWORD;
                                 dwItem: DWORD;
				End;
 MCI_GETDEVCAPS_PARMS   = _MCI_GETDEVCAPS_PARMS;
 PMCI_GETDEVCAPS_PARMS  = ^_MCI_GETDEVCAPS_PARMS;
 LPMCI_GETDEVCAPS_PARMS = ^_MCI_GETDEVCAPS_PARMS;
 TMCI_GETDEVCAPS_PARMS  = _MCI_GETDEVCAPS_PARMS;



 _MCI_SYSINFO_PARMSA = packed Record
                               dwCallback: DWORD_PTR;
                               lpstrReturn: PChar;
                               dwRetSize: DWORD;
                               dwNumber: DWORD;
                               wDeviceType: UINT;
 			       End;
 MCI_SYSINFO_PARMSA   = _MCI_SYSINFO_PARMSA;
 PMCI_SYSINFO_PARMSA  = ^_MCI_SYSINFO_PARMSA;
 LPMCI_SYSINFO_PARMSA = ^_MCI_SYSINFO_PARMSA;
 TMCI_SYSINFO_PARMSA  = _MCI_SYSINFO_PARMSA;

 _MCI_SYSINFO_PARMSW = packed Record
                               dwCallback: DWORD_PTR;
                               lpstrReturn: LPWSTR;
                               dwRetSize: DWORD;
                               dwNumber: DWORD;
                               wDeviceType: UINT;
			       End;
 MCI_SYSINFO_PARMSW   = _MCI_SYSINFO_PARMSW;
 PMCI_SYSINFO_PARMSW  = ^_MCI_SYSINFO_PARMSW;
 LPMCI_SYSINFO_PARMSW = ^_MCI_SYSINFO_PARMSW;
 TMCI_SYSINFO_PARMSW  = _MCI_SYSINFO_PARMSW;
 {$ifdef UNICODE}
  MCI_SYSINFO_PARMS = MCI_SYSINFO_PARMSW;
  PMCI_SYSINFO_PARMS = PMCI_SYSINFO_PARMSW;
  LPMCI_SYSINFO_PARMS = LPMCI_SYSINFO_PARMSW;
 {$else}
  MCI_SYSINFO_PARMS = MCI_SYSINFO_PARMSA;
  PMCI_SYSINFO_PARMS = PMCI_SYSINFO_PARMSA;
  LPMCI_SYSINFO_PARMS = LPMCI_SYSINFO_PARMSA;
 {$endif}
 TMCI_SYSINFO_PARMS = MCI_SYSINFO_PARMS;

 _MCI_SET_PARMS = packed Record
                          dwCallback: DWORD_PTR;
                          dwTimeFormat: DWORD;
                          dwAudio: DWORD;
			 End;
 MCI_SET_PARMS   = _MCI_SET_PARMS;
 PMCI_SET_PARMS  = ^_MCI_SET_PARMS;
 LPMCI_SET_PARMS = ^_MCI_SET_PARMS;
 TMCI_SET_PARMS  = _MCI_SET_PARMS;

 _MCI_BREAK_PARMS = packed Record
                            dwCallback: DWORD_PTR;
                            nVirtKey: longint;
                            hwndBreak: HWND;
			  End;
 MCI_BREAK_PARMS   = _MCI_BREAK_PARMS;
 PMCI_BREAK_PARMS  = ^_MCI_BREAK_PARMS;
 LPMCI_BREAK_PARMS = ^_MCI_BREAK_PARMS;
 TMCI_BREAK_PARMS  = _MCI_BREAK_PARMS;

 _MCI_SAVE_PARMSA = packed Record
                            dwCallback: DWORD_PTR;
                            lpfilename: LPCSTR;
			   End;
 MCI_SAVE_PARMSA   = _MCI_SAVE_PARMSA;
 PMCI_SAVE_PARMSA  = ^_MCI_SAVE_PARMSA;
 LPMCI_SAVE_PARMSA = ^_MCI_SAVE_PARMSA;
 TMCI_SAVE_PARMSA  = _MCI_SAVE_PARMSA;
 TMCI_SaveParmsA   = TMCI_SAVE_PARMSA;

 _MCI_SAVE_PARMSW = packed Record
                            dwCallback: DWORD_PTR;
                            lpfilename: LPCWSTR;
			   End;
 MCI_SAVE_PARMSW   = _MCI_SAVE_PARMSW;
 PMCI_SAVE_PARMSW  = ^_MCI_SAVE_PARMSW;
 LPMCI_SAVE_PARMSW = ^_MCI_SAVE_PARMSW;
 TMCI_SAVE_PARMSW  = _MCI_SAVE_PARMSW;
 TMCI_SaveParmsW   = TMCI_SAVE_PARMSW;

 {$ifdef UNICODE}
  MCI_SAVE_PARMS   = MCI_SAVE_PARMSW;
  PMCI_SAVE_PARMS  = PMCI_SAVE_PARMSW;
  LPMCI_SAVE_PARMS = LPMCI_SAVE_PARMSW;
 {$else}
  MCI_SAVE_PARMS   = MCI_SAVE_PARMSA;
  PMCI_SAVE_PARMS  = PMCI_SAVE_PARMSA;
  LPMCI_SAVE_PARMS = LPMCI_SAVE_PARMSA;
 {$endif}
  TMCI_SAVE_PARMS = MCI_SAVE_PARMS;
  TMCI_SaveParms   = TMCI_SAVE_PARMS;

 _MCI_LOAD_PARMSA = packed Record
                            dwCallback: DWORD_PTR;
                            lpfilename: LPCSTR;
			 End;
 MCI_LOAD_PARMSA   = _MCI_LOAD_PARMSA;
 PMCI_LOAD_PARMSA  = ^_MCI_LOAD_PARMSA;
 LPMCI_LOAD_PARMSA = ^_MCI_LOAD_PARMSA;
 TMCI_LOAD_PARMSA  = _MCI_LOAD_PARMSA;

 _MCI_LOAD_PARMSW  = packed Record
                            dwCallback: DWORD_PTR;
                            lpfilename: LPCWSTR;
			   End;

 MCI_LOAD_PARMSW   = _MCI_LOAD_PARMSW;
 PMCI_LOAD_PARMSW  = ^_MCI_LOAD_PARMSW;
 LPMCI_LOAD_PARMSW = ^_MCI_LOAD_PARMSW;
 TMCI_LOAD_PARMSW  = _MCI_LOAD_PARMSW;

 {$ifdef UNICODE}
  MCI_LOAD_PARMS   = MCI_LOAD_PARMSW;
  PMCI_LOAD_PARMS  = PMCI_LOAD_PARMSW;
  LPMCI_LOAD_PARMS = LPMCI_LOAD_PARMSW;
 {$else}
  MCI_LOAD_PARMS   = MCI_LOAD_PARMSA;
  PMCI_LOAD_PARMS  = PMCI_LOAD_PARMSA;
  LPMCI_LOAD_PARMS = LPMCI_LOAD_PARMSA;
 {$endif}
 TMCI_LOAD_PARMS = MCI_LOAD_PARMS;

 _MCI_RECORD_PARMS = packed Record
                             dwCallback: DWORD_PTR;
                             dwFrom: DWORD;
                             dwTo: DWORD;
			    End;
 MCI_RECORD_PARMS   = _MCI_RECORD_PARMS;
 LPMCI_RECORD_PARMS = ^_MCI_RECORD_PARMS;
 TMCI_RECORD_PARMS  = _MCI_RECORD_PARMS;

 _MCI_VD_PLAY_PARMS = packed Record
                              dwCallback: DWORD_PTR;
                              dwFrom: DWORD;
                              dwTo: DWORD;
                              dwSpeed: DWORD;
			     End;
 MCI_VD_PLAY_PARMS   = _MCI_VD_PLAY_PARMS;
 PMCI_VD_PLAY_PARMS  = ^_MCI_VD_PLAY_PARMS;
 LPMCI_VD_PLAY_PARMS = ^_MCI_VD_PLAY_PARMS;
 TMCI_VD_PLAY_PARMS  = _MCI_VD_PLAY_PARMS;

 _MCI_VD_STEP_PARMS  = packed Record
                              dwCallback: DWORD_PTR;
                              dwFrames: DWORD;
			    End;
 MCI_VD_STEP_PARMS     = _MCI_VD_STEP_PARMS;
 PMCI_VD_STEP_PARMS    = ^_MCI_VD_STEP_PARMS;
 LPMCI_VD_STEP_PARMS   = ^_MCI_VD_STEP_PARMS;

 _MCI_VD_ESCAPE_PARMSA = packed Record
                                 dwCallback: DWORD_PTR;
                                 lpstrCommand: LPCSTR;
				End;
 MCI_VD_ESCAPE_PARMSA   = _MCI_VD_ESCAPE_PARMSA;
 PMCI_VD_ESCAPE_PARMSA  = ^_MCI_VD_ESCAPE_PARMSA;
 LPMCI_VD_ESCAPE_PARMSA = ^_MCI_VD_ESCAPE_PARMSA;
 TMCI_VD_ESCAPE_PARMSA  = _MCI_VD_ESCAPE_PARMSA;

_MCI_VD_ESCAPE_PARMSW   = packed Record
                                 dwCallback: DWORD_PTR;
                                 lpstrCommand: LPCWSTR;
				 End;
 MCI_VD_ESCAPE_PARMSW   = _MCI_VD_ESCAPE_PARMSW;
 PMCI_VD_ESCAPE_PARMSW  = ^_MCI_VD_ESCAPE_PARMSW;
 LPMCI_VD_ESCAPE_PARMSW = ^_MCI_VD_ESCAPE_PARMSW;
 TMCI_VD_ESCAPE_PARMSW  = _MCI_VD_ESCAPE_PARMSW;
 {$ifdef UNICODE}
  MCI_VD_ESCAPE_PARMS   = MCI_VD_ESCAPE_PARMSW;
  PMCI_VD_ESCAPE_PARMS  = PMCI_VD_ESCAPE_PARMSW;
  LPMCI_VD_ESCAPE_PARMS = LPMCI_VD_ESCAPE_PARMSW;
 {$else}
  MCI_VD_ESCAPE_PARMS   = MCI_VD_ESCAPE_PARMSA;
  PMCI_VD_ESCAPE_PARMS  = PMCI_VD_ESCAPE_PARMSA;
  LPMCI_VD_ESCAPE_PARMS = LPMCI_VD_ESCAPE_PARMSA;
 {$endif}
 TMCI_VD_ESCAPE_PARMS   = MCI_VD_ESCAPE_PARMS;

 _MCI_WAVE_OPEN_PARMSA  = packed Record
                                 dwCallback: DWORD_PTR;
                                 wDeviceID: MCIDEVICEID;
                                 lpstrDeviceType: LPCSTR;
                                 lpstrElementName: LPCSTR;
                                 lpstrAlias: LPCSTR;
                                 dwBufferSeconds: DWORD;
				End;
 MCI_WAVE_OPEN_PARMSA   = _MCI_WAVE_OPEN_PARMSA;
 PMCI_WAVE_OPEN_PARMSA  = ^_MCI_WAVE_OPEN_PARMSA;
 LPMCI_WAVE_OPEN_PARMSA = ^_MCI_WAVE_OPEN_PARMSA;
 TMCI_WAVE_OPEN_PARMSA  = _MCI_WAVE_OPEN_PARMSA;

 _MCI_WAVE_OPEN_PARMSW  = packed Record
                                 dwCallback: DWORD_PTR;
                                 wDeviceID: MCIDEVICEID;
                                 lpstrDeviceType: LPCWSTR;
                                 lpstrElementName: LPCWSTR;
                                 lpstrAlias: LPCWSTR;
                                 dwBufferSeconds: DWORD;
				End;
 MCI_WAVE_OPEN_PARMSW   = _MCI_WAVE_OPEN_PARMSW;
 PMCI_WAVE_OPEN_PARMSW  = ^_MCI_WAVE_OPEN_PARMSW;
 LPMCI_WAVE_OPEN_PARMSW = ^_MCI_WAVE_OPEN_PARMSW;
 TMCI_WAVE_OPEN_PARMSW  = _MCI_WAVE_OPEN_PARMSW;
 {$ifdef UNICODE}
  MCI_WAVE_OPEN_PARMS   = MCI_WAVE_OPEN_PARMSW;
  PMCI_WAVE_OPEN_PARMS  = PMCI_WAVE_OPEN_PARMSW;
  LPMCI_WAVE_OPEN_PARMS = LPMCI_WAVE_OPEN_PARMSW;
 {$else}
  MCI_WAVE_OPEN_PARMS = MCI_WAVE_OPEN_PARMSA;
  PMCI_WAVE_OPEN_PARMS = PMCI_WAVE_OPEN_PARMSA;
  LPMCI_WAVE_OPEN_PARMS = LPMCI_WAVE_OPEN_PARMSA;
 {$endif}
 TMCI_WAVE_OPEN_PARMS   = MCI_WAVE_OPEN_PARMS;

 _MCI_WAVE_DELETE_PARMS = packed Record
                                  dwCallback: DWORD_PTR;
                                  dwFrom: DWORD;
                                  dwTo: DWORD;
				End;
 MCI_WAVE_DELETE_PARMS = _MCI_WAVE_DELETE_PARMS;
 PMCI_WAVE_DELETE_PARMS = ^_MCI_WAVE_DELETE_PARMS;
 LPMCI_WAVE_DELETE_PARMS = ^_MCI_WAVE_DELETE_PARMS;
 TMCI_WAVE_DELETE_PARMS = _MCI_WAVE_DELETE_PARMS;

 _MCI_WAVE_SET_PARMS = packed Record
                               dwCallback: DWORD_PTR;
                               dwTimeFormat: DWORD;
                               dwAudio: DWORD;
                               wInput: UINT;
                               wOutput: UINT;
                               wFormatTag: WORD;
                               wReserved2: WORD;
                               nChannels: WORD;
                               wReserved3: WORD;
                               nSamplesPerSec: DWORD;
                               nAvgBytesPerSec: DWORD;
                               nBlockAlign: WORD;
                               wReserved4: WORD;
                               wBitsPerSample: WORD;
                               wReserved5: WORD;
				End;
 MCI_WAVE_SET_PARMS   = _MCI_WAVE_SET_PARMS;
 PMCI_WAVE_SET_PARMS  = ^_MCI_WAVE_SET_PARMS;
 LPMCI_WAVE_SET_PARMS = ^_MCI_WAVE_SET_PARMS;
 TMCI_WAVE_SET_PARMS  = _MCI_WAVE_SET_PARMS;

 _MCI_SEQ_SET_PARMS  = packed Record
                              dwCallback: DWORD_PTR;
                              dwTimeFormat: DWORD;
                              dwAudio: DWORD;
                              dwTempo: DWORD;
                              dwPort: DWORD;
                              dwSlave: DWORD;
                              dwMaster: DWORD;
                              dwOffset: DWORD;
			     End;
 MCI_SEQ_SET_PARMS   = _MCI_SEQ_SET_PARMS;
 PMCI_SEQ_SET_PARMS  = ^_MCI_SEQ_SET_PARMS;
 LPMCI_SEQ_SET_PARMS = ^_MCI_SEQ_SET_PARMS;
 TMCI_SEQ_SET_PARMS  = _MCI_SEQ_SET_PARMS;

 _MCI_ANIM_OPEN_PARMSA = packed Record
                                 dwCallback: DWORD_PTR;
                                 wDeviceID: MCIDEVICEID;
                                 lpstrDeviceType: LPCSTR;
                                 lpstrElementName: LPCSTR;
                                 lpstrAlias: LPCSTR;
                                 dwStyle: DWORD;
                                 hWndParent: HWND;
				End;
 MCI_ANIM_OPEN_PARMSA   = _MCI_ANIM_OPEN_PARMSA;
 PMCI_ANIM_OPEN_PARMSA  = ^_MCI_ANIM_OPEN_PARMSA;
 LPMCI_ANIM_OPEN_PARMSA = ^_MCI_ANIM_OPEN_PARMSA;
 TMCI_ANIM_OPEN_PARMSA  = _MCI_ANIM_OPEN_PARMSA;

 _MCI_ANIM_OPEN_PARMSW = packed Record
                                 dwCallback: DWORD_PTR;
                                 wDeviceID: MCIDEVICEID;
                                 lpstrDeviceType: LPCWSTR;
                                 lpstrElementName: LPCWSTR;
                                 lpstrAlias: LPCWSTR;
                                 dwStyle: DWORD;
                                 hWndParent: HWND;
				End;
 MCI_ANIM_OPEN_PARMSW = _MCI_ANIM_OPEN_PARMSW;
 PMCI_ANIM_OPEN_PARMSW = ^_MCI_ANIM_OPEN_PARMSW;
 LPMCI_ANIM_OPEN_PARMSW = ^_MCI_ANIM_OPEN_PARMSW;
 {$ifdef UNICODE}
  MCI_ANIM_OPEN_PARMS = MCI_ANIM_OPEN_PARMSW;
  PMCI_ANIM_OPEN_PARMS = PMCI_ANIM_OPEN_PARMSW;
  LPMCI_ANIM_OPEN_PARMS = LPMCI_ANIM_OPEN_PARMSW;
 {$else}
  MCI_ANIM_OPEN_PARMS = MCI_ANIM_OPEN_PARMSA;
  PMCI_ANIM_OPEN_PARMS = PMCI_ANIM_OPEN_PARMSA;
  LPMCI_ANIM_OPEN_PARMS = LPMCI_ANIM_OPEN_PARMSA;
 {$endif}
 TMCI_ANIM_OPEN_PARMS = MCI_ANIM_OPEN_PARMS;

 _MCI_ANIM_WINDOW_PARMSW = packed Record
                                   dwCallback: DWORD_PTR;
                                   Wnd: HWND;
                                   nCmdShow: UINT;
                                   lpstrText: LPCWSTR;
				End;
 MCI_ANIM_WINDOW_PARMSW   = _MCI_ANIM_WINDOW_PARMSW;
 PMCI_ANIM_WINDOW_PARMSW  = ^_MCI_ANIM_WINDOW_PARMSW;
 LPMCI_ANIM_WINDOW_PARMSW = ^_MCI_ANIM_WINDOW_PARMSW;
 TMCI_ANIM_WINDOW_PARMSW  = _MCI_ANIM_WINDOW_PARMSW;

 _MCI_ANIM_STEP_PARMS = packed Record
                                dwCallback: DWORD_PTR;
                                dwFrames: DWORD;
				End;
 MCI_ANIM_STEP_PARMS   = _MCI_ANIM_STEP_PARMS;
 PMCI_ANIM_STEP_PARMS  = ^_MCI_ANIM_STEP_PARMS;
 LPMCI_ANIM_STEP_PARMS = ^_MCI_ANIM_STEP_PARMS;
 TMCI_ANIM_STEP_PARMS  = _MCI_ANIM_STEP_PARMS;

 _MCI_ANIM_WINDOW_PARMSA = packed Record
                                   dwCallback: DWORD_PTR;
                                   Wnd: HWND;
                                   nCmdShow: UINT;
                                   lpstrText: LPCSTR;
				  End;
 MCI_ANIM_WINDOW_PARMSA   = _MCI_ANIM_WINDOW_PARMSA;
 PMCI_ANIM_WINDOW_PARMSA  = ^_MCI_ANIM_WINDOW_PARMSA;
 LPMCI_ANIM_WINDOW_PARMSA = ^_MCI_ANIM_WINDOW_PARMSA;
 TMCI_ANIM_WINDOW_PARMSA  = _MCI_ANIM_WINDOW_PARMSA;
_MCI_ANIM_PLAY_PARMS = packed Record
                                dwCallback: DWORD_PTR;
                                dwFrom: DWORD;
                                dwTo: DWORD;
                                dwSpeed: DWORD;
				End;
 MCI_ANIM_PLAY_PARMS   = _MCI_ANIM_PLAY_PARMS;
 PMCI_ANIM_PLAY_PARMS  = ^_MCI_ANIM_PLAY_PARMS;
 LPMCI_ANIM_PLAY_PARMS = ^_MCI_ANIM_PLAY_PARMS;
 {$ifdef UNICODE}
  MCI_ANIM_WINDOW_PARMS   = MCI_ANIM_WINDOW_PARMSW;
  PMCI_ANIM_WINDOW_PARMS  = PMCI_ANIM_WINDOW_PARMSW;
  LPMCI_ANIM_WINDOW_PARMS = LPMCI_ANIM_WINDOW_PARMSW;
 {$else}
  MCI_ANIM_WINDOW_PARMS   = MCI_ANIM_WINDOW_PARMSA;
  PMCI_ANIM_WINDOW_PARMS  = PMCI_ANIM_WINDOW_PARMSA;
  LPMCI_ANIM_WINDOW_PARMS = LPMCI_ANIM_WINDOW_PARMSA;
 {$endif}
  TMCI_ANIM_WINDOW_PARMS  = MCI_Anim_Window_Parms;
 _MCI_ANIM_RECT_PARMS  = packed Record
                                dwCallback: DWORD_PTR;
                                rc: TRECT;
			       End;
 MCI_ANIM_RECT_PARMS   = _MCI_ANIM_RECT_PARMS;
 PMCI_ANIM_RECT_PARMS  = ^MCI_ANIM_RECT_PARMS;
 LPMCI_ANIM_RECT_PARMS = ^MCI_ANIM_RECT_PARMS;
 TMCI_ANIM_RECT_PARMS  = _MCI_ANIM_RECT_PARMS;

 _MCI_ANIM_UPDATE_PARMS = packed Record
                                  dwCallback: DWORD_PTR;
                                  rc: TRECT;
                                  hDC: HDC;
				End;
 MCI_ANIM_UPDATE_PARMS   = _MCI_ANIM_UPDATE_PARMS;
 PMCI_ANIM_UPDATE_PARMS  = ^_MCI_ANIM_UPDATE_PARMS;
 LPMCI_ANIM_UPDATE_PARMS = ^_MCI_ANIM_UPDATE_PARMS;
 TMCI_ANIM_UPDATE_PARMS  = _MCI_ANIM_UPDATE_PARMS;

 _MCI_OVLY_OPEN_PARMSA = packed Record
                                 dwCallback: DWORD_PTR;
                                 wDeviceID: MCIDEVICEID;
                                 lpstrDeviceType: LPCSTR;
                                 lpstrElementName: LPCSTR;
                                 lpstrAlias: LPCSTR;
                                 dwStyle: DWORD;
                                 hWndParent: HWND;
				End;
 MCI_OVLY_OPEN_PARMSA   = _MCI_OVLY_OPEN_PARMSA;
 PMCI_OVLY_OPEN_PARMSA  = ^_MCI_OVLY_OPEN_PARMSA;
 LPMCI_OVLY_OPEN_PARMSA = ^_MCI_OVLY_OPEN_PARMSA;
 TMCI_OVLY_OPEN_PARMSA  = _MCI_OVLY_OPEN_PARMSA;

 _MCI_OVLY_OPEN_PARMSW = packed Record
                                 dwCallback: DWORD_PTR;
                                 wDeviceID: MCIDEVICEID;
                                 lpstrDeviceType: LPCWSTR;
                                 lpstrElementName: LPCWSTR;
                                 lpstrAlias: LPCWSTR;
                                 dwStyle: DWORD;
                                 hWndParent: HWND;
				End;
 MCI_OVLY_OPEN_PARMSW   = _MCI_OVLY_OPEN_PARMSW;
 PMCI_OVLY_OPEN_PARMSW  = ^_MCI_OVLY_OPEN_PARMSW;
 LPMCI_OVLY_OPEN_PARMSW = ^_MCI_OVLY_OPEN_PARMSW;
 TMCI_OVLY_OPEN_PARMSW  = _MCI_OVLY_OPEN_PARMSW;

 {$ifdef UNICODE}
  MCI_OVLY_OPEN_PARMS   = MCI_OVLY_OPEN_PARMSW;
  PMCI_OVLY_OPEN_PARMS  = PMCI_OVLY_OPEN_PARMSW;
  LPMCI_OVLY_OPEN_PARMS = LPMCI_OVLY_OPEN_PARMSW;
 {$else}
  MCI_OVLY_OPEN_PARMS   = MCI_OVLY_OPEN_PARMSA;
  PMCI_OVLY_OPEN_PARMS  = PMCI_OVLY_OPEN_PARMSA;
  LPMCI_OVLY_OPEN_PARMS = LPMCI_OVLY_OPEN_PARMSA;
 {$endif}
 TMCI_OVLY_OPEN_PARMS   = MCI_OVLY_OPEN_PARMS;

_MCI_OVLY_WINDOW_PARMSA = packed Record
                                   dwCallback: DWORD_PTR;
                                   hWnd: HWND;
                                   nCmdShow: UINT;
                                   lpstrText: LPCSTR;
 				End;
 MCI_OVLY_WINDOW_PARMSA   = _MCI_OVLY_WINDOW_PARMSA;
 PMCI_OVLY_WINDOW_PARMSA  = ^_MCI_OVLY_WINDOW_PARMSA;
 LPMCI_OVLY_WINDOW_PARMSA = ^_MCI_OVLY_WINDOW_PARMSA;
 TMCI_OVLY_WINDOW_PARMSA   = _MCI_OVLY_WINDOW_PARMSA;

 _MCI_OVLY_WINDOW_PARMSW = packed Record
                                   dwCallback: DWORD_PTR;
                                   hWnd: HWND;
                                   nCmdShow: UINT;
                                   lpstrText: LPCWSTR;
				End;
 MCI_OVLY_WINDOW_PARMSW   = _MCI_OVLY_WINDOW_PARMSW;
 PMCI_OVLY_WINDOW_PARMSW  = ^_MCI_OVLY_WINDOW_PARMSW;
 LPMCI_OVLY_WINDOW_PARMSW = ^_MCI_OVLY_WINDOW_PARMSW;
 TMCI_OVLY_WINDOW_PARMSW  = _MCI_OVLY_WINDOW_PARMSW;

 {$ifdef UNICODE}
  MCI_OVLY_WINDOW_PARMS   = MCI_OVLY_WINDOW_PARMSW;
  PMCI_OVLY_WINDOW_PARMS  = PMCI_OVLY_WINDOW_PARMSW;
  LPMCI_OVLY_WINDOW_PARMS = LPMCI_OVLY_WINDOW_PARMSW;
 {$else}
  MCI_OVLY_WINDOW_PARMS   = MCI_OVLY_WINDOW_PARMSA;
  PMCI_OVLY_WINDOW_PARMS  = PMCI_OVLY_WINDOW_PARMSA;
  LPMCI_OVLY_WINDOW_PARMS = LPMCI_OVLY_WINDOW_PARMSA;
 {$endif}
 TMCI_OVLY_WINDOW_PARMS   = MCI_OVLY_WINDOW_PARMSW;

 _MCI_OVLY_RECT_PARMS = packed Record
                                dwCallback: DWORD_PTR;
                                rc: TRECT;
				End;
 MCI_OVLY_RECT_PARMS   = _MCI_OVLY_RECT_PARMS;
 PMCI_OVLY_RECT_PARMS  = ^_MCI_OVLY_RECT_PARMS;
 LPMCI_OVLY_RECT_PARMS = ^_MCI_OVLY_RECT_PARMS;
 TMCI_OVLY_RECT_PARMS  = _MCI_OVLY_RECT_PARMS;

 _MCI_OVLY_SAVE_PARMSA = packed Record
                                 dwCallback: DWORD_PTR;
                                 lpfilename: LPCSTR;
                                 rc: TRECT;
				End;
 MCI_OVLY_SAVE_PARMSA   = _MCI_OVLY_SAVE_PARMSA;
 PMCI_OVLY_SAVE_PARMSA  = ^_MCI_OVLY_SAVE_PARMSA;
 LPMCI_OVLY_SAVE_PARMSA = ^_MCI_OVLY_SAVE_PARMSA;
 TMCI_OVLY_SAVE_PARMSA  = _MCI_OVLY_SAVE_PARMSA;

 _MCI_OVLY_SAVE_PARMSW = packed Record
                                 dwCallback: DWORD_PTR;
                                 lpfilename: LPCWSTR;
                                 rc: TRECT;
				End;
 MCI_OVLY_SAVE_PARMSW   = _MCI_OVLY_SAVE_PARMSW;
 PMCI_OVLY_SAVE_PARMSW  = ^_MCI_OVLY_SAVE_PARMSW;
 LPMCI_OVLY_SAVE_PARMSW = ^_MCI_OVLY_SAVE_PARMSW;
 TMCI_OVLY_SAVE_PARMSW  = _MCI_OVLY_SAVE_PARMSW;

 {$ifdef UNICODE}
  MCI_OVLY_SAVE_PARMS   = MCI_OVLY_SAVE_PARMSW;
  PMCI_OVLY_SAVE_PARMS  = PMCI_OVLY_SAVE_PARMSW;
  LPMCI_OVLY_SAVE_PARMS = LPMCI_OVLY_SAVE_PARMSW;
 {$else}
  MCI_OVLY_SAVE_PARMS   = MCI_OVLY_SAVE_PARMSA;
  PMCI_OVLY_SAVE_PARMS  = PMCI_OVLY_SAVE_PARMSA;
  LPMCI_OVLY_SAVE_PARMS = LPMCI_OVLY_SAVE_PARMSA;
 {$endif}
 TMCI_OVLY_SAVE_PARMS = MCI_OVLY_SAVE_PARMS;

 _MCI_OVLY_LOAD_PARMSA = packed Record
                                 dwCallback: DWORD_PTR;
                                 lpfilename: LPCSTR;
                                 rc: TRECT;
				End;
 MCI_OVLY_LOAD_PARMSA   = _MCI_OVLY_LOAD_PARMSA;
 PMCI_OVLY_LOAD_PARMSA  = ^_MCI_OVLY_LOAD_PARMSA;
 LPMCI_OVLY_LOAD_PARMSA = ^_MCI_OVLY_LOAD_PARMSA;
 TMCI_OVLY_LOAD_PARMSA  = _MCI_OVLY_LOAD_PARMSA;
 _MCI_OVLY_LOAD_PARMSW = packed Record
                                 dwCallback: DWORD_PTR;
                                 lpfilename: LPCWSTR;
                                 rc: TRECT;
				End;
 MCI_OVLY_LOAD_PARMSW   = _MCI_OVLY_LOAD_PARMSW;
 PMCI_OVLY_LOAD_PARMSW  = ^_MCI_OVLY_LOAD_PARMSW;
 LPMCI_OVLY_LOAD_PARMSW = ^_MCI_OVLY_LOAD_PARMSW;
 TMCI_OVLY_LOAD_PARMSW  = _MCI_OVLY_LOAD_PARMSW;

 {$ifdef UNICODE}
  MCI_OVLY_LOAD_PARMS   = MCI_OVLY_LOAD_PARMSW;
  PMCI_OVLY_LOAD_PARMS  = PMCI_OVLY_LOAD_PARMSW;
  LPMCI_OVLY_LOAD_PARMS = LPMCI_OVLY_LOAD_PARMSW;
 {$else}
  MCI_OVLY_LOAD_PARMS   = MCI_OVLY_LOAD_PARMSA;
  PMCI_OVLY_LOAD_PARMS  = PMCI_OVLY_LOAD_PARMSA;
  LPMCI_OVLY_LOAD_PARMS = LPMCI_OVLY_LOAD_PARMSA;
 {$endif}
 TMCI_OVLY_LOAD_PARMS = MCI_OVLY_LOAD_PARMS;

Type // Delphi compatibility
//  TMMIOInfo = _MMIOINFO;
//  TMMCKInfo = _MMCKINFO;
  pcmwaveformat_tag = PCMWAVEFORMAT;
//  TPCMWaveFormat = pcmwaveformat_tag;


(*////////////////////////////////////////////////////////*)
(* Function prototypes*)
(*////////////////////////////////////////////////////////*)
Function mmioStringToFOURCCA(x1: LPCSTR; x2: UINT): FOURCC;stdcall; external 'winmm.dll' name 'mmioStringToFOURCCA';
Function mmioStringToFOURCCW(x1: LPCWSTR; x2: UINT): FOURCC;stdcall; external 'winmm.dll' name 'mmioStringToFOURCCW';
Function mmioStringToFOURCC(x1: PChar; x2: UINT): FOURCC;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'mmioStringToFOURCCW'
 {$else}'mmioStringToFOURCCA'
 {$endif};
Function mmioInstallIOProcA(x1: FOURCC; x2: LPMMIOPROC; x3: DWORD): LPMMIOPROC;stdcall; external 'winmm.dll' name 'mmioInstallIOProcA';
Function mmioInstallIOProcW(x1: FOURCC; x2: LPMMIOPROC; x3: DWORD): LPMMIOPROC;stdcall; external 'winmm.dll' name 'mmioInstallIOProcW';
Function mmioInstallIOProc(x1: FOURCC; x2: LPMMIOPROC; x3: DWORD): LPMMIOPROC;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'mmioInstallIOProcW'
 {$else}'mmioInstallIOProcA'
 {$endif};
Function mmioOpenA(x1: LPSTR; x2: LPMMIOINFO; x3: DWORD): HMMIO;stdcall; external 'winmm.dll' name 'mmioOpenA';
Function mmioOpenW(x1: LPWSTR; x2: LPMMIOINFO; x3: DWORD): HMMIO;stdcall; external 'winmm.dll' name 'mmioOpenW';
Function mmioOpen(x1: PChar; x2: LPMMIOINFO; x3: DWORD): HMMIO;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'mmioOpenW'
 {$else}'mmioOpenA'
 {$endif};
Function mmioRenameA(x1: LPCSTR; x2: LPCSTR; x3: LPCMMIOINFO; x4: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'mmioRenameA';
Function mmioRenameW(x1: LPCWSTR; x2: LPCWSTR; x3: LPCMMIOINFO; x4: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'mmioRenameW';
Function mmioRename(x1: PChar; x2: PChar; x3: LPCMMIOINFO; x4: DWORD): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'mmioRenameW'
 {$else}'mmioRenameA'
 {$endif};
Function mmioClose(x1: HMMIO; x2: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'mmioClose';
Function mmioRead(x1: HMMIO; x2: HPSTR; x3: LONG): LONG;stdcall; external 'winmm.dll' name 'mmioRead';
Function mmioWrite(x1: HMMIO; x2: pchar; x3: LONG): LONG;stdcall; external 'winmm.dll' name 'mmioWrite';
Function mmioSeek(x1: HMMIO; x2: LONG; x3: WINT): LONG;stdcall; external 'winmm.dll' name 'mmioSeek';
Function mmioGetInfo(x1: HMMIO; x2: LPMMIOINFO; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'mmioGetInfo';
Function mmioSetInfo(x1: HMMIO; x2: LPCMMIOINFO; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'mmioSetInfo';
Function mmioSetBuffer(x1: HMMIO; x2: LPSTR; x3: LONG; x4: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'mmioSetBuffer';
Function mmioFlush(x1: HMMIO; x2: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'mmioFlush';
Function mmioAdvance(x1: HMMIO; x2: LPMMIOINFO; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'mmioAdvance';
Function mmioSendMessage(x1: HMMIO; x2: UINT; x3: LPARAM; x4: LPARAM): LRESULT;stdcall; external 'winmm.dll' name 'mmioSendMessage';
Function mmioDescend(x1: HMMIO; x2: LPMMCKINFO; x3: PMMCKINFO; x4: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'mmioDescend';
Function mmioAscend(x1: HMMIO; x2: LPMMCKINFO; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'mmioAscend';
Function mmioCreateChunk(x1: HMMIO; x2: LPMMCKINFO; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'mmioCreateChunk';
Function mciSendCommandA(x1: MCIDEVICEID; x2: UINT; x3: DWORD_PTR; x4: DWORD_PTR): MCIERROR;stdcall; external 'winmm.dll' name 'mciSendCommandA';
Function mciSendCommandW(x1: MCIDEVICEID; x2: UINT; x3: DWORD_PTR; x4: DWORD_PTR): MCIERROR;stdcall; external 'winmm.dll' name 'mciSendCommandW';
Function mciSendCommand(x1: MCIDEVICEID; x2: UINT; x3: DWORD_PTR; x4: DWORD_PTR): MCIERROR;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'mciSendCommandW' {$else}'mciSendCommandA' {$endif};
Function mciSendStringA(x1: LPCSTR; x2: LPSTR; x3: UINT; x4: HWND): MCIERROR;stdcall; external 'winmm.dll' name 'mciSendStringA';
Function mciSendStringW(x1: LPCWSTR; x2: LPWSTR; x3: UINT; x4: HWND): MCIERROR;stdcall; external 'winmm.dll' name 'mciSendStringW';
Function mciSendString(x1: PChar; x2: PChar; x3: UINT; x4: HWND): MCIERROR;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'mciSendStringW' {$else}'mciSendStringA' {$endif};
Function mciGetDeviceIDA(x1: LPCSTR): MCIDEVICEID;stdcall; external 'winmm.dll' name 'mciGetDeviceIDA';
Function mciGetDeviceIDW(x1: LPCWSTR): MCIDEVICEID;stdcall; external 'winmm.dll' name 'mciGetDeviceIDW';
Function mciGetDeviceID(x1: PChar): MCIDEVICEID;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'mciGetDeviceIDW' {$else}'mciGetDeviceIDA' {$endif};
Function mciGetDeviceIDFromElementIDA(x1: DWORD; x2: LPCSTR): MCIDEVICEID;stdcall; external 'winmm.dll' name 'mciGetDeviceIDFromElementIDA';
Function mciGetDeviceIDFromElementIDW(x1: DWORD; x2: LPCWSTR): MCIDEVICEID;stdcall; external 'winmm.dll' name 'mciGetDeviceIDFromElementIDW';
Function mciGetDeviceIDFromElementID(x1: DWORD; x2: PChar): MCIDEVICEID;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'mciGetDeviceIDFromElementIDW' {$else}'mciGetDeviceIDFromElementIDA' {$endif};
Function mciGetErrorStringA(x1: MCIERROR; x2: LPSTR; x3: UINT): BOOL;stdcall; external 'winmm.dll' name 'mciGetErrorStringA';
Function mciGetErrorStringW(x1: MCIERROR; x2: LPWSTR; x3: UINT): BOOL;stdcall; external 'winmm.dll' name 'mciGetErrorStringW';
Function mciGetErrorString(x1: MCIERROR; x2: PChar; x3: UINT): BOOL;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'mciGetErrorStringW' {$else}'mciGetErrorStringA' {$endif};
Function mciSetYieldProc(x1: MCIDEVICEID; x2: YIELDPROC; x3: DWORD): BOOL;stdcall; external 'winmm.dll' name 'mciSetYieldProc';
Function mciGetCreatorTask(x1: MCIDEVICEID): HTASK;stdcall; external 'winmm.dll' name 'mciGetCreatorTask';
Function mciGetYieldProc(x1: MCIDEVICEID; x2: LPDWORD): YIELDPROC;stdcall; external 'winmm.dll' name 'mciGetYieldProc';
Function mciExecute(x1: LPCSTR): BOOL;stdcall; external 'winmm.dll' name 'mciExecute';
Function joyGetPos(x1: UINT; x2: LPJOYINFO): MMRESULT;stdcall; external 'winmm.dll' name 'joyGetPos';
Function joyGetPosEx(x1: UINT; x2: LPJOYINFOEX): MMRESULT;stdcall; external 'winmm.dll' name 'joyGetPosEx';
Function joyGetThreshold(x1: UINT; x2: LPUINT): MMRESULT;stdcall; external 'winmm.dll' name 'joyGetThreshold';
Function joyReleaseCapture(x1: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'joyReleaseCapture';
Function joySetCapture(x1: HWND; x2: UINT; x3: UINT; x4: BOOL): MMRESULT;stdcall; external 'winmm.dll' name 'joySetCapture';
Function joySetThreshold(x1: UINT; x2: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'joySetThreshold';
Function waveOutGetNumDevs: UINT;stdcall; external 'winmm.dll' name 'waveOutGetNumDevs';
Function waveOutGetDevCapsA(x1: UINT; x2: LPWAVEOUTCAPSA; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutGetDevCapsA';
Function waveOutGetDevCapsW(x1: UINT; x2: LPWAVEOUTCAPSW; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutGetDevCapsW';
Function waveOutGetDevCaps(x1: UINT; x2: LPWAVEOUTCAPS; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'waveOutGetDevCapsW' {$else}'waveOutGetDevCapsA' {$endif};
Function waveOutGetVolume(x1: HWAVEOUT; x2: LPDWORD): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutGetVolume';
Function waveOutSetVolume(x1: HWAVEOUT; x2: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutSetVolume';
Function waveOutGetErrorTextA(x1: MMRESULT; x2: LPSTR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutGetErrorTextA';
Function waveOutGetErrorTextW(x1: MMRESULT; x2: LPWSTR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutGetErrorTextW';
Function waveOutGetErrorText(x1: MMRESULT; x2: PChar; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'waveOutGetErrorTextW' {$else}'waveOutGetErrorTextA' {$endif};
Function waveOutOpen(x1: LPHWAVEOUT; x2: UINT; x3: LPCWAVEFORMATEX; x4: DWORD_PTR; x5: DWORD_PTR;
                     x6: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutOpen';
Function waveOutClose(x1: HWAVEOUT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutClose';
Function waveOutPrepareHeader(x1: HWAVEOUT; x2: LPWAVEHDR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutPrepareHeader';
Function waveOutUnprepareHeader(x1: HWAVEOUT; x2: LPWAVEHDR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutUnprepareHeader';
Function waveOutWrite(x1: HWAVEOUT; x2: LPWAVEHDR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutWrite';
Function waveOutPause(x1: HWAVEOUT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutPause';
Function waveOutRestart(x1: HWAVEOUT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutRestart';
Function waveOutReset(x1: HWAVEOUT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutReset';
Function waveOutBreakLoop(x1: HWAVEOUT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutBreakLoop';
Function waveOutGetPosition(x1: HWAVEOUT; x2: LPMMTIME; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutGetPosition';
Function waveOutGetPitch(x1: HWAVEOUT; x2: LPDWORD): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutGetPitch';
Function waveOutSetPitch(x1: HWAVEOUT; x2: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutSetPitch';
Function waveOutGetPlaybackRate(x1: HWAVEOUT; x2: LPDWORD): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutGetPlaybackRate';
Function waveOutSetPlaybackRate(x1: HWAVEOUT; x2: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutSetPlaybackRate';
Function waveOutGetID(x1: HWAVEOUT; x2: LPUINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutGetID';
Function waveOutMessage(x1: HWAVEOUT; x2: UINT; x3: DWORD_PTR; x4: DWORD_PTR): MMRESULT;stdcall; external 'winmm.dll' name 'waveOutMessage';
Function waveInGetNumDevs: UINT;stdcall; external 'winmm.dll' name 'waveInGetNumDevs';
Function waveInGetDevCapsA(x1: UINT; x2: LPWAVEINCAPSA; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveInGetDevCapsA';
Function waveInGetDevCapsW(x1: UINT; x2: LPWAVEINCAPSW; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveInGetDevCapsW';
Function waveInGetDevCaps(x1: UINT; x2: LPWAVEINCAPS; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'waveInGetDevCapsW' {$else}'waveInGetDevCapsA' {$endif};
Function waveInGetErrorTextA(x1: MMRESULT; x2: LPSTR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveInGetErrorTextA';
Function waveInGetErrorTextW(x1: MMRESULT; x2: LPWSTR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveInGetErrorTextW';
Function waveInGetErrorText(x1: MMRESULT; x2: PChar; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'waveInGetErrorTextW' {$else}'waveInGetErrorTextA' {$endif};
Function waveInOpen(x1: LPHWAVEIN; x2: UINT; x3: LPCWAVEFORMATEX; x4: DWORD_PTR; x5: DWORD_PTR; x6 : DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'waveInOpen';
Function waveInClose(x1: HWAVEIN): MMRESULT;stdcall; external 'winmm.dll' name 'waveInClose';
Function waveInPrepareHeader(x1: HWAVEIN; x2: LPWAVEHDR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveInPrepareHeader';
Function waveInUnprepareHeader(x1: HWAVEIN; x2: LPWAVEHDR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveInUnprepareHeader';
Function waveInAddBuffer(x1: HWAVEIN; x2: LPWAVEHDR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveInAddBuffer';
Function waveInStart(x1: HWAVEIN): MMRESULT;stdcall; external 'winmm.dll' name 'waveInStart';
Function waveInStop(x1: HWAVEIN): MMRESULT;stdcall; external 'winmm.dll' name 'waveInStop';
Function waveInReset(x1: HWAVEIN): MMRESULT;stdcall; external 'winmm.dll' name 'waveInReset';
Function waveInGetPosition(x1: HWAVEIN; x2: LPMMTIME; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveInGetPosition';
Function waveInGetID(x1: HWAVEIN; x2: LPUINT): MMRESULT;stdcall; external 'winmm.dll' name 'waveInGetID';
Function waveInMessage(x1: HWAVEIN; x2: UINT; x3: DWORD_PTR; x4: DWORD_PTR): MMRESULT;stdcall; external 'winmm.dll' name 'waveInMessage';
Function mixerGetLineControlsA(x1: HMIXEROBJ; x2: LPMIXERLINECONTROLSA; x3: DWORD):MMRESULT;stdcall; external 'winmm.dll' name 'mixerGetLineControlsA';
Function mixerGetLineControlsW(x1: HMIXEROBJ; x2: LPMIXERLINECONTROLSW; x3: DWORD):MMRESULT;stdcall; external 'winmm.dll' name 'mixerGetLineControlsW';
Function mixerGetLineControls(x1: HMIXEROBJ; x2: LPMIXERLINECONTROLS; x3: DWORD): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'mixerGetLineControlsW' {$else}'mixerGetLineControlsA' {$endif};
Function joyGetNumDevs: UINT;stdcall; external 'winmm.dll' name 'joyGetNumDevs';
Function joyGetDevCapsA(x1: UINT; x2: LPJOYCAPSA; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'joyGetDevCapsA';
Function joyGetDevCapsW(x1: UINT; x2: LPJOYCAPSW; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'joyGetDevCapsW';
Function joyGetDevCaps(x1: UINT; x2: LPJOYCAPS; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'joyGetDevCapsW' {$else}'joyGetDevCapsA' {$endif};
Function mixerSetControlDetails(hmxobj: HMIXEROBJ; pmxcd: LPMIXERCONTROLDETAILS; fdwdetails: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'mixerSetControlDetails';
Function mixerGetControlDetailsA(x1: HMIXEROBJ; x2: LPMIXERCONTROLDETAILS; x3: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'mixerGetControlDetailsA';
Function mixerGetControlDetailsW(x1: HMIXEROBJ; x2: LPMIXERCONTROLDETAILS; x3: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'mixerGetControlDetailsW';
Function mixerGetControlDetails(x1: HMIXEROBJ; x2: LPMIXERCONTROLDETAILS; x3: DWORD): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'mixerGetControlDetailsW' {$else}'mixerGetControlDetailsA' {$endif};
Function timeGetSystemTime(x1: LPMMTIME; x2: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'timeGetSystemTime';
Function timeGetTime: DWORD;stdcall; external 'winmm.dll' name 'timeGetTime';
Function timeSetEvent(x1: UINT; x2: UINT; x3: LPTIMECALLBACK; x4: DWORD_PTR; x5: UINT):MMRESULT;stdcall; external 'winmm.dll' name 'timeSetEvent';
Function timeKillEvent(x1: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'timeKillEvent';
Function timeGetDevCaps(x1: LPTIMECAPS; x2: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'timeGetDevCaps';
Function timeBeginPeriod(x1: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'timeBeginPeriod';
Function timeEndPeriod(x1: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'timeEndPeriod';
Function mixerGetDevCapsA(x1: UINT; x2: LPMIXERCAPSA; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'mixerGetDevCapsA';
Function mixerGetDevCapsW(x1: UINT; x2: LPMIXERCAPSW; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'mixerGetDevCapsW';
Function mixerGetDevCaps(x1: UINT; x2: LPMIXERCAPS; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'mixerGetDevCapsW' {$else}'mixerGetDevCapsA' {$endif};
Function mixerOpen(x1: LPHMIXER; x2: UINT; x3: DWORD; x4: DWORD; x5: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'mixerOpen';
Function mixerClose(x1: HMIXER): MMRESULT;stdcall; external 'winmm.dll' name 'mixerClose';
Function mixerMessage(x1: HMIXER; x2: UINT; x3: DWORD; x4: DWORD): DWORD;stdcall; external 'winmm.dll' name 'mixerMessage';
Function auxGetNumDevs: UINT;stdcall; external 'winmm.dll' name 'auxGetNumDevs';
Function auxGetDevCapsA(x1: UINT; x2: LPAUXCAPSA ; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'auxGetDevCapsA';
Function auxGetDevCapsW(x1: UINT; x2: LPAUXCAPSW ; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'auxGetDevCapsW';
Function auxGetDevCaps(x1: UINT; x2: LPAUXCAPS ; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'auxGetDevCapsW' {$else}'auxGetDevCapsA' {$endif};
Function auxSetVolume(x1: UINT; x2: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'auxSetVolume';
Function auxGetVolume(x1: UINT; x2: LPDWORD): MMRESULT;stdcall; external 'winmm.dll' name 'auxGetVolume';
Function auxOutMessage(x1: UINT; x2: UINT; x3: DWORD_PTR; x4: DWORD_PTR): MMRESULT;stdcall; external 'winmm.dll' name 'auxOutMessage';
Function midiOutGetNumDevs: UINT;stdcall; external 'winmm.dll' name 'midiOutGetNumDevs';
Function midiStreamOpen(x1: LPHMIDISTRM; x2: LPUINT; x3: DWORD; x4: DWORD_PTR; x5: DWORD_PTR; x6:
                        DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'midiStreamOpen';
Function midiStreamClose(x1: HMIDISTRM): MMRESULT;stdcall; external 'winmm.dll' name 'midiStreamClose';
Function midiStreamProperty(x1: HMIDISTRM; x2: LPBYTE; x3: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'midiStreamProperty';
Function midiStreamPosition(x1: HMIDISTRM; x2: LPMMTIME; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiStreamPosition';
Function midiStreamOut(x1: HMIDISTRM; x2: LPMIDIHDR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiStreamOut';
Function midiStreamPause(x1: HMIDISTRM): MMRESULT;stdcall; external 'winmm.dll' name 'midiStreamPause';
Function midiStreamRestart(x1: HMIDISTRM): MMRESULT;stdcall; external 'winmm.dll' name 'midiStreamRestart';
Function midiStreamStop(x1: HMIDISTRM): MMRESULT;stdcall; external 'winmm.dll' name 'midiStreamStop';
Function midiConnect(x1: HMIDI; x2: HMIDIOUT; x3: pointer): MMRESULT;stdcall; external 'winmm.dll' name 'midiConnect';
Function midiDisconnect(x1: HMIDI; x2: HMIDIOUT; x3: pointer): MMRESULT;stdcall; external 'winmm.dll' name 'midiDisconnect';
Function midiOutGetDevCapsA(x1: UINT; x2: LPMIDIOUTCAPSA; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutGetDevCapsA';
Function midiOutGetDevCapsW(x1: UINT; x2: LPMIDIOUTCAPSW; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutGetDevCapsW';
Function midiOutGetDevCaps(x1: UINT; x2: LPMIDIOUTCAPS; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'midiOutGetDevCapsW' {$else}'midiOutGetDevCapsA' {$endif};
Function midiOutGetVolume(x1: HMIDIOUT; x2: LPDWORD): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutGetVolume';
Function midiOutSetVolume(x1: HMIDIOUT; x2: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutSetVolume';
Function midiOutGetErrorTextA(x1: MMRESULT; x2: LPSTR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutGetErrorTextA';
Function midiOutGetErrorTextW(x1: MMRESULT; x2: LPWSTR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutGetErrorTextW';
Function midiOutGetErrorText(x1: MMRESULT; x2: PChar; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'midiOutGetErrorTextW' {$else}'midiOutGetErrorTextA' {$endif};
Function midiOutOpen(x1: LPHMIDIOUT; x2: UINT; x3: DWORD_PTR; x4: DWORD_PTR; x5: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutOpen';
Function midiOutClose(x1: HMIDIOUT): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutClose';
Function midiOutPrepareHeader(x1: HMIDIOUT; x2: LPMIDIHDR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutPrepareHeader';
Function midiOutUnprepareHeader(x1: HMIDIOUT; x2: LPMIDIHDR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutUnprepareHeader';
Function midiOutShortMsg(x1: HMIDIOUT; x2: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutShortMsg';
Function midiOutLongMsg(x1: HMIDIOUT; x2: LPMIDIHDR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutLongMsg';
Function midiOutReset(x1: HMIDIOUT): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutReset';
Function midiOutCachePatches(x1: HMIDIOUT; x2: UINT; x3: LPWORD; x4: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutCachePatches';
Function midiOutCacheDrumPatches(x1: HMIDIOUT; x2: UINT; x3: LPWORD; x4: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutCacheDrumPatches';
Function midiOutGetID(x1: HMIDIOUT; x2: LPUINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutGetID';
Function midiOutMessage(x1: HMIDIOUT; x2: UINT; x3: DWORD_PTR; x4: DWORD_PTR): MMRESULT;stdcall; external 'winmm.dll' name 'midiOutMessage';
Function midiInGetNumDevs: UINT;stdcall; external 'winmm.dll' name 'midiInGetNumDevs';
Function midiInGetDevCapsA(x1: UINT; x2: LPMIDIINCAPSA; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiInGetDevCapsA';
Function midiInGetDevCapsW(x1: UINT; x2: LPMIDIINCAPSW; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiInGetDevCapsW';
Function midiInGetDevCaps(x1: UINT; x2: LPMIDIINCAPS; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'midiInGetDevCapsW' {$else}'midiInGetDevCapsA' {$endif};
Function midiInGetErrorTextA(x1: MMRESULT; x2: LPSTR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiInGetErrorTextA';
Function midiInGetErrorTextW(x1: MMRESULT; x2: LPWSTR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiInGetErrorTextW';
Function midiInGetErrorText(x1: MMRESULT; x2: PChar; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'midiInGetErrorTextW' {$else}'midiInGetErrorTextA' {$endif};
Function midiInOpen(x1: LPHMIDIIN; x2: UINT; x3: DWORD_PTR; x4: DWORD_PTR; x5: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'midiInOpen';
Function midiInClose(x1: HMIDIIN): MMRESULT;stdcall; external 'winmm.dll' name 'midiInClose';
Function midiInPrepareHeader(x1: HMIDIIN; x2: LPMIDIHDR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiInPrepareHeader';
Function midiInUnprepareHeader(x1: HMIDIIN; x2: LPMIDIHDR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiInUnprepareHeader';
Function midiInAddBuffer(x1: HMIDIIN; x2: LPMIDIHDR; x3: UINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiInAddBuffer';
Function midiInStart(x1: HMIDIIN): MMRESULT;stdcall; external 'winmm.dll' name 'midiInStart';
Function midiInStop(x1: HMIDIIN): MMRESULT;stdcall; external 'winmm.dll' name 'midiInStop';
Function midiInReset(x1: HMIDIIN): MMRESULT;stdcall; external 'winmm.dll' name 'midiInReset';
Function midiInGetID(x1: HMIDIIN; x2: LPUINT): MMRESULT;stdcall; external 'winmm.dll' name 'midiInGetID';
Function midiInMessage(x1: HMIDIIN; x2: UINT; x3: DWORD_PTR; x4: DWORD_PTR): MMRESULT;stdcall; external 'winmm.dll' name 'midiInMessage';
Function mixerGetLineInfoA(x1: HMIXEROBJ; x2: LPMIXERLINEA; x3: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'mixerGetLineInfoA';
Function mixerGetLineInfoW(x1: HMIXEROBJ; x2: LPMIXERLINEW; x3: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'mixerGetLineInfoW';
Function mixerGetLineInfo(x1: HMIXEROBJ; x2: LPMIXERLINE; x3: DWORD): MMRESULT;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'mixerGetLineInfoW' {$else}'mixerGetLineInfoA' {$endif};
Function mixerGetID(x1: HMIXEROBJ; Var x2: UINT; x3: DWORD): MMRESULT;stdcall; external 'winmm.dll' name 'mixerGetID';
Function PlaySoundA(x1: LPCSTR; x2: HMODULE; x3: DWORD): BOOL;stdcall; external 'winmm.dll' name 'PlaySoundA';
Function PlaySoundW(x1: LPCWSTR; x2: HMODULE; x3: DWORD): BOOL;stdcall; external 'winmm.dll' name 'PlaySoundW';
Function PlaySound(x1: PChar; x2: HMODULE; x3: DWORD): BOOL;stdcall; external 'winmm.dll' name
 {$ifdef UNICODE}'PlaySoundW' {$else}'PlaySoundA' {$endif};

implementation

Function MEVT_EVENTTYPE(x: byte): byte;
 Begin
   MEVT_EVENTTYPE := (x shr 24) And $FF;
 End;

Function MEVT_EVENTPARM(x: DWORD): DWORD;
 Begin
   MEVT_EVENTPARM := x And $00FFFFFF;
 End;

Type
  TFourBytes = packed array [0..3] Of byte;

Function MCI_MSF_MINUTE(msf: longint): byte;
 Begin
   MCI_MSF_MINUTE := TFourBytes (msf) [0];
 End;

Function MCI_TMSF_TRACK(tmsf: longint): byte;
 Begin
   MCI_TMSF_TRACK := TFourBytes (tmsf) [0];
 End;

Function MCI_HMS_HOUR(h: longint): byte;
 Begin
   MCI_HMS_HOUR := TFourBytes (h) [0];
 End;

Function MCI_MSF_SECOND(msf: longint): byte;
 Begin
   MCI_MSF_SECOND := TFourBytes (msf) [1];
 End;

Function MCI_TMSF_MINUTE(tmsf: longint): byte;
 Begin
   MCI_TMSF_MINUTE := TFourBytes (tmsf) [1];
 End;

Function MCI_HMS_MINUTE(h: longint): byte;
 Begin
   MCI_HMS_MINUTE := TFourBytes (h) [1];
 End;

Function MCI_MSF_FRAME(msf: longint): byte;
 Begin
   MCI_MSF_FRAME := TFourBytes (msf) [2];
 End;

Function MCI_TMSF_SECOND(tmsf: longint): byte;
 Begin
   MCI_TMSF_SECOND := TFourBytes (tmsf) [2];
 End;

Function MCI_HMS_SECOND(h: longint): byte;
 Begin
   MCI_HMS_SECOND := TFourBytes (h) [2];
 End;

Function MCI_MAKE_MSF(m, s, f: byte): longint;
 Begin
   TFourBytes (Result) [0] := m;
   TFourBytes (Result) [1] := s;
   TFourBytes (Result) [2] := f;
 End;

Function MCI_MAKE_HMS(h, m, s: byte): longint;
 Begin
   TFourBytes (Result) [0] := h;
   TFourBytes (Result) [1] := m;
   TFourBytes (Result) [2] := s;
 End;

Function MCI_TMSF_FRAME(tmsf: longint): byte;
 Begin
   MCI_TMSF_FRAME := TFourBytes (tmsf) [3];
 End;

Function mci_Make_TMSF(t, m, s, f: Byte): Longint;
 Begin
   TFourBytes (Result) [0] := t;
   TFourBytes (Result) [1] := m;
   TFourBytes (Result) [2] := s;
   TFourBytes (Result) [3] := f;
 End;

Function DIBINDEX(n: longint): longint;
 Begin
   DIBINDEX := n Or $10FF shl 16;
 End;

End.
