' **************************************************************************
'
'         Multimedia API Declares adapted from MMSYSTEM.H
'
'         Copyright (c) 1990-1993, Microsoft Corp.  All rights reserved.
'
' **************************************************************************



' ***************************************************************************

'                     General constants and data types

' ****************************************************************************/

'  general constants
Global Const MAXPNAMELEN = 32           '  max product name length (including NULL)
Global Const MAXERRORLENGTH = 128       '  max error text length (including NULL)

Type RECT   ' Same as Windows API
    left As Integer
    top As Integer
    right As Integer
    bottom As Integer
End Type

'  MMTIME data structure

Type SMPTE
    hour As String * 1          '  hours
    min As String * 1           '  minutes
    sec As String * 1           '  seconds
    frame As String * 1         '  frames
    fps As String * 1           '  frames per second
    dummy As String * 1         '  pad
End Type

Type MMTIME
    wType As Integer        '  indicates the contents of units
    units As Long           '  (msecs, samples, bytes)
    SMPTEVal As SMPTE
    songptrpos As Long      '  song pointer position
End Type


'  types for wType field in MMTIME struct
Global Const TIME_MS = &H1              '  time in milliseconds
Global Const TIME_SAMPLES = &H2         '  number of wave samples
Global Const TIME_BYTES = &H4           '  current byte offset
Global Const TIME_SMPTE = &H8           '  SMPTE time
Global Const TIME_MIDI = &H10           '  MIDI time


' ***************************************************************************

'                     Multimedia Extensions Window Messages

' ****************************************************************************/

Global Const MM_JOY1MOVE = &H3A0                    '  joystick
Global Const MM_JOY2MOVE = &H3A1
Global Const MM_JOY1ZMOVE = &H3A2
Global Const MM_JOY2ZMOVE = &H3A3
Global Const MM_JOY1BUTTONDOWN = &H3B5
Global Const MM_JOY2BUTTONDOWN = &H3B6
Global Const MM_JOY1BUTTONUP = &H3B7
Global Const MM_JOY2BUTTONUP = &H3B8

Global Const MM_MCINOTIFY = &H3B9                   '  MCI

Global Const MM_WOM_OPEN = &H3BB                    '  waveform output
Global Const MM_WOM_CLOSE = &H3BC
Global Const MM_WOM_DONE = &H3BD

Global Const MM_WIM_OPEN = &H3BE                    '  waveform input
Global Const MM_WIM_CLOSE = &H3BF
Global Const MM_WIM_DATA = &H3C0

Global Const MM_MIM_OPEN = &H3C1                    '  MIDI input
Global Const MM_MIM_CLOSE = &H3C2
Global Const MM_MIM_DATA = &H3C3
Global Const MM_MIM_LONGDATA = &H3C4
Global Const MM_MIM_ERROR = &H3C5
Global Const MM_MIM_LONGERROR = &H3C6

Global Const MM_MOM_OPEN = &H3C7                    '  MIDI output
Global Const MM_MOM_CLOSE = &H3C8
Global Const MM_MOM_DONE = &H3C9


' ***************************************************************************

'                 String resource number bases (internal use)

' ****************************************************************************/

Global Const MMSYSERR_BASE = 0
Global Const WAVERR_BASE = 32
Global Const MIDIERR_BASE = 64
Global Const TIMERR_BASE = 96
Global Const JOYERR_BASE = 160
Global Const MCIERR_BASE = 256

Global Const MCI_STRING_OFFSET = 512
Global Const MCI_VD_OFFSET = 1024
Global Const MCI_CD_OFFSET = 1088
Global Const MCI_WAVE_OFFSET = 1152
Global Const MCI_SEQ_OFFSET = 1216

' ***************************************************************************

'                         General error return values

' ****************************************************************************/

'  general error return values
Global Const MMSYSERR_NOERROR = 0                          '  no error
Global Const MMSYSERR_ERROR = (MMSYSERR_BASE + 1)          '  unspecified error
Global Const MMSYSERR_BADDEVICEID = (MMSYSERR_BASE + 2)    '  device ID out of range
Global Const MMSYSERR_NOTENABLED = (MMSYSERR_BASE + 3)     '  driver failed enable
Global Const MMSYSERR_ALLOCATED = (MMSYSERR_BASE + 4)      '  device already allocated
Global Const MMSYSERR_INVALHANDLE = (MMSYSERR_BASE + 5)    '  device handle is invalid
Global Const MMSYSERR_NODRIVER = (MMSYSERR_BASE + 6)       '  no device driver present
Global Const MMSYSERR_NOMEM = (MMSYSERR_BASE + 7)          '  memory allocation error
Global Const MMSYSERR_NOTSUPPORTED = (MMSYSERR_BASE + 8)   '  function isn't supported
Global Const MMSYSERR_BADERRNUM = (MMSYSERR_BASE + 9)      '  error value out of range
Global Const MMSYSERR_INVALFLAG = (MMSYSERR_BASE + 10)     '  invalid flag passed
Global Const MMSYSERR_INVALPARAM = (MMSYSERR_BASE + 11)    '  invalid parameter passed
Global Const MMSYSERR_LASTERROR = (MMSYSERR_BASE + 11)     '  last error in range


' ***************************************************************************

'                         Installable driver support

' ****************************************************************************/

'  return values from DriverProc() function
Global Const DRV_CANCEL = &H0
Global Const DRV_OK = &H1
Global Const DRV_RESTART = &H2

'  Driver messages
Global Const DRV_LOAD = &H1
Global Const DRV_ENABLE = &H2
Global Const DRV_OPEN = &H3
Global Const DRV_CLOSE = &H4
Global Const DRV_DISABLE = &H5
Global Const DRV_FREE = &H6
Global Const DRV_CONFIGURE = &H7
Global Const DRV_QUERYCONFIGURE = &H8
Global Const DRV_INSTALL = &H9
Global Const DRV_REMOVE = &HA
Global Const DRV_RESERVED = &H800
Global Const DRV_USER = &H4000

'  LPARAM of DRV_CONFIGURE message
Type DRVCONFIGINFO
	dwDCISize As Long
	lpszDCISectionName As String
	lpszDCIAliasName As String
End Type

'  installable driver function prototypes
Declare Function DrvClose Lib "MMSYSTEM" (ByVal hDriver As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long) As Long
Declare Function DrvOpen Lib "MMSYSTEM" (ByVal szDriverName As String, ByVal szSectionName As String, ByVal lParam2 As Long) As Integer
Declare Function DrvSendMessage Lib "MMSYSTEM" (ByVal hDriver As Integer, ByVal uMessage As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long) As Long
Declare Function DrvGetModuleHandle Lib "MMSYSTEM" (ByVal hDriver As Integer) As Integer
Declare Function DrvDefDriverProc Lib "MMSYSTEM" (ByVal dwDriverIdentifier As Long, ByVal driverID As Integer, ByVal uMessage As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long) As Long


' ***************************************************************************

'                           Driver callback support

' ****************************************************************************/

'  flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and
'  midiOutOpen() to specify the type of the dwCallback parameter.

Global Const CALLBACK_TYPEMASK = &H70000           '  callback type mask
Global Const CALLBACK_NULL = &H0&                  '  no callback
Global Const CALLBACK_WINDOW = &H10000             '  dwCallback is a HWND
Global Const CALLBACK_TASK = &H20000               '  dwCallback is a HTASK
Global Const CALLBACK_FUNCTION = &H30000           '  dwCallback is a FARPROC


' ***************************************************************************

'                          Manufacturer and product IDs
	
'     Used with wMid and wPid fields in WAVEOUTCAPS, WAVEINCAPS,
'     MIDIOUTCAPS, MIDIINCAPS, AUXCAPS, JOYCAPS structures.

' ****************************************************************************/

'  manufacturer IDs
Global Const MM_MICROSOFT = 1                   '  Microsoft Corp.

'  product IDs
Global Const MM_MIDI_MAPPER = 1                 '  MIDI Mapper
Global Const MM_WAVE_MAPPER = 2                 '  Wave Mapper
Global Const MM_SNDBLST_MIDIOUT = 3             '  Sound Blaster MIDI output port
Global Const MM_SNDBLST_MIDIIN = 4              '  Sound Blaster MIDI input port
Global Const MM_SNDBLST_SYNTH = 5               '  Sound Blaster internal synthesizer
Global Const MM_SNDBLST_WAVEOUT = 6             '  Sound Blaster waveform output
Global Const MM_SNDBLST_WAVEIN = 7              '  Sound Blaster waveform input
Global Const MM_ADLIB = 9                       '  Ad Lib-compatible synthesizer
Global Const MM_MPU401_MIDIOUT = 10             '  MPU401-compatible MIDI output port
Global Const MM_MPU401_MIDIIN = 11              '  MPU401-compatible MIDI input port
Global Const MM_PC_JOYSTICK = 12                '  Joystick adapter


' ***************************************************************************

'                     General MMSYSTEM support

' ****************************************************************************/

Declare Function mmsystemGetVersion Lib "MMSYSTEM" () As Integer
Declare Sub OutputDebugStr Lib "MMSYSTEM" (ByVal LPCSTR As String)



' ***************************************************************************

'                             Sound support

' ****************************************************************************/

Declare Function sndPlaySound Lib "MMSYSTEM" (ByVal lpszSoundName As String, ByVal uFlags As Integer) As Integer

'  flag values for wFlags parameter
Global Const SND_SYNC = &H0                 '  play synchronously (default)
Global Const SND_ASYNC = &H1                '  play asynchronously
Global Const SND_NODEFAULT = &H2            '  don't use default sound
Global Const SND_MEMORY = &H4               '  lpszSoundName points to a memory file
Global Const SND_LOOP = &H8                 '  loop the sound until next sndPlaySound
Global Const SND_NOSTOP = &H10              '  don't stop any currently playing sound

' ***************************************************************************

'                         Waveform audio support

' ****************************************************************************/

