Module:    Win32-Multimedia
Copyright:    Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
              All rights reserved.
License:      See License.txt in this distribution for details.
Warranty:     Distributed WITHOUT WARRANTY OF ANY KIND

// This file is automatically generated from "mmsystem.h"; do not edit.


// Adapted from:
/*==========================================================================
 *
 *  mmsystem.h -- Include file for Multimedia API's
 *
 *  Version 4.00
 *
 *  
 *
 *--------------------------------------------------------------------------
 *
 *  Define:         Prevent inclusion of:
 *  --------------  --------------------------------------------------------
 *  MMNODRV         Installable driver support
 *  MMNOSOUND       Sound support
 *  MMNOWAVE        Waveform support
 *  MMNOMIDI        MIDI support
 *  MMNOAUX         Auxiliary audio support
 *  MMNOMIXER       Mixer support
 *  MMNOTIMER       Timer support
 *  MMNOJOY         Joystick support
 *  MMNOMCI         MCI support
 *  MMNOMMIO        Multimedia file I/O support
 *  MMNOMMSYSTEM    General MMSYSTEM functions
 *
 *==========================================================================
 */
/****************************************************************************

		    General constants and data types

****************************************************************************/

define inline-only constant $MAXPNAMELEN                =   32;
define inline-only constant $MAXERRORLENGTH             =  256;
define inline-only constant $MAX-JOYSTICKOEMVXDNAME     =  260;
define inline constant <MMVERSION> = <UINT>;
define inline constant <MMRESULT> = <C-unsigned-int>;
define C-struct <smpte%1>
  sealed inline-only slot hour-value     :: <C-BYTE>;
  sealed inline-only slot min-value      :: <C-BYTE>;
  sealed inline-only slot sec-value      :: <C-BYTE>;
  sealed inline-only slot frame-value    :: <C-BYTE>;
  sealed inline-only slot fps-value      :: <C-BYTE>;
  sealed inline-only slot dummy-value    :: <C-BYTE>;
  sealed inline-only array slot pad-array :: <C-BYTE>, length: 2,
	address-getter: pad-value;
  pack: 1;
end;
define C-struct <midi%2>
  sealed inline-only slot songptrpos-value :: <DWORD>;
  pack: 1;
end;
define C-struct <smpte%3>
  sealed inline-only slot hour-value     :: <C-BYTE>;
  sealed inline-only slot min-value      :: <C-BYTE>;
  sealed inline-only slot sec-value      :: <C-BYTE>;
  sealed inline-only slot frame-value    :: <C-BYTE>;
  sealed inline-only slot fps-value      :: <C-BYTE>;
  sealed inline-only slot dummy-value    :: <C-BYTE>;
  sealed inline-only array slot pad-array :: <C-BYTE>, length: 2,
	address-getter: pad-value;
  pack: 1;
end;
define C-struct <midi%4>
  sealed inline-only slot songptrpos-value :: <DWORD>;
  pack: 1;
end;
define C-union <u%5>
  sealed inline-only slot ms-value       :: <DWORD>;
  sealed inline-only slot sample-value   :: <DWORD>;
  sealed inline-only slot cb-value       :: <DWORD>;
  sealed inline-only slot ticks-value    :: <DWORD>;
  sealed inline-only slot smpte-value    :: <smpte%3>, setter: #f;
  sealed inline-only slot midi-value     :: <midi%4>, setter: #f;
  pack: 1;
end;

define C-struct <MMTIME>
  sealed inline-only slot wType-value    :: <UINT>;
  sealed inline-only slot u-value        :: <u%5>;
  pack: 1;
  pointer-type-name: <LPMMTIME>;
  c-name: "struct mmtime_tag";
end C-struct <MMTIME>;
define inline constant <PMMTIME> = <LPMMTIME>;
define inline-only constant $TIME-MS                    = #x0001;
define inline-only constant $TIME-SAMPLES               = #x0002;
define inline-only constant $TIME-BYTES                 = #x0004;
define inline-only constant $TIME-SMPTE                 = #x0008;
define inline-only constant $TIME-MIDI                  = #x0010;
define inline-only constant $TIME-TICKS                 = #x0020;

define inline-only function MAKEFOURCC (ch0, ch1, ch2, ch3);
   logior(LOBYTE(ch0) , 	ash(LOBYTE(ch1), 8), ash(LOBYTE(ch2), 16), ash(LOBYTE(ch3), 24) )
end;
/****************************************************************************

		    Multimedia Extensions Window Messages

****************************************************************************/

define inline-only constant $MM-JOY1MOVE                = #x3A0;
define inline-only constant $MM-JOY2MOVE                = #x3A1;
define inline-only constant $MM-JOY1ZMOVE               = #x3A2;
define inline-only constant $MM-JOY2ZMOVE               = #x3A3;
define inline-only constant $MM-JOY1BUTTONDOWN          = #x3B5;
define inline-only constant $MM-JOY2BUTTONDOWN          = #x3B6;
define inline-only constant $MM-JOY1BUTTONUP            = #x3B7;
define inline-only constant $MM-JOY2BUTTONUP            = #x3B8;
define inline-only constant $MM-MCINOTIFY               = #x3B9;
define inline-only constant $MM-WOM-OPEN                = #x3BB;
define inline-only constant $MM-WOM-CLOSE               = #x3BC;
define inline-only constant $MM-WOM-DONE                = #x3BD;
define inline-only constant $MM-WIM-OPEN                = #x3BE;
define inline-only constant $MM-WIM-CLOSE               = #x3BF;
define inline-only constant $MM-WIM-DATA                = #x3C0;
define inline-only constant $MM-MIM-OPEN                = #x3C1;
define inline-only constant $MM-MIM-CLOSE               = #x3C2;
define inline-only constant $MM-MIM-DATA                = #x3C3;
define inline-only constant $MM-MIM-LONGDATA            = #x3C4;
define inline-only constant $MM-MIM-ERROR               = #x3C5;
define inline-only constant $MM-MIM-LONGERROR           = #x3C6;
define inline-only constant $MM-MOM-OPEN                = #x3C7;
define inline-only constant $MM-MOM-CLOSE               = #x3C8;
define inline-only constant $MM-MOM-DONE                = #x3C9;
define inline-only constant $MM-DRVM-OPEN               = #x3D0;
define inline-only constant $MM-DRVM-CLOSE              = #x3D1;
define inline-only constant $MM-DRVM-DATA               = #x3D2;
define inline-only constant $MM-DRVM-ERROR              = #x3D3;
define inline-only constant $MM-STREAM-OPEN             = #x3D4;
define inline-only constant $MM-STREAM-CLOSE            = #x3D5;
define inline-only constant $MM-STREAM-DONE             = #x3D6;
define inline-only constant $MM-STREAM-ERROR            = #x3D7;
define inline-only constant $MM-MOM-POSITIONCB          = #x3CA;
define inline-only constant $MM-MCISIGNAL               = #x3CB;
define inline-only constant $MM-MIM-MOREDATA            = #x3CC;
define inline-only constant $MM-MIXM-LINE-CHANGE        = #x3D0;
define inline-only constant $MM-MIXM-CONTROL-CHANGE     = #x3D1;
/****************************************************************************

		String resource number bases (internal use)

****************************************************************************/

define inline-only constant $MMSYSERR-BASE              =    0;
define inline-only constant $WAVERR-BASE                =   32;
define inline-only constant $MIDIERR-BASE               =   64;
define inline-only constant $TIMERR-BASE                =   96;
define inline-only constant $JOYERR-BASE                =  160;
define inline-only constant $MCIERR-BASE                =  256;
define inline-only constant $MIXERR-BASE                = 1024;
define inline-only constant $MCI-STRING-OFFSET          =  512;
define inline-only constant $MCI-VD-OFFSET              = 1024;
define inline-only constant $MCI-CD-OFFSET              = 1088;
define inline-only constant $MCI-WAVE-OFFSET            = 1152;
define inline-only constant $MCI-SEQ-OFFSET             = 1216;
/****************************************************************************

			General error return values

****************************************************************************/

define inline-only constant $MMSYSERR-NOERROR           =    0;
define inline-only constant $MMSYSERR-ERROR             =
	$MMSYSERR-BASE + 1;
define inline-only constant $MMSYSERR-BADDEVICEID       =
	$MMSYSERR-BASE + 2;
define inline-only constant $MMSYSERR-NOTENABLED        =
	$MMSYSERR-BASE + 3;
define inline-only constant $MMSYSERR-ALLOCATED         =
	$MMSYSERR-BASE + 4;
define inline-only constant $MMSYSERR-INVALHANDLE       =
	$MMSYSERR-BASE + 5;
define inline-only constant $MMSYSERR-NODRIVER          =
	$MMSYSERR-BASE + 6;
define inline-only constant $MMSYSERR-NOMEM             =
	$MMSYSERR-BASE + 7;
define inline-only constant $MMSYSERR-NOTSUPPORTED      =
	$MMSYSERR-BASE + 8;
define inline-only constant $MMSYSERR-BADERRNUM         =
	$MMSYSERR-BASE + 9;
define inline-only constant $MMSYSERR-INVALFLAG         =
	$MMSYSERR-BASE + 10;
define inline-only constant $MMSYSERR-INVALPARAM        =
	$MMSYSERR-BASE + 11;
define inline-only constant $MMSYSERR-HANDLEBUSY        =
	$MMSYSERR-BASE + 12;
define inline-only constant $MMSYSERR-INVALIDALIAS      =
	$MMSYSERR-BASE + 13;
define inline-only constant $MMSYSERR-BADDB             =
	$MMSYSERR-BASE + 14;
define inline-only constant $MMSYSERR-KEYNOTFOUND       =
	$MMSYSERR-BASE + 15;
define inline-only constant $MMSYSERR-READERROR         =
	$MMSYSERR-BASE + 16;
define inline-only constant $MMSYSERR-WRITEERROR        =
	$MMSYSERR-BASE + 17;
define inline-only constant $MMSYSERR-DELETEERROR       =
	$MMSYSERR-BASE + 18;
define inline-only constant $MMSYSERR-VALNOTFOUND       =
	$MMSYSERR-BASE + 19;
define inline-only constant $MMSYSERR-NODRIVERCB        =
	$MMSYSERR-BASE + 20;
define inline-only constant $MMSYSERR-LASTERROR         =
	$MMSYSERR-BASE + 20;
define C-subtype <HDRVR> ( <HANDLE> ) end;
/****************************************************************************

			Installable driver support

****************************************************************************/


define C-struct <DRVCONFIGINFOEX>
  sealed inline-only slot dwDCISize-value :: <DWORD>;
  sealed inline-only slot lpszDCISectionName-value :: <LPCWSTR>;
  sealed inline-only slot lpszDCIAliasName-value :: <LPCWSTR>;
  sealed inline-only slot dnDevNode-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPDRVCONFIGINFOEX>;
  c-name: "struct DRVCONFIGINFOEX";
end C-struct <DRVCONFIGINFOEX>;
define inline constant <PDRVCONFIGINFOEX> = <LPDRVCONFIGINFOEX>;
define inline-only constant $DRV-LOAD                   = #x0001;
define inline-only constant $DRV-ENABLE                 = #x0002;
define inline-only constant $DRV-OPEN                   = #x0003;
define inline-only constant $DRV-CLOSE                  = #x0004;
define inline-only constant $DRV-DISABLE                = #x0005;
define inline-only constant $DRV-FREE                   = #x0006;
define inline-only constant $DRV-CONFIGURE              = #x0007;
define inline-only constant $DRV-QUERYCONFIGURE         = #x0008;
define inline-only constant $DRV-INSTALL                = #x0009;
define inline-only constant $DRV-REMOVE                 = #x000A;
define inline-only constant $DRV-EXITSESSION            = #x000B;
define inline-only constant $DRV-POWER                  = #x000F;
define inline-only constant $DRV-RESERVED               = #x0800;
define inline-only constant $DRV-USER                   = #x4000;

define C-struct <DRVCONFIGINFO>
  sealed inline-only slot dwDCISize-value :: <DWORD>;
  sealed inline-only slot lpszDCISectionName-value :: <LPCWSTR>;
  sealed inline-only slot lpszDCIAliasName-value :: <LPCWSTR>;
  pack: 1;
  pointer-type-name: <LPDRVCONFIGINFO>;
  c-name: "struct tagDRVCONFIGINFO";
end C-struct <DRVCONFIGINFO>;
define inline constant <PDRVCONFIGINFO> = <LPDRVCONFIGINFO>;
define inline-only constant $DRVCNF-CANCEL              = #x0000;
define inline-only constant $DRVCNF-OK                  = #x0001;
define inline-only constant $DRVCNF-RESTART             = #x0002;

define C-subtype <DRIVERPROC> ( <C-function-pointer> ) end;
define macro <DRIVERPROC>-callback-wrapper
 { <DRIVERPROC>-callback-wrapper(?new:name,?old:name) } =>
 { define C-callable-wrapper ?new of ?old
  parameter dword1     :: <DWORD>;
  parameter hdrvr2     :: <HDRVR>;
  parameter uint3      :: <UINT>;
  parameter lparam4    :: <LPARAM>;
  parameter lparam5    :: <LPARAM>;
  result value :: <LRESULT>;
  c-modifiers: "__stdcall";
 end C-callable-wrapper }
end;

define inline-only C-function CloseDriver
  parameter hDriver    :: <HDRVR>;
  parameter lParam1    :: <LONG>;
  parameter lParam2    :: <LONG>;
  result value :: <LRESULT>;
  c-name: "CloseDriver", c-modifiers: "__stdcall";
end;

define inline-only C-function OpenDriver
  parameter szDriverName :: <LPCWSTR>;
  parameter szSectionName :: <LPCWSTR>;
  parameter lParam2    :: <LONG>;
  result value :: <HDRVR>;
  c-name: "OpenDriver", c-modifiers: "__stdcall";
end;

define inline-only C-function SendDriverMessage
  parameter hDriver    :: <HDRVR>;
  parameter message    :: <UINT>;
  parameter lParam1    :: <LONG>;
  parameter lParam2    :: <LONG>;
  result value :: <LRESULT>;
  c-name: "SendDriverMessage", c-modifiers: "__stdcall";
end;

define inline-only C-function DrvGetModuleHandle
  parameter hDriver    :: <HDRVR>;
  result value :: <HMODULE>;
  c-name: "DrvGetModuleHandle", c-modifiers: "__stdcall";
end;

define inline-only C-function GetDriverModuleHandle
  parameter hDriver    :: <HDRVR>;
  result value :: <HMODULE>;
  c-name: "GetDriverModuleHandle", c-modifiers: "__stdcall";
end;

define inline-only C-function DefDriverProc
  parameter dwDriverIdentifier :: <DWORD>;
  parameter hdrvr      :: <HDRVR>;
  parameter uMsg       :: <UINT>;
  parameter lParam1    :: <LPARAM>;
  parameter lParam2    :: <LPARAM>;
  result value :: <LRESULT>;
  c-name: "DefDriverProc", c-modifiers: "__stdcall";
end;
/****************************************************************************

			  Driver callback support

****************************************************************************/

define inline-only constant $CALLBACK-TYPEMASK          = #x00070000;
define inline-only constant $CALLBACK-NULL              = #x00000000;
define inline-only constant $CALLBACK-WINDOW            = #x00010000;
define inline-only constant $CALLBACK-TASK              = #x00020000;
define inline-only constant $CALLBACK-FUNCTION          = #x00030000;
define inline-only constant $CALLBACK-THREAD            =
	$CALLBACK-TASK;
define inline-only constant $CALLBACK-EVENT             = #x00050000;

define C-subtype <LPDRVCALLBACK> ( <C-function-pointer> ) end;
define macro <LPDRVCALLBACK>-callback-wrapper
 { <LPDRVCALLBACK>-callback-wrapper(?new:name,?old:name) } =>
 { define C-callable-wrapper ?new of ?old
  parameter hdrvr      :: <HDRVR>;
  parameter uMsg       :: <UINT>;
  parameter dwUser     :: <DWORD>;
  parameter dw1        :: <DWORD>;
  parameter dw2        :: <DWORD>;
  c-modifiers: "__stdcall";
 end C-callable-wrapper }
end;
define inline constant <PDRVCALLBACK> = <LPDRVCALLBACK>;
/****************************************************************************

		    General MMSYSTEM support

****************************************************************************/

/****************************************************************************

			    Sound support

****************************************************************************/


define inline-only C-function sndPlaySound
  parameter pszSound   :: <LPCSTR>;
  parameter fuSound    :: <UINT>;
  result value :: <BOOL>;
  c-name: "sndPlaySoundA", c-modifiers: "__stdcall";
end;
define inline-only constant $SND-SYNC                   = #x0000;
define inline-only constant $SND-ASYNC                  = #x0001;
define inline-only constant $SND-NODEFAULT              = #x0002;
define inline-only constant $SND-MEMORY                 = #x0004;
define inline-only constant $SND-LOOP                   = #x0008;
define inline-only constant $SND-NOSTOP                 = #x0010;
define inline-only constant $SND-NOWAIT                 = #x00002000;
define inline-only constant $SND-ALIAS                  = #x00010000;
define inline-only constant $SND-ALIAS-ID               = #x00110000;
define inline-only constant $SND-FILENAME               = #x00020000;
define inline-only constant $SND-RESOURCE               = #x00040004;
define inline-only constant $SND-PURGE                  = #x0040;
define inline-only constant $SND-APPLICATION            = #x0080;
define inline-only constant $SND-ALIAS-START            =    0;

define inline-only C-function PlaySound
  parameter pszSound   :: <LPCSTR>;
  parameter hmod       :: <HMODULE>;
  parameter fdwSound   :: <DWORD>;
  result value :: <BOOL>;
  c-name: "PlaySoundA", c-modifiers: "__stdcall";
end;
/****************************************************************************

			Waveform audio support

****************************************************************************/

define inline-only constant $WAVERR-BADFORMAT           =
	$WAVERR-BASE + 0;
define inline-only constant $WAVERR-STILLPLAYING        =
	$WAVERR-BASE + 1;
define inline-only constant $WAVERR-UNPREPARED          =
	$WAVERR-BASE + 2;
define inline-only constant $WAVERR-SYNC                =
	$WAVERR-BASE + 3;
define inline-only constant $WAVERR-LASTERROR           =
	$WAVERR-BASE + 3;
define C-subtype <HWAVE> ( <HANDLE> ) end;
define C-subtype <HWAVEIN> ( <HANDLE> ) end;
define C-subtype <HWAVEOUT> ( <HANDLE> ) end;
define C-pointer-type <LPHWAVEIN> => <HWAVEIN>;
define C-pointer-type <LPHWAVEOUT> => <HWAVEOUT>;
define inline constant <LPWAVECALLBACK> = <LPDRVCALLBACK>;
define macro <LPWAVECALLBACK>-callback-wrapper
	{ <LPWAVECALLBACK>-callback-wrapper(?new:name,?old:name) } =>
	{ <LPDRVCALLBACK>-callback-wrapper(?new,?old) }
end;
define inline-only constant $WAVE-MAPPER                = $FFFFFFFF;
define inline-only constant $WAVE-FORMAT-QUERY          = #x0001;
define inline-only constant $WAVE-ALLOWSYNC             = #x0002;
define inline-only constant $WAVE-MAPPED                = #x0004;
define inline-only constant $WAVE-FORMAT-DIRECT         = #x0008;
define inline-only constant $WAVE-FORMAT-DIRECT-QUERY   =
	logior($WAVE-FORMAT-QUERY, $WAVE-FORMAT-DIRECT);

define C-struct <WAVEHDR>
  sealed inline-only slot lpData-value   :: <LPSTR>;
  sealed inline-only slot dwBufferLength-value :: <DWORD>;
  sealed inline-only slot dwBytesRecorded-value :: <DWORD>;
  sealed inline-only slot dwUser-value   :: <DWORD>;
  sealed inline-only slot dwFlags-value  :: <DWORD>;
  sealed inline-only slot dwLoops-value  :: <DWORD>;
  sealed inline-only slot lpNext-value   :: <LPWAVEHDR>;
  sealed inline-only slot reserved-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPWAVEHDR>;
  c-name: "struct wavehdr_tag";
end C-struct <WAVEHDR>;
define inline constant <PWAVEHDR> = <LPWAVEHDR>;
define inline-only constant $WHDR-DONE                  = #x00000001;
define inline-only constant $WHDR-PREPARED              = #x00000002;
define inline-only constant $WHDR-BEGINLOOP             = #x00000004;
define inline-only constant $WHDR-ENDLOOP               = #x00000008;
define inline-only constant $WHDR-INQUEUE               = #x00000010;

define C-struct <WAVEOUTCAPSA>
  sealed inline-only slot wMid-value     :: <WORD>;
  sealed inline-only slot wPid-value     :: <WORD>;
  sealed inline-only slot vDriverVersion-value :: <MMVERSION>;
  sealed inline-only array slot szPname-array :: <CHAR>,
	length: $MAXPNAMELEN, address-getter: szPname-value;
  sealed inline-only slot dwFormats-value :: <DWORD>;
  sealed inline-only slot wChannels-value :: <WORD>;
  sealed inline-only slot wReserved1     :: <WORD>;
  sealed inline-only slot dwSupport-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPWAVEOUTCAPSA>;
  c-name: "struct tagWAVEOUTCAPSA";
end C-struct <WAVEOUTCAPSA>;
define inline constant <PWAVEOUTCAPSA> = <LPWAVEOUTCAPSA>;
define inline constant <WAVEOUTCAPS> = <WAVEOUTCAPSA>;
define inline constant <PWAVEOUTCAPS> = <PWAVEOUTCAPSA>;
define inline constant <LPWAVEOUTCAPS> = <LPWAVEOUTCAPSA>;
define inline-only constant $WAVECAPS-PITCH             = #x0001;
define inline-only constant $WAVECAPS-PLAYBACKRATE      = #x0002;
define inline-only constant $WAVECAPS-VOLUME            = #x0004;
define inline-only constant $WAVECAPS-LRVOLUME          = #x0008;
define inline-only constant $WAVECAPS-SYNC              = #x0010;
define inline-only constant $WAVECAPS-SAMPLEACCURATE    = #x0020;
define inline-only constant $WAVECAPS-DIRECTSOUND       = #x0040;