'  waveform audio error return values
Global Const WAVERR_BADFORMAT = (WAVERR_BASE + 0)          '  unsupported wave format
Global Const WAVERR_STILLPLAYING = (WAVERR_BASE + 1)       '  still something playing
Global Const WAVERR_UNPREPARED = (WAVERR_BASE + 2)         '  header not prepared
Global Const WAVERR_SYNC = (WAVERR_BASE + 3)               '  device is synchronous
Global Const WAVERR_LASTERROR = (WAVERR_BASE + 3)          '  last error in range

'  waveform audio data types

'  wave callback messages
Global Const WOM_OPEN = MM_WOM_OPEN
Global Const WOM_CLOSE = MM_WOM_CLOSE
Global Const WOM_DONE = MM_WOM_DONE
Global Const WIM_OPEN = MM_WIM_OPEN
Global Const WIM_CLOSE = MM_WIM_CLOSE
Global Const WIM_DATA = MM_WIM_DATA

'  device ID for wave device mapper
Global Const WAVE_MAPPER = (-1)

'  flags for dwFlags parameter in waveOutOpen() and waveInOpen()
Global Const WAVE_FORMAT_QUERY = &H1
Global Const WAVE_ALLOWSYNC = &H2

'  wave data block header
Type WAVEHDR
    lpData As Long                 '  pointer to locked data buffer
    dwBufferLength As Long         '  length of data buffer
    dwBytesRecorded As Long        '  used for input only
    dwUser As Long                 '  for client's use
    dwFlags As Long                '  assorted flags (see defines)
    dwLoops As Long                '  loop control counter
    wavehdr_tag As Long            '  reserved for driver
    reserved As Long               '  reserved for driver
End Type

'  flags for dwFlags field of WAVEHDR
Global Const WHDR_DONE = &H1                '  done bit
Global Const WHDR_PREPARED = &H2            '  set if this header has been prepared
Global Const WHDR_BEGINLOOP = &H4           '  loop start block
Global Const WHDR_ENDLOOP = &H8             '  loop end block
Global Const WHDR_INQUEUE = &H10            '  reserved for driver

'  waveform output device capabilities structure
Type WAVEOUTCAPS
    wMid As Integer                  '  manufacturer ID
    wPid As Integer                  '  product ID
    vDriverVersion As Integer        '  version of the driver
    szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
    dwFormats As Long                '  formats supported
    wChannels As Integer             '  number of sources supported
    dwSupport As Long                '  functionality supported by driver
End Type
' typedef WAVEOUTCAPS       *PWAVEOUTCAPS;
' typedef WAVEOUTCAPS NEAR *NPWAVEOUTCAPS;
' typedef WAVEOUTCAPS FAR  *LPWAVEOUTCAPS;

'  flags for dwSupport field of WAVEOUTCAPS
Global Const WAVECAPS_PITCH = &H1                '  supports pitch control
Global Const WAVECAPS_PLAYBACKRATE = &H2         '  supports playback rate control
Global Const WAVECAPS_VOLUME = &H4               '  supports volume control
Global Const WAVECAPS_LRVOLUME = &H8             '  separate left-right volume control
Global Const WAVECAPS_SYNC = &H10

'  waveform input device capabilities structure
Type WAVEINCAPS
    wMid As Integer                    '  manufacturer ID
    wPid As Integer                    '  product ID
    vDriverVersion As Integer          '  version of the driver
    szPname As String * MAXPNAMELEN    '  product name (NULL terminated string)
    dwFormats As Long                  '  formats supported
    wChannels As Integer               '  number of channels supported
End Type

'  defines for dwFormat field of WAVEINCAPS and WAVEOUTCAPS
Global Const WAVE_INVALIDFORMAT = &H0                   '  invalid format
Global Const WAVE_FORMAT_1M08 = &H1                     '  11.025 kHz, Mono,   8-bit
Global Const WAVE_FORMAT_1S08 = &H2                     '  11.025 kHz, Stereo, 8-bit
Global Const WAVE_FORMAT_1M16 = &H4                     '  11.025 kHz, Mono,   16-bit
Global Const WAVE_FORMAT_1S16 = &H8                     '  11.025 kHz, Stereo, 16-bit
Global Const WAVE_FORMAT_2M08 = &H10                    '  22.05  kHz, Mono,   8-bit
Global Const WAVE_FORMAT_2S08 = &H20                    '  22.05  kHz, Stereo, 8-bit
Global Const WAVE_FORMAT_2M16 = &H40                    '  22.05  kHz, Mono,   16-bit
Global Const WAVE_FORMAT_2S16 = &H80                    '  22.05  kHz, Stereo, 16-bit
Global Const WAVE_FORMAT_4M08 = &H100                   '  44.1   kHz, Mono,   8-bit
Global Const WAVE_FORMAT_4S08 = &H200                   '  44.1   kHz, Stereo, 8-bit
Global Const WAVE_FORMAT_4M16 = &H400                   '  44.1   kHz, Mono,   16-bit
Global Const WAVE_FORMAT_4S16 = &H800                   '  44.1   kHz, Stereo, 16-bit

'  general waveform format structure (information common to all formats)
Type WAVEFORMAT
    wFormatTag As Integer     '  format type
    nChannels As Integer      '  number of channels (i.e. mono, stereo, etc.)
    nSamplesPerSec As Long    '  sample rate
    nAvgBytesPerSec As Long   '  for buffer estimation
    nBlockAlign As Integer    '  block size of data
End Type

'  flags for wFormatTag field of WAVEFORMAT
Global Const WAVE_FORMAT_PCM = 1

'  specific waveform format structure for PCM data
Type PCMWAVEFORMAT
    wf As WAVEFORMAT
    wBitsPerSample As Integer
End Type