define C-struct <WAVEINCAPSA>
  sealed inline-only slot wMid-value     :: <WORD>;
  sealed inline-only slot wPid-value     :: <WORD>;
  sealed inline-only slot vDriverVersion-value :: <MMVERSION>;
  sealed inline-only array slot szPname-array :: <CHAR>,
	length: $MAXPNAMELEN, address-getter: szPname-value;
  sealed inline-only slot dwFormats-value :: <DWORD>;
  sealed inline-only slot wChannels-value :: <WORD>;
  sealed inline-only slot wReserved1     :: <WORD>;
  pack: 1;
  pointer-type-name: <LPWAVEINCAPSA>;
  c-name: "struct tagWAVEINCAPSA";
end C-struct <WAVEINCAPSA>;
define inline constant <PWAVEINCAPSA> = <LPWAVEINCAPSA>;
define inline constant <WAVEINCAPS> = <WAVEINCAPSA>;
define inline constant <PWAVEINCAPS> = <PWAVEINCAPSA>;
define inline constant <LPWAVEINCAPS> = <LPWAVEINCAPSA>;
define inline-only constant $WAVE-INVALIDFORMAT         = #x00000000;
define inline-only constant $WAVE-FORMAT-1M08           = #x00000001;
define inline-only constant $WAVE-FORMAT-1S08           = #x00000002;
define inline-only constant $WAVE-FORMAT-1M16           = #x00000004;
define inline-only constant $WAVE-FORMAT-1S16           = #x00000008;
define inline-only constant $WAVE-FORMAT-2M08           = #x00000010;
define inline-only constant $WAVE-FORMAT-2S08           = #x00000020;
define inline-only constant $WAVE-FORMAT-2M16           = #x00000040;
define inline-only constant $WAVE-FORMAT-2S16           = #x00000080;
define inline-only constant $WAVE-FORMAT-4M08           = #x00000100;
define inline-only constant $WAVE-FORMAT-4S08           = #x00000200;
define inline-only constant $WAVE-FORMAT-4M16           = #x00000400;
define inline-only constant $WAVE-FORMAT-4S16           = #x00000800;

define C-struct <WAVEFORMAT>
  sealed inline-only slot wFormatTag-value :: <WORD>;
  sealed inline-only slot nChannels-value :: <WORD>;
  sealed inline-only slot nSamplesPerSec-value :: <DWORD>;
  sealed inline-only slot nAvgBytesPerSec-value :: <DWORD>;
  sealed inline-only slot nBlockAlign-value :: <WORD>;
  pack: 1;
  pointer-type-name: <LPWAVEFORMAT>;
  c-name: "struct waveformat_tag";
end C-struct <WAVEFORMAT>;
define inline constant <PWAVEFORMAT> = <LPWAVEFORMAT>;
define inline-only constant $WAVE-FORMAT-PCM            =    1;

define C-struct <PCMWAVEFORMAT>
  sealed inline-only slot wf-value       :: <WAVEFORMAT>;
  sealed inline-only slot wBitsPerSample-value :: <WORD>;
  pack: 1;
  pointer-type-name: <LPPCMWAVEFORMAT>;
  c-name: "struct pcmwaveformat_tag";
end C-struct <PCMWAVEFORMAT>;
define inline constant <PPCMWAVEFORMAT> = <LPPCMWAVEFORMAT>;

define C-struct <WAVEFORMATEX>
  sealed inline-only slot wFormatTag-value :: <WORD>;
  sealed inline-only slot nChannels-value :: <WORD>;
  sealed inline-only slot nSamplesPerSec-value :: <DWORD>;
  sealed inline-only slot nAvgBytesPerSec-value :: <DWORD>;
  sealed inline-only slot nBlockAlign-value :: <WORD>;
  sealed inline-only slot wBitsPerSample-value :: <WORD>;
  sealed inline-only slot cbSize-value   :: <WORD>;
  pack: 1;
  pointer-type-name: <LPWAVEFORMATEX>;
  c-name: "struct tWAVEFORMATEX";
end C-struct <WAVEFORMATEX>;
define inline constant <PWAVEFORMATEX> = <LPWAVEFORMATEX>;
define inline constant <LPCWAVEFORMATEX> =  /* const */ <LPWAVEFORMATEX>;

define inline-only C-function waveOutGetNumDevs
  result value :: <UINT>;
  c-name: "waveOutGetNumDevs", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutGetDevCaps
  parameter uDeviceID  :: <UINT>;
  parameter pwoc       :: <LPWAVEOUTCAPSA>;
  parameter cbwoc      :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "waveOutGetDevCapsA", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutGetVolume
  parameter hwo        :: <HWAVEOUT>;
  output parameter pdwVolume :: <LPDWORD>;
  result value :: <MMRESULT>;
  c-name: "waveOutGetVolume", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutSetVolume
  parameter hwo        :: <HWAVEOUT>;
  parameter dwVolume   :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "waveOutSetVolume", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutGetErrorText
  parameter mmrError   :: <MMRESULT>;
  parameter pszText    :: <LPSTR>;
  parameter cchText    :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "waveOutGetErrorTextA", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutOpen
  output parameter phwo :: <LPHWAVEOUT>;
  parameter uDeviceID  :: <UINT>;
  parameter pwfx       :: <LPCWAVEFORMATEX>;
  parameter dwCallback :: <DWORD>;
  parameter dwInstance :: <DWORD>;
  parameter fdwOpen    :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "waveOutOpen", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutClose
  parameter hwo        :: <HWAVEOUT>;
  result value :: <MMRESULT>;
  c-name: "waveOutClose", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutPrepareHeader
  parameter hwo        :: <HWAVEOUT>;
  parameter pwh        :: <LPWAVEHDR>;
  parameter cbwh       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "waveOutPrepareHeader", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutUnprepareHeader
  parameter hwo        :: <HWAVEOUT>;
  parameter pwh        :: <LPWAVEHDR>;
  parameter cbwh       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "waveOutUnprepareHeader", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutWrite
  parameter hwo        :: <HWAVEOUT>;
  parameter pwh        :: <LPWAVEHDR>;
  parameter cbwh       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "waveOutWrite", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutPause
  parameter hwo        :: <HWAVEOUT>;
  result value :: <MMRESULT>;
  c-name: "waveOutPause", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutRestart
  parameter hwo        :: <HWAVEOUT>;
  result value :: <MMRESULT>;
  c-name: "waveOutRestart", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutReset
  parameter hwo        :: <HWAVEOUT>;
  result value :: <MMRESULT>;
  c-name: "waveOutReset", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutBreakLoop
  parameter hwo        :: <HWAVEOUT>;
  result value :: <MMRESULT>;
  c-name: "waveOutBreakLoop", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutGetPosition
  parameter hwo        :: <HWAVEOUT>;
  parameter pmmt       :: <LPMMTIME>;
  parameter cbmmt      :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "waveOutGetPosition", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutGetPitch
  parameter hwo        :: <HWAVEOUT>;
  output parameter pdwPitch :: <LPDWORD>;
  result value :: <MMRESULT>;
  c-name: "waveOutGetPitch", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutSetPitch
  parameter hwo        :: <HWAVEOUT>;
  parameter dwPitch    :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "waveOutSetPitch", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutGetPlaybackRate
  parameter hwo        :: <HWAVEOUT>;
  output parameter pdwRate :: <LPDWORD>;
  result value :: <MMRESULT>;
  c-name: "waveOutGetPlaybackRate", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutSetPlaybackRate
  parameter hwo        :: <HWAVEOUT>;
  parameter dwRate     :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "waveOutSetPlaybackRate", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutGetID
  parameter hwo        :: <HWAVEOUT>;
  output parameter puDeviceID :: <LPUINT>;
  result value :: <MMRESULT>;
  c-name: "waveOutGetID", c-modifiers: "__stdcall";
end;

define inline-only C-function waveOutMessage
  parameter hwo        :: <HWAVEOUT>;
  parameter uMsg       :: <UINT>;
  parameter dw1        :: <DWORD>;
  parameter dw2        :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "waveOutMessage", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInGetNumDevs
  result value :: <UINT>;
  c-name: "waveInGetNumDevs", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInGetDevCaps
  parameter uDeviceID  :: <UINT>;
  parameter pwic       :: <LPWAVEINCAPSA>;
  parameter cbwic      :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "waveInGetDevCapsA", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInGetErrorText
  parameter mmrError   :: <MMRESULT>;
  parameter pszText    :: <LPSTR>;
  parameter cchText    :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "waveInGetErrorTextA", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInOpen
  output parameter phwi :: <LPHWAVEIN>;
  parameter uDeviceID  :: <UINT>;
  parameter pwfx       :: <LPCWAVEFORMATEX>;
  parameter dwCallback :: <DWORD>;
  parameter dwInstance :: <DWORD>;
  parameter fdwOpen    :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "waveInOpen", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInClose
  parameter hwi        :: <HWAVEIN>;
  result value :: <MMRESULT>;
  c-name: "waveInClose", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInPrepareHeader
  parameter hwi        :: <HWAVEIN>;
  parameter pwh        :: <LPWAVEHDR>;
  parameter cbwh       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "waveInPrepareHeader", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInUnprepareHeader
  parameter hwi        :: <HWAVEIN>;
  parameter pwh        :: <LPWAVEHDR>;
  parameter cbwh       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "waveInUnprepareHeader", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInAddBuffer
  parameter hwi        :: <HWAVEIN>;
  parameter pwh        :: <LPWAVEHDR>;
  parameter cbwh       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "waveInAddBuffer", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInStart
  parameter hwi        :: <HWAVEIN>;
  result value :: <MMRESULT>;
  c-name: "waveInStart", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInStop
  parameter hwi        :: <HWAVEIN>;
  result value :: <MMRESULT>;
  c-name: "waveInStop", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInReset
  parameter hwi        :: <HWAVEIN>;
  result value :: <MMRESULT>;
  c-name: "waveInReset", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInGetPosition
  parameter hwi        :: <HWAVEIN>;
  parameter pmmt       :: <LPMMTIME>;
  parameter cbmmt      :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "waveInGetPosition", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInGetID
  parameter hwi        :: <HWAVEIN>;
  output parameter puDeviceID :: <LPUINT>;
  result value :: <MMRESULT>;
  c-name: "waveInGetID", c-modifiers: "__stdcall";
end;

define inline-only C-function waveInMessage
  parameter hwi        :: <HWAVEIN>;
  parameter uMsg       :: <UINT>;
  parameter dw1        :: <DWORD>;
  parameter dw2        :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "waveInMessage", c-modifiers: "__stdcall";
end;
/****************************************************************************

			    MIDI audio support

****************************************************************************/

define inline-only constant $MIDIERR-UNPREPARED         =
	$MIDIERR-BASE + 0;
define inline-only constant $MIDIERR-STILLPLAYING       =
	$MIDIERR-BASE + 1;
define inline-only constant $MIDIERR-NOMAP              =
	$MIDIERR-BASE + 2;
define inline-only constant $MIDIERR-NOTREADY           =
	$MIDIERR-BASE + 3;
define inline-only constant $MIDIERR-NODEVICE           =
	$MIDIERR-BASE + 4;
define inline-only constant $MIDIERR-INVALIDSETUP       =
	$MIDIERR-BASE + 5;
define inline-only constant $MIDIERR-BADOPENMODE        =
	$MIDIERR-BASE + 6;
define inline-only constant $MIDIERR-DONT-CONTINUE      =
	$MIDIERR-BASE + 7;
define inline-only constant $MIDIERR-LASTERROR          =
	$MIDIERR-BASE + 7;
define C-subtype <HMIDI> ( <HANDLE> ) end;
define C-subtype <HMIDIIN> ( <HANDLE> ) end;
define C-subtype <HMIDIOUT> ( <HANDLE> ) end;
define C-subtype <HMIDISTRM> ( <HANDLE> ) end;
define C-pointer-type <LPHMIDI> => <HMIDI>;
define C-pointer-type <LPHMIDIIN> => <HMIDIIN>;
define C-pointer-type <LPHMIDIOUT> => <HMIDIOUT>;
define C-pointer-type <LPHMIDISTRM> => <HMIDISTRM>;
define inline constant <LPMIDICALLBACK> = <LPDRVCALLBACK>;
define macro <LPMIDICALLBACK>-callback-wrapper
	{ <LPMIDICALLBACK>-callback-wrapper(?new:name,?old:name) } =>
	{ <LPDRVCALLBACK>-callback-wrapper(?new,?old) }
end;
define inline-only constant $MIDIPATCHSIZE              =  128;
define C-pointer-type <LPPATCHARRAY> => <WORD>;
define C-pointer-type <LPKEYARRAY> => <WORD>;
define inline-only constant $MIDIMAPPER                 = $FFFFFFFF;
define inline-only constant $MIDI-MAPPER                = $FFFFFFFF;
define inline-only constant $MIDI-IO-STATUS             = #x00000020;
define inline-only constant $MIDI-CACHE-ALL             =    1;
define inline-only constant $MIDI-CACHE-BESTFIT         =    2;
define inline-only constant $MIDI-CACHE-QUERY           =    3;
define inline-only constant $MIDI-UNCACHE               =    4;

define C-struct <MIDIOUTCAPSA>
  sealed inline-only slot wMid-value     :: <WORD>;
  sealed inline-only slot wPid-value     :: <WORD>;
  sealed inline-only slot vDriverVersion-value :: <MMVERSION>;
  sealed inline-only array slot szPname-array :: <CHAR>,
	length: $MAXPNAMELEN, address-getter: szPname-value;
  sealed inline-only slot wTechnology-value :: <WORD>;
  sealed inline-only slot wVoices-value  :: <WORD>;
  sealed inline-only slot wNotes-value   :: <WORD>;
  sealed inline-only slot wChannelMask-value :: <WORD>;
  sealed inline-only slot dwSupport-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMIDIOUTCAPSA>;
  c-name: "struct tagMIDIOUTCAPSA";
end C-struct <MIDIOUTCAPSA>;
define inline constant <PMIDIOUTCAPSA> = <LPMIDIOUTCAPSA>;
define inline constant <MIDIOUTCAPS> = <MIDIOUTCAPSA>;
define inline constant <PMIDIOUTCAPS> = <PMIDIOUTCAPSA>;
define inline constant <LPMIDIOUTCAPS> = <LPMIDIOUTCAPSA>;
define inline-only constant $MOD-MIDIPORT               =    1;
define inline-only constant $MOD-SYNTH                  =    2;
define inline-only constant $MOD-SQSYNTH                =    3;
define inline-only constant $MOD-FMSYNTH                =    4;
define inline-only constant $MOD-MAPPER                 =    5;
define inline-only constant $MIDICAPS-VOLUME            = #x0001;
define inline-only constant $MIDICAPS-LRVOLUME          = #x0002;
define inline-only constant $MIDICAPS-CACHE             = #x0004;
define inline-only constant $MIDICAPS-STREAM            = #x0008;

define C-struct <MIDIINCAPSA>
  sealed inline-only slot wMid-value     :: <WORD>;
  sealed inline-only slot wPid-value     :: <WORD>;
  sealed inline-only slot vDriverVersion-value :: <MMVERSION>;
  sealed inline-only array slot szPname-array :: <CHAR>,
	length: $MAXPNAMELEN, address-getter: szPname-value;
  sealed inline-only slot dwSupport-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMIDIINCAPSA>;
  c-name: "struct tagMIDIINCAPSA";
end C-struct <MIDIINCAPSA>;
define inline constant <PMIDIINCAPSA> = <LPMIDIINCAPSA>;
define inline constant <MIDIINCAPS> = <MIDIINCAPSA>;
define inline constant <PMIDIINCAPS> = <PMIDIINCAPSA>;
define inline constant <LPMIDIINCAPS> = <LPMIDIINCAPSA>;

define C-struct <MIDIHDR>
  sealed inline-only slot lpData-value   :: <LPSTR>;
  sealed inline-only slot dwBufferLength-value :: <DWORD>;
  sealed inline-only slot dwBytesRecorded-value :: <DWORD>;
  sealed inline-only slot dwUser-value   :: <DWORD>;
  sealed inline-only slot dwFlags-value  :: <DWORD>;
  sealed inline-only slot lpNext-value   :: <LPMIDIHDR>;
  sealed inline-only slot reserved-value :: <DWORD>;
  sealed inline-only slot dwOffset-value :: <DWORD>;
  sealed inline-only array slot dwReserved-array :: <DWORD>,
	length: 8, address-getter: dwReserved-value;
  pack: 1;
  pointer-type-name: <LPMIDIHDR>;
  c-name: "struct midihdr_tag";
end C-struct <MIDIHDR>;
define inline constant <PMIDIHDR> = <LPMIDIHDR>;

define C-struct <MIDIEVENT>
  sealed inline-only slot dwDeltaTime-value :: <DWORD>;
  sealed inline-only slot dwStreamID-value :: <DWORD>;
  sealed inline-only slot dwEvent-value  :: <DWORD>;
  sealed inline-only array slot dwParms-array :: <DWORD>, length: 1,
	address-getter: dwParms-value;
  pack: 1;
  pointer-type-name: <LPMIDIEVENT>;
  c-name: "struct midievent_tag";
end C-struct <MIDIEVENT>;

define C-struct <MIDISTRMBUFFVER>
  sealed inline-only slot dwVersion-value :: <DWORD>;
  sealed inline-only slot dwMid-value    :: <DWORD>;
  sealed inline-only slot dwOEMVersion-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMIDISTRMBUFFVER>;
  c-name: "struct midistrmbuffver_tag";