'  waveform audio function prototypes
Declare Function waveOutGetNumDevs Lib "MMSYSTEM" () As Integer
Declare Function waveOutGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As WAVEOUTCAPS, uSize As Integer) As Integer
Declare Function waveOutGetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpdwvolume As Long) As Integer
Declare Function waveOutSetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, ByVal dwVolume As Long) As Integer
Declare Function waveOutGetErrorText Lib "MMSYSTEM" (ByVal uError As Integer, ByVal lpText As String, ByVal uSize As Integer) As Integer
Declare Function waveOutOpen Lib "MMSYSTEM" (lpWaveout As Integer, ByVal UINT As Integer, lpformat As Integer, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal flags As Long) As Integer
Declare Function waveOutClose Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
Declare Function waveOutPrepareHeader Lib "MMSYSTEM" (ByVal hWaveOut As Integer, WH As WAVEHDR, ByVal uSize As Integer) As Integer
Declare Function waveOutUnprepareHeader Lib "MMSYSTEM" (ByVal hWaveOut As Integer, WH As WAVEHDR, ByVal uSize As Integer) As Integer
Declare Function waveOutWrite Lib "MMSYSTEM" (ByVal hWaveOut As Integer, WH1 As WAVEHDR, ByVal uSize As Integer) As Integer
Declare Function waveOutPause Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
Declare Function waveOutRestart Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
Declare Function waveOutReset Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
Declare Function waveOutBreakLoop Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
Declare Function waveOutGetPosition Lib "MMSYSTEM" (ByVal hWaveOut As Integer, lpinfo As MMTIME, ByVal uSize As Integer) As Integer
Declare Function waveOutGetPitch Lib "MMSYSTEM" (ByVal hWaveOut As Integer, lpdwpitch As Long) As Integer
Declare Function waveOutSetPitch Lib "MMSYSTEM" (ByVal hWaveOut As Integer, ByVal dwPitch As Long) As Integer
Declare Function waveOutGetPlaybackRate Lib "MMSYSTEM" (ByVal hWaveOut As Integer, lpdwrate As Long) As Integer
Declare Function waveOutSetPlaybackRate Lib "MMSYSTEM" (ByVal hWaveOut As Integer, ByVal dwRate As Long) As Integer
Declare Function waveOutGetID Lib "MMSYSTEM" (ByVal hWaveOut As Integer, lpudeviceid As Integer) As Integer
Declare Function waveOutMessage Lib "MMSYSTEM" (ByVal hWaveOut As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long
Declare Function waveInGetNumDevs Lib "MMSYSTEM" () As Integer
Declare Function waveInGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As WAVEINCAPS, ByVal uSize As Integer) As Integer
Declare Function waveInGetErrorText Lib "MMSYSTEM" (ByVal uError As Integer, ByVal lpText As String, ByVal uSize As Integer) As Integer
Declare Function waveInOpen Lib "MMSYSTEM" (lphWaveIn As Integer, ByVal udeviceid As Integer, lpformat As WAVEFORMAT, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Integer
Declare Function waveInClose Lib "MMSYSTEM" (ByVal hWaveIn As Integer) As Integer
Declare Function waveInPrepareHeader Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpWaveInHdr As WAVEHDR, ByVal uSize As Integer) As Integer
Declare Function waveInUnprepareHeader Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpWaveInHdr As WAVEHDR, ByVal uSize As Integer) As Integer
Declare Function waveInAddBuffer Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpWaveInHdr As WAVEHDR, ByVal uSize As Integer) As Integer
Declare Function waveInStart Lib "MMSYSTEM" (ByVal hWaveIn As Integer) As Integer
Declare Function waveInStop Lib "MMSYSTEM" (ByVal hWaveIn As Integer) As Integer
Declare Function waveInReset Lib "MMSYSTEM" (ByVal hWaveIn As Integer) As Integer
Declare Function waveInGetPosition Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpinfo As MMTIME, ByVal uSize As Integer) As Integer
Declare Function waveInGetID Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpudeviceid As Integer) As Integer
Declare Function waveInMessage Lib "MMSYSTEM" (ByVal hWaveIn As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long


' ***************************************************************************

'                             MIDI audio support

' ****************************************************************************/

'  MIDI error return values
Global Const MIDIERR_UNPREPARED = (MIDIERR_BASE + 0)       '  header not prepared
Global Const MIDIERR_STILLPLAYING = (MIDIERR_BASE + 1)     '  still something playing
Global Const MIDIERR_NOMAP = (MIDIERR_BASE + 2)            '  no current map
Global Const MIDIERR_NOTREADY = (MIDIERR_BASE + 3)         '  hardware is still busy
Global Const MIDIERR_NODEVICE = (MIDIERR_BASE + 4)         '  port no longer connected
Global Const MIDIERR_INVALIDSETUP = (MIDIERR_BASE + 5)     '  invalid setup
Global Const MIDIERR_LASTERROR = (MIDIERR_BASE + 5)        '  last error in range

Global Const MIDIPATCHSIZE = 128

'  MIDI callback messages
Global Const MIM_OPEN = MM_MIM_OPEN
Global Const MIM_CLOSE = MM_MIM_CLOSE
Global Const MIM_DATA = MM_MIM_DATA
Global Const MIM_LONGDATA = MM_MIM_LONGDATA
Global Const MIM_ERROR = MM_MIM_ERROR
Global Const MIM_LONGERROR = MM_MIM_LONGERROR
Global Const MOM_OPEN = MM_MOM_OPEN
Global Const MOM_CLOSE = MM_MOM_CLOSE
Global Const MOM_DONE = MM_MOM_DONE

'  device ID for MIDI mapper
Global Const MIDIMAPPER = (-1)
Global Const MIDI_MAPPER = (-1)

'  flags for wFlags parm of midiOutCachePatches(), midiOutCacheDrumPatches()
Global Const MIDI_CACHE_ALL = 1
Global Const MIDI_CACHE_BESTFIT = 2
Global Const MIDI_CACHE_QUERY = 3
Global Const MIDI_UNCACHE = 4

'  MIDI output device capabilities structure
Type MIDIOUTCAPS
    wMid As Integer                  '  manufacturer ID
    wPid As Integer                  '  product ID
    vDriverVersion As Integer        '  version of the driver
    szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
    wTechnology As Integer           '  type of device
    wVoices As Integer               '  # of voices (internal synth only)
    wNotes As Integer                '  max # of notes (internal synth only)
    wChannelMask As Integer          '  channels used (internal synth only)
    dwSupport As Long             '  functionality supported by driver
End Type

'  flags for wTechnology field of MIDIOUTCAPS structure
Global Const MOD_MIDIPORT = 1      '  output port
Global Const MOD_SYNTH = 2         '  generic internal synth
Global Const MOD_SQSYNTH = 3       '  square wave internal synth
Global Const MOD_FMSYNTH = 4       '  FM internal synth
Global Const MOD_MAPPER = 5        '  MIDI mapper

'  flags for dwSupport field of MIDIOUTCAPS structure
Global Const MIDICAPS_VOLUME = &H1               '  supports volume control
Global Const MIDICAPS_LRVOLUME = &H2             '  separate left-right volume control
Global Const MIDICAPS_CACHE = &H4

'  MIDI output device capabilities structure
Type MIDIINCAPS
    wMid As Integer                  '  manufacturer ID
    wPid As Integer                  '  product ID
    vDriverVersion As Integer        '  version of the driver
    szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
End Type

'  MIDI data block header
Type MIDIHDR
    lpData As Long               '  pointer to locked data block
    dwBufferLength As Long       '  length of data in data block
    dwBytesRecorded As Long      '  used for input only
    dwUser As Long               '  for client's use
    dwFlags As Long              '  assorted flags (see defines)
    midihdr_tag As Long          '  reserved for driver
    reserved As Long             '  reserved for driver
End Type

'  flags for dwFlags field of MIDIHDR structure
Global Const MHDR_DONE = &H1                     '  done bit
Global Const MHDR_PREPARED = &H2                 '  set if header prepared
Global Const MHDR_INQUEUE = &H4                  '  reserved for driver

'  MIDI function prototypes
Declare Function midiOutGetNumDevs Lib "MMSYSTEM" () As Integer
Declare Function midiOutGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As MIDIOUTCAPS, ByVal uSize As Integer) As Integer
Declare Function midiOutGetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpdwvolume As Long) As Integer
Declare Function midiOutSetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, ByVal dwVolume As Long) As Integer
Declare Function midiOutGetErrorText Lib "MMSYSTEM" (ByVal uError As Integer, ByVal lpText As String, ByVal uSize As Integer) As Integer
Declare Function midiOutOpen Lib "MMSYSTEM" (lphMidiOut As Integer, ByVal udeviceid As Integer, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Integer
Declare Function midiOutClose Lib "MMSYSTEM" (ByVal hMidiOut As Integer) As Integer
Declare Function midiOutPrepareHeader Lib "MMSYSTEM" (ByVal hMidiOut As Integer, lphMidiOut As MIDIHDR, ByVal uSize As Integer) As Integer
Declare Function midiOutUnprepareHeader Lib "MMSYSTEM" (ByVal hMidiOut As Integer, lphMidiOut As MIDIHDR, ByVal uSize As Integer) As Integer
Declare Function midiOutShortMsg Lib "MMSYSTEM" (ByVal hMidiOut As Integer, ByVal dwMsg As Long) As Integer
Declare Function midiOutLongMsg Lib "MMSYSTEM" (ByVal hMidiOut As Integer, lphMidiOut As MIDIHDR, ByVal uSize As Integer) As Integer
Declare Function midiOutReset Lib "MMSYSTEM" (ByVal hMidiOut As Integer) As Integer
Declare Function midiOutCachePatches Lib "MMSYSTEM" (ByVal hMidiOut As Integer, ByVal uBank As Integer, ByVal PatchArray As Long, ByVal uFlags As Integer) As Integer
Declare Function midiOutCacheDrumPatches Lib "MMSYSTEM" (ByVal hMidiOut As Integer, ByVal uPatch As Integer, lpwKeyArray As Integer, ByVal uFlags As Integer) As Integer
Declare Function midiOutGetID Lib "MMSYSTEM" (ByVal hMidiOut As Integer, lpudeviceid As Integer) As Integer
Declare Function midiOutMessage Lib "MMSYSTEM" (ByVal hMidiOut As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long
Declare Function midiInGetNumDevs Lib "MMSYSTEM" () As Integer
Declare Function midiInGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As MIDIINCAPS, ByVal uSize As Integer) As Integer
Declare Function midiInGetErrorText Lib "MMSYSTEM" (ByVal uError As Integer, ByVal lpText As String, ByVal uSize As Integer) As Integer
Declare Function midiInOpen Lib "MMSYSTEM" (lphMidiIn As Integer, ByVal udeviceid As Integer, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Integer
Declare Function midiInClose Lib "MMSYSTEM" (ByVal hMidiIn As Integer) As Integer
Declare Function midiInPrepareHeader Lib "MMSYSTEM" (ByVal hMidiIn As Integer, lpMidiInHdr As MIDIHDR, ByVal uSize As Integer) As Integer
Declare Function midiInUnprepareHeader Lib "MMSYSTEM" (ByVal hMidiIn As Integer, lpMidiInHdr As MIDIHDR, ByVal uSize As Integer) As Integer
Declare Function midiInAddBuffer Lib "MMSYSTEM" (ByVal hMidiIn As Integer, lpMidiInHdr As MIDIHDR, ByVal uSize As Integer) As Integer
Declare Function midiInStart Lib "MMSYSTEM" (ByVal hMidiIn As Integer) As Integer
Declare Function midiInStop Lib "MMSYSTEM" (ByVal hMidiIn As Integer) As Integer
Declare Function midiInReset Lib "MMSYSTEM" (ByVal hMidiIn As Integer) As Integer
Declare Function midiInGetID Lib "MMSYSTEM" (ByVal hMidiIn As Integer, lpudeviceid As Integer) As Integer
Declare Function midiInMessage Lib "MMSYSTEM" (ByVal hMidiIn As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long


' ***************************************************************************

'                         Auxiliary audio support

' ****************************************************************************/

'  device ID for aux device mapper
Global Const AUX_MAPPER = (-1)

'  Auxiliary audio device capabilities structure
Type AUXCAPS
    wMid As Integer                  '  manufacturer ID
    wPid As Integer                  '  product ID
    vDriverVersion As Integer        '  version of the driver
    szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
    wTechnology As Integer           '  type of device
    dwSupport As Long             '  functionality supported by driver
End Type
' typedef AUXCAPS       *PAUXCAPS;
' typedef AUXCAPS NEAR *NPAUXCAPS;
' typedef AUXCAPS FAR  *LPAUXCAPS;

'  flags for wTechnology field in AUXCAPS structure
Global Const AUXCAPS_CDAUDIO = 1           '  audio from internal CD-ROM drive
Global Const AUXCAPS_AUXIN = 2             '  audio from auxiliary input jacks

'  flags for dwSupport field in AUXCAPS structure
Global Const AUXCAPS_VOLUME = &H1               '  supports volume control
Global Const AUXCAPS_LRVOLUME = &H2             '  separate left-right volume control

'  auxiliary audio function prototypes
Declare Function auxGetNumDevs Lib "MMSYSTEM" () As Integer
Declare Function auxGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As AUXCAPS, ByVal uSize As Integer) As Integer
Declare Function auxSetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, ByVal dwVolume As Long) As Integer
Declare Function auxGetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpdwvolume As Long) As Integer
Declare Function auxOutMessage Lib "MMSYSTEM" (ByVal udeviceid As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long


' ***************************************************************************

'                             Timer support

' ****************************************************************************/

'  timer error return values
Global Const TIMERR_NOERROR = (0)                          '  no error
Global Const TIMERR_NOCANDO = (TIMERR_BASE + 1)            '  request not completed
Global Const TIMERR_STRUCT = (TIMERR_BASE + 33)            '  time struct size

'  flags for wFlags parameter of timeSetEvent() function
Global Const TIME_ONESHOT = 0       '  program timer for single event
Global Const TIME_PERIODIC = 1      '  program for continuous periodic event

'  timer device capabilities data structure
Type TIMECAPS
    wPeriodMin As Integer     '  minimum period supported
    wPeriodMax As Integer     '  maximum period supported
End Type

'  timer function prototypes
Declare Function timeGetSystemTime Lib "MMSYSTEM" (lpTime As MMTIME, ByVal uSize As Integer) As Integer
Declare Function timeGetTime Lib "MMSYSTEM" () As Long
Declare Function timeKillEvent Lib "MMSYSTEM" (ByVal uTimerID As Integer) As Integer
Declare Function timeGetDevCaps Lib "MMSYSTEM" (lpTimeCaps As TIMECAPS, ByVal uSize As Integer) As Integer
Declare Function timeBeginPeriod Lib "MMSYSTEM" (ByVal uPeriod As Integer) As Integer
Declare Function timeEndPeriod Lib "MMSYSTEM" (ByVal uPeriod As Integer) As Integer



' ***************************************************************************

'                             Joystick support

' ****************************************************************************/

'  joystick error return values
Global Const JOYERR_NOERROR = (0)                          '  no error
Global Const JOYERR_PARMS = (JOYERR_BASE + 5)              '  bad parameters
Global Const JOYERR_NOCANDO = (JOYERR_BASE + 6)            '  request not completed
Global Const JOYERR_UNPLUGGED = (JOYERR_BASE + 7)          '  joystick is unplugged

'  constants used with JOYINFO structure and MM_JOY* messages
Global Const JOY_BUTTON1 = &H1
Global Const JOY_BUTTON2 = &H2
Global Const JOY_BUTTON3 = &H4
Global Const JOY_BUTTON4 = &H8
Global Const JOY_BUTTON1CHG = &H100
Global Const JOY_BUTTON2CHG = &H200
Global Const JOY_BUTTON3CHG = &H400
Global Const JOY_BUTTON4CHG = &H800

'  joystick ID constants
Global Const JOYSTICKID1 = 0
Global Const JOYSTICKID2 = 1

'  joystick device capabilities data structure
Type JOYCAPS
    wMid As Integer                  '  manufacturer ID
    wPid As Integer                  '  product ID
    szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
    wXmin As Integer                 '  minimum x position value
    wXmax As Integer                 '  maximum x position value
    wYmin As Integer                 '  minimum y position value
    wYmax As Integer                 '  maximum y position value
    wZmin As Integer                 '  minimum z position value
    wZmax As Integer                 '  maximum z position value
    wNumButtons As Integer           '  number of buttons
    wPeriodMin As Integer            '  minimum message period when captured
    wPeriodMax As Integer            '  maximum message period when captured
End Type

'  joystick information data structure
Type JOYINFO
    wXpos As Integer                 '  x position
    wYpos As Integer                 '  y position
    wZpos As Integer                 '  z position
    wButtons As Integer              '  button states
End Type

'  joystick function prototypes
Declare Function joyGetDevCaps Lib "MMSYSTEM" (ByVal uJoyID As Integer, lpCaps As JOYCAPS, ByVal uSize As Integer) As Integer
Declare Function joyGetNumDevs Lib "MMSYSTEM" () As Integer
Declare Function joyGetPos Lib "MMSYSTEM" (ByVal uJoyID As Integer, lpCaps As JOYINFO) As Integer
Declare Function joyGetThreshold Lib "MMSYSTEM" (ByVal uJoyID As Integer, lputhreshold As Integer) As Integer
Declare Function joyReleaseCapture Lib "MMSYSTEM" (ByVal uJoyID As Integer) As Integer
Declare Function joySetCapture Lib "MMSYSTEM" (ByVal hWnd As Integer, ByVal uJoyID As Integer, ByVal uPeriod As Integer, ByVal bChanged As Integer) As Integer
Declare Function joySetThreshold Lib "MMSYSTEM" (ByVal uJoyID As Integer, ByVal uThreshold As Integer) As Integer

' ***************************************************************************

'                         Multimedia File I/O support

' ****************************************************************************/

'  MMIO error return values
Global Const MMIOERR_BASE = 256
Global Const MMIOERR_FILENOTFOUND = (MMIOERR_BASE + 1)      '  file not found
Global Const MMIOERR_OUTOFMEMORY = (MMIOERR_BASE + 2)       '  out of memory
Global Const MMIOERR_CANNOTOPEN = (MMIOERR_BASE + 3)        '  cannot open
Global Const MMIOERR_CANNOTCLOSE = (MMIOERR_BASE + 4)       '  cannot close
Global Const MMIOERR_CANNOTREAD = (MMIOERR_BASE + 5)        '  cannot read
Global Const MMIOERR_CANNOTWRITE = (MMIOERR_BASE + 6)       '  cannot write
Global Const MMIOERR_CANNOTSEEK = (MMIOERR_BASE + 7)        '  cannot seek
Global Const MMIOERR_CANNOTEXPAND = (MMIOERR_BASE + 8)      '  cannot expand file
Global Const MMIOERR_CHUNKNOTFOUND = (MMIOERR_BASE + 9)     '  chunk not found
Global Const MMIOERR_UNBUFFERED = (MMIOERR_BASE + 10)       '  file is unbuffered

'  MMIO constants
Global Const CFSEPCHAR = "+"    '  compound file name separator char.

'  MMIO data types

'  general MMIO information data structure
Type MMIOINFO
    '  general fields
    dwFlags As Long        '  general status flags
    fccIOProc As Long      '  pointer to I/O procedure
    pIOProc As Long        '  pointer to I/O procedure
    wErrorRet As Integer   '  place for error to be returned
    HTASK As Integer         '  alternate local task

    '  fields maintained by MMIO functions during buffered I/O
    cchBuffer As Long      '  size of I/O buffer (or 0L)
    pchBuffer As String     '  start of I/O buffer (or NULL)
    pchNext As String       '  pointer to next byte to read/write
    pchEndRead As String    '  pointer to last valid byte to read
    pchEndWrite As String   '  pointer to last byte to write
    lBufOffset As Long     '  disk offset of start of buffer

    '  fields maintained by I/O procedure
    lDiskOffset As Long    '  disk offset of next read or write
    adwInfo(3) As Long     '  data specific to type of MMIOPROC

    '  other fields maintained by MMIO
    dwReserved1 As Long    '  reserved for MMIO use
    dwReserved2 As Long    '  reserved for MMIO use
    hmmio As Integer       '  handle to open file
End Type

'  RIFF chunk information data structure
Type MMCKINFO
    ckid As Long           '  chunk ID
    cksize As Long         '  chunk size
    fccType As Long        '  form type or list type
    dwDataOffset As Long   '  offset of data portion of chunk
    dwFlags As Long        '  flags used by MMIO functions
End Type

'  bit field masks
Global Const MMIO_RWMODE = &H3                  '  open file for reading/writing/both
Global Const MMIO_SHAREMODE = &H70              '  file sharing mode number

'  constants for dwFlags field of MMIOINFO
Global Const MMIO_CREATE = &H1000               '  create new file (or truncate file)
Global Const MMIO_PARSE = &H100                 '  parse new file returning path
Global Const MMIO_DELETE = &H200                '  create new file (or truncate file)
Global Const MMIO_EXIST = &H4000                '  checks for existence of file
Global Const MMIO_ALLOCBUF = &H10000            '  mmioOpen() should allocate a buffer
Global Const MMIO_GETTEMP = &H20000             '  mmioOpen() should retrieve temp name

Global Const MMIO_DIRTY = &H10000000            '  I/O buffer is dirty


'  read/write mode numbers (bit field MMIO_RWMODE)
Global Const MMIO_READ = &H0                    '  open file for reading only
Global Const MMIO_WRITE = &H1                   '  open file for writing only
Global Const MMIO_READWRITE = &H2               '  open file for reading and writing

'  share mode numbers (bit field MMIO_SHAREMODE)
Global Const MMIO_COMPAT = &H0                  '  compatibility mode
Global Const MMIO_EXCLUSIVE = &H10              '  exclusive-access mode
Global Const MMIO_DENYWRITE = &H20              '  deny writing to other processes
Global Const MMIO_DENYREAD = &H30               '  deny reading to other processes
Global Const MMIO_DENYNONE = &H40               '  deny nothing to other processes

'  various MMIO flags
Global Const MMIO_FHOPEN = &H10                 '  mmioClose: keep file handle open
Global Const MMIO_EMPTYBUF = &H10               '  mmioFlush: empty the I/O buffer
Global Const MMIO_TOUPPER = &H10                '  mmioStringToFOURCC: to u-case
Global Const MMIO_INSTALLPROC = &H10000         '  mmioInstallIOProc: install MMIOProc
Global Const MMIO_GLOBALPROC = &H10000000       '  mmioInstallIOProc: install globally
Global Const MMIO_REMOVEPROC = &H20000          '  mmioInstallIOProc: remove MMIOProc
Global Const MMIO_FINDPROC = &H40000            '  mmioInstallIOProc: find an MMIOProc
Global Const MMIO_FINDCHUNK = &H10              '  mmioDescend: find a chunk by ID
Global Const MMIO_FINDRIFF = &H20               '  mmioDescend: find a LIST chunk
Global Const MMIO_FINDLIST = &H40               '  mmioDescend: find a RIFF chunk
Global Const MMIO_CREATERIFF = &H20             '  mmioCreateChunk: make a LIST chunk
Global Const MMIO_CREATELIST = &H40             '  mmioCreateChunk: make a RIFF chunk


'  message numbers for MMIOPROC I/O procedure functions
Global Const MMIOM_READ = MMIO_READ             '  read
Global Const MMIOM_WRITE = MMIO_WRITE           '  write
Global Const MMIOM_SEEK = 2                     '  seek to a new position in file
Global Const MMIOM_OPEN = 3                     '  open file
Global Const MMIOM_CLOSE = 4                    '  close file
Global Const MMIOM_WRITEFLUSH = 5               '  write and flush

Global Const MMIOM_RENAME = 6                   '  rename specified file

Global Const MMIOM_USER = &H8000                '  beginning of user-defined messages

'  standard four character codes
Global Const FOURCC_RIFF = "RIFF"
Global Const FOURCC_LIST = "LIST"

'  four character codes used to identify standard built-in I/O procedures
Global Const FOURCC_DOS = "DOS "
Global Const FOURCC_MEM = "MEM "

'  flags for mmioSeek()
Global Const SEEK_SET = 0                       '  seek to an absolute position
Global Const SEEK_CUR = 1                       '  seek relative to current position
Global Const SEEK_END = 2                       '  seek relative to end of file

'  other constants
Global Const MMIO_DEFAULTBUFFER = 8192          '  default buffer size

'  MMIO function prototypes
Declare Function mmioStringToFOURCC Lib "mmsystem" (ByVal sz As String, ByVal uFlags As Integer) As Long
Declare Function mmioOpen Lib "mmsystem" (ByVal szFileName As String, mi As MMIOINFO, lpmmioinfo As MMIOINFO, ByVal dwOpenFlags As Long) As Integer
Declare Function mmioRename Lib "mmsystem" (ByVal szFileName As String, ByVal szNewFileName As String, lpmmioinfo As MMIOINFO, ByVal dwRenameFlags As Long) As Integer
Declare Function mmioClose Lib "mmsystem" (ByVal hmmio As Integer, ByVal uFlags As Integer) As Integer
Declare Function mmioRead Lib "mmsystem" (ByVal hmmio As Integer, ByVal pch As String, ByVal cch As Long) As Long
Declare Function mmioWrite Lib "mmsystem" (ByVal hmmio As Integer, ByVal pch As String, ByVal cch As Long) As Long
Declare Function mmioSeek Lib "mmsystem" (ByVal hmmio As Integer, ByVal lOffset As Long, ByVal iOrigin As Integer) As Long
Declare Function mmioGetInfo Lib "mmsystem" (ByVal hmmio As Integer, lpmmioinfo As MMIOINFO, ByVal uFlags As Integer) As Integer
Declare Function mmioSetInfo Lib "mmsystem" (ByVal hmmio As Integer, lpmmioinfo As MMIOINFO, ByVal uFlags As Integer) As Integer
Declare Function mmioSetBuffer Lib "mmsystem" (ByVal hmmio As Integer, ByVal pchBuffer As String, ByVal cchBuffer As Long, ByVal uFlags As Integer) As Integer
Declare Function mmioFlush Lib "mmsystem" (ByVal hmmio As Integer, ByVal uFlags As Integer) As Integer
Declare Function mmioAdvance Lib "mmsystem" (ByVal hmmio As Integer, lpmmioinfo As MMIOINFO, ByVal uFlags As Integer) As Integer
Declare Function mmioSendMessage Lib "mmsystem" (ByVal hmmio As Integer, ByVal uMessage As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long) As Long
Declare Function mmioDescend Lib "mmsystem" (ByVal hmmio As Integer, lpck As MMCKINFO, lpckParent As MMCKINFO, ByVal uFlags As Integer) As Integer
Declare Function mmioAscend Lib "mmsystem" (ByVal hmmio As Integer, lpck As MMCKINFO, ByVal uFlags As Integer) As Integer
Declare Function mmioCreateChunk Lib "mmsystem" (ByVal hmmio As Integer, lpck As MMCKINFO, ByVal uFlags As Integer) As Integer


' ***************************************************************************

'                             MCI support

' ****************************************************************************/


'  MCI function prototypes
Declare Function mciSendCommand Lib "mmsystem" (ByVal udeviceid As Integer, ByVal uMessage As Integer, ByVal dwParam1 As Long, ByVal dwParam2 As Long) As Long
Declare Function mciSendString Lib "mmsystem" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hWndCallback As Integer) As Long
Declare Function mciGetDeviceID Lib "mmsystem" (ByVal lpstrName As String) As Integer
Declare Function mciGetDeviceIDFromElementID Lib "mmsystem" (ByVal dwElementID As Long, ByVal lpstrType As String) As Integer
Declare Function mciGetErrorString Lib "mmsystem" (ByVal wError As Long, ByVal lpstrBuffer As String, ByVal uLength As Integer) As Integer
Declare Function mciGetCreatorTask Lib "mmsystem" (ByVal udeviceid As Integer) As Integer
Declare Function mciExecute Lib "mmsystem" (ByVal lpstrCommand As String) As Integer

'  MCI error return values
Global Const MCIERR_INVALID_DEVICE_ID = (MCIERR_BASE + 1)
Global Const MCIERR_UNRECOGNIZED_KEYWORD = (MCIERR_BASE + 3)
Global Const MCIERR_UNRECOGNIZED_COMMAND = (MCIERR_BASE + 5)
Global Const MCIERR_HARDWARE = (MCIERR_BASE + 6)
Global Const MCIERR_INVALID_DEVICE_NAME = (MCIERR_BASE + 7)
Global Const MCIERR_OUT_OF_MEMORY = (MCIERR_BASE + 8)
Global Const MCIERR_DEVICE_OPEN = (MCIERR_BASE + 9)
Global Const MCIERR_CANNOT_LOAD_DRIVER = (MCIERR_BASE + 10)
Global Const MCIERR_MISSING_COMMAND_STRING = (MCIERR_BASE + 11)
Global Const MCIERR_PARAM_OVERFLOW = (MCIERR_BASE + 12)
Global Const MCIERR_MISSING_STRING_ARGUMENT = (MCIERR_BASE + 13)
Global Const MCIERR_BAD_INTEGER = (MCIERR_BASE + 14)
Global Const MCIERR_PARSER_INTERNAL = (MCIERR_BASE + 15)
Global Const MCIERR_DRIVER_INTERNAL = (MCIERR_BASE + 16)
Global Const MCIERR_MISSING_PARAMETER = (MCIERR_BASE + 17)
Global Const MCIERR_UNSUPPORTED_FUNCTION = (MCIERR_BASE + 18)
Global Const MCIERR_FILE_NOT_FOUND = (MCIERR_BASE + 19)
Global Const MCIERR_DEVICE_NOT_READY = (MCIERR_BASE + 20)
Global Const MCIERR_INTERNAL = (MCIERR_BASE + 21)
Global Const MCIERR_DRIVER = (MCIERR_BASE + 22)
Global Const MCIERR_CANNOT_USE_ALL = (MCIERR_BASE + 23)
Global Const MCIERR_MULTIPLE = (MCIERR_BASE + 24)
Global Const MCIERR_EXTENSION_NOT_FOUND = (MCIERR_BASE + 25)
Global Const MCIERR_OUTOFRANGE = (MCIERR_BASE + 26)
Global Const MCIERR_FLAGS_NOT_COMPATIBLE = (MCIERR_BASE + 28)
Global Const MCIERR_FILE_NOT_SAVED = (MCIERR_BASE + 30)
Global Const MCIERR_DEVICE_TYPE_REQUIRED = (MCIERR_BASE + 31)
Global Const MCIERR_DEVICE_LOCKED = (MCIERR_BASE + 32)
Global Const MCIERR_DUPLICATE_ALIAS = (MCIERR_BASE + 33)
Global Const MCIERR_BAD_CONSTANT = (MCIERR_BASE + 34)
Global Const MCIERR_MUST_USE_SHAREABLE = (MCIERR_BASE + 35)
Global Const MCIERR_MISSING_DEVICE_NAME = (MCIERR_BASE + 36)
Global Const MCIERR_BAD_TIME_FORMAT = (MCIERR_BASE + 37)
Global Const MCIERR_NO_CLOSING_QUOTE = (MCIERR_BASE + 38)
Global Const MCIERR_DUPLICATE_FLAGS = (MCIERR_BASE + 39)
Global Const MCIERR_INVALID_FILE = (MCIERR_BASE + 40)
Global Const MCIERR_NULL_PARAMETER_BLOCK = (MCIERR_BASE + 41)
Global Const MCIERR_UNNAMED_RESOURCE = (MCIERR_BASE + 42)
Global Const MCIERR_NEW_REQUIRES_ALIAS = (MCIERR_BASE + 43)
Global Const MCIERR_NOTIFY_ON_AUTO_OPEN = (MCIERR_BASE + 44)
Global Const MCIERR_NO_ELEMENT_ALLOWED = (MCIERR_BASE + 45)
Global Const MCIERR_NONAPPLICABLE_FUNCTION = (MCIERR_BASE + 46)
Global Const MCIERR_ILLEGAL_FOR_AUTO_OPEN = (MCIERR_BASE + 47)
Global Const MCIERR_FILENAME_REQUIRED = (MCIERR_BASE + 48)
Global Const MCIERR_EXTRA_CHARACTERS = (MCIERR_BASE + 49)
Global Const MCIERR_DEVICE_NOT_INSTALLED = (MCIERR_BASE + 50)
Global Const MCIERR_GET_CD = (MCIERR_BASE + 51)
Global Const MCIERR_SET_CD = (MCIERR_BASE + 52)
Global Const MCIERR_SET_DRIVE = (MCIERR_BASE + 53)
Global Const MCIERR_DEVICE_LENGTH = (MCIERR_BASE + 54)
Global Const MCIERR_DEVICE_ORD_LENGTH = (MCIERR_BASE + 55)
Global Const MCIERR_NO_INTEGER = (MCIERR_BASE + 56)
Global Const MCIERR_WAVE_OUTPUTSINUSE = (MCIERR_BASE + 64)
Global Const MCIERR_WAVE_SETOUTPUTINUSE = (MCIERR_BASE + 65)
Global Const MCIERR_WAVE_INPUTSINUSE = (MCIERR_BASE + 66)
Global Const MCIERR_WAVE_SETINPUTINUSE = (MCIERR_BASE + 67)
Global Const MCIERR_WAVE_OUTPUTUNSPECIFIED = (MCIERR_BASE + 68)
Global Const MCIERR_WAVE_INPUTUNSPECIFIED = (MCIERR_BASE + 69)
Global Const MCIERR_WAVE_OUTPUTSUNSUITABLE = (MCIERR_BASE + 70)
Global Const MCIERR_WAVE_SETOUTPUTUNSUITABLE = (MCIERR_BASE + 71)
Global Const MCIERR_WAVE_INPUTSUNSUITABLE = (MCIERR_BASE + 72)
Global Const MCIERR_WAVE_SETINPUTUNSUITABLE = (MCIERR_BASE + 73)
Global Const MCIERR_SEQ_DIV_INCOMPATIBLE = (MCIERR_BASE + 80)
Global Const MCIERR_SEQ_PORT_INUSE = (MCIERR_BASE + 81)
Global Const MCIERR_SEQ_PORT_NONEXISTENT = (MCIERR_BASE + 82)
Global Const MCIERR_SEQ_PORT_MAPNODEVICE = (MCIERR_BASE + 83)
Global Const MCIERR_SEQ_PORT_MISCERROR = (MCIERR_BASE + 84)
Global Const MCIERR_SEQ_TIMER = (MCIERR_BASE + 85)
Global Const MCIERR_SEQ_PORTUNSPECIFIED = (MCIERR_BASE + 86)
Global Const MCIERR_SEQ_NOMIDIPRESENT = (MCIERR_BASE + 87)
Global Const MCIERR_NO_WINDOW = (MCIERR_BASE + 90)
Global Const MCIERR_CREATEWINDOW = (MCIERR_BASE + 91)
Global Const MCIERR_FILE_READ = (MCIERR_BASE + 92)
Global Const MCIERR_FILE_WRITE = (MCIERR_BASE + 93)