end C-struct <MIDISTRMBUFFVER>;
define inline-only constant $MHDR-DONE                  = #x00000001;
define inline-only constant $MHDR-PREPARED              = #x00000002;
define inline-only constant $MHDR-INQUEUE               = #x00000004;
define inline-only constant $MHDR-ISSTRM                = #x00000008;
define inline-only constant $MEVT-F-SHORT               = #x00000000;
define inline-only constant $MEVT-F-LONG                =
	as(<machine-word>, #x80000000);
define inline-only constant $MEVT-F-CALLBACK            =
	as(<machine-word>, #x40000000);

define inline-only function MEVT-EVENTTYPE (x);
  logand((ash(x,-24)), #xFF)
end;

define inline-only function MEVT-EVENTPARM (x);
  (logand(x, #x00FFFFFF))
end;
define inline-only constant $MEVT-SHORTMSG              = #x00;
define inline-only constant $MEVT-TEMPO                 = #x01;
define inline-only constant $MEVT-NOP                   = #x02;
define inline-only constant $MEVT-LONGMSG               = #x80;
define inline-only constant $MEVT-COMMENT               = #x82;
define inline-only constant $MEVT-VERSION               = #x84;
define inline-only constant $MIDISTRM-ERROR             =   -2;
define inline-only constant $MIDIPROP-SET               =
	as(<machine-word>, #x80000000);
define inline-only constant $MIDIPROP-GET               =
	as(<machine-word>, #x40000000);
define inline-only constant $MIDIPROP-TIMEDIV           = #x00000001;
define inline-only constant $MIDIPROP-TEMPO             = #x00000002;

define C-struct <MIDIPROPTIMEDIV>
  sealed inline-only slot cbStruct-value :: <DWORD>;
  sealed inline-only slot dwTimeDiv-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMIDIPROPTIMEDIV>;
  c-name: "struct midiproptimediv_tag";
end C-struct <MIDIPROPTIMEDIV>;

define C-struct <MIDIPROPTEMPO>
  sealed inline-only slot cbStruct-value :: <DWORD>;
  sealed inline-only slot dwTempo-value  :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMIDIPROPTEMPO>;
  c-name: "struct midiproptempo_tag";
end C-struct <MIDIPROPTEMPO>;

define inline-only C-function midiOutGetNumDevs
  result value :: <UINT>;
  c-name: "midiOutGetNumDevs", c-modifiers: "__stdcall";
end;

define inline-only C-function midiStreamOpen
  output parameter phms :: <LPHMIDISTRM>;
  output parameter puDeviceID :: <LPUINT>;
  parameter cMidi      :: <DWORD>;
  parameter dwCallback :: <DWORD>;
  parameter dwInstance :: <DWORD>;
  parameter fdwOpen    :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "midiStreamOpen", c-modifiers: "__stdcall";
end;

define inline-only C-function midiStreamClose
  parameter hms        :: <HMIDISTRM>;
  result value :: <MMRESULT>;
  c-name: "midiStreamClose", c-modifiers: "__stdcall";
end;

define inline-only C-function midiStreamProperty
  parameter hms        :: <HMIDISTRM>;
  parameter lppropdata :: <LPBYTE>;
  parameter dwProperty :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "midiStreamProperty", c-modifiers: "__stdcall";
end;

define inline-only C-function midiStreamPosition
  parameter hms        :: <HMIDISTRM>;
  parameter lpmmt      :: <LPMMTIME>;
  parameter cbmmt      :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "midiStreamPosition", c-modifiers: "__stdcall";
end;

define inline-only C-function midiStreamOut
  parameter hms        :: <HMIDISTRM>;
  parameter pmh        :: <LPMIDIHDR>;
  parameter cbmh       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "midiStreamOut", c-modifiers: "__stdcall";
end;

define inline-only C-function midiStreamPause
  parameter hms        :: <HMIDISTRM>;
  result value :: <MMRESULT>;
  c-name: "midiStreamPause", c-modifiers: "__stdcall";
end;

define inline-only C-function midiStreamRestart
  parameter hms        :: <HMIDISTRM>;
  result value :: <MMRESULT>;
  c-name: "midiStreamRestart", c-modifiers: "__stdcall";
end;

define inline-only C-function midiStreamStop
  parameter hms        :: <HMIDISTRM>;
  result value :: <MMRESULT>;
  c-name: "midiStreamStop", c-modifiers: "__stdcall";
end;

define inline-only C-function midiConnect
  parameter hmi        :: <HMIDI>;
  parameter hmo        :: <HMIDIOUT>;
  parameter pReserved  :: <LPVOID>;
  result value :: <MMRESULT>;
  c-name: "midiConnect", c-modifiers: "__stdcall";
end;

define inline-only C-function midiDisconnect
  parameter hmi        :: <HMIDI>;
  parameter hmo        :: <HMIDIOUT>;
  parameter pReserved  :: <LPVOID>;
  result value :: <MMRESULT>;
  c-name: "midiDisconnect", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutGetDevCaps
  parameter uDeviceID  :: <UINT>;
  parameter pmoc       :: <LPMIDIOUTCAPSA>;
  parameter cbmoc      :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "midiOutGetDevCapsA", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutGetVolume
  parameter hmo        :: <HMIDIOUT>;
  output parameter pdwVolume :: <LPDWORD>;
  result value :: <MMRESULT>;
  c-name: "midiOutGetVolume", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutSetVolume
  parameter hmo        :: <HMIDIOUT>;
  parameter dwVolume   :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "midiOutSetVolume", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutGetErrorText
  parameter mmrError   :: <MMRESULT>;
  parameter pszText    :: <LPSTR>;
  parameter cchText    :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "midiOutGetErrorTextA", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutOpen
  output parameter phmo :: <LPHMIDIOUT>;
  parameter uDeviceID  :: <UINT>;
  parameter dwCallback :: <DWORD>;
  parameter dwInstance :: <DWORD>;
  parameter fdwOpen    :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "midiOutOpen", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutClose
  parameter hmo        :: <HMIDIOUT>;
  result value :: <MMRESULT>;
  c-name: "midiOutClose", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutPrepareHeader
  parameter hmo        :: <HMIDIOUT>;
  parameter pmh        :: <LPMIDIHDR>;
  parameter cbmh       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "midiOutPrepareHeader", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutUnprepareHeader
  parameter hmo        :: <HMIDIOUT>;
  parameter pmh        :: <LPMIDIHDR>;
  parameter cbmh       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "midiOutUnprepareHeader", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutShortMsg
  parameter hmo        :: <HMIDIOUT>;
  parameter dwMsg      :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "midiOutShortMsg", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutLongMsg
  parameter hmo        :: <HMIDIOUT>;
  parameter pmh        :: <LPMIDIHDR>;
  parameter cbmh       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "midiOutLongMsg", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutReset
  parameter hmo        :: <HMIDIOUT>;
  result value :: <MMRESULT>;
  c-name: "midiOutReset", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutCachePatches
  parameter hmo        :: <HMIDIOUT>;
  parameter uBank      :: <UINT>;
  output parameter pwpa :: <LPWORD>;
  parameter fuCache    :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "midiOutCachePatches", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutCacheDrumPatches
  parameter hmo        :: <HMIDIOUT>;
  parameter uPatch     :: <UINT>;
  output parameter pwkya :: <LPWORD>;
  parameter fuCache    :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "midiOutCacheDrumPatches", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutGetID
  parameter hmo        :: <HMIDIOUT>;
  output parameter puDeviceID :: <LPUINT>;
  result value :: <MMRESULT>;
  c-name: "midiOutGetID", c-modifiers: "__stdcall";
end;

define inline-only C-function midiOutMessage
  parameter hmo        :: <HMIDIOUT>;
  parameter uMsg       :: <UINT>;
  parameter dw1        :: <DWORD>;
  parameter dw2        :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "midiOutMessage", c-modifiers: "__stdcall";
end;

define inline-only C-function midiInGetNumDevs
  result value :: <UINT>;
  c-name: "midiInGetNumDevs", c-modifiers: "__stdcall";
end;

define inline-only C-function midiInGetDevCaps
  parameter uDeviceID  :: <UINT>;
  parameter pmic       :: <LPMIDIINCAPSA>;
  parameter cbmic      :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "midiInGetDevCapsA", c-modifiers: "__stdcall";
end;

define inline-only C-function midiInGetErrorText
  parameter mmrError   :: <MMRESULT>;
  parameter pszText    :: <LPSTR>;
  parameter cchText    :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "midiInGetErrorTextA", c-modifiers: "__stdcall";
end;

define inline-only C-function midiInOpen
  output parameter phmi :: <LPHMIDIIN>;
  parameter uDeviceID  :: <UINT>;
  parameter dwCallback :: <DWORD>;
  parameter dwInstance :: <DWORD>;
  parameter fdwOpen    :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "midiInOpen", c-modifiers: "__stdcall";
end;

define inline-only C-function midiInClose
  parameter hmi        :: <HMIDIIN>;
  result value :: <MMRESULT>;
  c-name: "midiInClose", c-modifiers: "__stdcall";
end;

define inline-only C-function midiInPrepareHeader
  parameter hmi        :: <HMIDIIN>;
  parameter pmh        :: <LPMIDIHDR>;
  parameter cbmh       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "midiInPrepareHeader", c-modifiers: "__stdcall";
end;

define inline-only C-function midiInUnprepareHeader
  parameter hmi        :: <HMIDIIN>;
  parameter pmh        :: <LPMIDIHDR>;
  parameter cbmh       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "midiInUnprepareHeader", c-modifiers: "__stdcall";
end;

define inline-only C-function midiInAddBuffer
  parameter hmi        :: <HMIDIIN>;
  parameter pmh        :: <LPMIDIHDR>;
  parameter cbmh       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "midiInAddBuffer", c-modifiers: "__stdcall";
end;

define inline-only C-function midiInStart
  parameter hmi        :: <HMIDIIN>;
  result value :: <MMRESULT>;
  c-name: "midiInStart", c-modifiers: "__stdcall";
end;

define inline-only C-function midiInStop
  parameter hmi        :: <HMIDIIN>;
  result value :: <MMRESULT>;
  c-name: "midiInStop", c-modifiers: "__stdcall";
end;

define inline-only C-function midiInReset
  parameter hmi        :: <HMIDIIN>;
  result value :: <MMRESULT>;
  c-name: "midiInReset", c-modifiers: "__stdcall";
end;

define inline-only C-function midiInGetID
  parameter hmi        :: <HMIDIIN>;
  output parameter puDeviceID :: <LPUINT>;
  result value :: <MMRESULT>;
  c-name: "midiInGetID", c-modifiers: "__stdcall";
end;

define inline-only C-function midiInMessage
  parameter hmi        :: <HMIDIIN>;
  parameter uMsg       :: <UINT>;
  parameter dw1        :: <DWORD>;
  parameter dw2        :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "midiInMessage", c-modifiers: "__stdcall";
end;
/****************************************************************************

			Auxiliary audio support

****************************************************************************/

define inline-only constant $AUX-MAPPER                 = $FFFFFFFF;

define C-struct <AUXCAPSA>
  sealed inline-only slot wMid-value     :: <WORD>;
  sealed inline-only slot wPid-value     :: <WORD>;
  sealed inline-only slot vDriverVersion-value :: <MMVERSION>;
  sealed inline-only array slot szPname-array :: <CHAR>,
	length: $MAXPNAMELEN, address-getter: szPname-value;
  sealed inline-only slot wTechnology-value :: <WORD>;
  sealed inline-only slot wReserved1     :: <WORD>;
  sealed inline-only slot dwSupport-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPAUXCAPSA>;
  c-name: "struct tagAUXCAPSA";
end C-struct <AUXCAPSA>;
define inline constant <PAUXCAPSA> = <LPAUXCAPSA>;
define inline constant <AUXCAPS> = <AUXCAPSA>;
define inline constant <PAUXCAPS> = <PAUXCAPSA>;
define inline constant <LPAUXCAPS> = <LPAUXCAPSA>;
define inline-only constant $AUXCAPS-CDAUDIO            =    1;
define inline-only constant $AUXCAPS-AUXIN              =    2;
define inline-only constant $AUXCAPS-VOLUME             = #x0001;
define inline-only constant $AUXCAPS-LRVOLUME           = #x0002;

define inline-only C-function auxGetNumDevs
  result value :: <UINT>;
  c-name: "auxGetNumDevs", c-modifiers: "__stdcall";
end;

define inline-only C-function auxGetDevCaps
  parameter uDeviceID  :: <UINT>;
  parameter pac        :: <LPAUXCAPSA>;
  parameter cbac       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "auxGetDevCapsA", c-modifiers: "__stdcall";
end;

define inline-only C-function auxSetVolume
  parameter uDeviceID  :: <UINT>;
  parameter dwVolume   :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "auxSetVolume", c-modifiers: "__stdcall";
end;

define inline-only C-function auxGetVolume
  parameter uDeviceID  :: <UINT>;
  output parameter pdwVolume :: <LPDWORD>;
  result value :: <MMRESULT>;
  c-name: "auxGetVolume", c-modifiers: "__stdcall";
end;

define inline-only C-function auxOutMessage
  parameter uDeviceID  :: <UINT>;
  parameter uMsg       :: <UINT>;
  parameter dw1        :: <DWORD>;
  parameter dw2        :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "auxOutMessage", c-modifiers: "__stdcall";
end;
/****************************************************************************

			    Mixer Support

****************************************************************************/

define C-subtype <HMIXEROBJ> ( <HANDLE> ) end;
define C-pointer-type <LPHMIXEROBJ> => <HMIXEROBJ>;
define C-subtype <HMIXER> ( <HANDLE> ) end;
define C-pointer-type <LPHMIXER> => <HMIXER>;
define inline-only constant $MIXER-SHORT-NAME-CHARS     =   16;
define inline-only constant $MIXER-LONG-NAME-CHARS      =   64;
define inline-only constant $MIXERR-INVALLINE           =
	$MIXERR-BASE + 0;
define inline-only constant $MIXERR-INVALCONTROL        =
	$MIXERR-BASE + 1;
define inline-only constant $MIXERR-INVALVALUE          =
	$MIXERR-BASE + 2;
define inline-only constant $MIXERR-LASTERROR           =
	$MIXERR-BASE + 2;
define inline-only constant $MIXER-OBJECTF-HANDLE       =
	as(<machine-word>, #x80000000);
define inline-only constant $MIXER-OBJECTF-MIXER        = #x00000000;
define inline-only constant $MIXER-OBJECTF-HMIXER       =
	%logior($MIXER-OBJECTF-HANDLE, $MIXER-OBJECTF-MIXER);
define inline-only constant $MIXER-OBJECTF-WAVEOUT      =
	as(<machine-word>, #x10000000);
define inline-only constant $MIXER-OBJECTF-HWAVEOUT     =
	%logior($MIXER-OBJECTF-HANDLE, $MIXER-OBJECTF-WAVEOUT);
define inline-only constant $MIXER-OBJECTF-WAVEIN       =
	as(<machine-word>, #x20000000);
define inline-only constant $MIXER-OBJECTF-HWAVEIN      =
	%logior($MIXER-OBJECTF-HANDLE, $MIXER-OBJECTF-WAVEIN);
define inline-only constant $MIXER-OBJECTF-MIDIOUT      =
	as(<machine-word>, #x30000000);
define inline-only constant $MIXER-OBJECTF-HMIDIOUT     =
	%logior($MIXER-OBJECTF-HANDLE, $MIXER-OBJECTF-MIDIOUT);
define inline-only constant $MIXER-OBJECTF-MIDIIN       =
	as(<machine-word>, #x40000000);
define inline-only constant $MIXER-OBJECTF-HMIDIIN      =
	%logior($MIXER-OBJECTF-HANDLE, $MIXER-OBJECTF-MIDIIN);
define inline-only constant $MIXER-OBJECTF-AUX          =
	as(<machine-word>, #x50000000);

define inline-only C-function mixerGetNumDevs
  result value :: <UINT>;
  c-name: "mixerGetNumDevs", c-modifiers: "__stdcall";
end;

define C-struct <MIXERCAPSA>
  sealed inline-only slot wMid-value     :: <WORD>;
  sealed inline-only slot wPid-value     :: <WORD>;
  sealed inline-only slot vDriverVersion-value :: <MMVERSION>;
  sealed inline-only array slot szPname-array :: <CHAR>,
	length: $MAXPNAMELEN, address-getter: szPname-value;
  sealed inline-only slot fdwSupport-value :: <DWORD>;
  sealed inline-only slot cDestinations-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMIXERCAPSA>;
  c-name: "struct tagMIXERCAPSA";
end C-struct <MIXERCAPSA>;
define inline constant <PMIXERCAPSA> = <LPMIXERCAPSA>;
define inline constant <MIXERCAPS> = <MIXERCAPSA>;
define inline constant <PMIXERCAPS> = <PMIXERCAPSA>;
define inline constant <LPMIXERCAPS> = <LPMIXERCAPSA>;

define inline-only C-function mixerGetDevCaps
  parameter uMxId      :: <UINT>;
  parameter pmxcaps    :: <LPMIXERCAPSA>;
  parameter cbmxcaps   :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "mixerGetDevCapsA", c-modifiers: "__stdcall";
end;

define inline-only C-function mixerOpen
  output parameter phmx :: <LPHMIXER>;
  parameter uMxId      :: <UINT>;
  parameter dwCallback :: <DWORD>;
  parameter dwInstance :: <DWORD>;
  parameter fdwOpen    :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "mixerOpen", c-modifiers: "__stdcall";
end;

define inline-only C-function mixerClose
  parameter hmx        :: <HMIXER>;
  result value :: <MMRESULT>;
  c-name: "mixerClose", c-modifiers: "__stdcall";
end;

define inline-only C-function mixerMessage
  parameter hmx        :: <HMIXER>;
  parameter uMsg       :: <UINT>;
  parameter dwParam1   :: <DWORD>;
  parameter dwParam2   :: <DWORD>;
  result value :: <DWORD>;
  c-name: "mixerMessage", c-modifiers: "__stdcall";
end;
define C-struct <Target%6>
  sealed inline-only slot dwType-value   :: <DWORD>;
  sealed inline-only slot dwDeviceID-value :: <DWORD>;
  sealed inline-only slot wMid-value     :: <WORD>;
  sealed inline-only slot wPid-value     :: <WORD>;
  sealed inline-only slot vDriverVersion-value :: <MMVERSION>;
  sealed inline-only array slot szPname-array :: <CHAR>,
	length: $MAXPNAMELEN, address-getter: szPname-value;
  pack: 1;
end;

define C-struct <MIXERLINEA>
  sealed inline-only slot cbStruct-value :: <DWORD>;
  sealed inline-only slot dwDestination-value :: <DWORD>;
  sealed inline-only slot dwSource-value :: <DWORD>;
  sealed inline-only slot dwLineID-value :: <DWORD>;
  sealed inline-only slot fdwLine-value  :: <DWORD>;
  sealed inline-only slot dwUser-value   :: <DWORD>;
  sealed inline-only slot dwComponentType-value :: <DWORD>;
  sealed inline-only slot cChannels-value :: <DWORD>;
  sealed inline-only slot cConnections-value :: <DWORD>;
  sealed inline-only slot cControls-value :: <DWORD>;
  sealed inline-only array slot szShortName-array :: <CHAR>,
	length: $MIXER-SHORT-NAME-CHARS, address-getter: szShortName-value;
  sealed inline-only array slot szName-array :: <CHAR>,
	length: $MIXER-LONG-NAME-CHARS, address-getter: szName-value;
  sealed inline-only slot Target-value   :: <Target%6>, setter: #f;
  pack: 1;
  pointer-type-name: <LPMIXERLINEA>;
  c-name: "struct tagMIXERLINEA";
end C-struct <MIXERLINEA>;
define inline constant <PMIXERLINEA> = <LPMIXERLINEA>;
define inline constant <MIXERLINE> = <MIXERLINEA>;
define inline constant <PMIXERLINE> = <PMIXERLINEA>;
define inline constant <LPMIXERLINE> = <LPMIXERLINEA>;
define inline-only constant $MIXERLINE-LINEF-ACTIVE     = #x00000001;
define inline-only constant $MIXERLINE-LINEF-DISCONNECTED =
	#x00008000;
define inline-only constant $MIXERLINE-LINEF-SOURCE     =
	as(<machine-word>, #x80000000);
define inline-only constant $MIXERLINE-COMPONENTTYPE-DST-FIRST =
	#x00000000;
define inline-only constant $MIXERLINE-COMPONENTTYPE-DST-UNDEFINED =
	$MIXERLINE-COMPONENTTYPE-DST-FIRST + 0;
define inline-only constant $MIXERLINE-COMPONENTTYPE-DST-DIGITAL =
	$MIXERLINE-COMPONENTTYPE-DST-FIRST + 1;
define inline-only constant $MIXERLINE-COMPONENTTYPE-DST-LINE =
	$MIXERLINE-COMPONENTTYPE-DST-FIRST + 2;
define inline-only constant $MIXERLINE-COMPONENTTYPE-DST-MONITOR =
	$MIXERLINE-COMPONENTTYPE-DST-FIRST + 3;
define inline-only constant $MIXERLINE-COMPONENTTYPE-DST-SPEAKERS =
	$MIXERLINE-COMPONENTTYPE-DST-FIRST + 4;
define inline-only constant $MIXERLINE-COMPONENTTYPE-DST-HEADPHONES =
	$MIXERLINE-COMPONENTTYPE-DST-FIRST + 5;
define inline-only constant $MIXERLINE-COMPONENTTYPE-DST-TELEPHONE =
	$MIXERLINE-COMPONENTTYPE-DST-FIRST + 6;
define inline-only constant $MIXERLINE-COMPONENTTYPE-DST-WAVEIN =
	$MIXERLINE-COMPONENTTYPE-DST-FIRST + 7;
define inline-only constant $MIXERLINE-COMPONENTTYPE-DST-VOICEIN =
	$MIXERLINE-COMPONENTTYPE-DST-FIRST + 8;
define inline-only constant $MIXERLINE-COMPONENTTYPE-DST-LAST =
	$MIXERLINE-COMPONENTTYPE-DST-FIRST + 8;
define inline-only constant $MIXERLINE-COMPONENTTYPE-SRC-FIRST =
	#x00001000;
define inline-only constant $MIXERLINE-COMPONENTTYPE-SRC-UNDEFINED =
	$MIXERLINE-COMPONENTTYPE-SRC-FIRST + 0;
define inline-only constant $MIXERLINE-COMPONENTTYPE-SRC-DIGITAL =
	$MIXERLINE-COMPONENTTYPE-SRC-FIRST + 1;
define inline-only constant $MIXERLINE-COMPONENTTYPE-SRC-LINE =
	$MIXERLINE-COMPONENTTYPE-SRC-FIRST + 2;
define inline-only constant $MIXERLINE-COMPONENTTYPE-SRC-MICROPHONE =
	$MIXERLINE-COMPONENTTYPE-SRC-FIRST + 3;
define inline-only constant $MIXERLINE-COMPONENTTYPE-SRC-SYNTHESIZER =
	$MIXERLINE-COMPONENTTYPE-SRC-FIRST + 4;
define inline-only constant $MIXERLINE-COMPONENTTYPE-SRC-COMPACTDISC =
	$MIXERLINE-COMPONENTTYPE-SRC-FIRST + 5;
define inline-only constant $MIXERLINE-COMPONENTTYPE-SRC-TELEPHONE =
	$MIXERLINE-COMPONENTTYPE-SRC-FIRST + 6;
define inline-only constant $MIXERLINE-COMPONENTTYPE-SRC-PCSPEAKER =
	$MIXERLINE-COMPONENTTYPE-SRC-FIRST + 7;
define inline-only constant $MIXERLINE-COMPONENTTYPE-SRC-WAVEOUT =
	$MIXERLINE-COMPONENTTYPE-SRC-FIRST + 8;
define inline-only constant $MIXERLINE-COMPONENTTYPE-SRC-AUXILIARY =
	$MIXERLINE-COMPONENTTYPE-SRC-FIRST + 9;
define inline-only constant $MIXERLINE-COMPONENTTYPE-SRC-ANALOG =
	$MIXERLINE-COMPONENTTYPE-SRC-FIRST + 10;
define inline-only constant $MIXERLINE-COMPONENTTYPE-SRC-LAST =
	$MIXERLINE-COMPONENTTYPE-SRC-FIRST + 10;
define inline-only constant $MIXERLINE-TARGETTYPE-UNDEFINED =    0;
define inline-only constant $MIXERLINE-TARGETTYPE-WAVEOUT =    1;
define inline-only constant $MIXERLINE-TARGETTYPE-WAVEIN =    2;
define inline-only constant $MIXERLINE-TARGETTYPE-MIDIOUT =    3;
define inline-only constant $MIXERLINE-TARGETTYPE-MIDIIN =    4;
define inline-only constant $MIXERLINE-TARGETTYPE-AUX   =    5;

define inline-only C-function mixerGetLineInfo
  parameter hmxobj     :: <HMIXEROBJ>;
  parameter pmxl       :: <LPMIXERLINEA>;
  parameter fdwInfo    :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "mixerGetLineInfoA", c-modifiers: "__stdcall";
end;
define inline-only constant $MIXER-GETLINEINFOF-DESTINATION =
	#x00000000;
define inline-only constant $MIXER-GETLINEINFOF-SOURCE  = #x00000001;
define inline-only constant $MIXER-GETLINEINFOF-LINEID  = #x00000002;
define inline-only constant $MIXER-GETLINEINFOF-COMPONENTTYPE =
	#x00000003;
define inline-only constant $MIXER-GETLINEINFOF-TARGETTYPE =
	#x00000004;
define inline-only constant $MIXER-GETLINEINFOF-QUERYMASK =
	#x0000000F;

define inline-only C-function mixerGetID
  parameter hmxobj     :: <HMIXEROBJ>;
  output parameter puMxId :: <LPUINT>;
  parameter fdwId      :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "mixerGetID", c-modifiers: "__stdcall";
end;
define C-union <Metrics%7>
  sealed inline-only slot cSteps-value   :: <DWORD>;
  sealed inline-only slot cbCustomData-value :: <DWORD>;
  sealed inline-only array slot dwReserved-array :: <DWORD>,
	length: 6, address-getter: dwReserved-value;
  pack: 1;
end;

define C-struct <MIXERCONTROLA>
  sealed inline-only slot cbStruct-value :: <DWORD>;
  sealed inline-only slot dwControlID-value :: <DWORD>;
  sealed inline-only slot dwControlType-value :: <DWORD>;
  sealed inline-only slot fdwControl-value :: <DWORD>;
  sealed inline-only slot cMultipleItems-value :: <DWORD>;
  sealed inline-only array slot szShortName-array :: <CHAR>,
	length: $MIXER-SHORT-NAME-CHARS, address-getter: szShortName-value;
  sealed inline-only array slot szName-array :: <CHAR>,
	length: $MIXER-LONG-NAME-CHARS, address-getter: szName-value;
  sealed inline-only slot Bounds-value   :: <bounds-union>;
  sealed inline-only slot Metrics-value  :: <Metrics%7>;
  pack: 1;
  pointer-type-name: <LPMIXERCONTROLA>;
  c-name: "struct tagMIXERCONTROLA";
end C-struct <MIXERCONTROLA>;
define inline constant <PMIXERCONTROLA> = <LPMIXERCONTROLA>;
define inline constant <MIXERCONTROL> = <MIXERCONTROLA>;
define inline constant <PMIXERCONTROL> = <PMIXERCONTROLA>;
define inline constant <LPMIXERCONTROL> = <LPMIXERCONTROLA>;
define inline-only constant $MIXERCONTROL-CONTROLF-UNIFORM =
	#x00000001;
define inline-only constant $MIXERCONTROL-CONTROLF-MULTIPLE =
	#x00000002;
define inline-only constant $MIXERCONTROL-CONTROLF-DISABLED =
	as(<machine-word>, #x80000000);
define inline-only constant $MIXERCONTROL-CT-CLASS-MASK =
	as(<machine-word>, #xF0000000);
define inline-only constant $MIXERCONTROL-CT-CLASS-CUSTOM =
	#x00000000;
define inline-only constant $MIXERCONTROL-CT-CLASS-METER =
	as(<machine-word>, #x10000000);
define inline-only constant $MIXERCONTROL-CT-CLASS-SWITCH =
	as(<machine-word>, #x20000000);
define inline-only constant $MIXERCONTROL-CT-CLASS-NUMBER =
	as(<machine-word>, #x30000000);
define inline-only constant $MIXERCONTROL-CT-CLASS-SLIDER =
	as(<machine-word>, #x40000000);
define inline-only constant $MIXERCONTROL-CT-CLASS-FADER =
	as(<machine-word>, #x50000000);
define inline-only constant $MIXERCONTROL-CT-CLASS-TIME =
	as(<machine-word>, #x60000000);
define inline-only constant $MIXERCONTROL-CT-CLASS-LIST =
	as(<machine-word>, #x70000000);
define inline-only constant $MIXERCONTROL-CT-SUBCLASS-MASK =
	#x0F000000;
define inline-only constant $MIXERCONTROL-CT-SC-SWITCH-BOOLEAN =
	#x00000000;
define inline-only constant $MIXERCONTROL-CT-SC-SWITCH-BUTTON =
	#x01000000;
define inline-only constant $MIXERCONTROL-CT-SC-METER-POLLED =
	#x00000000;
define inline-only constant $MIXERCONTROL-CT-SC-TIME-MICROSECS =
	#x00000000;
define inline-only constant $MIXERCONTROL-CT-SC-TIME-MILLISECS =
	#x01000000;
define inline-only constant $MIXERCONTROL-CT-SC-LIST-SINGLE =
	#x00000000;
define inline-only constant $MIXERCONTROL-CT-SC-LIST-MULTIPLE =
	#x01000000;
define inline-only constant $MIXERCONTROL-CT-UNITS-MASK = #x00FF0000;
define inline-only constant $MIXERCONTROL-CT-UNITS-CUSTOM =
	#x00000000;
define inline-only constant $MIXERCONTROL-CT-UNITS-BOOLEAN =
	#x00010000;
define inline-only constant $MIXERCONTROL-CT-UNITS-SIGNED =
	#x00020000;
define inline-only constant $MIXERCONTROL-CT-UNITS-UNSIGNED =
	#x00030000;
define inline-only constant $MIXERCONTROL-CT-UNITS-DECIBELS =
	#x00040000;
define inline-only constant $MIXERCONTROL-CT-UNITS-PERCENT =
	#x00050000;
define inline-only constant $MIXERCONTROL-CONTROLTYPE-CUSTOM =
	%logior($MIXERCONTROL-CT-CLASS-CUSTOM, $MIXERCONTROL-CT-UNITS-CUSTOM);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-BOOLEANMETER =
	%logior($MIXERCONTROL-CT-CLASS-METER, $MIXERCONTROL-CT-SC-METER-POLLED, $MIXERCONTROL-CT-UNITS-BOOLEAN);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-SIGNEDMETER =
	%logior($MIXERCONTROL-CT-CLASS-METER, $MIXERCONTROL-CT-SC-METER-POLLED, $MIXERCONTROL-CT-UNITS-SIGNED);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-PEAKMETER =
	u%+($MIXERCONTROL-CONTROLTYPE-SIGNEDMETER, 1);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-UNSIGNEDMETER =
	%logior($MIXERCONTROL-CT-CLASS-METER, $MIXERCONTROL-CT-SC-METER-POLLED, $MIXERCONTROL-CT-UNITS-UNSIGNED);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-BOOLEAN =
	%logior($MIXERCONTROL-CT-CLASS-SWITCH, $MIXERCONTROL-CT-SC-SWITCH-BOOLEAN, $MIXERCONTROL-CT-UNITS-BOOLEAN);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-ONOFF =
	u%+($MIXERCONTROL-CONTROLTYPE-BOOLEAN, 1);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-MUTE =
	u%+($MIXERCONTROL-CONTROLTYPE-BOOLEAN, 2);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-MONO =
	u%+($MIXERCONTROL-CONTROLTYPE-BOOLEAN, 3);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-LOUDNESS =
	u%+($MIXERCONTROL-CONTROLTYPE-BOOLEAN, 4);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-STEREOENH =
	u%+($MIXERCONTROL-CONTROLTYPE-BOOLEAN, 5);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-BUTTON =
	%logior($MIXERCONTROL-CT-CLASS-SWITCH, $MIXERCONTROL-CT-SC-SWITCH-BUTTON, $MIXERCONTROL-CT-UNITS-BOOLEAN);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-DECIBELS =
	%logior($MIXERCONTROL-CT-CLASS-NUMBER, $MIXERCONTROL-CT-UNITS-DECIBELS);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-SIGNED =
	%logior($MIXERCONTROL-CT-CLASS-NUMBER, $MIXERCONTROL-CT-UNITS-SIGNED);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-UNSIGNED =
	%logior($MIXERCONTROL-CT-CLASS-NUMBER, $MIXERCONTROL-CT-UNITS-UNSIGNED);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-PERCENT =
	%logior($MIXERCONTROL-CT-CLASS-NUMBER, $MIXERCONTROL-CT-UNITS-PERCENT);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-SLIDER =
	%logior($MIXERCONTROL-CT-CLASS-SLIDER, $MIXERCONTROL-CT-UNITS-SIGNED);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-PAN =
	u%+($MIXERCONTROL-CONTROLTYPE-SLIDER, 1);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-QSOUNDPAN =
	u%+($MIXERCONTROL-CONTROLTYPE-SLIDER, 2);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-FADER =
	%logior($MIXERCONTROL-CT-CLASS-FADER, $MIXERCONTROL-CT-UNITS-UNSIGNED);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-VOLUME =
	u%+($MIXERCONTROL-CONTROLTYPE-FADER, 1);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-BASS =
	u%+($MIXERCONTROL-CONTROLTYPE-FADER, 2);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-TREBLE =
	u%+($MIXERCONTROL-CONTROLTYPE-FADER, 3);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-EQUALIZER =
	u%+($MIXERCONTROL-CONTROLTYPE-FADER, 4);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-SINGLESELECT =
	%logior($MIXERCONTROL-CT-CLASS-LIST, $MIXERCONTROL-CT-SC-LIST-SINGLE, $MIXERCONTROL-CT-UNITS-BOOLEAN);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-MUX =
	u%+($MIXERCONTROL-CONTROLTYPE-SINGLESELECT, 1);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-MULTIPLESELECT =
	%logior($MIXERCONTROL-CT-CLASS-LIST, $MIXERCONTROL-CT-SC-LIST-MULTIPLE, $MIXERCONTROL-CT-UNITS-BOOLEAN);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-MIXER =
	u%+($MIXERCONTROL-CONTROLTYPE-MULTIPLESELECT, 1);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-MICROTIME =
	%logior($MIXERCONTROL-CT-CLASS-TIME, $MIXERCONTROL-CT-SC-TIME-MICROSECS, $MIXERCONTROL-CT-UNITS-UNSIGNED);
define inline-only constant $MIXERCONTROL-CONTROLTYPE-MILLITIME =
	%logior($MIXERCONTROL-CT-CLASS-TIME, $MIXERCONTROL-CT-SC-TIME-MILLISECS, $MIXERCONTROL-CT-UNITS-UNSIGNED);
define C-union <u%8>
  sealed inline-only slot dwControlID-value :: <DWORD>;
  sealed inline-only slot dwControlType-value :: <DWORD>;
  pack: 1;
end;

define C-struct <MIXERLINECONTROLSA>
  sealed inline-only slot cbStruct-value :: <DWORD>;
  sealed inline-only slot dwLineID-value :: <DWORD>;
  sealed inline-only slot u-value        :: <u%8>;
  sealed inline-only slot cControls-value :: <DWORD>;
  sealed inline-only slot cbmxctrl-value :: <DWORD>;
  sealed inline-only slot pamxctrl-value :: <LPMIXERCONTROLA>;
  pack: 1;
  pointer-type-name: <LPMIXERLINECONTROLSA>;
  c-name: "struct tagMIXERLINECONTROLSA";
end C-struct <MIXERLINECONTROLSA>;
define inline constant <PMIXERLINECONTROLSA> = <LPMIXERLINECONTROLSA>;
define inline constant <MIXERLINECONTROLS> = <MIXERLINECONTROLSA>;
define inline constant <PMIXERLINECONTROLS> = <PMIXERLINECONTROLSA>;
define inline constant <LPMIXERLINECONTROLS> = <LPMIXERLINECONTROLSA>;

define inline-only C-function mixerGetLineControls
  parameter hmxobj     :: <HMIXEROBJ>;
  parameter pmxlc      :: <LPMIXERLINECONTROLSA>;
  parameter fdwControls :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "mixerGetLineControlsA", c-modifiers: "__stdcall";
end;
define inline-only constant $MIXER-GETLINECONTROLSF-ALL = #x00000000;
define inline-only constant $MIXER-GETLINECONTROLSF-ONEBYID =
	#x00000001;
define inline-only constant $MIXER-GETLINECONTROLSF-ONEBYTYPE =
	#x00000002;
define inline-only constant $MIXER-GETLINECONTROLSF-QUERYMASK =
	#x0000000F;
define C-union <u%9>
  sealed inline-only slot hwndOwner-value :: <HWND>;
  sealed inline-only slot cMultipleItems-value :: <DWORD>;
  pack: 1;
end;

define C-struct <MIXERCONTROLDETAILS>
  sealed inline-only slot cbStruct-value :: <DWORD>;
  sealed inline-only slot dwControlID-value :: <DWORD>;
  sealed inline-only slot cChannels-value :: <DWORD>;
  sealed inline-only slot u-value        :: <u%9>;
  sealed inline-only slot cbDetails-value :: <DWORD>;
  sealed inline-only slot paDetails-value :: <LPVOID>;
  pack: 1;
  pointer-type-name: <LPMIXERCONTROLDETAILS>;
  c-name: "struct tMIXERCONTROLDETAILS";
end C-struct <MIXERCONTROLDETAILS>;
define inline constant <PMIXERCONTROLDETAILS> = <LPMIXERCONTROLDETAILS>;

define C-struct <MIXERCONTROLDETAILS-LISTTEXTA>
  sealed inline-only slot dwParam1-value :: <DWORD>;
  sealed inline-only slot dwParam2-value :: <DWORD>;
  sealed inline-only array slot szName-array :: <CHAR>,
	length: $MIXER-LONG-NAME-CHARS, address-getter: szName-value;
  pack: 1;
  pointer-type-name: <LPMIXERCONTROLDETAILS-LISTTEXTA>;
  c-name: "struct tagMIXERCONTROLDETAILS_LISTTEXTA";
end C-struct <MIXERCONTROLDETAILS-LISTTEXTA>;
define inline constant <PMIXERCONTROLDETAILS-LISTTEXTA> = <LPMIXERCONTROLDETAILS-LISTTEXTA>;
define inline constant <MIXERCONTROLDETAILS-LISTTEXT> = <MIXERCONTROLDETAILS-LISTTEXTA>;
define inline constant <PMIXERCONTROLDETAILS-LISTTEXT> = <PMIXERCONTROLDETAILS-LISTTEXTA>;
define inline constant <LPMIXERCONTROLDETAILS-LISTTEXT> = <LPMIXERCONTROLDETAILS-LISTTEXTA>;

define C-struct <MIXERCONTROLDETAILS-BOOLEAN>
  sealed inline-only slot fValue-value   :: <LONG>;
  pack: 1;
  pointer-type-name: <LPMIXERCONTROLDETAILS-BOOLEAN>;
  c-name: "struct tMIXERCONTROLDETAILS_BOOLEAN";
end C-struct <MIXERCONTROLDETAILS-BOOLEAN>;
define inline constant <PMIXERCONTROLDETAILS-BOOLEAN> = <LPMIXERCONTROLDETAILS-BOOLEAN>;

define C-struct <MIXERCONTROLDETAILS-SIGNED>
  sealed inline-only slot lValue-value   :: <LONG>;
  pack: 1;
  pointer-type-name: <LPMIXERCONTROLDETAILS-SIGNED>;
  c-name: "struct tMIXERCONTROLDETAILS_SIGNED";
end C-struct <MIXERCONTROLDETAILS-SIGNED>;
define inline constant <PMIXERCONTROLDETAILS-SIGNED> = <LPMIXERCONTROLDETAILS-SIGNED>;

define C-struct <MIXERCONTROLDETAILS-UNSIGNED>
  sealed inline-only slot dwValue-value  :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMIXERCONTROLDETAILS-UNSIGNED>;
  c-name: "struct tMIXERCONTROLDETAILS_UNSIGNED";
end C-struct <MIXERCONTROLDETAILS-UNSIGNED>;
define inline constant <PMIXERCONTROLDETAILS-UNSIGNED> = <LPMIXERCONTROLDETAILS-UNSIGNED>;

define inline-only C-function mixerGetControlDetails
  parameter hmxobj     :: <HMIXEROBJ>;
  parameter pmxcd      :: <LPMIXERCONTROLDETAILS>;
  parameter fdwDetails :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "mixerGetControlDetailsA", c-modifiers: "__stdcall";
end;
define inline-only constant $MIXER-GETCONTROLDETAILSF-VALUE =
	#x00000000;
define inline-only constant $MIXER-GETCONTROLDETAILSF-LISTTEXT =
	#x00000001;
define inline-only constant $MIXER-GETCONTROLDETAILSF-QUERYMASK =
	#x0000000F;

define inline-only C-function mixerSetControlDetails
  parameter hmxobj     :: <HMIXEROBJ>;
  parameter pmxcd      :: <LPMIXERCONTROLDETAILS>;
  parameter fdwDetails :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "mixerSetControlDetails", c-modifiers: "__stdcall";
end;
define inline-only constant $MIXER-SETCONTROLDETAILSF-VALUE =
	#x00000000;
define inline-only constant $MIXER-SETCONTROLDETAILSF-CUSTOM =
	#x00000001;
define inline-only constant $MIXER-SETCONTROLDETAILSF-QUERYMASK =
	#x0000000F;
/****************************************************************************

			    Timer support

****************************************************************************/

define inline-only constant $TIMERR-NOERROR             =    0;
define inline-only constant $TIMERR-NOCANDO             =
	$TIMERR-BASE + 1;
define inline-only constant $TIMERR-STRUCT              =
	$TIMERR-BASE + 33;

define C-subtype <LPTIMECALLBACK> ( <C-function-pointer> ) end;
define macro <LPTIMECALLBACK>-callback-wrapper
 { <LPTIMECALLBACK>-callback-wrapper(?new:name,?old:name) } =>
 { define C-callable-wrapper ?new of ?old
  parameter uTimerID   :: <UINT>;
  parameter uMsg       :: <UINT>;
  parameter dwUser     :: <DWORD>;
  parameter dw1        :: <DWORD>;
  parameter dw2        :: <DWORD>;
  c-modifiers: "__stdcall";
 end C-callable-wrapper }
end;
define inline-only constant $TIME-ONESHOT               = #x0000;
define inline-only constant $TIME-PERIODIC              = #x0001;
define inline-only constant $TIME-CALLBACK-FUNCTION     = #x0000;
define inline-only constant $TIME-CALLBACK-EVENT-SET    = #x0010;
define inline-only constant $TIME-CALLBACK-EVENT-PULSE  = #x0020;

define C-struct <TIMECAPS>
  sealed inline-only slot wPeriodMin-value :: <UINT>;
  sealed inline-only slot wPeriodMax-value :: <UINT>;
  pack: 1;
  pointer-type-name: <LPTIMECAPS>;
  c-name: "struct timecaps_tag";
end C-struct <TIMECAPS>;
define inline constant <PTIMECAPS> = <LPTIMECAPS>;

define inline-only C-function timeGetSystemTime
  parameter pmmt       :: <LPMMTIME>;
  parameter cbmmt      :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "timeGetSystemTime", c-modifiers: "__stdcall";
end;

define inline-only C-function timeGetTime
  result value :: <DWORD>;
  c-name: "timeGetTime", c-modifiers: "__stdcall";
end;

define inline-only C-function timeSetEvent
  parameter uDelay     :: <UINT>;
  parameter uResolution :: <UINT>;
  parameter fptc       :: <LPTIMECALLBACK>;
  parameter dwUser     :: <DWORD>;
  parameter fuEvent    :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "timeSetEvent", c-modifiers: "__stdcall";
end;

define inline-only C-function timeKillEvent
  parameter uTimerID   :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "timeKillEvent", c-modifiers: "__stdcall";
end;

define inline-only C-function timeGetDevCaps
  parameter ptc        :: <LPTIMECAPS>;
  parameter cbtc       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "timeGetDevCaps", c-modifiers: "__stdcall";
end;

define inline-only C-function timeBeginPeriod
  parameter uPeriod    :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "timeBeginPeriod", c-modifiers: "__stdcall";
end;

define inline-only C-function timeEndPeriod
  parameter uPeriod    :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "timeEndPeriod", c-modifiers: "__stdcall";
end;
/****************************************************************************

			    Joystick support

****************************************************************************/

define inline-only constant $JOYERR-NOERROR             =    0;
define inline-only constant $JOYERR-PARMS               =
	$JOYERR-BASE + 5;
define inline-only constant $JOYERR-NOCANDO             =
	$JOYERR-BASE + 6;
define inline-only constant $JOYERR-UNPLUGGED           =
	$JOYERR-BASE + 7;
define inline-only constant $JOY-BUTTON1                = #x0001;
define inline-only constant $JOY-BUTTON2                = #x0002;
define inline-only constant $JOY-BUTTON3                = #x0004;
define inline-only constant $JOY-BUTTON4                = #x0008;
define inline-only constant $JOY-BUTTON1CHG             = #x0100;
define inline-only constant $JOY-BUTTON2CHG             = #x0200;
define inline-only constant $JOY-BUTTON3CHG             = #x0400;
define inline-only constant $JOY-BUTTON4CHG             = #x0800;
define inline-only constant $JOY-BUTTON5                = #x00000010;
define inline-only constant $JOY-BUTTON6                = #x00000020;
define inline-only constant $JOY-BUTTON7                = #x00000040;
define inline-only constant $JOY-BUTTON8                = #x00000080;
define inline-only constant $JOY-BUTTON9                = #x00000100;
define inline-only constant $JOY-BUTTON10               = #x00000200;
define inline-only constant $JOY-BUTTON11               = #x00000400;
define inline-only constant $JOY-BUTTON12               = #x00000800;
define inline-only constant $JOY-BUTTON13               = #x00001000;
define inline-only constant $JOY-BUTTON14               = #x00002000;
define inline-only constant $JOY-BUTTON15               = #x00004000;
define inline-only constant $JOY-BUTTON16               = #x00008000;
define inline-only constant $JOY-BUTTON17               = #x00010000;
define inline-only constant $JOY-BUTTON18               = #x00020000;
define inline-only constant $JOY-BUTTON19               = #x00040000;
define inline-only constant $JOY-BUTTON20               = #x00080000;
define inline-only constant $JOY-BUTTON21               = #x00100000;
define inline-only constant $JOY-BUTTON22               = #x00200000;
define inline-only constant $JOY-BUTTON23               = #x00400000;
define inline-only constant $JOY-BUTTON24               = #x00800000;
define inline-only constant $JOY-BUTTON25               = #x01000000;
define inline-only constant $JOY-BUTTON26               = #x02000000;
define inline-only constant $JOY-BUTTON27               = #x04000000;
define inline-only constant $JOY-BUTTON28               = #x08000000;
define inline-only constant $JOY-BUTTON29               =
	as(<machine-word>, #x10000000);
define inline-only constant $JOY-BUTTON30               =
	as(<machine-word>, #x20000000);
define inline-only constant $JOY-BUTTON31               =
	as(<machine-word>, #x40000000);
define inline-only constant $JOY-BUTTON32               =
	as(<machine-word>, #x80000000);
define inline-only constant $JOY-POVFORWARD             =    0;
define inline-only constant $JOY-POVRIGHT               = 9000;
define inline-only constant $JOY-POVBACKWARD            = 18000;
define inline-only constant $JOY-POVLEFT                = 27000;
define inline-only constant $JOY-RETURNX                = #x00000001;
define inline-only constant $JOY-RETURNY                = #x00000002;
define inline-only constant $JOY-RETURNZ                = #x00000004;
define inline-only constant $JOY-RETURNR                = #x00000008;
define inline-only constant $JOY-RETURNU                = #x00000010;
define inline-only constant $JOY-RETURNV                = #x00000020;
define inline-only constant $JOY-RETURNPOV              = #x00000040;
define inline-only constant $JOY-RETURNBUTTONS          = #x00000080;
define inline-only constant $JOY-RETURNRAWDATA          = #x00000100;
define inline-only constant $JOY-RETURNPOVCTS           = #x00000200;
define inline-only constant $JOY-RETURNCENTERED         = #x00000400;
define inline-only constant $JOY-USEDEADZONE            = #x00000800;
define inline-only constant $JOY-RETURNALL              =
	logior($JOY-RETURNX, $JOY-RETURNY, $JOY-RETURNZ, $JOY-RETURNR, $JOY-RETURNU, $JOY-RETURNV, $JOY-RETURNPOV, $JOY-RETURNBUTTONS);
define inline-only constant $JOY-CAL-READALWAYS         = #x00010000;
define inline-only constant $JOY-CAL-READXYONLY         = #x00020000;
define inline-only constant $JOY-CAL-READ3              = #x00040000;
define inline-only constant $JOY-CAL-READ4              = #x00080000;
define inline-only constant $JOY-CAL-READXONLY          = #x00100000;
define inline-only constant $JOY-CAL-READYONLY          = #x00200000;
define inline-only constant $JOY-CAL-READ5              = #x00400000;
define inline-only constant $JOY-CAL-READ6              = #x00800000;
define inline-only constant $JOY-CAL-READZONLY          = #x01000000;
define inline-only constant $JOY-CAL-READRONLY          = #x02000000;
define inline-only constant $JOY-CAL-READUONLY          = #x04000000;
define inline-only constant $JOY-CAL-READVONLY          = #x08000000;
define inline-only constant $JOYSTICKID1                =    0;
define inline-only constant $JOYSTICKID2                =    1;
define inline-only constant $JOYCAPS-HASZ               = #x0001;
define inline-only constant $JOYCAPS-HASR               = #x0002;
define inline-only constant $JOYCAPS-HASU               = #x0004;
define inline-only constant $JOYCAPS-HASV               = #x0008;
define inline-only constant $JOYCAPS-HASPOV             = #x0010;
define inline-only constant $JOYCAPS-POV4DIR            = #x0020;
define inline-only constant $JOYCAPS-POVCTS             = #x0040;

define C-struct <JOYCAPSA>
  sealed inline-only slot wMid-value     :: <WORD>;
  sealed inline-only slot wPid-value     :: <WORD>;
  sealed inline-only array slot szPname-array :: <CHAR>,
	length: $MAXPNAMELEN, address-getter: szPname-value;
  sealed inline-only slot wXmin-value    :: <UINT>;
  sealed inline-only slot wXmax-value    :: <UINT>;
  sealed inline-only slot wYmin-value    :: <UINT>;
  sealed inline-only slot wYmax-value    :: <UINT>;
  sealed inline-only slot wZmin-value    :: <UINT>;
  sealed inline-only slot wZmax-value    :: <UINT>;
  sealed inline-only slot wNumButtons-value :: <UINT>;
  sealed inline-only slot wPeriodMin-value :: <UINT>;
  sealed inline-only slot wPeriodMax-value :: <UINT>;
  sealed inline-only slot wRmin-value    :: <UINT>;
  sealed inline-only slot wRmax-value    :: <UINT>;
  sealed inline-only slot wUmin-value    :: <UINT>;
  sealed inline-only slot wUmax-value    :: <UINT>;
  sealed inline-only slot wVmin-value    :: <UINT>;
  sealed inline-only slot wVmax-value    :: <UINT>;
  sealed inline-only slot wCaps-value    :: <UINT>;
  sealed inline-only slot wMaxAxes-value :: <UINT>;
  sealed inline-only slot wNumAxes-value :: <UINT>;
  sealed inline-only slot wMaxButtons-value :: <UINT>;
  sealed inline-only array slot szRegKey-array :: <CHAR>,
	length: $MAXPNAMELEN, address-getter: szRegKey-value;
  sealed inline-only array slot szOEMVxD-array :: <CHAR>,
	length: $MAX-JOYSTICKOEMVXDNAME, address-getter: szOEMVxD-value;
  pack: 1;
  pointer-type-name: <LPJOYCAPSA>;
  c-name: "struct tagJOYCAPSA";
end C-struct <JOYCAPSA>;
define inline constant <PJOYCAPSA> = <LPJOYCAPSA>;
define inline constant <JOYCAPS> = <JOYCAPSA>;
define inline constant <PJOYCAPS> = <PJOYCAPSA>;
define inline constant <LPJOYCAPS> = <LPJOYCAPSA>;

define C-struct <JOYINFO>
  sealed inline-only slot wXpos-value    :: <UINT>;
  sealed inline-only slot wYpos-value    :: <UINT>;
  sealed inline-only slot wZpos-value    :: <UINT>;
  sealed inline-only slot wButtons-value :: <UINT>;
  pack: 1;
  pointer-type-name: <LPJOYINFO>;
  c-name: "struct joyinfo_tag";
end C-struct <JOYINFO>;
define inline constant <PJOYINFO> = <LPJOYINFO>;

define C-struct <JOYINFOEX>
  sealed inline-only slot dwSize-value   :: <DWORD>;
  sealed inline-only slot dwFlags-value  :: <DWORD>;
  sealed inline-only slot dwXpos-value   :: <DWORD>;
  sealed inline-only slot dwYpos-value   :: <DWORD>;
  sealed inline-only slot dwZpos-value   :: <DWORD>;
  sealed inline-only slot dwRpos-value   :: <DWORD>;
  sealed inline-only slot dwUpos-value   :: <DWORD>;
  sealed inline-only slot dwVpos-value   :: <DWORD>;
  sealed inline-only slot dwButtons-value :: <DWORD>;
  sealed inline-only slot dwButtonNumber-value :: <DWORD>;
  sealed inline-only slot dwPOV-value    :: <DWORD>;
  sealed inline-only slot dwReserved1    :: <DWORD>;
  sealed inline-only slot dwReserved2    :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPJOYINFOEX>;
  c-name: "struct joyinfoex_tag";
end C-struct <JOYINFOEX>;
define inline constant <PJOYINFOEX> = <LPJOYINFOEX>;

define inline-only C-function joyGetNumDevs
  result value :: <UINT>;
  c-name: "joyGetNumDevs", c-modifiers: "__stdcall";
end;

define inline-only C-function joyGetDevCaps
  parameter uJoyID     :: <UINT>;
  parameter pjc        :: <LPJOYCAPSA>;
  parameter cbjc       :: <C-unsigned-int>;
  result value :: <MMRESULT>;
  c-name: "joyGetDevCapsA", c-modifiers: "__stdcall";
end;

define inline-only C-function joyGetPos
  parameter uJoyID     :: <UINT>;
  parameter pji        :: <LPJOYINFO>;
  result value :: <MMRESULT>;
  c-name: "joyGetPos", c-modifiers: "__stdcall";
end;

define inline-only C-function joyGetPosEx
  parameter uJoyID     :: <UINT>;
  parameter pji        :: <LPJOYINFOEX>;
  result value :: <MMRESULT>;
  c-name: "joyGetPosEx", c-modifiers: "__stdcall";
end;

define inline-only C-function joyGetThreshold
  parameter uJoyID     :: <UINT>;
  output parameter puThreshold :: <LPUINT>;
  result value :: <MMRESULT>;
  c-name: "joyGetThreshold", c-modifiers: "__stdcall";
end;

define inline-only C-function joyReleaseCapture
  parameter uJoyID     :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "joyReleaseCapture", c-modifiers: "__stdcall";
end;

define inline-only C-function joySetCapture
  parameter hwnd       :: <HWND>;
  parameter uJoyID     :: <UINT>;
  parameter uPeriod    :: <UINT>;
  parameter fChanged   :: <BOOL>;
  result value :: <MMRESULT>;
  c-name: "joySetCapture", c-modifiers: "__stdcall";
end;

define inline-only C-function joySetThreshold
  parameter uJoyID     :: <UINT>;
  parameter uThreshold :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "joySetThreshold", c-modifiers: "__stdcall";
end;
/****************************************************************************

			Multimedia File I/O support

****************************************************************************/

define inline-only constant $MMIOERR-BASE               =  256;
define inline-only constant $MMIOERR-FILENOTFOUND       =
	$MMIOERR-BASE + 1;
define inline-only constant $MMIOERR-OUTOFMEMORY        =
	$MMIOERR-BASE + 2;
define inline-only constant $MMIOERR-CANNOTOPEN         =
	$MMIOERR-BASE + 3;
define inline-only constant $MMIOERR-CANNOTCLOSE        =
	$MMIOERR-BASE + 4;
define inline-only constant $MMIOERR-CANNOTREAD         =
	$MMIOERR-BASE + 5;
define inline-only constant $MMIOERR-CANNOTWRITE        =
	$MMIOERR-BASE + 6;
define inline-only constant $MMIOERR-CANNOTSEEK         =
	$MMIOERR-BASE + 7;
define inline-only constant $MMIOERR-CANNOTEXPAND       =
	$MMIOERR-BASE + 8;
define inline-only constant $MMIOERR-CHUNKNOTFOUND      =
	$MMIOERR-BASE + 9;
define inline-only constant $MMIOERR-UNBUFFERED         =
	$MMIOERR-BASE + 10;
define inline-only constant $MMIOERR-PATHNOTFOUND       =
	$MMIOERR-BASE + 11;
define inline-only constant $MMIOERR-ACCESSDENIED       =
	$MMIOERR-BASE + 12;
define inline-only constant $MMIOERR-SHARINGVIOLATION   =
	$MMIOERR-BASE + 13;
define inline-only constant $MMIOERR-NETWORKERROR       =
	$MMIOERR-BASE + 14;
define inline-only constant $MMIOERR-TOOMANYOPENFILES   =
	$MMIOERR-BASE + 15;
define inline-only constant $MMIOERR-INVALIDFILE        =
	$MMIOERR-BASE + 16;
define inline constant <FOURCC> = <DWORD>;
define inline constant <HPSTR> = <C-char*>;
define C-subtype <HMMIO> ( <HANDLE> ) end;

define C-subtype <LPMMIOPROC> ( <C-function-pointer> ) end;
define macro <LPMMIOPROC>-callback-wrapper
 { <LPMMIOPROC>-callback-wrapper(?new:name,?old:name) } =>
 { define C-callable-wrapper ?new of ?old
  parameter lpmmioinfo :: <LPSTR>;
  parameter uMsg       :: <UINT>;
  parameter lParam1    :: <LPARAM>;
  parameter lParam2    :: <LPARAM>;
  result value :: <LRESULT>;
  c-modifiers: "__stdcall";
 end C-callable-wrapper }
end;

define C-struct <MMIOINFO>
  sealed inline-only slot dwFlags-value  :: <DWORD>;
  sealed inline-only slot fccIOProc-value :: <FOURCC>;
  sealed inline-only slot pIOProc-value  :: <LPMMIOPROC>;
  sealed inline-only slot wErrorRet-value :: <UINT>;
  sealed inline-only slot htask-value    :: <HTASK>;
  sealed inline-only slot cchBuffer-value :: <LONG>;
  sealed inline-only slot pchBuffer-value :: <HPSTR>;
  sealed inline-only slot pchNext-value  :: <HPSTR>;
  sealed inline-only slot pchEndRead-value :: <HPSTR>;
  sealed inline-only slot pchEndWrite-value :: <HPSTR>;
  sealed inline-only slot lBufOffset-value :: <LONG>;
  sealed inline-only slot lDiskOffset-value :: <LONG>;
  sealed inline-only array slot adwInfo-array :: <DWORD>, length: 3,
	address-getter: adwInfo-value;
  sealed inline-only slot dwReserved1    :: <DWORD>;
  sealed inline-only slot dwReserved2    :: <DWORD>;
  sealed inline-only slot hmmio-value    :: <HMMIO>;
  pack: 1;
  pointer-type-name: <LPMMIOINFO>;
  c-name: "struct _MMIOINFO";
end C-struct <MMIOINFO>;
define inline constant <PMMIOINFO> = <LPMMIOINFO>;
define inline constant <LPCMMIOINFO> =  /* const */ <LPMMIOINFO>;

define C-struct <MMCKINFO>
  sealed inline-only slot ckid-value     :: <FOURCC>;
  sealed inline-only slot cksize-value   :: <DWORD>;
  sealed inline-only slot fccType-value  :: <FOURCC>;
  sealed inline-only slot dwDataOffset-value :: <DWORD>;
  sealed inline-only slot dwFlags-value  :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMMCKINFO>;
  c-name: "struct _MMCKINFO";
end C-struct <MMCKINFO>;
define inline constant <PMMCKINFO> = <LPMMCKINFO>;
define inline constant <LPCMMCKINFO> =  /* const */ <LPMMCKINFO>;
define inline-only constant $MMIO-RWMODE                = #x00000003;
define inline-only constant $MMIO-SHAREMODE             = #x00000070;
define inline-only constant $MMIO-CREATE                = #x00001000;
define inline-only constant $MMIO-PARSE                 = #x00000100;
define inline-only constant $MMIO-DELETE                = #x00000200;
define inline-only constant $MMIO-EXIST                 = #x00004000;
define inline-only constant $MMIO-ALLOCBUF              = #x00010000;
define inline-only constant $MMIO-GETTEMP               = #x00020000;
define inline-only constant $MMIO-DIRTY                 =
	as(<machine-word>, #x10000000);
define inline-only constant $MMIO-READ                  = #x00000000;
define inline-only constant $MMIO-WRITE                 = #x00000001;
define inline-only constant $MMIO-READWRITE             = #x00000002;
define inline-only constant $MMIO-COMPAT                = #x00000000;
define inline-only constant $MMIO-EXCLUSIVE             = #x00000010;
define inline-only constant $MMIO-DENYWRITE             = #x00000020;
define inline-only constant $MMIO-DENYREAD              = #x00000030;
define inline-only constant $MMIO-DENYNONE              = #x00000040;
define inline-only constant $MMIO-FHOPEN                = #x0010;
define inline-only constant $MMIO-EMPTYBUF              = #x0010;
define inline-only constant $MMIO-TOUPPER               = #x0010;
define inline-only constant $MMIO-INSTALLPROC           = #x00010000;
define inline-only constant $MMIO-GLOBALPROC            =
	as(<machine-word>, #x10000000);
define inline-only constant $MMIO-REMOVEPROC            = #x00020000;
define inline-only constant $MMIO-UNICODEPROC           = #x01000000;
define inline-only constant $MMIO-FINDPROC              = #x00040000;
define inline-only constant $MMIO-FINDCHUNK             = #x0010;
define inline-only constant $MMIO-FINDRIFF              = #x0020;
define inline-only constant $MMIO-FINDLIST              = #x0040;
define inline-only constant $MMIO-CREATERIFF            = #x0020;
define inline-only constant $MMIO-CREATELIST            = #x0040;
define inline-only constant $MMIOM-SEEK                 =    2;
define inline-only constant $MMIOM-OPEN                 =    3;
define inline-only constant $MMIOM-CLOSE                =    4;
define inline-only constant $MMIOM-WRITEFLUSH           =    5;
define inline-only constant $MMIOM-RENAME               =    6;
define inline-only constant $MMIOM-USER                 = #x8000;
define inline-only constant $SEEK-SET                   =    0;
define inline-only constant $SEEK-CUR                   =    1;
define inline-only constant $SEEK-END                   =    2;
define inline-only constant $MMIO-DEFAULTBUFFER         = 8192;

define inline-only function mmioFOURCC (ch0, ch1, ch2, ch3);
  MAKEFOURCC(ch0, ch1, ch2, ch3)
end;

define inline-only C-function mmioStringToFOURCC
  parameter sz         :: <LPCSTR>;
  parameter uFlags     :: <UINT>;
  result value :: <FOURCC>;
  c-name: "mmioStringToFOURCCA", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioInstallIOProc
  parameter fccIOProc  :: <FOURCC>;
  parameter pIOProc    :: <LPMMIOPROC>;
  parameter dwFlags    :: <DWORD>;
  result value :: <LPMMIOPROC>;
  c-name: "mmioInstallIOProcA", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioOpen
  parameter pszFileName :: <LPSTR>;
  parameter pmmioinfo  :: <LPMMIOINFO>;
  parameter fdwOpen    :: <DWORD>;
  result value :: <HMMIO>;
  c-name: "mmioOpenA", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioRename
  parameter pszFileName :: <LPCSTR>;
  parameter pszNewFileName :: <LPCSTR>;
  parameter pmmioinfo  :: <LPCMMIOINFO>;
  parameter fdwRename  :: <DWORD>;
  result value :: <MMRESULT>;
  c-name: "mmioRenameA", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioClose
  parameter hmmio      :: <HMMIO>;
  parameter fuClose    :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "mmioClose", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioRead
  parameter hmmio      :: <HMMIO>;
  parameter pch        :: <HPSTR>;
  parameter cch        :: <LONG>;
  result value :: <LONG>;
  c-name: "mmioRead", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioWrite
  parameter hmmio      :: <HMMIO>;
  parameter pch        ::  /* const */ <C-char*>;
  parameter cch        :: <LONG>;
  result value :: <LONG>;
  c-name: "mmioWrite", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioSeek
  parameter hmmio      :: <HMMIO>;
  parameter lOffset    :: <LONG>;
  parameter iOrigin    :: <C-int>;
  result value :: <LONG>;
  c-name: "mmioSeek", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioGetInfo
  parameter hmmio      :: <HMMIO>;
  parameter pmmioinfo  :: <LPMMIOINFO>;
  parameter fuInfo     :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "mmioGetInfo", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioSetInfo
  parameter hmmio      :: <HMMIO>;
  parameter pmmioinfo  :: <LPCMMIOINFO>;
  parameter fuInfo     :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "mmioSetInfo", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioSetBuffer
  parameter hmmio      :: <HMMIO>;
  parameter pchBuffer  :: <LPSTR>;
  parameter cchBuffer  :: <LONG>;
  parameter fuBuffer   :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "mmioSetBuffer", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioFlush
  parameter hmmio      :: <HMMIO>;
  parameter fuFlush    :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "mmioFlush", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioAdvance
  parameter hmmio      :: <HMMIO>;
  parameter pmmioinfo  :: <LPMMIOINFO>;
  parameter fuAdvance  :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "mmioAdvance", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioSendMessage
  parameter hmmio      :: <HMMIO>;
  parameter uMsg       :: <UINT>;
  parameter lParam1    :: <LPARAM>;
  parameter lParam2    :: <LPARAM>;
  result value :: <LRESULT>;
  c-name: "mmioSendMessage", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioDescend
  parameter hmmio      :: <HMMIO>;
  parameter pmmcki     :: <LPMMCKINFO>;
  parameter pmmckiParent ::  /* const */ <LPMMCKINFO>;
  parameter fuDescend  :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "mmioDescend", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioAscend
  parameter hmmio      :: <HMMIO>;
  parameter pmmcki     :: <LPMMCKINFO>;
  parameter fuAscend   :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "mmioAscend", c-modifiers: "__stdcall";
end;

define inline-only C-function mmioCreateChunk
  parameter hmmio      :: <HMMIO>;
  parameter pmmcki     :: <LPMMCKINFO>;
  parameter fuCreate   :: <UINT>;
  result value :: <MMRESULT>;
  c-name: "mmioCreateChunk", c-modifiers: "__stdcall";
end;
/****************************************************************************

			    MCI support

****************************************************************************/

define inline constant <MCIERROR> = <DWORD>;
define inline constant <MCIDEVICEID> = <UINT>;

define C-subtype <YIELDPROC> ( <C-function-pointer> ) end;
define macro <YIELDPROC>-callback-wrapper
 { <YIELDPROC>-callback-wrapper(?new:name,?old:name) } =>
 { define C-callable-wrapper ?new of ?old
  parameter mciId      :: <MCIDEVICEID>;
  parameter dwYieldData :: <DWORD>;
  result value :: <UINT>;
  c-modifiers: "__stdcall";
 end C-callable-wrapper }
end;

define inline-only C-function mciSendCommand
  parameter mciId      :: <MCIDEVICEID>;
  parameter uMsg       :: <UINT>;
  parameter dwParam1   :: <DWORD>;
  parameter dwParam2   :: <DWORD>;
  result value :: <MCIERROR>;
  c-name: "mciSendCommandA", c-modifiers: "__stdcall";
end;

define inline-only C-function mciSendString
  parameter lpstrCommand :: <LPCSTR>;
  parameter lpstrReturnString :: <LPSTR>;
  parameter uReturnLength :: <UINT>;
  parameter hwndCallback :: <HWND>;
  result value :: <MCIERROR>;
  c-name: "mciSendStringA", c-modifiers: "__stdcall";
end;

define inline-only C-function mciGetDeviceID
  parameter pszDevice  :: <LPCSTR>;
  result value :: <MCIDEVICEID>;
  c-name: "mciGetDeviceIDA", c-modifiers: "__stdcall";
end;

define inline-only C-function mciGetDeviceIDFromElementID
  parameter dwElementID :: <DWORD>;
  parameter lpstrType  :: <LPCSTR>;
  result value :: <MCIDEVICEID>;
  c-name: "mciGetDeviceIDFromElementIDA", c-modifiers: "__stdcall";
end;

define inline-only C-function mciGetErrorString
  parameter mcierr     :: <MCIERROR>;
  parameter pszText    :: <LPSTR>;
  parameter cchText    :: <UINT>;
  result value :: <BOOL>;
  c-name: "mciGetErrorStringA", c-modifiers: "__stdcall";
end;

define inline-only C-function mciSetYieldProc
  parameter mciId      :: <MCIDEVICEID>;
  parameter fpYieldProc :: <YIELDPROC>;
  parameter dwYieldData :: <DWORD>;
  result value :: <BOOL>;
  c-name: "mciSetYieldProc", c-modifiers: "__stdcall";
end;

define inline-only C-function mciGetCreatorTask
  parameter mciId      :: <MCIDEVICEID>;
  result value :: <HTASK>;
  c-name: "mciGetCreatorTask", c-modifiers: "__stdcall";
end;

define inline-only C-function mciGetYieldProc
  parameter mciId      :: <MCIDEVICEID>;
  output parameter pdwYieldData :: <LPDWORD>;
  result value :: <YIELDPROC>;
  c-name: "mciGetYieldProc", c-modifiers: "__stdcall";
end;
define inline-only constant $MCIERR-INVALID-DEVICE-ID   =
	$MCIERR-BASE + 1;
define inline-only constant $MCIERR-UNRECOGNIZED-KEYWORD =
	$MCIERR-BASE + 3;
define inline-only constant $MCIERR-UNRECOGNIZED-COMMAND =
	$MCIERR-BASE + 5;
define inline-only constant $MCIERR-HARDWARE            =
	$MCIERR-BASE + 6;
define inline-only constant $MCIERR-INVALID-DEVICE-NAME =
	$MCIERR-BASE + 7;
define inline-only constant $MCIERR-OUT-OF-MEMORY       =
	$MCIERR-BASE + 8;
define inline-only constant $MCIERR-DEVICE-OPEN         =
	$MCIERR-BASE + 9;
define inline-only constant $MCIERR-CANNOT-LOAD-DRIVER  =
	$MCIERR-BASE + 10;
define inline-only constant $MCIERR-MISSING-COMMAND-STRING =
	$MCIERR-BASE + 11;
define inline-only constant $MCIERR-PARAM-OVERFLOW      =
	$MCIERR-BASE + 12;
define inline-only constant $MCIERR-MISSING-STRING-ARGUMENT =
	$MCIERR-BASE + 13;
define inline-only constant $MCIERR-BAD-INTEGER         =
	$MCIERR-BASE + 14;
define inline-only constant $MCIERR-PARSER-INTERNAL     =
	$MCIERR-BASE + 15;
define inline-only constant $MCIERR-DRIVER-INTERNAL     =
	$MCIERR-BASE + 16;
define inline-only constant $MCIERR-MISSING-PARAMETER   =
	$MCIERR-BASE + 17;
define inline-only constant $MCIERR-UNSUPPORTED-FUNCTION =
	$MCIERR-BASE + 18;
define inline-only constant $MCIERR-FILE-NOT-FOUND      =
	$MCIERR-BASE + 19;
define inline-only constant $MCIERR-DEVICE-NOT-READY    =
	$MCIERR-BASE + 20;
define inline-only constant $MCIERR-INTERNAL            =
	$MCIERR-BASE + 21;
define inline-only constant $MCIERR-DRIVER              =
	$MCIERR-BASE + 22;
define inline-only constant $MCIERR-CANNOT-USE-ALL      =
	$MCIERR-BASE + 23;
define inline-only constant $MCIERR-MULTIPLE            =
	$MCIERR-BASE + 24;
define inline-only constant $MCIERR-EXTENSION-NOT-FOUND =
	$MCIERR-BASE + 25;
define inline-only constant $MCIERR-OUTOFRANGE          =
	$MCIERR-BASE + 26;
define inline-only constant $MCIERR-FLAGS-NOT-COMPATIBLE =
	$MCIERR-BASE + 28;
define inline-only constant $MCIERR-FILE-NOT-SAVED      =
	$MCIERR-BASE + 30;
define inline-only constant $MCIERR-DEVICE-TYPE-REQUIRED =
	$MCIERR-BASE + 31;
define inline-only constant $MCIERR-DEVICE-LOCKED       =
	$MCIERR-BASE + 32;
define inline-only constant $MCIERR-DUPLICATE-ALIAS     =
	$MCIERR-BASE + 33;
define inline-only constant $MCIERR-BAD-CONSTANT        =
	$MCIERR-BASE + 34;
define inline-only constant $MCIERR-MUST-USE-SHAREABLE  =
	$MCIERR-BASE + 35;
define inline-only constant $MCIERR-MISSING-DEVICE-NAME =
	$MCIERR-BASE + 36;
define inline-only constant $MCIERR-BAD-TIME-FORMAT     =
	$MCIERR-BASE + 37;
define inline-only constant $MCIERR-NO-CLOSING-QUOTE    =
	$MCIERR-BASE + 38;
define inline-only constant $MCIERR-DUPLICATE-FLAGS     =
	$MCIERR-BASE + 39;
define inline-only constant $MCIERR-INVALID-FILE        =
	$MCIERR-BASE + 40;
define inline-only constant $MCIERR-NULL-PARAMETER-BLOCK =
	$MCIERR-BASE + 41;
define inline-only constant $MCIERR-UNNAMED-RESOURCE    =
	$MCIERR-BASE + 42;
define inline-only constant $MCIERR-NEW-REQUIRES-ALIAS  =
	$MCIERR-BASE + 43;
define inline-only constant $MCIERR-NOTIFY-ON-AUTO-OPEN =
	$MCIERR-BASE + 44;
define inline-only constant $MCIERR-NO-ELEMENT-ALLOWED  =
	$MCIERR-BASE + 45;
define inline-only constant $MCIERR-NONAPPLICABLE-FUNCTION =
	$MCIERR-BASE + 46;
define inline-only constant $MCIERR-ILLEGAL-FOR-AUTO-OPEN =
	$MCIERR-BASE + 47;
define inline-only constant $MCIERR-FILENAME-REQUIRED   =
	$MCIERR-BASE + 48;
define inline-only constant $MCIERR-EXTRA-CHARACTERS    =
	$MCIERR-BASE + 49;
define inline-only constant $MCIERR-DEVICE-NOT-INSTALLED =
	$MCIERR-BASE + 50;
define inline-only constant $MCIERR-GET-CD              =
	$MCIERR-BASE + 51;
define inline-only constant $MCIERR-SET-CD              =
	$MCIERR-BASE + 52;
define inline-only constant $MCIERR-SET-DRIVE           =
	$MCIERR-BASE + 53;
define inline-only constant $MCIERR-DEVICE-LENGTH       =
	$MCIERR-BASE + 54;
define inline-only constant $MCIERR-DEVICE-ORD-LENGTH   =
	$MCIERR-BASE + 55;
define inline-only constant $MCIERR-NO-INTEGER          =
	$MCIERR-BASE + 56;
define inline-only constant $MCIERR-WAVE-OUTPUTSINUSE   =
	$MCIERR-BASE + 64;
define inline-only constant $MCIERR-WAVE-SETOUTPUTINUSE =
	$MCIERR-BASE + 65;
define inline-only constant $MCIERR-WAVE-INPUTSINUSE    =
	$MCIERR-BASE + 66;
define inline-only constant $MCIERR-WAVE-SETINPUTINUSE  =
	$MCIERR-BASE + 67;
define inline-only constant $MCIERR-WAVE-OUTPUTUNSPECIFIED =
	$MCIERR-BASE + 68;
define inline-only constant $MCIERR-WAVE-INPUTUNSPECIFIED =
	$MCIERR-BASE + 69;
define inline-only constant $MCIERR-WAVE-OUTPUTSUNSUITABLE =
	$MCIERR-BASE + 70;
define inline-only constant $MCIERR-WAVE-SETOUTPUTUNSUITABLE =
	$MCIERR-BASE + 71;
define inline-only constant $MCIERR-WAVE-INPUTSUNSUITABLE =
	$MCIERR-BASE + 72;
define inline-only constant $MCIERR-WAVE-SETINPUTUNSUITABLE =
	$MCIERR-BASE + 73;
define inline-only constant $MCIERR-SEQ-DIV-INCOMPATIBLE =
	$MCIERR-BASE + 80;
define inline-only constant $MCIERR-SEQ-PORT-INUSE      =
	$MCIERR-BASE + 81;
define inline-only constant $MCIERR-SEQ-PORT-NONEXISTENT =
	$MCIERR-BASE + 82;
define inline-only constant $MCIERR-SEQ-PORT-MAPNODEVICE =
	$MCIERR-BASE + 83;
define inline-only constant $MCIERR-SEQ-PORT-MISCERROR  =
	$MCIERR-BASE + 84;
define inline-only constant $MCIERR-SEQ-TIMER           =
	$MCIERR-BASE + 85;
define inline-only constant $MCIERR-SEQ-PORTUNSPECIFIED =
	$MCIERR-BASE + 86;
define inline-only constant $MCIERR-SEQ-NOMIDIPRESENT   =
	$MCIERR-BASE + 87;
define inline-only constant $MCIERR-NO-WINDOW           =
	$MCIERR-BASE + 90;
define inline-only constant $MCIERR-CREATEWINDOW        =
	$MCIERR-BASE + 91;
define inline-only constant $MCIERR-FILE-READ           =
	$MCIERR-BASE + 92;
define inline-only constant $MCIERR-FILE-WRITE          =
	$MCIERR-BASE + 93;
define inline-only constant $MCIERR-NO-IDENTITY         =
	$MCIERR-BASE + 94;
define inline-only constant $MCIERR-CUSTOM-DRIVER-BASE  =
	$MCIERR-BASE + 256;
define inline-only constant $MCI-OPEN                   = #x0803;
define inline-only constant $MCI-CLOSE                  = #x0804;
define inline-only constant $MCI-ESCAPE                 = #x0805;
define inline-only constant $MCI-PLAY                   = #x0806;
define inline-only constant $MCI-SEEK                   = #x0807;
define inline-only constant $MCI-STOP                   = #x0808;
define inline-only constant $MCI-PAUSE                  = #x0809;
define inline-only constant $MCI-INFO                   = #x080A;
define inline-only constant $MCI-GETDEVCAPS             = #x080B;
define inline-only constant $MCI-SPIN                   = #x080C;
define inline-only constant $MCI-SET                    = #x080D;
define inline-only constant $MCI-STEP                   = #x080E;
define inline-only constant $MCI-RECORD                 = #x080F;
define inline-only constant $MCI-SYSINFO                = #x0810;
define inline-only constant $MCI-BREAK                  = #x0811;
define inline-only constant $MCI-SAVE                   = #x0813;
define inline-only constant $MCI-STATUS                 = #x0814;
define inline-only constant $MCI-CUE                    = #x0830;
define inline-only constant $MCI-REALIZE                = #x0840;
define inline-only constant $MCI-WINDOW                 = #x0841;
define inline-only constant $MCI-PUT                    = #x0842;
define inline-only constant $MCI-WHERE                  = #x0843;
define inline-only constant $MCI-FREEZE                 = #x0844;
define inline-only constant $MCI-UNFREEZE               = #x0845;
define inline-only constant $MCI-LOAD                   = #x0850;
define inline-only constant $MCI-CUT                    = #x0851;
define inline-only constant $MCI-COPY                   = #x0852;
define inline-only constant $MCI-PASTE                  = #x0853;
define inline-only constant $MCI-UPDATE                 = #x0854;
define inline-only constant $MCI-RESUME                 = #x0855;
define inline-only constant $MCI-DELETE                 = #x0856;
define inline-only constant $MCI-LAST                   = #x0FFF;
define inline-only constant $MCI-ALL-DEVICE-ID          = $FFFFFFFF;
define inline-only constant $MCI-DEVTYPE-VCR            =  513;
define inline-only constant $MCI-DEVTYPE-VIDEODISC      =  514;
define inline-only constant $MCI-DEVTYPE-OVERLAY        =  515;
define inline-only constant $MCI-DEVTYPE-CD-AUDIO       =  516;
define inline-only constant $MCI-DEVTYPE-DAT            =  517;
define inline-only constant $MCI-DEVTYPE-SCANNER        =  518;
define inline-only constant $MCI-DEVTYPE-ANIMATION      =  519;
define inline-only constant $MCI-DEVTYPE-DIGITAL-VIDEO  =  520;
define inline-only constant $MCI-DEVTYPE-OTHER          =  521;
define inline-only constant $MCI-DEVTYPE-WAVEFORM-AUDIO =  522;
define inline-only constant $MCI-DEVTYPE-SEQUENCER      =  523;
define inline-only constant $MCI-DEVTYPE-FIRST-USER     = #x1000;
define inline-only constant $MCI-MODE-NOT-READY         =
	$MCI-STRING-OFFSET + 12;
define inline-only constant $MCI-MODE-STOP              =
	$MCI-STRING-OFFSET + 13;
define inline-only constant $MCI-MODE-PLAY              =
	$MCI-STRING-OFFSET + 14;
define inline-only constant $MCI-MODE-RECORD            =
	$MCI-STRING-OFFSET + 15;
define inline-only constant $MCI-MODE-SEEK              =
	$MCI-STRING-OFFSET + 16;
define inline-only constant $MCI-MODE-PAUSE             =
	$MCI-STRING-OFFSET + 17;
define inline-only constant $MCI-MODE-OPEN              =
	$MCI-STRING-OFFSET + 18;
define inline-only constant $MCI-FORMAT-MILLISECONDS    =    0;
define inline-only constant $MCI-FORMAT-HMS             =    1;
define inline-only constant $MCI-FORMAT-MSF             =    2;
define inline-only constant $MCI-FORMAT-FRAMES          =    3;
define inline-only constant $MCI-FORMAT-SMPTE-24        =    4;
define inline-only constant $MCI-FORMAT-SMPTE-25        =    5;
define inline-only constant $MCI-FORMAT-SMPTE-30        =    6;
define inline-only constant $MCI-FORMAT-SMPTE-30DROP    =    7;
define inline-only constant $MCI-FORMAT-BYTES           =    8;
define inline-only constant $MCI-FORMAT-SAMPLES         =    9;
define inline-only constant $MCI-FORMAT-TMSF            =   10;

define inline-only function MCI-MSF-MINUTE (msf);
  (LOBYTE(msf))
end;

define inline-only function MCI-MSF-SECOND (msf);
  (LOBYTE(ash(LOWORD(msf),-8)))
end;

define inline-only function MCI-MSF-FRAME (msf);
  logand(HIWORD(msf),#xFF)
end;

define inline-only function MCI-TMSF-TRACK (tmsf);
  (LOBYTE(tmsf))
end;

define inline-only function MCI-TMSF-MINUTE (tmsf);
  (LOBYTE(ash(LOWORD(tmsf),-8)))
end;

define inline-only function MCI-TMSF-SECOND (tmsf);
  logand(HIWORD(tmsf),#xFF)
end;

define inline-only function MCI-TMSF-FRAME (tmsf);
  (LOBYTE(ash(tmsf,-24)))
end;

define inline-only function MCI-HMS-HOUR (hms);
  (LOBYTE(hms))
end;

define inline-only function MCI-HMS-MINUTE (hms);
  (LOBYTE(ash(LOWORD(hms),-8)))
end;

define inline-only function MCI-HMS-SECOND (hms);
  logand(HIWORD(hms),#xFF)
end;
define inline-only constant $MCI-NOTIFY-SUCCESSFUL      = #x0001;
define inline-only constant $MCI-NOTIFY-SUPERSEDED      = #x0002;
define inline-only constant $MCI-NOTIFY-ABORTED         = #x0004;
define inline-only constant $MCI-NOTIFY-FAILURE         = #x0008;
define inline-only constant $MCI-NOTIFY                 = #x00000001;
define inline-only constant $MCI-WAIT                   = #x00000002;
define inline-only constant $MCI-FROM                   = #x00000004;
define inline-only constant $MCI-TO                     = #x00000008;
define inline-only constant $MCI-TRACK                  = #x00000010;
define inline-only constant $MCI-OPEN-SHAREABLE         = #x00000100;
define inline-only constant $MCI-OPEN-ELEMENT           = #x00000200;
define inline-only constant $MCI-OPEN-ALIAS             = #x00000400;
define inline-only constant $MCI-OPEN-ELEMENT-ID        = #x00000800;
define inline-only constant $MCI-OPEN-TYPE-ID           = #x00001000;
define inline-only constant $MCI-OPEN-TYPE              = #x00002000;
define inline-only constant $MCI-SEEK-TO-START          = #x00000100;
define inline-only constant $MCI-SEEK-TO-END            = #x00000200;
define inline-only constant $MCI-STATUS-ITEM            = #x00000100;
define inline-only constant $MCI-STATUS-START           = #x00000200;
define inline-only constant $MCI-STATUS-LENGTH          = #x00000001;
define inline-only constant $MCI-STATUS-POSITION        = #x00000002;
define inline-only constant $MCI-STATUS-NUMBER-OF-TRACKS =
	#x00000003;
define inline-only constant $MCI-STATUS-MODE            = #x00000004;
define inline-only constant $MCI-STATUS-MEDIA-PRESENT   = #x00000005;
define inline-only constant $MCI-STATUS-TIME-FORMAT     = #x00000006;
define inline-only constant $MCI-STATUS-READY           = #x00000007;
define inline-only constant $MCI-STATUS-CURRENT-TRACK   = #x00000008;
define inline-only constant $MCI-INFO-PRODUCT           = #x00000100;
define inline-only constant $MCI-INFO-FILE              = #x00000200;
define inline-only constant $MCI-INFO-MEDIA-UPC         = #x00000400;
define inline-only constant $MCI-INFO-MEDIA-IDENTITY    = #x00000800;
define inline-only constant $MCI-INFO-NAME              = #x00001000;
define inline-only constant $MCI-INFO-COPYRIGHT         = #x00002000;
define inline-only constant $MCI-GETDEVCAPS-ITEM        = #x00000100;
define inline-only constant $MCI-GETDEVCAPS-CAN-RECORD  = #x00000001;
define inline-only constant $MCI-GETDEVCAPS-HAS-AUDIO   = #x00000002;
define inline-only constant $MCI-GETDEVCAPS-HAS-VIDEO   = #x00000003;
define inline-only constant $MCI-GETDEVCAPS-DEVICE-TYPE = #x00000004;
define inline-only constant $MCI-GETDEVCAPS-USES-FILES  = #x00000005;
define inline-only constant $MCI-GETDEVCAPS-COMPOUND-DEVICE =
	#x00000006;
define inline-only constant $MCI-GETDEVCAPS-CAN-EJECT   = #x00000007;
define inline-only constant $MCI-GETDEVCAPS-CAN-PLAY    = #x00000008;
define inline-only constant $MCI-GETDEVCAPS-CAN-SAVE    = #x00000009;
define inline-only constant $MCI-SYSINFO-QUANTITY       = #x00000100;
define inline-only constant $MCI-SYSINFO-OPEN           = #x00000200;
define inline-only constant $MCI-SYSINFO-NAME           = #x00000400;
define inline-only constant $MCI-SYSINFO-INSTALLNAME    = #x00000800;
define inline-only constant $MCI-SET-DOOR-OPEN          = #x00000100;
define inline-only constant $MCI-SET-DOOR-CLOSED        = #x00000200;
define inline-only constant $MCI-SET-TIME-FORMAT        = #x00000400;
define inline-only constant $MCI-SET-AUDIO              = #x00000800;
define inline-only constant $MCI-SET-VIDEO              = #x00001000;
define inline-only constant $MCI-SET-ON                 = #x00002000;
define inline-only constant $MCI-SET-OFF                = #x00004000;
define inline-only constant $MCI-SET-AUDIO-ALL          = #x00000000;
define inline-only constant $MCI-SET-AUDIO-LEFT         = #x00000001;
define inline-only constant $MCI-SET-AUDIO-RIGHT        = #x00000002;
define inline-only constant $MCI-BREAK-KEY              = #x00000100;
define inline-only constant $MCI-BREAK-HWND             = #x00000200;
define inline-only constant $MCI-BREAK-OFF              = #x00000400;
define inline-only constant $MCI-RECORD-INSERT          = #x00000100;
define inline-only constant $MCI-RECORD-OVERWRITE       = #x00000200;
define inline-only constant $MCI-SAVE-FILE              = #x00000100;
define inline-only constant $MCI-LOAD-FILE              = #x00000100;

define C-struct <MCI-GENERIC-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-GENERIC-PARMS>;
  c-name: "struct tagMCI_GENERIC_PARMS";
end C-struct <MCI-GENERIC-PARMS>;
define inline constant <PMCI-GENERIC-PARMS> = <LPMCI-GENERIC-PARMS>;

define C-struct <MCI-OPEN-PARMSA>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot wDeviceID-value :: <MCIDEVICEID>;
  sealed inline-only slot lpstrDeviceType-value :: <LPCSTR>;
  sealed inline-only slot lpstrElementName-value :: <LPCSTR>;
  sealed inline-only slot lpstrAlias-value :: <LPCSTR>;
  pack: 1;
  pointer-type-name: <LPMCI-OPEN-PARMSA>;
  c-name: "struct tagMCI_OPEN_PARMSA";
end C-struct <MCI-OPEN-PARMSA>;
define inline constant <PMCI-OPEN-PARMSA> = <LPMCI-OPEN-PARMSA>;
define inline constant <MCI-OPEN-PARMS> = <MCI-OPEN-PARMSA>;
define inline constant <PMCI-OPEN-PARMS> = <PMCI-OPEN-PARMSA>;
define inline constant <LPMCI-OPEN-PARMS> = <LPMCI-OPEN-PARMSA>;

define C-struct <MCI-PLAY-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot dwFrom-value   :: <DWORD>;
  sealed inline-only slot dwTo-value     :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-PLAY-PARMS>;
  c-name: "struct tagMCI_PLAY_PARMS";
end C-struct <MCI-PLAY-PARMS>;
define inline constant <PMCI-PLAY-PARMS> = <LPMCI-PLAY-PARMS>;

define C-struct <MCI-SEEK-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot dwTo-value     :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-SEEK-PARMS>;
  c-name: "struct tagMCI_SEEK_PARMS";
end C-struct <MCI-SEEK-PARMS>;
define inline constant <PMCI-SEEK-PARMS> = <LPMCI-SEEK-PARMS>;

define C-struct <MCI-STATUS-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot dwReturn-value :: <DWORD>;
  sealed inline-only slot dwItem-value   :: <DWORD>;
  sealed inline-only slot dwTrack-value  :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-STATUS-PARMS>;
  c-name: "struct tagMCI_STATUS_PARMS";
end C-struct <MCI-STATUS-PARMS>;
define inline constant <PMCI-STATUS-PARMS> = <LPMCI-STATUS-PARMS>;

define C-struct <MCI-INFO-PARMSA>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot lpstrReturn-value :: <LPSTR>;
  sealed inline-only slot dwRetSize-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-INFO-PARMSA>;
  c-name: "struct tagMCI_INFO_PARMSA";
end C-struct <MCI-INFO-PARMSA>;
define inline constant <MCI-INFO-PARMS> = <MCI-INFO-PARMSA>;
define inline constant <LPMCI-INFO-PARMS> = <LPMCI-INFO-PARMSA>;

define C-struct <MCI-GETDEVCAPS-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot dwReturn-value :: <DWORD>;
  sealed inline-only slot dwItem-value   :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-GETDEVCAPS-PARMS>;
  c-name: "struct tagMCI_GETDEVCAPS_PARMS";
end C-struct <MCI-GETDEVCAPS-PARMS>;
define inline constant <PMCI-GETDEVCAPS-PARMS> = <LPMCI-GETDEVCAPS-PARMS>;

define C-struct <MCI-SYSINFO-PARMSA>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot lpstrReturn-value :: <LPSTR>;
  sealed inline-only slot dwRetSize-value :: <DWORD>;
  sealed inline-only slot dwNumber-value :: <DWORD>;
  sealed inline-only slot wDeviceType-value :: <UINT>;
  pack: 1;
  pointer-type-name: <LPMCI-SYSINFO-PARMSA>;
  c-name: "struct tagMCI_SYSINFO_PARMSA";
end C-struct <MCI-SYSINFO-PARMSA>;
define inline constant <PMCI-SYSINFO-PARMSA> = <LPMCI-SYSINFO-PARMSA>;
define inline constant <MCI-SYSINFO-PARMS> = <MCI-SYSINFO-PARMSA>;
define inline constant <PMCI-SYSINFO-PARMS> = <PMCI-SYSINFO-PARMSA>;
define inline constant <LPMCI-SYSINFO-PARMS> = <LPMCI-SYSINFO-PARMSA>;

define C-struct <MCI-SET-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot dwTimeFormat-value :: <DWORD>;
  sealed inline-only slot dwAudio-value  :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-SET-PARMS>;
  c-name: "struct tagMCI_SET_PARMS";
end C-struct <MCI-SET-PARMS>;
define inline constant <PMCI-SET-PARMS> = <LPMCI-SET-PARMS>;

define C-struct <MCI-BREAK-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot nVirtKey-value :: <C-int>;
  sealed inline-only slot hwndBreak-value :: <HWND>;
  pack: 1;
  pointer-type-name: <LPMCI-BREAK-PARMS>;
  c-name: "struct tagMCI_BREAK_PARMS";
end C-struct <MCI-BREAK-PARMS>;
define inline constant <PMCI-BREAK-PARMS> = <LPMCI-BREAK-PARMS>;

define C-struct <MCI-SAVE-PARMSA>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot lpfilename-value :: <LPCSTR>;
  pack: 1;
  pointer-type-name: <LPMCI-SAVE-PARMSA>;
  c-name: "struct tagMCI_SAVE_PARMSA";
end C-struct <MCI-SAVE-PARMSA>;
define inline constant <PMCI-SAVE-PARMSA> = <LPMCI-SAVE-PARMSA>;
define inline constant <MCI-SAVE-PARMS> = <MCI-SAVE-PARMSA>;
define inline constant <PMCI-SAVE-PARMS> = <PMCI-SAVE-PARMSA>;
define inline constant <LPMCI-SAVE-PARMS> = <LPMCI-SAVE-PARMSA>;

define C-struct <MCI-LOAD-PARMSA>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot lpfilename-value :: <LPCSTR>;
  pack: 1;
  pointer-type-name: <LPMCI-LOAD-PARMSA>;
  c-name: "struct tagMCI_LOAD_PARMSA";
end C-struct <MCI-LOAD-PARMSA>;
define inline constant <PMCI-LOAD-PARMSA> = <LPMCI-LOAD-PARMSA>;
define inline constant <MCI-LOAD-PARMS> = <MCI-LOAD-PARMSA>;
define inline constant <PMCI-LOAD-PARMS> = <PMCI-LOAD-PARMSA>;
define inline constant <LPMCI-LOAD-PARMS> = <LPMCI-LOAD-PARMSA>;

define C-struct <MCI-RECORD-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot dwFrom-value   :: <DWORD>;
  sealed inline-only slot dwTo-value     :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-RECORD-PARMS>;
  c-name: "struct tagMCI_RECORD_PARMS";
end C-struct <MCI-RECORD-PARMS>;
define inline-only constant $MCI-VD-MODE-PARK           =
	$MCI-VD-OFFSET + 1;
define inline-only constant $MCI-VD-MEDIA-CLV           =
	$MCI-VD-OFFSET + 2;
define inline-only constant $MCI-VD-MEDIA-CAV           =
	$MCI-VD-OFFSET + 3;
define inline-only constant $MCI-VD-MEDIA-OTHER         =
	$MCI-VD-OFFSET + 4;
define inline-only constant $MCI-VD-FORMAT-TRACK        = #x4001;
define inline-only constant $MCI-VD-PLAY-REVERSE        = #x00010000;
define inline-only constant $MCI-VD-PLAY-FAST           = #x00020000;
define inline-only constant $MCI-VD-PLAY-SPEED          = #x00040000;
define inline-only constant $MCI-VD-PLAY-SCAN           = #x00080000;
define inline-only constant $MCI-VD-PLAY-SLOW           = #x00100000;
define inline-only constant $MCI-VD-SEEK-REVERSE        = #x00010000;
define inline-only constant $MCI-VD-STATUS-SPEED        = #x00004002;
define inline-only constant $MCI-VD-STATUS-FORWARD      = #x00004003;
define inline-only constant $MCI-VD-STATUS-MEDIA-TYPE   = #x00004004;
define inline-only constant $MCI-VD-STATUS-SIDE         = #x00004005;
define inline-only constant $MCI-VD-STATUS-DISC-SIZE    = #x00004006;
define inline-only constant $MCI-VD-GETDEVCAPS-CLV      = #x00010000;
define inline-only constant $MCI-VD-GETDEVCAPS-CAV      = #x00020000;
define inline-only constant $MCI-VD-SPIN-UP             = #x00010000;
define inline-only constant $MCI-VD-SPIN-DOWN           = #x00020000;
define inline-only constant $MCI-VD-GETDEVCAPS-CAN-REVERSE =
	#x00004002;
define inline-only constant $MCI-VD-GETDEVCAPS-FAST-RATE =
	#x00004003;
define inline-only constant $MCI-VD-GETDEVCAPS-SLOW-RATE =
	#x00004004;
define inline-only constant $MCI-VD-GETDEVCAPS-NORMAL-RATE =
	#x00004005;
define inline-only constant $MCI-VD-STEP-FRAMES         = #x00010000;
define inline-only constant $MCI-VD-STEP-REVERSE        = #x00020000;
define inline-only constant $MCI-VD-ESCAPE-STRING       = #x00000100;

define C-struct <MCI-VD-PLAY-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot dwFrom-value   :: <DWORD>;
  sealed inline-only slot dwTo-value     :: <DWORD>;
  sealed inline-only slot dwSpeed-value  :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-VD-PLAY-PARMS>;
  c-name: "struct tagMCI_VD_PLAY_PARMS";
end C-struct <MCI-VD-PLAY-PARMS>;
define inline constant <PMCI-VD-PLAY-PARMS> = <LPMCI-VD-PLAY-PARMS>;

define C-struct <MCI-VD-STEP-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot dwFrames-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-VD-STEP-PARMS>;
  c-name: "struct tagMCI_VD_STEP_PARMS";
end C-struct <MCI-VD-STEP-PARMS>;
define inline constant <PMCI-VD-STEP-PARMS> = <LPMCI-VD-STEP-PARMS>;

define C-struct <MCI-VD-ESCAPE-PARMSA>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot lpstrCommand-value :: <LPCSTR>;
  pack: 1;
  pointer-type-name: <LPMCI-VD-ESCAPE-PARMSA>;
  c-name: "struct tagMCI_VD_ESCAPE_PARMSA";
end C-struct <MCI-VD-ESCAPE-PARMSA>;
define inline constant <PMCI-VD-ESCAPE-PARMSA> = <LPMCI-VD-ESCAPE-PARMSA>;
define inline constant <MCI-VD-ESCAPE-PARMS> = <MCI-VD-ESCAPE-PARMSA>;
define inline constant <PMCI-VD-ESCAPE-PARMS> = <PMCI-VD-ESCAPE-PARMSA>;
define inline constant <LPMCI-VD-ESCAPE-PARMS> = <LPMCI-VD-ESCAPE-PARMSA>;
define inline-only constant $MCI-CDA-STATUS-TYPE-TRACK  = #x00004001;
define inline-only constant $MCI-CDA-TRACK-AUDIO        =
	$MCI-CD-OFFSET + 0;
define inline-only constant $MCI-CDA-TRACK-OTHER        =
	$MCI-CD-OFFSET + 1;
define inline-only constant $MCI-WAVE-PCM               =
	$MCI-WAVE-OFFSET + 0;
define inline-only constant $MCI-WAVE-MAPPER            =
	$MCI-WAVE-OFFSET + 1;
define inline-only constant $MCI-WAVE-OPEN-BUFFER       = #x00010000;
define inline-only constant $MCI-WAVE-SET-FORMATTAG     = #x00010000;
define inline-only constant $MCI-WAVE-SET-CHANNELS      = #x00020000;
define inline-only constant $MCI-WAVE-SET-SAMPLESPERSEC = #x00040000;
define inline-only constant $MCI-WAVE-SET-AVGBYTESPERSEC =
	#x00080000;
define inline-only constant $MCI-WAVE-SET-BLOCKALIGN    = #x00100000;
define inline-only constant $MCI-WAVE-SET-BITSPERSAMPLE = #x00200000;
define inline-only constant $MCI-WAVE-INPUT             = #x00400000;
define inline-only constant $MCI-WAVE-OUTPUT            = #x00800000;
define inline-only constant $MCI-WAVE-STATUS-FORMATTAG  = #x00004001;
define inline-only constant $MCI-WAVE-STATUS-CHANNELS   = #x00004002;
define inline-only constant $MCI-WAVE-STATUS-SAMPLESPERSEC =
	#x00004003;
define inline-only constant $MCI-WAVE-STATUS-AVGBYTESPERSEC =
	#x00004004;
define inline-only constant $MCI-WAVE-STATUS-BLOCKALIGN = #x00004005;
define inline-only constant $MCI-WAVE-STATUS-BITSPERSAMPLE =
	#x00004006;
define inline-only constant $MCI-WAVE-STATUS-LEVEL      = #x00004007;
define inline-only constant $MCI-WAVE-SET-ANYINPUT      = #x04000000;
define inline-only constant $MCI-WAVE-SET-ANYOUTPUT     = #x08000000;
define inline-only constant $MCI-WAVE-GETDEVCAPS-INPUTS = #x00004001;
define inline-only constant $MCI-WAVE-GETDEVCAPS-OUTPUTS =
	#x00004002;

define C-struct <MCI-WAVE-OPEN-PARMSA>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot wDeviceID-value :: <MCIDEVICEID>;
  sealed inline-only slot lpstrDeviceType-value :: <LPCSTR>;
  sealed inline-only slot lpstrElementName-value :: <LPCSTR>;
  sealed inline-only slot lpstrAlias-value :: <LPCSTR>;
  sealed inline-only slot dwBufferSeconds-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-WAVE-OPEN-PARMSA>;
  c-name: "struct tagMCI_WAVE_OPEN_PARMSA";
end C-struct <MCI-WAVE-OPEN-PARMSA>;
define inline constant <PMCI-WAVE-OPEN-PARMSA> = <LPMCI-WAVE-OPEN-PARMSA>;
define inline constant <MCI-WAVE-OPEN-PARMS> = <MCI-WAVE-OPEN-PARMSA>;
define inline constant <PMCI-WAVE-OPEN-PARMS> = <PMCI-WAVE-OPEN-PARMSA>;
define inline constant <LPMCI-WAVE-OPEN-PARMS> = <LPMCI-WAVE-OPEN-PARMSA>;

define C-struct <MCI-WAVE-DELETE-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot dwFrom-value   :: <DWORD>;
  sealed inline-only slot dwTo-value     :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-WAVE-DELETE-PARMS>;
  c-name: "struct tagMCI_WAVE_DELETE_PARMS";
end C-struct <MCI-WAVE-DELETE-PARMS>;
define inline constant <PMCI-WAVE-DELETE-PARMS> = <LPMCI-WAVE-DELETE-PARMS>;

define C-struct <MCI-WAVE-SET-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot dwTimeFormat-value :: <DWORD>;
  sealed inline-only slot dwAudio-value  :: <DWORD>;
  sealed inline-only slot wInput-value   :: <UINT>;
  sealed inline-only slot wOutput-value  :: <UINT>;
  sealed inline-only slot wFormatTag-value :: <WORD>;
  sealed inline-only slot wReserved2     :: <WORD>;
  sealed inline-only slot nChannels-value :: <WORD>;
  sealed inline-only slot wReserved3     :: <WORD>;
  sealed inline-only slot nSamplesPerSec-value :: <DWORD>;
  sealed inline-only slot nAvgBytesPerSec-value :: <DWORD>;
  sealed inline-only slot nBlockAlign-value :: <WORD>;
  sealed inline-only slot wReserved4     :: <WORD>;
  sealed inline-only slot wBitsPerSample-value :: <WORD>;
  sealed inline-only slot wReserved5     :: <WORD>;
  pack: 1;
  pointer-type-name: <LPMCI-WAVE-SET-PARMS>;
  c-name: "struct tagMCI_WAVE_SET_PARMS";
end C-struct <MCI-WAVE-SET-PARMS>;
define inline constant <PMCI-WAVE-SET-PARMS> = <LPMCI-WAVE-SET-PARMS>;
define inline-only constant $MCI-SEQ-FORMAT-SONGPTR     = #x4001;
define inline-only constant $MCI-SEQ-FILE               = #x4002;
define inline-only constant $MCI-SEQ-MIDI               = #x4003;
define inline-only constant $MCI-SEQ-SMPTE              = #x4004;
define inline-only constant $MCI-SEQ-NONE               = 65533;
define inline-only constant $MCI-SEQ-MAPPER             = 65535;
define inline-only constant $MCI-SEQ-STATUS-TEMPO       = #x00004002;
define inline-only constant $MCI-SEQ-STATUS-PORT        = #x00004003;
define inline-only constant $MCI-SEQ-STATUS-SLAVE       = #x00004007;
define inline-only constant $MCI-SEQ-STATUS-MASTER      = #x00004008;
define inline-only constant $MCI-SEQ-STATUS-OFFSET      = #x00004009;
define inline-only constant $MCI-SEQ-STATUS-DIVTYPE     = #x0000400A;
define inline-only constant $MCI-SEQ-STATUS-NAME        = #x0000400B;
define inline-only constant $MCI-SEQ-STATUS-COPYRIGHT   = #x0000400C;
define inline-only constant $MCI-SEQ-SET-TEMPO          = #x00010000;
define inline-only constant $MCI-SEQ-SET-PORT           = #x00020000;
define inline-only constant $MCI-SEQ-SET-SLAVE          = #x00040000;
define inline-only constant $MCI-SEQ-SET-MASTER         = #x00080000;
define inline-only constant $MCI-SEQ-SET-OFFSET         = #x01000000;

define C-struct <MCI-SEQ-SET-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot dwTimeFormat-value :: <DWORD>;
  sealed inline-only slot dwAudio-value  :: <DWORD>;
  sealed inline-only slot dwTempo-value  :: <DWORD>;
  sealed inline-only slot dwPort-value   :: <DWORD>;
  sealed inline-only slot dwSlave-value  :: <DWORD>;
  sealed inline-only slot dwMaster-value :: <DWORD>;
  sealed inline-only slot dwOffset-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-SEQ-SET-PARMS>;
  c-name: "struct tagMCI_SEQ_SET_PARMS";
end C-struct <MCI-SEQ-SET-PARMS>;
define inline constant <PMCI-SEQ-SET-PARMS> = <LPMCI-SEQ-SET-PARMS>;
define inline-only constant $MCI-ANIM-OPEN-WS           = #x00010000;
define inline-only constant $MCI-ANIM-OPEN-PARENT       = #x00020000;
define inline-only constant $MCI-ANIM-OPEN-NOSTATIC     = #x00040000;
define inline-only constant $MCI-ANIM-PLAY-SPEED        = #x00010000;
define inline-only constant $MCI-ANIM-PLAY-REVERSE      = #x00020000;
define inline-only constant $MCI-ANIM-PLAY-FAST         = #x00040000;
define inline-only constant $MCI-ANIM-PLAY-SLOW         = #x00080000;
define inline-only constant $MCI-ANIM-PLAY-SCAN         = #x00100000;
define inline-only constant $MCI-ANIM-STEP-REVERSE      = #x00010000;
define inline-only constant $MCI-ANIM-STEP-FRAMES       = #x00020000;
define inline-only constant $MCI-ANIM-STATUS-SPEED      = #x00004001;
define inline-only constant $MCI-ANIM-STATUS-FORWARD    = #x00004002;
define inline-only constant $MCI-ANIM-STATUS-HWND       = #x00004003;
define inline-only constant $MCI-ANIM-STATUS-HPAL       = #x00004004;
define inline-only constant $MCI-ANIM-STATUS-STRETCH    = #x00004005;
define inline-only constant $MCI-ANIM-INFO-TEXT         = #x00010000;
define inline-only constant $MCI-ANIM-GETDEVCAPS-CAN-REVERSE =
	#x00004001;
define inline-only constant $MCI-ANIM-GETDEVCAPS-FAST-RATE =
	#x00004002;
define inline-only constant $MCI-ANIM-GETDEVCAPS-SLOW-RATE =
	#x00004003;
define inline-only constant $MCI-ANIM-GETDEVCAPS-NORMAL-RATE =
	#x00004004;
define inline-only constant $MCI-ANIM-GETDEVCAPS-PALETTES =
	#x00004006;
define inline-only constant $MCI-ANIM-GETDEVCAPS-CAN-STRETCH =
	#x00004007;
define inline-only constant $MCI-ANIM-GETDEVCAPS-MAX-WINDOWS =
	#x00004008;
define inline-only constant $MCI-ANIM-REALIZE-NORM      = #x00010000;
define inline-only constant $MCI-ANIM-REALIZE-BKGD      = #x00020000;
define inline-only constant $MCI-ANIM-WINDOW-HWND       = #x00010000;
define inline-only constant $MCI-ANIM-WINDOW-STATE      = #x00040000;
define inline-only constant $MCI-ANIM-WINDOW-TEXT       = #x00080000;
define inline-only constant $MCI-ANIM-WINDOW-ENABLE-STRETCH =
	#x00100000;
define inline-only constant $MCI-ANIM-WINDOW-DISABLE-STRETCH =
	#x00200000;
define inline-only constant $MCI-ANIM-WINDOW-DEFAULT    = #x00000000;
define inline-only constant $MCI-ANIM-RECT              = #x00010000;
define inline-only constant $MCI-ANIM-PUT-SOURCE        = #x00020000;
define inline-only constant $MCI-ANIM-PUT-DESTINATION   = #x00040000;
define inline-only constant $MCI-ANIM-WHERE-SOURCE      = #x00020000;
define inline-only constant $MCI-ANIM-WHERE-DESTINATION = #x00040000;
define inline-only constant $MCI-ANIM-UPDATE-HDC        = #x00020000;

define C-struct <MCI-ANIM-OPEN-PARMSA>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot wDeviceID-value :: <MCIDEVICEID>;
  sealed inline-only slot lpstrDeviceType-value :: <LPCSTR>;
  sealed inline-only slot lpstrElementName-value :: <LPCSTR>;
  sealed inline-only slot lpstrAlias-value :: <LPCSTR>;
  sealed inline-only slot dwStyle-value  :: <DWORD>;
  sealed inline-only slot hWndParent-value :: <HWND>;
  pack: 1;
  pointer-type-name: <LPMCI-ANIM-OPEN-PARMSA>;
  c-name: "struct tagMCI_ANIM_OPEN_PARMSA";
end C-struct <MCI-ANIM-OPEN-PARMSA>;
define inline constant <PMCI-ANIM-OPEN-PARMSA> = <LPMCI-ANIM-OPEN-PARMSA>;
define inline constant <MCI-ANIM-OPEN-PARMS> = <MCI-ANIM-OPEN-PARMSA>;
define inline constant <PMCI-ANIM-OPEN-PARMS> = <PMCI-ANIM-OPEN-PARMSA>;
define inline constant <LPMCI-ANIM-OPEN-PARMS> = <LPMCI-ANIM-OPEN-PARMSA>;

define C-struct <MCI-ANIM-PLAY-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot dwFrom-value   :: <DWORD>;
  sealed inline-only slot dwTo-value     :: <DWORD>;
  sealed inline-only slot dwSpeed-value  :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-ANIM-PLAY-PARMS>;
  c-name: "struct tagMCI_ANIM_PLAY_PARMS";
end C-struct <MCI-ANIM-PLAY-PARMS>;
define inline constant <PMCI-ANIM-PLAY-PARMS> = <LPMCI-ANIM-PLAY-PARMS>;

define C-struct <MCI-ANIM-STEP-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot dwFrames-value :: <DWORD>;
  pack: 1;
  pointer-type-name: <LPMCI-ANIM-STEP-PARMS>;
  c-name: "struct tagMCI_ANIM_STEP_PARMS";
end C-struct <MCI-ANIM-STEP-PARMS>;
define inline constant <PMCI-ANIM-STEP-PARMS> = <LPMCI-ANIM-STEP-PARMS>;

define C-struct <MCI-ANIM-WINDOW-PARMSA>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot hWnd-value     :: <HWND>;
  sealed inline-only slot nCmdShow-value :: <UINT>;
  sealed inline-only slot lpstrText-value :: <LPCSTR>;
  pack: 1;
  pointer-type-name: <LPMCI-ANIM-WINDOW-PARMSA>;
  c-name: "struct tagMCI_ANIM_WINDOW_PARMSA";
end C-struct <MCI-ANIM-WINDOW-PARMSA>;
define inline constant <PMCI-ANIM-WINDOW-PARMSA> = <LPMCI-ANIM-WINDOW-PARMSA>;
define inline constant <MCI-ANIM-WINDOW-PARMS> = <MCI-ANIM-WINDOW-PARMSA>;
define inline constant <PMCI-ANIM-WINDOW-PARMS> = <PMCI-ANIM-WINDOW-PARMSA>;
define inline constant <LPMCI-ANIM-WINDOW-PARMS> = <LPMCI-ANIM-WINDOW-PARMSA>;

define C-struct <MCI-ANIM-RECT-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot rc-value       :: <RECT>;
  pack: 1;
  pointer-type-name: <LPMCI-ANIM-RECT-PARMS>;
  c-name: "struct tagMCI_ANIM_RECT_PARMS";
end C-struct <MCI-ANIM-RECT-PARMS>;
define inline constant <PMCI-ANIM-RECT-PARMS> = <LPMCI-ANIM-RECT-PARMS>;

define C-struct <MCI-ANIM-UPDATE-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot rc-value       :: <RECT>;
  sealed inline-only slot hDC-value      :: <HDC>;
  pack: 1;
  pointer-type-name: <LPMCI-ANIM-UPDATE-PARMS>;
  c-name: "struct tagMCI_ANIM_UPDATE_PARMS";
end C-struct <MCI-ANIM-UPDATE-PARMS>;
define inline constant <PMCI-ANIM-UPDATE-PARMS> = <LPMCI-ANIM-UPDATE-PARMS>;
define inline-only constant $MCI-OVLY-OPEN-WS           = #x00010000;
define inline-only constant $MCI-OVLY-OPEN-PARENT       = #x00020000;
define inline-only constant $MCI-OVLY-STATUS-HWND       = #x00004001;
define inline-only constant $MCI-OVLY-STATUS-STRETCH    = #x00004002;
define inline-only constant $MCI-OVLY-INFO-TEXT         = #x00010000;
define inline-only constant $MCI-OVLY-GETDEVCAPS-CAN-STRETCH =
	#x00004001;
define inline-only constant $MCI-OVLY-GETDEVCAPS-CAN-FREEZE =
	#x00004002;
define inline-only constant $MCI-OVLY-GETDEVCAPS-MAX-WINDOWS =
	#x00004003;
define inline-only constant $MCI-OVLY-WINDOW-HWND       = #x00010000;
define inline-only constant $MCI-OVLY-WINDOW-STATE      = #x00040000;
define inline-only constant $MCI-OVLY-WINDOW-TEXT       = #x00080000;
define inline-only constant $MCI-OVLY-WINDOW-ENABLE-STRETCH =
	#x00100000;
define inline-only constant $MCI-OVLY-WINDOW-DISABLE-STRETCH =
	#x00200000;
define inline-only constant $MCI-OVLY-WINDOW-DEFAULT    = #x00000000;
define inline-only constant $MCI-OVLY-RECT              = #x00010000;
define inline-only constant $MCI-OVLY-PUT-SOURCE        = #x00020000;
define inline-only constant $MCI-OVLY-PUT-DESTINATION   = #x00040000;
define inline-only constant $MCI-OVLY-PUT-FRAME         = #x00080000;
define inline-only constant $MCI-OVLY-PUT-VIDEO         = #x00100000;
define inline-only constant $MCI-OVLY-WHERE-SOURCE      = #x00020000;
define inline-only constant $MCI-OVLY-WHERE-DESTINATION = #x00040000;
define inline-only constant $MCI-OVLY-WHERE-FRAME       = #x00080000;
define inline-only constant $MCI-OVLY-WHERE-VIDEO       = #x00100000;

define C-struct <MCI-OVLY-OPEN-PARMSA>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot wDeviceID-value :: <MCIDEVICEID>;
  sealed inline-only slot lpstrDeviceType-value :: <LPCSTR>;
  sealed inline-only slot lpstrElementName-value :: <LPCSTR>;
  sealed inline-only slot lpstrAlias-value :: <LPCSTR>;
  sealed inline-only slot dwStyle-value  :: <DWORD>;
  sealed inline-only slot hWndParent-value :: <HWND>;
  pack: 1;
  pointer-type-name: <LPMCI-OVLY-OPEN-PARMSA>;
  c-name: "struct tagMCI_OVLY_OPEN_PARMSA";
end C-struct <MCI-OVLY-OPEN-PARMSA>;
define inline constant <PMCI-OVLY-OPEN-PARMSA> = <LPMCI-OVLY-OPEN-PARMSA>;
define inline constant <MCI-OVLY-OPEN-PARMS> = <MCI-OVLY-OPEN-PARMSA>;
define inline constant <PMCI-OVLY-OPEN-PARMS> = <PMCI-OVLY-OPEN-PARMSA>;
define inline constant <LPMCI-OVLY-OPEN-PARMS> = <LPMCI-OVLY-OPEN-PARMSA>;

define C-struct <MCI-OVLY-WINDOW-PARMSA>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot hWnd-value     :: <HWND>;
  sealed inline-only slot nCmdShow-value :: <UINT>;
  sealed inline-only slot lpstrText-value :: <LPCSTR>;
  pack: 1;
  pointer-type-name: <LPMCI-OVLY-WINDOW-PARMSA>;
  c-name: "struct tagMCI_OVLY_WINDOW_PARMSA";
end C-struct <MCI-OVLY-WINDOW-PARMSA>;
define inline constant <PMCI-OVLY-WINDOW-PARMSA> = <LPMCI-OVLY-WINDOW-PARMSA>;
define inline constant <MCI-OVLY-WINDOW-PARMS> = <MCI-OVLY-WINDOW-PARMSA>;
define inline constant <PMCI-OVLY-WINDOW-PARMS> = <PMCI-OVLY-WINDOW-PARMSA>;
define inline constant <LPMCI-OVLY-WINDOW-PARMS> = <LPMCI-OVLY-WINDOW-PARMSA>;

define C-struct <MCI-OVLY-RECT-PARMS>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot rc-value       :: <RECT>;
  pack: 1;
  pointer-type-name: <LPMCI-OVLY-RECT-PARMS>;
  c-name: "struct tagMCI_OVLY_RECT_PARMS";
end C-struct <MCI-OVLY-RECT-PARMS>;
define inline constant <PMCI-OVLY-RECT-PARMS> = <LPMCI-OVLY-RECT-PARMS>;

define C-struct <MCI-OVLY-SAVE-PARMSA>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot lpfilename-value :: <LPCSTR>;
  sealed inline-only slot rc-value       :: <RECT>;
  pack: 1;
  pointer-type-name: <LPMCI-OVLY-SAVE-PARMSA>;
  c-name: "struct tagMCI_OVLY_SAVE_PARMSA";
end C-struct <MCI-OVLY-SAVE-PARMSA>;
define inline constant <PMCI-OVLY-SAVE-PARMSA> = <LPMCI-OVLY-SAVE-PARMSA>;
define inline constant <MCI-OVLY-SAVE-PARMS> = <MCI-OVLY-SAVE-PARMSA>;
define inline constant <PMCI-OVLY-SAVE-PARMS> = <PMCI-OVLY-SAVE-PARMSA>;
define inline constant <LPMCI-OVLY-SAVE-PARMS> = <LPMCI-OVLY-SAVE-PARMSA>;

define C-struct <MCI-OVLY-LOAD-PARMSA>
  sealed inline-only slot dwCallback-value :: <DWORD>;
  sealed inline-only slot lpfilename-value :: <LPCSTR>;
  sealed inline-only slot rc-value       :: <RECT>;
  pack: 1;
  pointer-type-name: <LPMCI-OVLY-LOAD-PARMSA>;
  c-name: "struct tagMCI_OVLY_LOAD_PARMSA";
end C-struct <MCI-OVLY-LOAD-PARMSA>;
define inline constant <PMCI-OVLY-LOAD-PARMSA> = <LPMCI-OVLY-LOAD-PARMSA>;
define inline constant <MCI-OVLY-LOAD-PARMS> = <MCI-OVLY-LOAD-PARMSA>;
define inline constant <PMCI-OVLY-LOAD-PARMS> = <PMCI-OVLY-LOAD-PARMSA>;
define inline constant <LPMCI-OVLY-LOAD-PARMS> = <LPMCI-OVLY-LOAD-PARMSA>;
/****************************************************************************

			DISPLAY Driver extensions

****************************************************************************/

define inline-only constant $NEWTRANSPARENT             =    3;
define inline-only constant $QUERYROPSUPPORT            =   40;
/****************************************************************************

			DIB Driver extensions

****************************************************************************/

define inline-only constant $SELECTDIB                  =   41;

define inline-only function DIBINDEX (n);
  MAKELONG(n, #x10FF)
end;
/****************************************************************************

			ScreenSaver support

    The current application will receive a syscommand of SC_SCREENSAVE just
    before the screen saver is invoked.  If the app wishes to prevent a
    screen save, return non-zero value, otherwise call DefWindowProc().

****************************************************************************/


define sealed domain make (singleton(<LPMMTIME>));
define sealed domain initialize (<LPMMTIME>);
define sealed domain make (singleton(<LPDRVCONFIGINFOEX>));
define sealed domain initialize (<LPDRVCONFIGINFOEX>);
define sealed domain make (singleton(<LPDRVCONFIGINFO>));
define sealed domain initialize (<LPDRVCONFIGINFO>);
define inline-only constant $DRV-CANCEL  = $DRVCNF-CANCEL;
define inline-only constant $DRV-OK      = $DRVCNF-OK;
define inline-only constant $DRV-RESTART = $DRVCNF-RESTART;
define inline-only constant $DRV-MCI-FIRST = $DRV-RESERVED;
define inline-only constant $WOM-OPEN    = $MM-WOM-OPEN;
define inline-only constant $WOM-CLOSE   = $MM-WOM-CLOSE;
define inline-only constant $WOM-DONE    = $MM-WOM-DONE;
define inline-only constant $WIM-OPEN    = $MM-WIM-OPEN;
define inline-only constant $WIM-CLOSE   = $MM-WIM-CLOSE;
define inline-only constant $WIM-DATA    = $MM-WIM-DATA;
define sealed domain make (singleton(<LPWAVEHDR>));
define sealed domain initialize (<LPWAVEHDR>);
define sealed domain make (singleton(<LPWAVEOUTCAPSA>));
define sealed domain initialize (<LPWAVEOUTCAPSA>);
define sealed domain make (singleton(<LPWAVEINCAPSA>));
define sealed domain initialize (<LPWAVEINCAPSA>);
define sealed domain make (singleton(<LPWAVEFORMAT>));
define sealed domain initialize (<LPWAVEFORMAT>);
define sealed domain make (singleton(<LPPCMWAVEFORMAT>));
define sealed domain initialize (<LPPCMWAVEFORMAT>);
define sealed domain make (singleton(<LPWAVEFORMATEX>));
define sealed domain initialize (<LPWAVEFORMATEX>);
define inline-only constant $MIM-OPEN    = $MM-MIM-OPEN;
define inline-only constant $MIM-CLOSE   = $MM-MIM-CLOSE;
define inline-only constant $MIM-DATA    = $MM-MIM-DATA;
define inline-only constant $MIM-LONGDATA = $MM-MIM-LONGDATA;
define inline-only constant $MIM-ERROR   = $MM-MIM-ERROR;
define inline-only constant $MIM-LONGERROR = $MM-MIM-LONGERROR;
define inline-only constant $MOM-OPEN    = $MM-MOM-OPEN;
define inline-only constant $MOM-CLOSE   = $MM-MOM-CLOSE;
define inline-only constant $MOM-DONE    = $MM-MOM-DONE;
define inline-only constant $MIM-MOREDATA = $MM-MIM-MOREDATA;
define inline-only constant $MOM-POSITIONCB = $MM-MOM-POSITIONCB;
define sealed domain make (singleton(<LPMIDIOUTCAPSA>));
define sealed domain initialize (<LPMIDIOUTCAPSA>);
define sealed domain make (singleton(<LPMIDIINCAPSA>));
define sealed domain initialize (<LPMIDIINCAPSA>);
define sealed domain make (singleton(<LPMIDIHDR>));
define sealed domain initialize (<LPMIDIHDR>);
define sealed domain make (singleton(<LPMIDIEVENT>));
define sealed domain initialize (<LPMIDIEVENT>);
define sealed domain make (singleton(<LPMIDISTRMBUFFVER>));
define sealed domain initialize (<LPMIDISTRMBUFFVER>);
define sealed domain make (singleton(<LPMIDIPROPTIMEDIV>));
define sealed domain initialize (<LPMIDIPROPTIMEDIV>);
define sealed domain make (singleton(<LPMIDIPROPTEMPO>));
define sealed domain initialize (<LPMIDIPROPTEMPO>);
define sealed domain make (singleton(<LPAUXCAPSA>));
define sealed domain initialize (<LPAUXCAPSA>);
define sealed domain make (singleton(<LPMIXERCAPSA>));
define sealed domain initialize (<LPMIXERCAPSA>);
define sealed domain make (singleton(<LPMIXERLINEA>));
define sealed domain initialize (<LPMIXERLINEA>);
define sealed domain make (singleton(<LPMIXERCONTROLA>));
define sealed domain initialize (<LPMIXERCONTROLA>);
define sealed domain make (singleton(<LPMIXERLINECONTROLSA>));
define sealed domain initialize (<LPMIXERLINECONTROLSA>);
define sealed domain make (singleton(<LPMIXERCONTROLDETAILS>));
define sealed domain initialize (<LPMIXERCONTROLDETAILS>);
define sealed domain make (singleton(<LPMIXERCONTROLDETAILS-LISTTEXTA>));
define sealed domain initialize (<LPMIXERCONTROLDETAILS-LISTTEXTA>);
define sealed domain make (singleton(<LPMIXERCONTROLDETAILS-BOOLEAN>));
define sealed domain initialize (<LPMIXERCONTROLDETAILS-BOOLEAN>);
define sealed domain make (singleton(<LPMIXERCONTROLDETAILS-SIGNED>));
define sealed domain initialize (<LPMIXERCONTROLDETAILS-SIGNED>);
define sealed domain make (singleton(<LPMIXERCONTROLDETAILS-UNSIGNED>));
define sealed domain initialize (<LPMIXERCONTROLDETAILS-UNSIGNED>);
define sealed domain make (singleton(<LPTIMECAPS>));
define sealed domain initialize (<LPTIMECAPS>);
define sealed domain make (singleton(<LPJOYCAPSA>));
define sealed domain initialize (<LPJOYCAPSA>);
define sealed domain make (singleton(<LPJOYINFO>));
define sealed domain initialize (<LPJOYINFO>);
define sealed domain make (singleton(<LPJOYINFOEX>));
define sealed domain initialize (<LPJOYINFOEX>);
define sealed domain make (singleton(<LPMMIOINFO>));
define sealed domain initialize (<LPMMIOINFO>);
define sealed domain make (singleton(<LPMMCKINFO>));
define sealed domain initialize (<LPMMCKINFO>);
define inline-only constant $MMIOM-READ  = $MMIO-READ;
define inline-only constant $MMIOM-WRITE = $MMIO-WRITE;
define inline-only constant $MCI-FIRST   = $DRV-MCI-FIRST;
define inline-only constant $MCI-DEVTYPE-FIRST = $MCI-DEVTYPE-VCR;
define inline-only constant $MCI-DEVTYPE-LAST =
	$MCI-DEVTYPE-SEQUENCER;
define sealed domain make (singleton(<LPMCI-GENERIC-PARMS>));
define sealed domain initialize (<LPMCI-GENERIC-PARMS>);
define sealed domain make (singleton(<LPMCI-OPEN-PARMSA>));
define sealed domain initialize (<LPMCI-OPEN-PARMSA>);
define sealed domain make (singleton(<LPMCI-PLAY-PARMS>));
define sealed domain initialize (<LPMCI-PLAY-PARMS>);
define sealed domain make (singleton(<LPMCI-SEEK-PARMS>));
define sealed domain initialize (<LPMCI-SEEK-PARMS>);
define sealed domain make (singleton(<LPMCI-STATUS-PARMS>));
define sealed domain initialize (<LPMCI-STATUS-PARMS>);
define sealed domain make (singleton(<LPMCI-INFO-PARMSA>));
define sealed domain initialize (<LPMCI-INFO-PARMSA>);
define sealed domain make (singleton(<LPMCI-GETDEVCAPS-PARMS>));
define sealed domain initialize (<LPMCI-GETDEVCAPS-PARMS>);
define sealed domain make (singleton(<LPMCI-SYSINFO-PARMSA>));
define sealed domain initialize (<LPMCI-SYSINFO-PARMSA>);
define sealed domain make (singleton(<LPMCI-SET-PARMS>));
define sealed domain initialize (<LPMCI-SET-PARMS>);
define sealed domain make (singleton(<LPMCI-BREAK-PARMS>));
define sealed domain initialize (<LPMCI-BREAK-PARMS>);
define sealed domain make (singleton(<LPMCI-SAVE-PARMSA>));
define sealed domain initialize (<LPMCI-SAVE-PARMSA>);
define sealed domain make (singleton(<LPMCI-LOAD-PARMSA>));
define sealed domain initialize (<LPMCI-LOAD-PARMSA>);
define sealed domain make (singleton(<LPMCI-RECORD-PARMS>));
define sealed domain initialize (<LPMCI-RECORD-PARMS>);
define sealed domain make (singleton(<LPMCI-VD-PLAY-PARMS>));
define sealed domain initialize (<LPMCI-VD-PLAY-PARMS>);
define sealed domain make (singleton(<LPMCI-VD-STEP-PARMS>));
define sealed domain initialize (<LPMCI-VD-STEP-PARMS>);
define sealed domain make (singleton(<LPMCI-VD-ESCAPE-PARMSA>));
define sealed domain initialize (<LPMCI-VD-ESCAPE-PARMSA>);
define sealed domain make (singleton(<LPMCI-WAVE-OPEN-PARMSA>));
define sealed domain initialize (<LPMCI-WAVE-OPEN-PARMSA>);
define sealed domain make (singleton(<LPMCI-WAVE-DELETE-PARMS>));
define sealed domain initialize (<LPMCI-WAVE-DELETE-PARMS>);
define sealed domain make (singleton(<LPMCI-WAVE-SET-PARMS>));
define sealed domain initialize (<LPMCI-WAVE-SET-PARMS>);
define sealed domain make (singleton(<LPMCI-SEQ-SET-PARMS>));
define sealed domain initialize (<LPMCI-SEQ-SET-PARMS>);
define sealed domain make (singleton(<LPMCI-ANIM-OPEN-PARMSA>));
define sealed domain initialize (<LPMCI-ANIM-OPEN-PARMSA>);
define sealed domain make (singleton(<LPMCI-ANIM-PLAY-PARMS>));
define sealed domain initialize (<LPMCI-ANIM-PLAY-PARMS>);
define sealed domain make (singleton(<LPMCI-ANIM-STEP-PARMS>));
define sealed domain initialize (<LPMCI-ANIM-STEP-PARMS>);
define sealed domain make (singleton(<LPMCI-ANIM-WINDOW-PARMSA>));
define sealed domain initialize (<LPMCI-ANIM-WINDOW-PARMSA>);
define sealed domain make (singleton(<LPMCI-ANIM-RECT-PARMS>));
define sealed domain initialize (<LPMCI-ANIM-RECT-PARMS>);
define sealed domain make (singleton(<LPMCI-ANIM-UPDATE-PARMS>));
define sealed domain initialize (<LPMCI-ANIM-UPDATE-PARMS>);
define sealed domain make (singleton(<LPMCI-OVLY-OPEN-PARMSA>));
define sealed domain initialize (<LPMCI-OVLY-OPEN-PARMSA>);
define sealed domain make (singleton(<LPMCI-OVLY-WINDOW-PARMSA>));
define sealed domain initialize (<LPMCI-OVLY-WINDOW-PARMSA>);
define sealed domain make (singleton(<LPMCI-OVLY-RECT-PARMS>));
define sealed domain initialize (<LPMCI-OVLY-RECT-PARMS>);
define sealed domain make (singleton(<LPMCI-OVLY-SAVE-PARMSA>));
define sealed domain initialize (<LPMCI-OVLY-SAVE-PARMSA>);
define sealed domain make (singleton(<LPMCI-OVLY-LOAD-PARMSA>));
define sealed domain initialize (<LPMCI-OVLY-LOAD-PARMSA>);