'  all custom device driver errors must be >= than this value
Global Const MCIERR_CUSTOM_DRIVER_BASE = (MCIERR_BASE + 256)

'  MCI command message identifiers
Global Const MCI_OPEN = &H803
Global Const MCI_CLOSE = &H804
Global Const MCI_ESCAPE = &H805
Global Const MCI_PLAY = &H806
Global Const MCI_SEEK = &H807
Global Const MCI_STOP = &H808
Global Const MCI_PAUSE = &H809
Global Const MCI_INFO = &H80A
Global Const MCI_GETDEVCAPS = &H80B
Global Const MCI_SPIN = &H80C
Global Const MCI_SET = &H80D
Global Const MCI_STEP = &H80E
Global Const MCI_RECORD = &H80F
Global Const MCI_SYSINFO = &H810
Global Const MCI_BREAK = &H811
Global Const MCI_SOUND = &H812
Global Const MCI_SAVE = &H813
Global Const MCI_STATUS = &H814
Global Const MCI_CUE = &H830
Global Const MCI_REALIZE = &H840
Global Const MCI_WINDOW = &H841
Global Const MCI_PUT = &H842
Global Const MCI_WHERE = &H843
Global Const MCI_FREEZE = &H844
Global Const MCI_UNFREEZE = &H845
Global Const MCI_LOAD = &H850
Global Const MCI_CUT = &H851
Global Const MCI_COPY = &H852
Global Const MCI_PASTE = &H853
Global Const MCI_UPDATE = &H854
Global Const MCI_RESUME = &H855
Global Const MCI_DELETE = &H856

'  device ID for "all devices"
Global Const MCI_ALL_DEVICE_ID = &HFFFF

'  constants for predefined MCI device types
Global Const MCI_DEVTYPE_VCR = (MCI_STRING_OFFSET + 1)
Global Const MCI_DEVTYPE_VIDEODISC = (MCI_STRING_OFFSET + 2)
Global Const MCI_DEVTYPE_OVERLAY = (MCI_STRING_OFFSET + 3)
Global Const MCI_DEVTYPE_CD_AUDIO = (MCI_STRING_OFFSET + 4)
Global Const MCI_DEVTYPE_DAT = (MCI_STRING_OFFSET + 5)
Global Const MCI_DEVTYPE_SCANNER = (MCI_STRING_OFFSET + 6)
Global Const MCI_DEVTYPE_ANIMATION = (MCI_STRING_OFFSET + 7)
Global Const MCI_DEVTYPE_DIGITAL_VIDEO = (MCI_STRING_OFFSET + 8)
Global Const MCI_DEVTYPE_OTHER = (MCI_STRING_OFFSET + 9)
Global Const MCI_DEVTYPE_WAVEFORM_AUDIO = (MCI_STRING_OFFSET + 10)
Global Const MCI_DEVTYPE_SEQUENCER = (MCI_STRING_OFFSET + 11)

Global Const MCI_DEVTYPE_FIRST = MCI_DEVTYPE_VCR
Global Const MCI_DEVTYPE_LAST = MCI_DEVTYPE_SEQUENCER

'  return values for 'status mode' command
Global Const MCI_MODE_NOT_READY = (MCI_STRING_OFFSET + 12)
Global Const MCI_MODE_STOP = (MCI_STRING_OFFSET + 13)
Global Const MCI_MODE_PLAY = (MCI_STRING_OFFSET + 14)
Global Const MCI_MODE_RECORD = (MCI_STRING_OFFSET + 15)
Global Const MCI_MODE_SEEK = (MCI_STRING_OFFSET + 16)
Global Const MCI_MODE_PAUSE = (MCI_STRING_OFFSET + 17)
Global Const MCI_MODE_OPEN = (MCI_STRING_OFFSET + 18)

'  constants used in 'set time format' and 'status time format' commands
Global Const MCI_FORMAT_MILLISECONDS = 0
Global Const MCI_FORMAT_HMS = 1
Global Const MCI_FORMAT_MSF = 2
Global Const MCI_FORMAT_FRAMES = 3
Global Const MCI_FORMAT_SMPTE_24 = 4
Global Const MCI_FORMAT_SMPTE_25 = 5
Global Const MCI_FORMAT_SMPTE_30 = 6
Global Const MCI_FORMAT_SMPTE_30DROP = 7
Global Const MCI_FORMAT_BYTES = 8
Global Const MCI_FORMAT_SAMPLES = 9
Global Const MCI_FORMAT_TMSF = 10

'  MCI time format conversion macros

'  flags for wParam of MM_MCINOTIFY message
Global Const MCI_NOTIFY_SUCCESSFUL = &H1
Global Const MCI_NOTIFY_SUPERSEDED = &H2
Global Const MCI_NOTIFY_ABORTED = &H4
Global Const MCI_NOTIFY_FAILURE = &H8


'  common flags for dwFlags parameter of MCI command messages
Global Const MCI_NOTIFY = &H1&
Global Const MCI_WAIT = &H2&
Global Const MCI_FROM = &H4&
Global Const MCI_TO = &H8&
Global Const MCI_TRACK = &H10&

'  flags for dwFlags parameter of MCI_OPEN command message
Global Const MCI_OPEN_SHAREABLE = &H100&
Global Const MCI_OPEN_ELEMENT = &H200&
Global Const MCI_OPEN_ALIAS = &H400&
Global Const MCI_OPEN_ELEMENT_ID = &H800&
Global Const MCI_OPEN_TYPE_ID = &H1000&
Global Const MCI_OPEN_TYPE = &H2000&

'  flags for dwFlags parameter of MCI_SEEK command message
Global Const MCI_SEEK_TO_START = &H100&
Global Const MCI_SEEK_TO_END = &H200&

'  flags for dwFlags parameter of MCI_STATUS command message
Global Const MCI_STATUS_ITEM = &H100&
Global Const MCI_STATUS_START = &H200&

'  flags for dwItem field of the MCI_STATUS_PARMS parameter block
Global Const MCI_STATUS_LENGTH = &H1&
Global Const MCI_STATUS_POSITION = &H2&
Global Const MCI_STATUS_NUMBER_OF_TRACKS = &H3&
Global Const MCI_STATUS_MODE = &H4&
Global Const MCI_STATUS_MEDIA_PRESENT = &H5&
Global Const MCI_STATUS_TIME_FORMAT = &H6&
Global Const MCI_STATUS_READY = &H7&
Global Const MCI_STATUS_CURRENT_TRACK = &H8&

'  flags for dwFlags parameter of MCI_INFO command message
Global Const MCI_INFO_PRODUCT = &H100&
Global Const MCI_INFO_FILE = &H200&

'  flags for dwFlags parameter of MCI_GETDEVCAPS command message
Global Const MCI_GETDEVCAPS_ITEM = &H100&

'  flags for dwItem field of the MCI_GETDEVCAPS_PARMS parameter block
Global Const MCI_GETDEVCAPS_CAN_RECORD = &H1&
Global Const MCI_GETDEVCAPS_HAS_AUDIO = &H2&
Global Const MCI_GETDEVCAPS_HAS_VIDEO = &H3&
Global Const MCI_GETDEVCAPS_DEVICE_TYPE = &H4&
Global Const MCI_GETDEVCAPS_USES_FILES = &H5&
Global Const MCI_GETDEVCAPS_COMPOUND_DEVICE = &H6&
Global Const MCI_GETDEVCAPS_CAN_EJECT = &H7&
Global Const MCI_GETDEVCAPS_CAN_PLAY = &H8&
Global Const MCI_GETDEVCAPS_CAN_SAVE = &H9&

'  flags for dwFlags parameter of MCI_SYSINFO command message
Global Const MCI_SYSINFO_QUANTITY = &H100&
Global Const MCI_SYSINFO_OPEN = &H200&
Global Const MCI_SYSINFO_NAME = &H400&
Global Const MCI_SYSINFO_INSTALLNAME = &H800&

'  flags for dwFlags parameter of MCI_SET command message
Global Const MCI_SET_DOOR_OPEN = &H100&
Global Const MCI_SET_DOOR_CLOSED = &H200&
Global Const MCI_SET_TIME_FORMAT = &H400&
Global Const MCI_SET_AUDIO = &H800&
Global Const MCI_SET_VIDEO = &H1000&
Global Const MCI_SET_ON = &H2000&
Global Const MCI_SET_OFF = &H4000&

'  flags for dwAudio field of MCI_SET_PARMS or MCI_SEQ_SET_PARMS
Global Const MCI_SET_AUDIO_ALL = &H0&
Global Const MCI_SET_AUDIO_LEFT = &H1&
Global Const MCI_SET_AUDIO_RIGHT = &H2&

'  flags for dwFlags parameter of MCI_BREAK command message
Global Const MCI_BREAK_KEY = &H100&
Global Const MCI_BREAK_HWND = &H200&
Global Const MCI_BREAK_OFF = &H400&

'  flags for dwFlags parameter of MCI_RECORD command message
Global Const MCI_RECORD_INSERT = &H100&
Global Const MCI_RECORD_OVERWRITE = &H200&

'  flags for dwFlags parameter of MCI_SOUND command message
Global Const MCI_SOUND_NAME = &H100&

'  flags for dwFlags parameter of MCI_SAVE command message
Global Const MCI_SAVE_FILE = &H100&

'  flags for dwFlags parameter of MCI_LOAD command message
Global Const MCI_LOAD_FILE = &H100&

'  generic parameter block for MCI command messages with no special parameters
Type MCI_GENERIC_PARMS
	dwCallback As Long
End Type
' typedef MCI_GENERIC_PARMS FAR *LPMCI_GENERIC_PARMS;

'  parameter block for MCI_OPEN command message
Type MCI_OPEN_PARMS
    dwCallback As Long
    wDeviceID As Integer
    wReserved0 As Integer
    lpstrDeviceType As String
    lpstrElementName As String
    lpstrAlias As String
End Type

'  parameter block for MCI_PLAY command message
Type MCI_PLAY_PARMS
    dwCallback As Long
    dwFrom As Long
    dwTo As Long
End Type

'  parameter block for MCI_SEEK command message
Type MCI_SEEK_PARMS
    dwCallback As Long
    dwTo As Long
End Type

'  parameter block for MCI_STATUS command message
Type MCI_STATUS_PARMS
    dwCallback As Long
    dwReturn As Long
    dwItem As Long
    dwTrack As Long
End Type

'  parameter block for MCI_INFO command message
Type MCI_INFO_PARMS
    dwCallback As Long
    lpstrReturn As Long
    dwRetSize As Long
End Type

'  parameter block for MCI_GETDEVCAPS command message
Type MCI_GETDEVCAPS_PARMS
    dwCallback As Long
    dwReturn As Long
    dwItem As Long
End Type

'  parameter block for MCI_SYSINFO command message
Type MCI_SYSINFO_PARMS
    dwCallback As Long
    lpstrReturn As Long
    dwRetSize As Long
    dwNumber As Long
    wDeviceType As Integer
    wReserved0 As Integer
End Type

'  parameter block for MCI_SET command message
Type MCI_SET_PARMS
    dwCallback As Long
    dwTimeFormat As Long
    dwAudio As Long
End Type

'  parameter block for MCI_BREAK command message
Type MCI_BREAK_PARMS
    dwCallback As Long
    nVirtKey As Integer
    wReserved0 As Integer
    hwndBreak As Integer
    wReserved1 As Integer
End Type

'  parameter block for MCI_SOUND command message
Type MCI_SOUND_PARMS
    dwCallback As Long
    lpstrSoundName As String
End Type

'  parameter block for MCI_SAVE command message
Type MCI_SAVE_PARMS
    dwCallback As Long
    lpfilename As String
End Type

'  parameter block for MCI_LOAD command message
Type MCI_LOAD_PARMS
    dwCallback As Long
    lpfilename As String
End Type

'  parameter block for MCI_RECORD command message
Type MCI_RECORD_PARMS
    dwCallback As Long
    dwFrom As Long
    dwTo As Long
End Type


'  MCI extensions for videodisc devices

'  flag for dwReturn field of MCI_STATUS_PARMS
Global Const MCI_VD_MODE_PARK = (MCI_VD_OFFSET + 1)

'  flag for dwReturn field of MCI_STATUS_PARMS
Global Const MCI_VD_MEDIA_CLV = (MCI_VD_OFFSET + 2)
Global Const MCI_VD_MEDIA_CAV = (MCI_VD_OFFSET + 3)
Global Const MCI_VD_MEDIA_OTHER = (MCI_VD_OFFSET + 4)
Global Const MCI_VD_FORMAT_TRACK = &H4001

'  flags for dwFlags parameter of MCI_PLAY command message
Global Const MCI_VD_PLAY_REVERSE = &H10000
Global Const MCI_VD_PLAY_FAST = &H20000
Global Const MCI_VD_PLAY_SPEED = &H40000
Global Const MCI_VD_PLAY_SCAN = &H80000
Global Const MCI_VD_PLAY_SLOW = &H100000

'  flag for dwFlags parameter of MCI_SEEK command message
Global Const MCI_VD_SEEK_REVERSE = &H10000

'  flags for dwItem field of MCI_STATUS_PARMS parameter block
Global Const MCI_VD_STATUS_SPEED = &H4002&
Global Const MCI_VD_STATUS_FORWARD = &H4003&
Global Const MCI_VD_STATUS_MEDIA_TYPE = &H4004&
Global Const MCI_VD_STATUS_SIDE = &H4005&
Global Const MCI_VD_STATUS_DISC_SIZE = &H4006&

'  flags for dwFlags parameter of MCI_GETDEVCAPS command message
Global Const MCI_VD_GETDEVCAPS_CLV = &H10000
Global Const MCI_VD_GETDEVCAPS_CAV = &H20000

Global Const MCI_VD_SPIN_UP = &H10000
Global Const MCI_VD_SPIN_DOWN = &H20000

'  flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
Global Const MCI_VD_GETDEVCAPS_CAN_REVERSE = &H4002&
Global Const MCI_VD_GETDEVCAPS_FAST_RATE = &H4003&
Global Const MCI_VD_GETDEVCAPS_SLOW_RATE = &H4004&
Global Const MCI_VD_GETDEVCAPS_NORMAL_RATE = &H4005&

'  flags for the dwFlags parameter of MCI_STEP command message
Global Const MCI_VD_STEP_FRAMES = &H10000
Global Const MCI_VD_STEP_REVERSE = &H20000

'  flag for the MCI_ESCAPE command message
Global Const MCI_VD_ESCAPE_STRING = &H100&

'  parameter block for MCI_PLAY command message
Type MCI_VD_PLAY_PARMS
    dwCallback As Long
    dwFrom As Long
    dwTo As Long
    dwSpeed As Long
End Type

'  parameter block for MCI_STEP command message
Type MCI_VD_STEP_PARMS
    dwCallback As Long
    dwFrames As Long
End Type

'  parameter block for MCI_ESCAPE command message
Type MCI_VD_ESCAPE_PARMS
    dwCallback As Long
    lpstrCommand As String
End Type


'  MCI extensions for waveform audio devices

'  flags for the dwFlags parameter of MCI_OPEN command message
Global Const MCI_WAVE_OPEN_BUFFER = &H10000

'  flags for the dwFlags parameter of MCI_SET command message
Global Const MCI_WAVE_SET_FORMATTAG = &H10000
Global Const MCI_WAVE_SET_CHANNELS = &H20000
Global Const MCI_WAVE_SET_SAMPLESPERSEC = &H40000
Global Const MCI_WAVE_SET_AVGBYTESPERSEC = &H80000
Global Const MCI_WAVE_SET_BLOCKALIGN = &H100000
Global Const MCI_WAVE_SET_BITSPERSAMPLE = &H200000

'  flags for the dwFlags parameter of MCI_STATUS, MCI_SET command messages
Global Const MCI_WAVE_INPUT = &H400000
Global Const MCI_WAVE_OUTPUT = &H800000

'  flags for the dwItem field of MCI_STATUS_PARMS parameter block
Global Const MCI_WAVE_STATUS_FORMATTAG = &H4001&
Global Const MCI_WAVE_STATUS_CHANNELS = &H4002&
Global Const MCI_WAVE_STATUS_SAMPLESPERSEC = &H4003&
Global Const MCI_WAVE_STATUS_AVGBYTESPERSEC = &H4004&
Global Const MCI_WAVE_STATUS_BLOCKALIGN = &H4005&
Global Const MCI_WAVE_STATUS_BITSPERSAMPLE = &H4006&
Global Const MCI_WAVE_STATUS_LEVEL = &H4007&

'  flags for the dwFlags parameter of MCI_SET command message
Global Const MCI_WAVE_SET_ANYINPUT = &H4000000
Global Const MCI_WAVE_SET_ANYOUTPUT = &H8000000

'  flags for the dwFlags parameter of MCI_GETDEVCAPS command message
Global Const MCI_WAVE_GETDEVCAPS_INPUTS = &H4001&
Global Const MCI_WAVE_GETDEVCAPS_OUTPUTS = &H4002&

'  parameter block for MCI_OPEN command message
Type MCI_WAVE_OPEN_PARMS
    dwCallback As Long
    wDeviceID As Integer
    wReserved0 As Integer
    lpstrDeviceType As String
    lpstrElementName As String
    lpstrAlias As String
    dwBufferSeconds As Long
End Type

'  parameter block for MCI_DELETE command message
Type MCI_WAVE_DELETE_PARMS
    dwCallback As Long
    dwFrom As Long
    dwTo As Long
End Type
' typedef MCI_WAVE_DELETE_PARMS FAR *LPMCI_WAVE_DELETE_PARMS;

'  parameter block for MCI_SET command message
Type MCI_WAVE_SET_PARMS
    dwCallback As Long
    dwTimeFormat As Long
    dwAudio As Long
    wInput As Integer
    wReserved0 As Integer
    wOutput As Integer
    wReserved1 As Integer
    wFormatTag As Integer
    wReserved2 As Integer
    nChannels As Integer
    wReserved3 As Integer
    nSamplesPerSec As Long
    nAvgBytesPerSec As Long
    nBlockAlign As Integer
    wReserved4 As Integer
    wBitsPerSample As Integer
    wReserved5 As Integer
End Type


'  MCI extensions for MIDI sequencer devices

'  flags for the dwReturn field of MCI_STATUS_PARMS parameter block
Global Const MCI_SEQ_DIV_PPQN = (0 + MCI_SEQ_OFFSET)
Global Const MCI_SEQ_DIV_SMPTE_24 = (1 + MCI_SEQ_OFFSET)
Global Const MCI_SEQ_DIV_SMPTE_25 = (2 + MCI_SEQ_OFFSET)
Global Const MCI_SEQ_DIV_SMPTE_30DROP = (3 + MCI_SEQ_OFFSET)
Global Const MCI_SEQ_DIV_SMPTE_30 = (4 + MCI_SEQ_OFFSET)

'  flags for the dwMaster field of MCI_SEQ_SET_PARMS parameter block
Global Const MCI_SEQ_FORMAT_SONGPTR = &H4001
Global Const MCI_SEQ_FILE = &H4002
Global Const MCI_SEQ_MIDI = &H4003
Global Const MCI_SEQ_SMPTE = &H4004
Global Const MCI_SEQ_NONE = 65533

'  flags for the dwItem field of MCI_STATUS_PARMS parameter block
Global Const MCI_SEQ_STATUS_TEMPO = &H4002&
Global Const MCI_SEQ_STATUS_PORT = &H4003&
Global Const MCI_SEQ_STATUS_SLAVE = &H4007&
Global Const MCI_SEQ_STATUS_MASTER = &H4008&
Global Const MCI_SEQ_STATUS_OFFSET = &H4009&
Global Const MCI_SEQ_STATUS_DIVTYPE = &H400A&

'  flags for the dwFlags parameter of MCI_SET command message
Global Const MCI_SEQ_SET_TEMPO = &H10000
Global Const MCI_SEQ_SET_PORT = &H20000
Global Const MCI_SEQ_SET_SLAVE = &H40000
Global Const MCI_SEQ_SET_MASTER = &H80000
Global Const MCI_SEQ_SET_OFFSET = &H1000000

'  parameter block for MCI_SET command message
Type MCI_SEQ_SET_PARMS
    dwCallback As Long
    dwTimeFormat As Long
    dwAudio As Long
    dwTempo As Long
    dwPort As Long
    dwSlave As Long
    dwMaster As Long
    dwOffset As Long
End Type


'  MCI extensions for animation devices

'  flags for dwFlags parameter of MCI_OPEN command message
Global Const MCI_ANIM_OPEN_WS = &H10000
Global Const MCI_ANIM_OPEN_PARENT = &H20000
Global Const MCI_ANIM_OPEN_NOSTATIC = &H40000

'  flags for dwFlags parameter of MCI_PLAY command message
Global Const MCI_ANIM_PLAY_SPEED = &H10000
Global Const MCI_ANIM_PLAY_REVERSE = &H20000
Global Const MCI_ANIM_PLAY_FAST = &H40000
Global Const MCI_ANIM_PLAY_SLOW = &H80000
Global Const MCI_ANIM_PLAY_SCAN = &H100000

'  flags for dwFlags parameter of MCI_STEP command message
Global Const MCI_ANIM_STEP_REVERSE = &H10000
Global Const MCI_ANIM_STEP_FRAMES = &H20000

'  flags for dwItem field of MCI_STATUS_PARMS parameter block
Global Const MCI_ANIM_STATUS_SPEED = &H4001&
Global Const MCI_ANIM_STATUS_FORWARD = &H4002&
Global Const MCI_ANIM_STATUS_HWND = &H4003&
Global Const MCI_ANIM_STATUS_HPAL = &H4004&
Global Const MCI_ANIM_STATUS_STRETCH = &H4005&

'  flags for the dwFlags parameter of MCI_INFO command message
Global Const MCI_ANIM_INFO_TEXT = &H10000

'  flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
Global Const MCI_ANIM_GETDEVCAPS_CAN_REVERSE = &H4001&
Global Const MCI_ANIM_GETDEVCAPS_FAST_RATE = &H4002&
Global Const MCI_ANIM_GETDEVCAPS_SLOW_RATE = &H4003&
Global Const MCI_ANIM_GETDEVCAPS_NORMAL_RATE = &H4004&
Global Const MCI_ANIM_GETDEVCAPS_PALETTES = &H4006&
Global Const MCI_ANIM_GETDEVCAPS_CAN_STRETCH = &H4007&
Global Const MCI_ANIM_GETDEVCAPS_MAX_WINDOWS = &H4008&

'  flags for the MCI_REALIZE command message
Global Const MCI_ANIM_REALIZE_NORM = &H10000
Global Const MCI_ANIM_REALIZE_BKGD = &H20000

'  flags for dwFlags parameter of MCI_WINDOW command message
Global Const MCI_ANIM_WINDOW_HWND = &H10000
Global Const MCI_ANIM_WINDOW_STATE = &H40000
Global Const MCI_ANIM_WINDOW_TEXT = &H80000
Global Const MCI_ANIM_WINDOW_ENABLE_STRETCH = &H100000
Global Const MCI_ANIM_WINDOW_DISABLE_STRETCH = &H200000

'  flags for hWnd field of MCI_ANIM_WINDOW_PARMS parameter block
Global Const MCI_ANIM_WINDOW_DEFAULT = &H0&

'  flags for dwFlags parameter of MCI_PUT command message
Global Const MCI_ANIM_RECT = &H10000
Global Const MCI_ANIM_PUT_SOURCE = &H20000
Global Const MCI_ANIM_PUT_DESTINATION = &H40000

'  flags for dwFlags parameter of MCI_WHERE command message
Global Const MCI_ANIM_WHERE_SOURCE = &H20000
Global Const MCI_ANIM_WHERE_DESTINATION = &H40000

'  flags for dwFlags parameter of MCI_UPDATE command message
Global Const MCI_ANIM_UPDATE_HDC = &H20000

'  parameter block for MCI_OPEN command message
Type MCI_ANIM_OPEN_PARMS
    dwCallback As Long
    wDeviceID As Integer
    wReserved0 As Integer
    lpstrDeviceType As String
    lpstrElementName As String
    lpstrAlias As String
    dwStyle As Long
    hWndParent As Integer
    wReserved1 As Integer
End Type

'  parameter block for MCI_PLAY command message
Type MCI_ANIM_PLAY_PARMS
    dwCallback As Long
    dwFrom As Long
    dwTo As Long
    dwSpeed As Long
End Type

'  parameter block for MCI_STEP command message
Type MCI_ANIM_STEP_PARMS
    dwCallback As Long
    dwFrames As Long
End Type

'  parameter block for MCI_WINDOW command message
Type MCI_ANIM_WINDOW_PARMS
    dwCallback As Long
    hWnd As Integer
    wReserved1 As Integer
    nCmdShow As Integer
    wReserved2 As Integer
    lpstrText As String
End Type

'  parameter block for MCI_PUT, MCI_UPDATE, MCI_WHERE command messages
Type MCI_ANIM_RECT_PARMS
    dwCallback As Long
    rc As RECT
End Type

'  parameter block for MCI_UPDATE PARMS
Type MCI_ANIM_UPDATE_PARMS
    dwCallback As Long
    rc As RECT
    hDC As Integer
End Type


'  MCI extensions for video overlay devices

'  flags for dwFlags parameter of MCI_OPEN command message
Global Const MCI_OVLY_OPEN_WS = &H10000
Global Const MCI_OVLY_OPEN_PARENT = &H20000

'  flags for dwFlags parameter of MCI_STATUS command message
Global Const MCI_OVLY_STATUS_HWND = &H4001&
Global Const MCI_OVLY_STATUS_STRETCH = &H4002&

'  flags for dwFlags parameter of MCI_INFO command message
Global Const MCI_OVLY_INFO_TEXT = &H10000

'  flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
Global Const MCI_OVLY_GETDEVCAPS_CAN_STRETCH = &H4001&
Global Const MCI_OVLY_GETDEVCAPS_CAN_FREEZE = &H4002&
Global Const MCI_OVLY_GETDEVCAPS_MAX_WINDOWS = &H4003&

'  flags for dwFlags parameter of MCI_WINDOW command message
Global Const MCI_OVLY_WINDOW_HWND = &H10000
Global Const MCI_OVLY_WINDOW_STATE = &H40000
Global Const MCI_OVLY_WINDOW_TEXT = &H80000
Global Const MCI_OVLY_WINDOW_ENABLE_STRETCH = &H100000
Global Const MCI_OVLY_WINDOW_DISABLE_STRETCH = &H200000

'  flags for hWnd parameter of MCI_OVLY_WINDOW_PARMS parameter block
Global Const MCI_OVLY_WINDOW_DEFAULT = &H0&

'  flags for dwFlags parameter of MCI_PUT command message
Global Const MCI_OVLY_RECT = &H10000
Global Const MCI_OVLY_PUT_SOURCE = &H20000
Global Const MCI_OVLY_PUT_DESTINATION = &H40000
Global Const MCI_OVLY_PUT_FRAME = &H80000
Global Const MCI_OVLY_PUT_VIDEO = &H100000

'  flags for dwFlags parameter of MCI_WHERE command message
Global Const MCI_OVLY_WHERE_SOURCE = &H20000
Global Const MCI_OVLY_WHERE_DESTINATION = &H40000
Global Const MCI_OVLY_WHERE_FRAME = &H80000
Global Const MCI_OVLY_WHERE_VIDEO = &H100000

'  parameter block for MCI_OPEN command message
Type MCI_OVLY_OPEN_PARMS
    dwCallback As Long
    wDeviceID As Integer
    wReserved0 As Integer
    lpstrDeviceType As String
    lpstrElementName As String
    lpstrAlias As String
    dwStyle As Long
    hWndParent As Integer
    wReserved1 As Integer
End Type

'  parameter block for MCI_WINDOW command message
Type MCI_OVLY_WINDOW_PARMS
    dwCallback As Long
    hWnd As Integer
    wReserved1 As Integer
    nCmdShow As Integer
    wReserved2 As Integer
    lpstrText As String
End Type

'  parameter block for MCI_PUT, MCI_UPDATE, and MCI_WHERE command messages
Type MCI_OVLY_RECT_PARMS
    dwCallback As Long
    rc As RECT
End Type

'  parameter block for MCI_SAVE command message
Type MCI_OVLY_SAVE_PARMS
    dwCallback As Long
    lpfilename As String
    rc As RECT
End Type

'  parameter block for MCI_LOAD command message
Type MCI_OVLY_LOAD_PARMS
    dwCallback As Long
    lpfilename As String
    rc As RECT
End Type


' ***************************************************************************

'                         DISPLAY Driver extensions

' ****************************************************************************/

Global Const CAPS1 = 94                     '  other caps
Global Const C1_TRANSPARENT = &H1           '  new raster cap
Global Const NEWTRANSPARENT = 3             '  use with SetBkMode()
Global Const QUERYROPSUPPORT = 40           '  use to determine ROP support

' ***************************************************************************

'                         DIB Driver extensions

' ****************************************************************************/

Global Const SELECTDIB = 41                             '  DIB.DRV select dib escape


' ***************************************************************************

'                         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().

' ****************************************************************************/


Global Const SC_SCREENSAVE = &HF140

