home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l405 / 5.ddi / WINMMSYS.TX_ / WINMMSYS.bin
Encoding:
Text File  |  1993-04-28  |  68.7 KB  |  1,580 lines

  1. ' **************************************************************************
  2. '
  3. '         Multimedia API Declares adapted from MMSYSTEM.H
  4. '
  5. '         Copyright (c) 1990-1993, Microsoft Corp.  All rights reserved.
  6. '
  7. ' **************************************************************************
  8.  
  9.  
  10.  
  11. ' ***************************************************************************
  12.  
  13. '                     General constants and data types
  14.  
  15. ' ****************************************************************************/
  16.  
  17. '  general constants
  18. Global Const MAXPNAMELEN = 32           '  max product name length (including NULL)
  19. Global Const MAXERRORLENGTH = 128       '  max error text length (including NULL)
  20.  
  21. Type RECT   ' Same as Windows API
  22.     left As Integer
  23.     top As Integer
  24.     right As Integer
  25.     bottom As Integer
  26. End Type
  27.  
  28. '  MMTIME data structure
  29.  
  30. Type SMPTE
  31.     hour As String * 1          '  hours
  32.     min As String * 1           '  minutes
  33.     sec As String * 1           '  seconds
  34.     frame As String * 1         '  frames
  35.     fps As String * 1           '  frames per second
  36.     dummy As String * 1         '  pad
  37. End Type
  38.  
  39. Type MMTIME
  40.     wType As Integer        '  indicates the contents of units
  41.     units As Long           '  (msecs, samples, bytes)
  42.     SMPTEVal As SMPTE
  43.     songptrpos As Long      '  song pointer position
  44. End Type
  45.  
  46.  
  47. '  types for wType field in MMTIME struct
  48. Global Const TIME_MS = &H1              '  time in milliseconds
  49. Global Const TIME_SAMPLES = &H2         '  number of wave samples
  50. Global Const TIME_BYTES = &H4           '  current byte offset
  51. Global Const TIME_SMPTE = &H8           '  SMPTE time
  52. Global Const TIME_MIDI = &H10           '  MIDI time
  53.  
  54.  
  55. ' ***************************************************************************
  56.  
  57. '                     Multimedia Extensions Window Messages
  58.  
  59. ' ****************************************************************************/
  60.  
  61. Global Const MM_JOY1MOVE = &H3A0                    '  joystick
  62. Global Const MM_JOY2MOVE = &H3A1
  63. Global Const MM_JOY1ZMOVE = &H3A2
  64. Global Const MM_JOY2ZMOVE = &H3A3
  65. Global Const MM_JOY1BUTTONDOWN = &H3B5
  66. Global Const MM_JOY2BUTTONDOWN = &H3B6
  67. Global Const MM_JOY1BUTTONUP = &H3B7
  68. Global Const MM_JOY2BUTTONUP = &H3B8
  69.  
  70. Global Const MM_MCINOTIFY = &H3B9                   '  MCI
  71.  
  72. Global Const MM_WOM_OPEN = &H3BB                    '  waveform output
  73. Global Const MM_WOM_CLOSE = &H3BC
  74. Global Const MM_WOM_DONE = &H3BD
  75.  
  76. Global Const MM_WIM_OPEN = &H3BE                    '  waveform input
  77. Global Const MM_WIM_CLOSE = &H3BF
  78. Global Const MM_WIM_DATA = &H3C0
  79.  
  80. Global Const MM_MIM_OPEN = &H3C1                    '  MIDI input
  81. Global Const MM_MIM_CLOSE = &H3C2
  82. Global Const MM_MIM_DATA = &H3C3
  83. Global Const MM_MIM_LONGDATA = &H3C4
  84. Global Const MM_MIM_ERROR = &H3C5
  85. Global Const MM_MIM_LONGERROR = &H3C6
  86.  
  87. Global Const MM_MOM_OPEN = &H3C7                    '  MIDI output
  88. Global Const MM_MOM_CLOSE = &H3C8
  89. Global Const MM_MOM_DONE = &H3C9
  90.  
  91.  
  92. ' ***************************************************************************
  93.  
  94. '                 String resource number bases (internal use)
  95.  
  96. ' ****************************************************************************/
  97.  
  98. Global Const MMSYSERR_BASE = 0
  99. Global Const WAVERR_BASE = 32
  100. Global Const MIDIERR_BASE = 64
  101. Global Const TIMERR_BASE = 96
  102. Global Const JOYERR_BASE = 160
  103. Global Const MCIERR_BASE = 256
  104.  
  105. Global Const MCI_STRING_OFFSET = 512
  106. Global Const MCI_VD_OFFSET = 1024
  107. Global Const MCI_CD_OFFSET = 1088
  108. Global Const MCI_WAVE_OFFSET = 1152
  109. Global Const MCI_SEQ_OFFSET = 1216
  110.  
  111. ' ***************************************************************************
  112.  
  113. '                         General error return values
  114.  
  115. ' ****************************************************************************/
  116.  
  117. '  general error return values
  118. Global Const MMSYSERR_NOERROR = 0                          '  no error
  119. Global Const MMSYSERR_ERROR = (MMSYSERR_BASE + 1)          '  unspecified error
  120. Global Const MMSYSERR_BADDEVICEID = (MMSYSERR_BASE + 2)    '  device ID out of range
  121. Global Const MMSYSERR_NOTENABLED = (MMSYSERR_BASE + 3)     '  driver failed enable
  122. Global Const MMSYSERR_ALLOCATED = (MMSYSERR_BASE + 4)      '  device already allocated
  123. Global Const MMSYSERR_INVALHANDLE = (MMSYSERR_BASE + 5)    '  device handle is invalid
  124. Global Const MMSYSERR_NODRIVER = (MMSYSERR_BASE + 6)       '  no device driver present
  125. Global Const MMSYSERR_NOMEM = (MMSYSERR_BASE + 7)          '  memory allocation error
  126. Global Const MMSYSERR_NOTSUPPORTED = (MMSYSERR_BASE + 8)   '  function isn't supported
  127. Global Const MMSYSERR_BADERRNUM = (MMSYSERR_BASE + 9)      '  error value out of range
  128. Global Const MMSYSERR_INVALFLAG = (MMSYSERR_BASE + 10)     '  invalid flag passed
  129. Global Const MMSYSERR_INVALPARAM = (MMSYSERR_BASE + 11)    '  invalid parameter passed
  130. Global Const MMSYSERR_LASTERROR = (MMSYSERR_BASE + 11)     '  last error in range
  131.  
  132.  
  133. ' ***************************************************************************
  134.  
  135. '                         Installable driver support
  136.  
  137. ' ****************************************************************************/
  138.  
  139. '  return values from DriverProc() function
  140. Global Const DRV_CANCEL = &H0
  141. Global Const DRV_OK = &H1
  142. Global Const DRV_RESTART = &H2
  143.  
  144. '  Driver messages
  145. Global Const DRV_LOAD = &H1
  146. Global Const DRV_ENABLE = &H2
  147. Global Const DRV_OPEN = &H3
  148. Global Const DRV_CLOSE = &H4
  149. Global Const DRV_DISABLE = &H5
  150. Global Const DRV_FREE = &H6
  151. Global Const DRV_CONFIGURE = &H7
  152. Global Const DRV_QUERYCONFIGURE = &H8
  153. Global Const DRV_INSTALL = &H9
  154. Global Const DRV_REMOVE = &HA
  155. Global Const DRV_RESERVED = &H800
  156. Global Const DRV_USER = &H4000
  157.  
  158. '  LPARAM of DRV_CONFIGURE message
  159. Type DRVCONFIGINFO
  160.     dwDCISize As Long
  161.     lpszDCISectionName As String
  162.     lpszDCIAliasName As String
  163. End Type
  164.  
  165. '  installable driver function prototypes
  166. Declare Function DrvClose Lib "MMSYSTEM" (ByVal hDriver As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long) As Long
  167. Declare Function DrvOpen Lib "MMSYSTEM" (ByVal szDriverName As String, ByVal szSectionName As String, ByVal lParam2 As Long) As Integer
  168. Declare Function DrvSendMessage Lib "MMSYSTEM" (ByVal hDriver As Integer, ByVal uMessage As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long) As Long
  169. Declare Function DrvGetModuleHandle Lib "MMSYSTEM" (ByVal hDriver As Integer) As Integer
  170. 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
  171.  
  172.  
  173. ' ***************************************************************************
  174.  
  175. '                           Driver callback support
  176.  
  177. ' ****************************************************************************/
  178.  
  179. '  flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and
  180. '  midiOutOpen() to specify the type of the dwCallback parameter.
  181.  
  182. Global Const CALLBACK_TYPEMASK = &H70000           '  callback type mask
  183. Global Const CALLBACK_NULL = &H0&                  '  no callback
  184. Global Const CALLBACK_WINDOW = &H10000             '  dwCallback is a HWND
  185. Global Const CALLBACK_TASK = &H20000               '  dwCallback is a HTASK
  186. Global Const CALLBACK_FUNCTION = &H30000           '  dwCallback is a FARPROC
  187.  
  188.  
  189. ' ***************************************************************************
  190.  
  191. '                          Manufacturer and product IDs
  192.     
  193. '     Used with wMid and wPid fields in WAVEOUTCAPS, WAVEINCAPS,
  194. '     MIDIOUTCAPS, MIDIINCAPS, AUXCAPS, JOYCAPS structures.
  195.  
  196. ' ****************************************************************************/
  197.  
  198. '  manufacturer IDs
  199. Global Const MM_MICROSOFT = 1                   '  Microsoft Corp.
  200.  
  201. '  product IDs
  202. Global Const MM_MIDI_MAPPER = 1                 '  MIDI Mapper
  203. Global Const MM_WAVE_MAPPER = 2                 '  Wave Mapper
  204. Global Const MM_SNDBLST_MIDIOUT = 3             '  Sound Blaster MIDI output port
  205. Global Const MM_SNDBLST_MIDIIN = 4              '  Sound Blaster MIDI input port
  206. Global Const MM_SNDBLST_SYNTH = 5               '  Sound Blaster internal synthesizer
  207. Global Const MM_SNDBLST_WAVEOUT = 6             '  Sound Blaster waveform output
  208. Global Const MM_SNDBLST_WAVEIN = 7              '  Sound Blaster waveform input
  209. Global Const MM_ADLIB = 9                       '  Ad Lib-compatible synthesizer
  210. Global Const MM_MPU401_MIDIOUT = 10             '  MPU401-compatible MIDI output port
  211. Global Const MM_MPU401_MIDIIN = 11              '  MPU401-compatible MIDI input port
  212. Global Const MM_PC_JOYSTICK = 12                '  Joystick adapter
  213.  
  214.  
  215. ' ***************************************************************************
  216.  
  217. '                     General MMSYSTEM support
  218.  
  219. ' ****************************************************************************/
  220.  
  221. Declare Function mmsystemGetVersion Lib "MMSYSTEM" () As Integer
  222. Declare Sub OutputDebugStr Lib "MMSYSTEM" (ByVal LPCSTR As String)
  223.  
  224.  
  225.  
  226. ' ***************************************************************************
  227.  
  228. '                             Sound support
  229.  
  230. ' ****************************************************************************/
  231.  
  232. Declare Function sndPlaySound Lib "MMSYSTEM" (ByVal lpszSoundName As String, ByVal uFlags As Integer) As Integer
  233.  
  234. '  flag values for wFlags parameter
  235. Global Const SND_SYNC = &H0                 '  play synchronously (default)
  236. Global Const SND_ASYNC = &H1                '  play asynchronously
  237. Global Const SND_NODEFAULT = &H2            '  don't use default sound
  238. Global Const SND_MEMORY = &H4               '  lpszSoundName points to a memory file
  239. Global Const SND_LOOP = &H8                 '  loop the sound until next sndPlaySound
  240. Global Const SND_NOSTOP = &H10              '  don't stop any currently playing sound
  241.  
  242. ' ***************************************************************************
  243.  
  244. '                         Waveform audio support
  245.  
  246. ' ****************************************************************************/
  247.  
  248. '  waveform audio error return values
  249. Global Const WAVERR_BADFORMAT = (WAVERR_BASE + 0)          '  unsupported wave format
  250. Global Const WAVERR_STILLPLAYING = (WAVERR_BASE + 1)       '  still something playing
  251. Global Const WAVERR_UNPREPARED = (WAVERR_BASE + 2)         '  header not prepared
  252. Global Const WAVERR_SYNC = (WAVERR_BASE + 3)               '  device is synchronous
  253. Global Const WAVERR_LASTERROR = (WAVERR_BASE + 3)          '  last error in range
  254.  
  255. '  waveform audio data types
  256.  
  257. '  wave callback messages
  258. Global Const WOM_OPEN = MM_WOM_OPEN
  259. Global Const WOM_CLOSE = MM_WOM_CLOSE
  260. Global Const WOM_DONE = MM_WOM_DONE
  261. Global Const WIM_OPEN = MM_WIM_OPEN
  262. Global Const WIM_CLOSE = MM_WIM_CLOSE
  263. Global Const WIM_DATA = MM_WIM_DATA
  264.  
  265. '  device ID for wave device mapper
  266. Global Const WAVE_MAPPER = (-1)
  267.  
  268. '  flags for dwFlags parameter in waveOutOpen() and waveInOpen()
  269. Global Const WAVE_FORMAT_QUERY = &H1
  270. Global Const WAVE_ALLOWSYNC = &H2
  271.  
  272. '  wave data block header
  273. Type WAVEHDR
  274.     lpData As Long                 '  pointer to locked data buffer
  275.     dwBufferLength As Long         '  length of data buffer
  276.     dwBytesRecorded As Long        '  used for input only
  277.     dwUser As Long                 '  for client's use
  278.     dwFlags As Long                '  assorted flags (see defines)
  279.     dwLoops As Long                '  loop control counter
  280.     wavehdr_tag As Long            '  reserved for driver
  281.     reserved As Long               '  reserved for driver
  282. End Type
  283.  
  284. '  flags for dwFlags field of WAVEHDR
  285. Global Const WHDR_DONE = &H1                '  done bit
  286. Global Const WHDR_PREPARED = &H2            '  set if this header has been prepared
  287. Global Const WHDR_BEGINLOOP = &H4           '  loop start block
  288. Global Const WHDR_ENDLOOP = &H8             '  loop end block
  289. Global Const WHDR_INQUEUE = &H10            '  reserved for driver
  290.  
  291. '  waveform output device capabilities structure
  292. Type WAVEOUTCAPS
  293.     wMid As Integer                  '  manufacturer ID
  294.     wPid As Integer                  '  product ID
  295.     vDriverVersion As Integer        '  version of the driver
  296.     szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
  297.     dwFormats As Long                '  formats supported
  298.     wChannels As Integer             '  number of sources supported
  299.     dwSupport As Long                '  functionality supported by driver
  300. End Type
  301. ' typedef WAVEOUTCAPS       *PWAVEOUTCAPS;
  302. ' typedef WAVEOUTCAPS NEAR *NPWAVEOUTCAPS;
  303. ' typedef WAVEOUTCAPS FAR  *LPWAVEOUTCAPS;
  304.  
  305. '  flags for dwSupport field of WAVEOUTCAPS
  306. Global Const WAVECAPS_PITCH = &H1                '  supports pitch control
  307. Global Const WAVECAPS_PLAYBACKRATE = &H2         '  supports playback rate control
  308. Global Const WAVECAPS_VOLUME = &H4               '  supports volume control
  309. Global Const WAVECAPS_LRVOLUME = &H8             '  separate left-right volume control
  310. Global Const WAVECAPS_SYNC = &H10
  311.  
  312. '  waveform input device capabilities structure
  313. Type WAVEINCAPS
  314.     wMid As Integer                    '  manufacturer ID
  315.     wPid As Integer                    '  product ID
  316.     vDriverVersion As Integer          '  version of the driver
  317.     szPname As String * MAXPNAMELEN    '  product name (NULL terminated string)
  318.     dwFormats As Long                  '  formats supported
  319.     wChannels As Integer               '  number of channels supported
  320. End Type
  321.  
  322. '  defines for dwFormat field of WAVEINCAPS and WAVEOUTCAPS
  323. Global Const WAVE_INVALIDFORMAT = &H0                   '  invalid format
  324. Global Const WAVE_FORMAT_1M08 = &H1                     '  11.025 kHz, Mono,   8-bit
  325. Global Const WAVE_FORMAT_1S08 = &H2                     '  11.025 kHz, Stereo, 8-bit
  326. Global Const WAVE_FORMAT_1M16 = &H4                     '  11.025 kHz, Mono,   16-bit
  327. Global Const WAVE_FORMAT_1S16 = &H8                     '  11.025 kHz, Stereo, 16-bit
  328. Global Const WAVE_FORMAT_2M08 = &H10                    '  22.05  kHz, Mono,   8-bit
  329. Global Const WAVE_FORMAT_2S08 = &H20                    '  22.05  kHz, Stereo, 8-bit
  330. Global Const WAVE_FORMAT_2M16 = &H40                    '  22.05  kHz, Mono,   16-bit
  331. Global Const WAVE_FORMAT_2S16 = &H80                    '  22.05  kHz, Stereo, 16-bit
  332. Global Const WAVE_FORMAT_4M08 = &H100                   '  44.1   kHz, Mono,   8-bit
  333. Global Const WAVE_FORMAT_4S08 = &H200                   '  44.1   kHz, Stereo, 8-bit
  334. Global Const WAVE_FORMAT_4M16 = &H400                   '  44.1   kHz, Mono,   16-bit
  335. Global Const WAVE_FORMAT_4S16 = &H800                   '  44.1   kHz, Stereo, 16-bit
  336.  
  337. '  general waveform format structure (information common to all formats)
  338. Type WAVEFORMAT
  339.     wFormatTag As Integer     '  format type
  340.     nChannels As Integer      '  number of channels (i.e. mono, stereo, etc.)
  341.     nSamplesPerSec As Long    '  sample rate
  342.     nAvgBytesPerSec As Long   '  for buffer estimation
  343.     nBlockAlign As Integer    '  block size of data
  344. End Type
  345.  
  346. '  flags for wFormatTag field of WAVEFORMAT
  347. Global Const WAVE_FORMAT_PCM = 1
  348.  
  349. '  specific waveform format structure for PCM data
  350. Type PCMWAVEFORMAT
  351.     wf As WAVEFORMAT
  352.     wBitsPerSample As Integer
  353. End Type
  354.  
  355. '  waveform audio function prototypes
  356. Declare Function waveOutGetNumDevs Lib "MMSYSTEM" () As Integer
  357. Declare Function waveOutGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As WAVEOUTCAPS, uSize As Integer) As Integer
  358. Declare Function waveOutGetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpdwvolume As Long) As Integer
  359. Declare Function waveOutSetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, ByVal dwVolume As Long) As Integer
  360. Declare Function waveOutGetErrorText Lib "MMSYSTEM" (ByVal uError As Integer, ByVal lpText As String, ByVal uSize As Integer) As Integer
  361. 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
  362. Declare Function waveOutClose Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
  363. Declare Function waveOutPrepareHeader Lib "MMSYSTEM" (ByVal hWaveOut As Integer, WH As WAVEHDR, ByVal uSize As Integer) As Integer
  364. Declare Function waveOutUnprepareHeader Lib "MMSYSTEM" (ByVal hWaveOut As Integer, WH As WAVEHDR, ByVal uSize As Integer) As Integer
  365. Declare Function waveOutWrite Lib "MMSYSTEM" (ByVal hWaveOut As Integer, WH1 As WAVEHDR, ByVal uSize As Integer) As Integer
  366. Declare Function waveOutPause Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
  367. Declare Function waveOutRestart Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
  368. Declare Function waveOutReset Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
  369. Declare Function waveOutBreakLoop Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
  370. Declare Function waveOutGetPosition Lib "MMSYSTEM" (ByVal hWaveOut As Integer, lpinfo As MMTIME, ByVal uSize As Integer) As Integer
  371. Declare Function waveOutGetPitch Lib "MMSYSTEM" (ByVal hWaveOut As Integer, lpdwpitch As Long) As Integer
  372. Declare Function waveOutSetPitch Lib "MMSYSTEM" (ByVal hWaveOut As Integer, ByVal dwPitch As Long) As Integer
  373. Declare Function waveOutGetPlaybackRate Lib "MMSYSTEM" (ByVal hWaveOut As Integer, lpdwrate As Long) As Integer
  374. Declare Function waveOutSetPlaybackRate Lib "MMSYSTEM" (ByVal hWaveOut As Integer, ByVal dwRate As Long) As Integer
  375. Declare Function waveOutGetID Lib "MMSYSTEM" (ByVal hWaveOut As Integer, lpudeviceid As Integer) As Integer
  376. Declare Function waveOutMessage Lib "MMSYSTEM" (ByVal hWaveOut As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long
  377. Declare Function waveInGetNumDevs Lib "MMSYSTEM" () As Integer
  378. Declare Function waveInGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As WAVEINCAPS, ByVal uSize As Integer) As Integer
  379. Declare Function waveInGetErrorText Lib "MMSYSTEM" (ByVal uError As Integer, ByVal lpText As String, ByVal uSize As Integer) As Integer
  380. 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
  381. Declare Function waveInClose Lib "MMSYSTEM" (ByVal hWaveIn As Integer) As Integer
  382. Declare Function waveInPrepareHeader Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpWaveInHdr As WAVEHDR, ByVal uSize As Integer) As Integer
  383. Declare Function waveInUnprepareHeader Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpWaveInHdr As WAVEHDR, ByVal uSize As Integer) As Integer
  384. Declare Function waveInAddBuffer Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpWaveInHdr As WAVEHDR, ByVal uSize As Integer) As Integer
  385. Declare Function waveInStart Lib "MMSYSTEM" (ByVal hWaveIn As Integer) As Integer
  386. Declare Function waveInStop Lib "MMSYSTEM" (ByVal hWaveIn As Integer) As Integer
  387. Declare Function waveInReset Lib "MMSYSTEM" (ByVal hWaveIn As Integer) As Integer
  388. Declare Function waveInGetPosition Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpinfo As MMTIME, ByVal uSize As Integer) As Integer
  389. Declare Function waveInGetID Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpudeviceid As Integer) As Integer
  390. Declare Function waveInMessage Lib "MMSYSTEM" (ByVal hWaveIn As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long
  391.  
  392.  
  393. ' ***************************************************************************
  394.  
  395. '                             MIDI audio support
  396.  
  397. ' ****************************************************************************/
  398.  
  399. '  MIDI error return values
  400. Global Const MIDIERR_UNPREPARED = (MIDIERR_BASE + 0)       '  header not prepared
  401. Global Const MIDIERR_STILLPLAYING = (MIDIERR_BASE + 1)     '  still something playing
  402. Global Const MIDIERR_NOMAP = (MIDIERR_BASE + 2)            '  no current map
  403. Global Const MIDIERR_NOTREADY = (MIDIERR_BASE + 3)         '  hardware is still busy
  404. Global Const MIDIERR_NODEVICE = (MIDIERR_BASE + 4)         '  port no longer connected
  405. Global Const MIDIERR_INVALIDSETUP = (MIDIERR_BASE + 5)     '  invalid setup
  406. Global Const MIDIERR_LASTERROR = (MIDIERR_BASE + 5)        '  last error in range
  407.  
  408. Global Const MIDIPATCHSIZE = 128
  409.  
  410. '  MIDI callback messages
  411. Global Const MIM_OPEN = MM_MIM_OPEN
  412. Global Const MIM_CLOSE = MM_MIM_CLOSE
  413. Global Const MIM_DATA = MM_MIM_DATA
  414. Global Const MIM_LONGDATA = MM_MIM_LONGDATA
  415. Global Const MIM_ERROR = MM_MIM_ERROR
  416. Global Const MIM_LONGERROR = MM_MIM_LONGERROR
  417. Global Const MOM_OPEN = MM_MOM_OPEN
  418. Global Const MOM_CLOSE = MM_MOM_CLOSE
  419. Global Const MOM_DONE = MM_MOM_DONE
  420.  
  421. '  device ID for MIDI mapper
  422. Global Const MIDIMAPPER = (-1)
  423. Global Const MIDI_MAPPER = (-1)
  424.  
  425. '  flags for wFlags parm of midiOutCachePatches(), midiOutCacheDrumPatches()
  426. Global Const MIDI_CACHE_ALL = 1
  427. Global Const MIDI_CACHE_BESTFIT = 2
  428. Global Const MIDI_CACHE_QUERY = 3
  429. Global Const MIDI_UNCACHE = 4
  430.  
  431. '  MIDI output device capabilities structure
  432. Type MIDIOUTCAPS
  433.     wMid As Integer                  '  manufacturer ID
  434.     wPid As Integer                  '  product ID
  435.     vDriverVersion As Integer        '  version of the driver
  436.     szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
  437.     wTechnology As Integer           '  type of device
  438.     wVoices As Integer               '  # of voices (internal synth only)
  439.     wNotes As Integer                '  max # of notes (internal synth only)
  440.     wChannelMask As Integer          '  channels used (internal synth only)
  441.     dwSupport As Long             '  functionality supported by driver
  442. End Type
  443.  
  444. '  flags for wTechnology field of MIDIOUTCAPS structure
  445. Global Const MOD_MIDIPORT = 1      '  output port
  446. Global Const MOD_SYNTH = 2         '  generic internal synth
  447. Global Const MOD_SQSYNTH = 3       '  square wave internal synth
  448. Global Const MOD_FMSYNTH = 4       '  FM internal synth
  449. Global Const MOD_MAPPER = 5        '  MIDI mapper
  450.  
  451. '  flags for dwSupport field of MIDIOUTCAPS structure
  452. Global Const MIDICAPS_VOLUME = &H1               '  supports volume control
  453. Global Const MIDICAPS_LRVOLUME = &H2             '  separate left-right volume control
  454. Global Const MIDICAPS_CACHE = &H4
  455.  
  456. '  MIDI output device capabilities structure
  457. Type MIDIINCAPS
  458.     wMid As Integer                  '  manufacturer ID
  459.     wPid As Integer                  '  product ID
  460.     vDriverVersion As Integer        '  version of the driver
  461.     szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
  462. End Type
  463.  
  464. '  MIDI data block header
  465. Type MIDIHDR
  466.     lpData As Long               '  pointer to locked data block
  467.     dwBufferLength As Long       '  length of data in data block
  468.     dwBytesRecorded As Long      '  used for input only
  469.     dwUser As Long               '  for client's use
  470.     dwFlags As Long              '  assorted flags (see defines)
  471.     midihdr_tag As Long          '  reserved for driver
  472.     reserved As Long             '  reserved for driver
  473. End Type
  474.  
  475. '  flags for dwFlags field of MIDIHDR structure
  476. Global Const MHDR_DONE = &H1                     '  done bit
  477. Global Const MHDR_PREPARED = &H2                 '  set if header prepared
  478. Global Const MHDR_INQUEUE = &H4                  '  reserved for driver
  479.  
  480. '  MIDI function prototypes
  481. Declare Function midiOutGetNumDevs Lib "MMSYSTEM" () As Integer
  482. Declare Function midiOutGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As MIDIOUTCAPS, ByVal uSize As Integer) As Integer
  483. Declare Function midiOutGetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpdwvolume As Long) As Integer
  484. Declare Function midiOutSetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, ByVal dwVolume As Long) As Integer
  485. Declare Function midiOutGetErrorText Lib "MMSYSTEM" (ByVal uError As Integer, ByVal lpText As String, ByVal uSize As Integer) As Integer
  486. 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
  487. Declare Function midiOutClose Lib "MMSYSTEM" (ByVal hMidiOut As Integer) As Integer
  488. Declare Function midiOutPrepareHeader Lib "MMSYSTEM" (ByVal hMidiOut As Integer, lphMidiOut As MIDIHDR, ByVal uSize As Integer) As Integer
  489. Declare Function midiOutUnprepareHeader Lib "MMSYSTEM" (ByVal hMidiOut As Integer, lphMidiOut As MIDIHDR, ByVal uSize As Integer) As Integer
  490. Declare Function midiOutShortMsg Lib "MMSYSTEM" (ByVal hMidiOut As Integer, ByVal dwMsg As Long) As Integer
  491. Declare Function midiOutLongMsg Lib "MMSYSTEM" (ByVal hMidiOut As Integer, lphMidiOut As MIDIHDR, ByVal uSize As Integer) As Integer
  492. Declare Function midiOutReset Lib "MMSYSTEM" (ByVal hMidiOut As Integer) As Integer
  493. Declare Function midiOutCachePatches Lib "MMSYSTEM" (ByVal hMidiOut As Integer, ByVal uBank As Integer, ByVal PatchArray As Long, ByVal uFlags As Integer) As Integer
  494. Declare Function midiOutCacheDrumPatches Lib "MMSYSTEM" (ByVal hMidiOut As Integer, ByVal uPatch As Integer, lpwKeyArray As Integer, ByVal uFlags As Integer) As Integer
  495. Declare Function midiOutGetID Lib "MMSYSTEM" (ByVal hMidiOut As Integer, lpudeviceid As Integer) As Integer
  496. Declare Function midiOutMessage Lib "MMSYSTEM" (ByVal hMidiOut As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long
  497. Declare Function midiInGetNumDevs Lib "MMSYSTEM" () As Integer
  498. Declare Function midiInGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As MIDIINCAPS, ByVal uSize As Integer) As Integer
  499. Declare Function midiInGetErrorText Lib "MMSYSTEM" (ByVal uError As Integer, ByVal lpText As String, ByVal uSize As Integer) As Integer
  500. 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
  501. Declare Function midiInClose Lib "MMSYSTEM" (ByVal hMidiIn As Integer) As Integer
  502. Declare Function midiInPrepareHeader Lib "MMSYSTEM" (ByVal hMidiIn As Integer, lpMidiInHdr As MIDIHDR, ByVal uSize As Integer) As Integer
  503. Declare Function midiInUnprepareHeader Lib "MMSYSTEM" (ByVal hMidiIn As Integer, lpMidiInHdr As MIDIHDR, ByVal uSize As Integer) As Integer
  504. Declare Function midiInAddBuffer Lib "MMSYSTEM" (ByVal hMidiIn As Integer, lpMidiInHdr As MIDIHDR, ByVal uSize As Integer) As Integer
  505. Declare Function midiInStart Lib "MMSYSTEM" (ByVal hMidiIn As Integer) As Integer
  506. Declare Function midiInStop Lib "MMSYSTEM" (ByVal hMidiIn As Integer) As Integer
  507. Declare Function midiInReset Lib "MMSYSTEM" (ByVal hMidiIn As Integer) As Integer
  508. Declare Function midiInGetID Lib "MMSYSTEM" (ByVal hMidiIn As Integer, lpudeviceid As Integer) As Integer
  509. Declare Function midiInMessage Lib "MMSYSTEM" (ByVal hMidiIn As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long
  510.  
  511.  
  512. ' ***************************************************************************
  513.  
  514. '                         Auxiliary audio support
  515.  
  516. ' ****************************************************************************/
  517.  
  518. '  device ID for aux device mapper
  519. Global Const AUX_MAPPER = (-1)
  520.  
  521. '  Auxiliary audio device capabilities structure
  522. Type AUXCAPS
  523.     wMid As Integer                  '  manufacturer ID
  524.     wPid As Integer                  '  product ID
  525.     vDriverVersion As Integer        '  version of the driver
  526.     szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
  527.     wTechnology As Integer           '  type of device
  528.     dwSupport As Long             '  functionality supported by driver
  529. End Type
  530. ' typedef AUXCAPS       *PAUXCAPS;
  531. ' typedef AUXCAPS NEAR *NPAUXCAPS;
  532. ' typedef AUXCAPS FAR  *LPAUXCAPS;
  533.  
  534. '  flags for wTechnology field in AUXCAPS structure
  535. Global Const AUXCAPS_CDAUDIO = 1           '  audio from internal CD-ROM drive
  536. Global Const AUXCAPS_AUXIN = 2             '  audio from auxiliary input jacks
  537.  
  538. '  flags for dwSupport field in AUXCAPS structure
  539. Global Const AUXCAPS_VOLUME = &H1               '  supports volume control
  540. Global Const AUXCAPS_LRVOLUME = &H2             '  separate left-right volume control
  541.  
  542. '  auxiliary audio function prototypes
  543. Declare Function auxGetNumDevs Lib "MMSYSTEM" () As Integer
  544. Declare Function auxGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As AUXCAPS, ByVal uSize As Integer) As Integer
  545. Declare Function auxSetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, ByVal dwVolume As Long) As Integer
  546. Declare Function auxGetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpdwvolume As Long) As Integer
  547. Declare Function auxOutMessage Lib "MMSYSTEM" (ByVal udeviceid As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long
  548.  
  549.  
  550. ' ***************************************************************************
  551.  
  552. '                             Timer support
  553.  
  554. ' ****************************************************************************/
  555.  
  556. '  timer error return values
  557. Global Const TIMERR_NOERROR = (0)                          '  no error
  558. Global Const TIMERR_NOCANDO = (TIMERR_BASE + 1)            '  request not completed
  559. Global Const TIMERR_STRUCT = (TIMERR_BASE + 33)            '  time struct size
  560.  
  561. '  flags for wFlags parameter of timeSetEvent() function
  562. Global Const TIME_ONESHOT = 0       '  program timer for single event
  563. Global Const TIME_PERIODIC = 1      '  program for continuous periodic event
  564.  
  565. '  timer device capabilities data structure
  566. Type TIMECAPS
  567.     wPeriodMin As Integer     '  minimum period supported
  568.     wPeriodMax As Integer     '  maximum period supported
  569. End Type
  570.  
  571. '  timer function prototypes
  572. Declare Function timeGetSystemTime Lib "MMSYSTEM" (lpTime As MMTIME, ByVal uSize As Integer) As Integer
  573. Declare Function timeGetTime Lib "MMSYSTEM" () As Long
  574. Declare Function timeKillEvent Lib "MMSYSTEM" (ByVal uTimerID As Integer) As Integer
  575. Declare Function timeGetDevCaps Lib "MMSYSTEM" (lpTimeCaps As TIMECAPS, ByVal uSize As Integer) As Integer
  576. Declare Function timeBeginPeriod Lib "MMSYSTEM" (ByVal uPeriod As Integer) As Integer
  577. Declare Function timeEndPeriod Lib "MMSYSTEM" (ByVal uPeriod As Integer) As Integer
  578.  
  579.  
  580.  
  581. ' ***************************************************************************
  582.  
  583. '                             Joystick support
  584.  
  585. ' ****************************************************************************/
  586.  
  587. '  joystick error return values
  588. Global Const JOYERR_NOERROR = (0)                          '  no error
  589. Global Const JOYERR_PARMS = (JOYERR_BASE + 5)              '  bad parameters
  590. Global Const JOYERR_NOCANDO = (JOYERR_BASE + 6)            '  request not completed
  591. Global Const JOYERR_UNPLUGGED = (JOYERR_BASE + 7)          '  joystick is unplugged
  592.  
  593. '  constants used with JOYINFO structure and MM_JOY* messages
  594. Global Const JOY_BUTTON1 = &H1
  595. Global Const JOY_BUTTON2 = &H2
  596. Global Const JOY_BUTTON3 = &H4
  597. Global Const JOY_BUTTON4 = &H8
  598. Global Const JOY_BUTTON1CHG = &H100
  599. Global Const JOY_BUTTON2CHG = &H200
  600. Global Const JOY_BUTTON3CHG = &H400
  601. Global Const JOY_BUTTON4CHG = &H800
  602.  
  603. '  joystick ID constants
  604. Global Const JOYSTICKID1 = 0
  605. Global Const JOYSTICKID2 = 1
  606.  
  607. '  joystick device capabilities data structure
  608. Type JOYCAPS
  609.     wMid As Integer                  '  manufacturer ID
  610.     wPid As Integer                  '  product ID
  611.     szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
  612.     wXmin As Integer                 '  minimum x position value
  613.     wXmax As Integer                 '  maximum x position value
  614.     wYmin As Integer                 '  minimum y position value
  615.     wYmax As Integer                 '  maximum y position value
  616.     wZmin As Integer                 '  minimum z position value
  617.     wZmax As Integer                 '  maximum z position value
  618.     wNumButtons As Integer           '  number of buttons
  619.     wPeriodMin As Integer            '  minimum message period when captured
  620.     wPeriodMax As Integer            '  maximum message period when captured
  621. End Type
  622.  
  623. '  joystick information data structure
  624. Type JOYINFO
  625.     wXpos As Integer                 '  x position
  626.     wYpos As Integer                 '  y position
  627.     wZpos As Integer                 '  z position
  628.     wButtons As Integer              '  button states
  629. End Type
  630.  
  631. '  joystick function prototypes
  632. Declare Function joyGetDevCaps Lib "MMSYSTEM" (ByVal uJoyID As Integer, lpCaps As JOYCAPS, ByVal uSize As Integer) As Integer
  633. Declare Function joyGetNumDevs Lib "MMSYSTEM" () As Integer
  634. Declare Function joyGetPos Lib "MMSYSTEM" (ByVal uJoyID As Integer, lpCaps As JOYINFO) As Integer
  635. Declare Function joyGetThreshold Lib "MMSYSTEM" (ByVal uJoyID As Integer, lputhreshold As Integer) As Integer
  636. Declare Function joyReleaseCapture Lib "MMSYSTEM" (ByVal uJoyID As Integer) As Integer
  637. Declare Function joySetCapture Lib "MMSYSTEM" (ByVal hWnd As Integer, ByVal uJoyID As Integer, ByVal uPeriod As Integer, ByVal bChanged As Integer) As Integer
  638. Declare Function joySetThreshold Lib "MMSYSTEM" (ByVal uJoyID As Integer, ByVal uThreshold As Integer) As Integer
  639.  
  640. ' ***************************************************************************
  641.  
  642. '                         Multimedia File I/O support
  643.  
  644. ' ****************************************************************************/
  645.  
  646. '  MMIO error return values
  647. Global Const MMIOERR_BASE = 256
  648. Global Const MMIOERR_FILENOTFOUND = (MMIOERR_BASE + 1)      '  file not found
  649. Global Const MMIOERR_OUTOFMEMORY = (MMIOERR_BASE + 2)       '  out of memory
  650. Global Const MMIOERR_CANNOTOPEN = (MMIOERR_BASE + 3)        '  cannot open
  651. Global Const MMIOERR_CANNOTCLOSE = (MMIOERR_BASE + 4)       '  cannot close
  652. Global Const MMIOERR_CANNOTREAD = (MMIOERR_BASE + 5)        '  cannot read
  653. Global Const MMIOERR_CANNOTWRITE = (MMIOERR_BASE + 6)       '  cannot write
  654. Global Const MMIOERR_CANNOTSEEK = (MMIOERR_BASE + 7)        '  cannot seek
  655. Global Const MMIOERR_CANNOTEXPAND = (MMIOERR_BASE + 8)      '  cannot expand file
  656. Global Const MMIOERR_CHUNKNOTFOUND = (MMIOERR_BASE + 9)     '  chunk not found
  657. Global Const MMIOERR_UNBUFFERED = (MMIOERR_BASE + 10)       '  file is unbuffered
  658.  
  659. '  MMIO constants
  660. Global Const CFSEPCHAR = "+"    '  compound file name separator char.
  661.  
  662. '  MMIO data types
  663.  
  664. '  general MMIO information data structure
  665. Type MMIOINFO
  666.     '  general fields
  667.     dwFlags As Long        '  general status flags
  668.     fccIOProc As Long      '  pointer to I/O procedure
  669.     pIOProc As Long        '  pointer to I/O procedure
  670.     wErrorRet As Integer   '  place for error to be returned
  671.     HTASK As Integer         '  alternate local task
  672.  
  673.     '  fields maintained by MMIO functions during buffered I/O
  674.     cchBuffer As Long      '  size of I/O buffer (or 0L)
  675.     pchBuffer As String     '  start of I/O buffer (or NULL)
  676.     pchNext As String       '  pointer to next byte to read/write
  677.     pchEndRead As String    '  pointer to last valid byte to read
  678.     pchEndWrite As String   '  pointer to last byte to write
  679.     lBufOffset As Long     '  disk offset of start of buffer
  680.  
  681.     '  fields maintained by I/O procedure
  682.     lDiskOffset As Long    '  disk offset of next read or write
  683.     adwInfo(3) As Long     '  data specific to type of MMIOPROC
  684.  
  685.     '  other fields maintained by MMIO
  686.     dwReserved1 As Long    '  reserved for MMIO use
  687.     dwReserved2 As Long    '  reserved for MMIO use
  688.     hmmio As Integer       '  handle to open file
  689. End Type
  690.  
  691. '  RIFF chunk information data structure
  692. Type MMCKINFO
  693.     ckid As Long           '  chunk ID
  694.     cksize As Long         '  chunk size
  695.     fccType As Long        '  form type or list type
  696.     dwDataOffset As Long   '  offset of data portion of chunk
  697.     dwFlags As Long        '  flags used by MMIO functions
  698. End Type
  699.  
  700. '  bit field masks
  701. Global Const MMIO_RWMODE = &H3                  '  open file for reading/writing/both
  702. Global Const MMIO_SHAREMODE = &H70              '  file sharing mode number
  703.  
  704. '  constants for dwFlags field of MMIOINFO
  705. Global Const MMIO_CREATE = &H1000               '  create new file (or truncate file)
  706. Global Const MMIO_PARSE = &H100                 '  parse new file returning path
  707. Global Const MMIO_DELETE = &H200                '  create new file (or truncate file)
  708. Global Const MMIO_EXIST = &H4000                '  checks for existence of file
  709. Global Const MMIO_ALLOCBUF = &H10000            '  mmioOpen() should allocate a buffer
  710. Global Const MMIO_GETTEMP = &H20000             '  mmioOpen() should retrieve temp name
  711.  
  712. Global Const MMIO_DIRTY = &H10000000            '  I/O buffer is dirty
  713.  
  714.  
  715. '  read/write mode numbers (bit field MMIO_RWMODE)
  716. Global Const MMIO_READ = &H0                    '  open file for reading only
  717. Global Const MMIO_WRITE = &H1                   '  open file for writing only
  718. Global Const MMIO_READWRITE = &H2               '  open file for reading and writing
  719.  
  720. '  share mode numbers (bit field MMIO_SHAREMODE)
  721. Global Const MMIO_COMPAT = &H0                  '  compatibility mode
  722. Global Const MMIO_EXCLUSIVE = &H10              '  exclusive-access mode
  723. Global Const MMIO_DENYWRITE = &H20              '  deny writing to other processes
  724. Global Const MMIO_DENYREAD = &H30               '  deny reading to other processes
  725. Global Const MMIO_DENYNONE = &H40               '  deny nothing to other processes
  726.  
  727. '  various MMIO flags
  728. Global Const MMIO_FHOPEN = &H10                 '  mmioClose: keep file handle open
  729. Global Const MMIO_EMPTYBUF = &H10               '  mmioFlush: empty the I/O buffer
  730. Global Const MMIO_TOUPPER = &H10                '  mmioStringToFOURCC: to u-case
  731. Global Const MMIO_INSTALLPROC = &H10000         '  mmioInstallIOProc: install MMIOProc
  732. Global Const MMIO_GLOBALPROC = &H10000000       '  mmioInstallIOProc: install globally
  733. Global Const MMIO_REMOVEPROC = &H20000          '  mmioInstallIOProc: remove MMIOProc
  734. Global Const MMIO_FINDPROC = &H40000            '  mmioInstallIOProc: find an MMIOProc
  735. Global Const MMIO_FINDCHUNK = &H10              '  mmioDescend: find a chunk by ID
  736. Global Const MMIO_FINDRIFF = &H20               '  mmioDescend: find a LIST chunk
  737. Global Const MMIO_FINDLIST = &H40               '  mmioDescend: find a RIFF chunk
  738. Global Const MMIO_CREATERIFF = &H20             '  mmioCreateChunk: make a LIST chunk
  739. Global Const MMIO_CREATELIST = &H40             '  mmioCreateChunk: make a RIFF chunk
  740.  
  741.  
  742. '  message numbers for MMIOPROC I/O procedure functions
  743. Global Const MMIOM_READ = MMIO_READ             '  read
  744. Global Const MMIOM_WRITE = MMIO_WRITE           '  write
  745. Global Const MMIOM_SEEK = 2                     '  seek to a new position in file
  746. Global Const MMIOM_OPEN = 3                     '  open file
  747. Global Const MMIOM_CLOSE = 4                    '  close file
  748. Global Const MMIOM_WRITEFLUSH = 5               '  write and flush
  749.  
  750. Global Const MMIOM_RENAME = 6                   '  rename specified file
  751.  
  752. Global Const MMIOM_USER = &H8000                '  beginning of user-defined messages
  753.  
  754. '  standard four character codes
  755. Global Const FOURCC_RIFF = "RIFF"
  756. Global Const FOURCC_LIST = "LIST"
  757.  
  758. '  four character codes used to identify standard built-in I/O procedures
  759. Global Const FOURCC_DOS = "DOS "
  760. Global Const FOURCC_MEM = "MEM "
  761.  
  762. '  flags for mmioSeek()
  763. Global Const SEEK_SET = 0                       '  seek to an absolute position
  764. Global Const SEEK_CUR = 1                       '  seek relative to current position
  765. Global Const SEEK_END = 2                       '  seek relative to end of file
  766.  
  767. '  other constants
  768. Global Const MMIO_DEFAULTBUFFER = 8192          '  default buffer size
  769.  
  770. '  MMIO function prototypes
  771. Declare Function mmioStringToFOURCC Lib "mmsystem" (ByVal sz As String, ByVal uFlags As Integer) As Long
  772. Declare Function mmioOpen Lib "mmsystem" (ByVal szFileName As String, mi As MMIOINFO, lpmmioinfo As MMIOINFO, ByVal dwOpenFlags As Long) As Integer
  773. Declare Function mmioRename Lib "mmsystem" (ByVal szFileName As String, ByVal szNewFileName As String, lpmmioinfo As MMIOINFO, ByVal dwRenameFlags As Long) As Integer
  774. Declare Function mmioClose Lib "mmsystem" (ByVal hmmio As Integer, ByVal uFlags As Integer) As Integer
  775. Declare Function mmioRead Lib "mmsystem" (ByVal hmmio As Integer, ByVal pch As String, ByVal cch As Long) As Long
  776. Declare Function mmioWrite Lib "mmsystem" (ByVal hmmio As Integer, ByVal pch As String, ByVal cch As Long) As Long
  777. Declare Function mmioSeek Lib "mmsystem" (ByVal hmmio As Integer, ByVal lOffset As Long, ByVal iOrigin As Integer) As Long
  778. Declare Function mmioGetInfo Lib "mmsystem" (ByVal hmmio As Integer, lpmmioinfo As MMIOINFO, ByVal uFlags As Integer) As Integer
  779. Declare Function mmioSetInfo Lib "mmsystem" (ByVal hmmio As Integer, lpmmioinfo As MMIOINFO, ByVal uFlags As Integer) As Integer
  780. Declare Function mmioSetBuffer Lib "mmsystem" (ByVal hmmio As Integer, ByVal pchBuffer As String, ByVal cchBuffer As Long, ByVal uFlags As Integer) As Integer
  781. Declare Function mmioFlush Lib "mmsystem" (ByVal hmmio As Integer, ByVal uFlags As Integer) As Integer
  782. Declare Function mmioAdvance Lib "mmsystem" (ByVal hmmio As Integer, lpmmioinfo As MMIOINFO, ByVal uFlags As Integer) As Integer
  783. Declare Function mmioSendMessage Lib "mmsystem" (ByVal hmmio As Integer, ByVal uMessage As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long) As Long
  784. Declare Function mmioDescend Lib "mmsystem" (ByVal hmmio As Integer, lpck As MMCKINFO, lpckParent As MMCKINFO, ByVal uFlags As Integer) As Integer
  785. Declare Function mmioAscend Lib "mmsystem" (ByVal hmmio As Integer, lpck As MMCKINFO, ByVal uFlags As Integer) As Integer
  786. Declare Function mmioCreateChunk Lib "mmsystem" (ByVal hmmio As Integer, lpck As MMCKINFO, ByVal uFlags As Integer) As Integer
  787.  
  788.  
  789. ' ***************************************************************************
  790.  
  791. '                             MCI support
  792.  
  793. ' ****************************************************************************/
  794.  
  795.  
  796. '  MCI function prototypes
  797. Declare Function mciSendCommand Lib "mmsystem" (ByVal udeviceid As Integer, ByVal uMessage As Integer, ByVal dwParam1 As Long, ByVal dwParam2 As Long) As Long
  798. Declare Function mciSendString Lib "mmsystem" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hWndCallback As Integer) As Long
  799. Declare Function mciGetDeviceID Lib "mmsystem" (ByVal lpstrName As String) As Integer
  800. Declare Function mciGetDeviceIDFromElementID Lib "mmsystem" (ByVal dwElementID As Long, ByVal lpstrType As String) As Integer
  801. Declare Function mciGetErrorString Lib "mmsystem" (ByVal wError As Long, ByVal lpstrBuffer As String, ByVal uLength As Integer) As Integer
  802. Declare Function mciGetCreatorTask Lib "mmsystem" (ByVal udeviceid As Integer) As Integer
  803. Declare Function mciExecute Lib "mmsystem" (ByVal lpstrCommand As String) As Integer
  804.  
  805. '  MCI error return values
  806. Global Const MCIERR_INVALID_DEVICE_ID = (MCIERR_BASE + 1)
  807. Global Const MCIERR_UNRECOGNIZED_KEYWORD = (MCIERR_BASE + 3)
  808. Global Const MCIERR_UNRECOGNIZED_COMMAND = (MCIERR_BASE + 5)
  809. Global Const MCIERR_HARDWARE = (MCIERR_BASE + 6)
  810. Global Const MCIERR_INVALID_DEVICE_NAME = (MCIERR_BASE + 7)
  811. Global Const MCIERR_OUT_OF_MEMORY = (MCIERR_BASE + 8)
  812. Global Const MCIERR_DEVICE_OPEN = (MCIERR_BASE + 9)
  813. Global Const MCIERR_CANNOT_LOAD_DRIVER = (MCIERR_BASE + 10)
  814. Global Const MCIERR_MISSING_COMMAND_STRING = (MCIERR_BASE + 11)
  815. Global Const MCIERR_PARAM_OVERFLOW = (MCIERR_BASE + 12)
  816. Global Const MCIERR_MISSING_STRING_ARGUMENT = (MCIERR_BASE + 13)
  817. Global Const MCIERR_BAD_INTEGER = (MCIERR_BASE + 14)
  818. Global Const MCIERR_PARSER_INTERNAL = (MCIERR_BASE + 15)
  819. Global Const MCIERR_DRIVER_INTERNAL = (MCIERR_BASE + 16)
  820. Global Const MCIERR_MISSING_PARAMETER = (MCIERR_BASE + 17)
  821. Global Const MCIERR_UNSUPPORTED_FUNCTION = (MCIERR_BASE + 18)
  822. Global Const MCIERR_FILE_NOT_FOUND = (MCIERR_BASE + 19)
  823. Global Const MCIERR_DEVICE_NOT_READY = (MCIERR_BASE + 20)
  824. Global Const MCIERR_INTERNAL = (MCIERR_BASE + 21)
  825. Global Const MCIERR_DRIVER = (MCIERR_BASE + 22)
  826. Global Const MCIERR_CANNOT_USE_ALL = (MCIERR_BASE + 23)
  827. Global Const MCIERR_MULTIPLE = (MCIERR_BASE + 24)
  828. Global Const MCIERR_EXTENSION_NOT_FOUND = (MCIERR_BASE + 25)
  829. Global Const MCIERR_OUTOFRANGE = (MCIERR_BASE + 26)
  830. Global Const MCIERR_FLAGS_NOT_COMPATIBLE = (MCIERR_BASE + 28)
  831. Global Const MCIERR_FILE_NOT_SAVED = (MCIERR_BASE + 30)
  832. Global Const MCIERR_DEVICE_TYPE_REQUIRED = (MCIERR_BASE + 31)
  833. Global Const MCIERR_DEVICE_LOCKED = (MCIERR_BASE + 32)
  834. Global Const MCIERR_DUPLICATE_ALIAS = (MCIERR_BASE + 33)
  835. Global Const MCIERR_BAD_CONSTANT = (MCIERR_BASE + 34)
  836. Global Const MCIERR_MUST_USE_SHAREABLE = (MCIERR_BASE + 35)
  837. Global Const MCIERR_MISSING_DEVICE_NAME = (MCIERR_BASE + 36)
  838. Global Const MCIERR_BAD_TIME_FORMAT = (MCIERR_BASE + 37)
  839. Global Const MCIERR_NO_CLOSING_QUOTE = (MCIERR_BASE + 38)
  840. Global Const MCIERR_DUPLICATE_FLAGS = (MCIERR_BASE + 39)
  841. Global Const MCIERR_INVALID_FILE = (MCIERR_BASE + 40)
  842. Global Const MCIERR_NULL_PARAMETER_BLOCK = (MCIERR_BASE + 41)
  843. Global Const MCIERR_UNNAMED_RESOURCE = (MCIERR_BASE + 42)
  844. Global Const MCIERR_NEW_REQUIRES_ALIAS = (MCIERR_BASE + 43)
  845. Global Const MCIERR_NOTIFY_ON_AUTO_OPEN = (MCIERR_BASE + 44)
  846. Global Const MCIERR_NO_ELEMENT_ALLOWED = (MCIERR_BASE + 45)
  847. Global Const MCIERR_NONAPPLICABLE_FUNCTION = (MCIERR_BASE + 46)
  848. Global Const MCIERR_ILLEGAL_FOR_AUTO_OPEN = (MCIERR_BASE + 47)
  849. Global Const MCIERR_FILENAME_REQUIRED = (MCIERR_BASE + 48)
  850. Global Const MCIERR_EXTRA_CHARACTERS = (MCIERR_BASE + 49)
  851. Global Const MCIERR_DEVICE_NOT_INSTALLED = (MCIERR_BASE + 50)
  852. Global Const MCIERR_GET_CD = (MCIERR_BASE + 51)
  853. Global Const MCIERR_SET_CD = (MCIERR_BASE + 52)
  854. Global Const MCIERR_SET_DRIVE = (MCIERR_BASE + 53)
  855. Global Const MCIERR_DEVICE_LENGTH = (MCIERR_BASE + 54)
  856. Global Const MCIERR_DEVICE_ORD_LENGTH = (MCIERR_BASE + 55)
  857. Global Const MCIERR_NO_INTEGER = (MCIERR_BASE + 56)
  858. Global Const MCIERR_WAVE_OUTPUTSINUSE = (MCIERR_BASE + 64)
  859. Global Const MCIERR_WAVE_SETOUTPUTINUSE = (MCIERR_BASE + 65)
  860. Global Const MCIERR_WAVE_INPUTSINUSE = (MCIERR_BASE + 66)
  861. Global Const MCIERR_WAVE_SETINPUTINUSE = (MCIERR_BASE + 67)
  862. Global Const MCIERR_WAVE_OUTPUTUNSPECIFIED = (MCIERR_BASE + 68)
  863. Global Const MCIERR_WAVE_INPUTUNSPECIFIED = (MCIERR_BASE + 69)
  864. Global Const MCIERR_WAVE_OUTPUTSUNSUITABLE = (MCIERR_BASE + 70)
  865. Global Const MCIERR_WAVE_SETOUTPUTUNSUITABLE = (MCIERR_BASE + 71)
  866. Global Const MCIERR_WAVE_INPUTSUNSUITABLE = (MCIERR_BASE + 72)
  867. Global Const MCIERR_WAVE_SETINPUTUNSUITABLE = (MCIERR_BASE + 73)
  868. Global Const MCIERR_SEQ_DIV_INCOMPATIBLE = (MCIERR_BASE + 80)
  869. Global Const MCIERR_SEQ_PORT_INUSE = (MCIERR_BASE + 81)
  870. Global Const MCIERR_SEQ_PORT_NONEXISTENT = (MCIERR_BASE + 82)
  871. Global Const MCIERR_SEQ_PORT_MAPNODEVICE = (MCIERR_BASE + 83)
  872. Global Const MCIERR_SEQ_PORT_MISCERROR = (MCIERR_BASE + 84)
  873. Global Const MCIERR_SEQ_TIMER = (MCIERR_BASE + 85)
  874. Global Const MCIERR_SEQ_PORTUNSPECIFIED = (MCIERR_BASE + 86)
  875. Global Const MCIERR_SEQ_NOMIDIPRESENT = (MCIERR_BASE + 87)
  876. Global Const MCIERR_NO_WINDOW = (MCIERR_BASE + 90)
  877. Global Const MCIERR_CREATEWINDOW = (MCIERR_BASE + 91)
  878. Global Const MCIERR_FILE_READ = (MCIERR_BASE + 92)
  879. Global Const MCIERR_FILE_WRITE = (MCIERR_BASE + 93)
  880.  
  881. '  all custom device driver errors must be >= than this value
  882. Global Const MCIERR_CUSTOM_DRIVER_BASE = (MCIERR_BASE + 256)
  883.  
  884. '  MCI command message identifiers
  885. Global Const MCI_OPEN = &H803
  886. Global Const MCI_CLOSE = &H804
  887. Global Const MCI_ESCAPE = &H805
  888. Global Const MCI_PLAY = &H806
  889. Global Const MCI_SEEK = &H807
  890. Global Const MCI_STOP = &H808
  891. Global Const MCI_PAUSE = &H809
  892. Global Const MCI_INFO = &H80A
  893. Global Const MCI_GETDEVCAPS = &H80B
  894. Global Const MCI_SPIN = &H80C
  895. Global Const MCI_SET = &H80D
  896. Global Const MCI_STEP = &H80E
  897. Global Const MCI_RECORD = &H80F
  898. Global Const MCI_SYSINFO = &H810
  899. Global Const MCI_BREAK = &H811
  900. Global Const MCI_SOUND = &H812
  901. Global Const MCI_SAVE = &H813
  902. Global Const MCI_STATUS = &H814
  903. Global Const MCI_CUE = &H830
  904. Global Const MCI_REALIZE = &H840
  905. Global Const MCI_WINDOW = &H841
  906. Global Const MCI_PUT = &H842
  907. Global Const MCI_WHERE = &H843
  908. Global Const MCI_FREEZE = &H844
  909. Global Const MCI_UNFREEZE = &H845
  910. Global Const MCI_LOAD = &H850
  911. Global Const MCI_CUT = &H851
  912. Global Const MCI_COPY = &H852
  913. Global Const MCI_PASTE = &H853
  914. Global Const MCI_UPDATE = &H854
  915. Global Const MCI_RESUME = &H855
  916. Global Const MCI_DELETE = &H856
  917.  
  918. '  device ID for "all devices"
  919. Global Const MCI_ALL_DEVICE_ID = &HFFFF
  920.  
  921. '  constants for predefined MCI device types
  922. Global Const MCI_DEVTYPE_VCR = (MCI_STRING_OFFSET + 1)
  923. Global Const MCI_DEVTYPE_VIDEODISC = (MCI_STRING_OFFSET + 2)
  924. Global Const MCI_DEVTYPE_OVERLAY = (MCI_STRING_OFFSET + 3)
  925. Global Const MCI_DEVTYPE_CD_AUDIO = (MCI_STRING_OFFSET + 4)
  926. Global Const MCI_DEVTYPE_DAT = (MCI_STRING_OFFSET + 5)
  927. Global Const MCI_DEVTYPE_SCANNER = (MCI_STRING_OFFSET + 6)
  928. Global Const MCI_DEVTYPE_ANIMATION = (MCI_STRING_OFFSET + 7)
  929. Global Const MCI_DEVTYPE_DIGITAL_VIDEO = (MCI_STRING_OFFSET + 8)
  930. Global Const MCI_DEVTYPE_OTHER = (MCI_STRING_OFFSET + 9)
  931. Global Const MCI_DEVTYPE_WAVEFORM_AUDIO = (MCI_STRING_OFFSET + 10)
  932. Global Const MCI_DEVTYPE_SEQUENCER = (MCI_STRING_OFFSET + 11)
  933.  
  934. Global Const MCI_DEVTYPE_FIRST = MCI_DEVTYPE_VCR
  935. Global Const MCI_DEVTYPE_LAST = MCI_DEVTYPE_SEQUENCER
  936.  
  937. '  return values for 'status mode' command
  938. Global Const MCI_MODE_NOT_READY = (MCI_STRING_OFFSET + 12)
  939. Global Const MCI_MODE_STOP = (MCI_STRING_OFFSET + 13)
  940. Global Const MCI_MODE_PLAY = (MCI_STRING_OFFSET + 14)
  941. Global Const MCI_MODE_RECORD = (MCI_STRING_OFFSET + 15)
  942. Global Const MCI_MODE_SEEK = (MCI_STRING_OFFSET + 16)
  943. Global Const MCI_MODE_PAUSE = (MCI_STRING_OFFSET + 17)
  944. Global Const MCI_MODE_OPEN = (MCI_STRING_OFFSET + 18)
  945.  
  946. '  constants used in 'set time format' and 'status time format' commands
  947. Global Const MCI_FORMAT_MILLISECONDS = 0
  948. Global Const MCI_FORMAT_HMS = 1
  949. Global Const MCI_FORMAT_MSF = 2
  950. Global Const MCI_FORMAT_FRAMES = 3
  951. Global Const MCI_FORMAT_SMPTE_24 = 4
  952. Global Const MCI_FORMAT_SMPTE_25 = 5
  953. Global Const MCI_FORMAT_SMPTE_30 = 6
  954. Global Const MCI_FORMAT_SMPTE_30DROP = 7
  955. Global Const MCI_FORMAT_BYTES = 8
  956. Global Const MCI_FORMAT_SAMPLES = 9
  957. Global Const MCI_FORMAT_TMSF = 10
  958.  
  959. '  MCI time format conversion macros
  960.  
  961. '  flags for wParam of MM_MCINOTIFY message
  962. Global Const MCI_NOTIFY_SUCCESSFUL = &H1
  963. Global Const MCI_NOTIFY_SUPERSEDED = &H2
  964. Global Const MCI_NOTIFY_ABORTED = &H4
  965. Global Const MCI_NOTIFY_FAILURE = &H8
  966.  
  967.  
  968. '  common flags for dwFlags parameter of MCI command messages
  969. Global Const MCI_NOTIFY = &H1&
  970. Global Const MCI_WAIT = &H2&
  971. Global Const MCI_FROM = &H4&
  972. Global Const MCI_TO = &H8&
  973. Global Const MCI_TRACK = &H10&
  974.  
  975. '  flags for dwFlags parameter of MCI_OPEN command message
  976. Global Const MCI_OPEN_SHAREABLE = &H100&
  977. Global Const MCI_OPEN_ELEMENT = &H200&
  978. Global Const MCI_OPEN_ALIAS = &H400&
  979. Global Const MCI_OPEN_ELEMENT_ID = &H800&
  980. Global Const MCI_OPEN_TYPE_ID = &H1000&
  981. Global Const MCI_OPEN_TYPE = &H2000&
  982.  
  983. '  flags for dwFlags parameter of MCI_SEEK command message
  984. Global Const MCI_SEEK_TO_START = &H100&
  985. Global Const MCI_SEEK_TO_END = &H200&
  986.  
  987. '  flags for dwFlags parameter of MCI_STATUS command message
  988. Global Const MCI_STATUS_ITEM = &H100&
  989. Global Const MCI_STATUS_START = &H200&
  990.  
  991. '  flags for dwItem field of the MCI_STATUS_PARMS parameter block
  992. Global Const MCI_STATUS_LENGTH = &H1&
  993. Global Const MCI_STATUS_POSITION = &H2&
  994. Global Const MCI_STATUS_NUMBER_OF_TRACKS = &H3&
  995. Global Const MCI_STATUS_MODE = &H4&
  996. Global Const MCI_STATUS_MEDIA_PRESENT = &H5&
  997. Global Const MCI_STATUS_TIME_FORMAT = &H6&
  998. Global Const MCI_STATUS_READY = &H7&
  999. Global Const MCI_STATUS_CURRENT_TRACK = &H8&
  1000.  
  1001. '  flags for dwFlags parameter of MCI_INFO command message
  1002. Global Const MCI_INFO_PRODUCT = &H100&
  1003. Global Const MCI_INFO_FILE = &H200&
  1004.  
  1005. '  flags for dwFlags parameter of MCI_GETDEVCAPS command message
  1006. Global Const MCI_GETDEVCAPS_ITEM = &H100&
  1007.  
  1008. '  flags for dwItem field of the MCI_GETDEVCAPS_PARMS parameter block
  1009. Global Const MCI_GETDEVCAPS_CAN_RECORD = &H1&
  1010. Global Const MCI_GETDEVCAPS_HAS_AUDIO = &H2&
  1011. Global Const MCI_GETDEVCAPS_HAS_VIDEO = &H3&
  1012. Global Const MCI_GETDEVCAPS_DEVICE_TYPE = &H4&
  1013. Global Const MCI_GETDEVCAPS_USES_FILES = &H5&
  1014. Global Const MCI_GETDEVCAPS_COMPOUND_DEVICE = &H6&
  1015. Global Const MCI_GETDEVCAPS_CAN_EJECT = &H7&
  1016. Global Const MCI_GETDEVCAPS_CAN_PLAY = &H8&
  1017. Global Const MCI_GETDEVCAPS_CAN_SAVE = &H9&
  1018.  
  1019. '  flags for dwFlags parameter of MCI_SYSINFO command message
  1020. Global Const MCI_SYSINFO_QUANTITY = &H100&
  1021. Global Const MCI_SYSINFO_OPEN = &H200&
  1022. Global Const MCI_SYSINFO_NAME = &H400&
  1023. Global Const MCI_SYSINFO_INSTALLNAME = &H800&
  1024.  
  1025. '  flags for dwFlags parameter of MCI_SET command message
  1026. Global Const MCI_SET_DOOR_OPEN = &H100&
  1027. Global Const MCI_SET_DOOR_CLOSED = &H200&
  1028. Global Const MCI_SET_TIME_FORMAT = &H400&
  1029. Global Const MCI_SET_AUDIO = &H800&
  1030. Global Const MCI_SET_VIDEO = &H1000&
  1031. Global Const MCI_SET_ON = &H2000&
  1032. Global Const MCI_SET_OFF = &H4000&
  1033.  
  1034. '  flags for dwAudio field of MCI_SET_PARMS or MCI_SEQ_SET_PARMS
  1035. Global Const MCI_SET_AUDIO_ALL = &H0&
  1036. Global Const MCI_SET_AUDIO_LEFT = &H1&
  1037. Global Const MCI_SET_AUDIO_RIGHT = &H2&
  1038.  
  1039. '  flags for dwFlags parameter of MCI_BREAK command message
  1040. Global Const MCI_BREAK_KEY = &H100&
  1041. Global Const MCI_BREAK_HWND = &H200&
  1042. Global Const MCI_BREAK_OFF = &H400&
  1043.  
  1044. '  flags for dwFlags parameter of MCI_RECORD command message
  1045. Global Const MCI_RECORD_INSERT = &H100&
  1046. Global Const MCI_RECORD_OVERWRITE = &H200&
  1047.  
  1048. '  flags for dwFlags parameter of MCI_SOUND command message
  1049. Global Const MCI_SOUND_NAME = &H100&
  1050.  
  1051. '  flags for dwFlags parameter of MCI_SAVE command message
  1052. Global Const MCI_SAVE_FILE = &H100&
  1053.  
  1054. '  flags for dwFlags parameter of MCI_LOAD command message
  1055. Global Const MCI_LOAD_FILE = &H100&
  1056.  
  1057. '  generic parameter block for MCI command messages with no special parameters
  1058. Type MCI_GENERIC_PARMS
  1059.     dwCallback As Long
  1060. End Type
  1061. ' typedef MCI_GENERIC_PARMS FAR *LPMCI_GENERIC_PARMS;
  1062.  
  1063. '  parameter block for MCI_OPEN command message
  1064. Type MCI_OPEN_PARMS
  1065.     dwCallback As Long
  1066.     wDeviceID As Integer
  1067.     wReserved0 As Integer
  1068.     lpstrDeviceType As String
  1069.     lpstrElementName As String
  1070.     lpstrAlias As String
  1071. End Type
  1072.  
  1073. '  parameter block for MCI_PLAY command message
  1074. Type MCI_PLAY_PARMS
  1075.     dwCallback As Long
  1076.     dwFrom As Long
  1077.     dwTo As Long
  1078. End Type
  1079.  
  1080. '  parameter block for MCI_SEEK command message
  1081. Type MCI_SEEK_PARMS
  1082.     dwCallback As Long
  1083.     dwTo As Long
  1084. End Type
  1085.  
  1086. '  parameter block for MCI_STATUS command message
  1087. Type MCI_STATUS_PARMS
  1088.     dwCallback As Long
  1089.     dwReturn As Long
  1090.     dwItem As Long
  1091.     dwTrack As Long
  1092. End Type
  1093.  
  1094. '  parameter block for MCI_INFO command message
  1095. Type MCI_INFO_PARMS
  1096.     dwCallback As Long
  1097.     lpstrReturn As Long
  1098.     dwRetSize As Long
  1099. End Type
  1100.  
  1101. '  parameter block for MCI_GETDEVCAPS command message
  1102. Type MCI_GETDEVCAPS_PARMS
  1103.     dwCallback As Long
  1104.     dwReturn As Long
  1105.     dwItem As Long
  1106. End Type
  1107.  
  1108. '  parameter block for MCI_SYSINFO command message
  1109. Type MCI_SYSINFO_PARMS
  1110.     dwCallback As Long
  1111.     lpstrReturn As Long
  1112.     dwRetSize As Long
  1113.     dwNumber As Long
  1114.     wDeviceType As Integer
  1115.     wReserved0 As Integer
  1116. End Type
  1117.  
  1118. '  parameter block for MCI_SET command message
  1119. Type MCI_SET_PARMS
  1120.     dwCallback As Long
  1121.     dwTimeFormat As Long
  1122.     dwAudio As Long
  1123. End Type
  1124.  
  1125. '  parameter block for MCI_BREAK command message
  1126. Type MCI_BREAK_PARMS
  1127.     dwCallback As Long
  1128.     nVirtKey As Integer
  1129.     wReserved0 As Integer
  1130.     hwndBreak As Integer
  1131.     wReserved1 As Integer
  1132. End Type
  1133.  
  1134. '  parameter block for MCI_SOUND command message
  1135. Type MCI_SOUND_PARMS
  1136.     dwCallback As Long
  1137.     lpstrSoundName As String
  1138. End Type
  1139.  
  1140. '  parameter block for MCI_SAVE command message
  1141. Type MCI_SAVE_PARMS
  1142.     dwCallback As Long
  1143.     lpfilename As String
  1144. End Type
  1145.  
  1146. '  parameter block for MCI_LOAD command message
  1147. Type MCI_LOAD_PARMS
  1148.     dwCallback As Long
  1149.     lpfilename As String
  1150. End Type
  1151.  
  1152. '  parameter block for MCI_RECORD command message
  1153. Type MCI_RECORD_PARMS
  1154.     dwCallback As Long
  1155.     dwFrom As Long
  1156.     dwTo As Long
  1157. End Type
  1158.  
  1159.  
  1160. '  MCI extensions for videodisc devices
  1161.  
  1162. '  flag for dwReturn field of MCI_STATUS_PARMS
  1163. Global Const MCI_VD_MODE_PARK = (MCI_VD_OFFSET + 1)
  1164.  
  1165. '  flag for dwReturn field of MCI_STATUS_PARMS
  1166. Global Const MCI_VD_MEDIA_CLV = (MCI_VD_OFFSET + 2)
  1167. Global Const MCI_VD_MEDIA_CAV = (MCI_VD_OFFSET + 3)
  1168. Global Const MCI_VD_MEDIA_OTHER = (MCI_VD_OFFSET + 4)
  1169. Global Const MCI_VD_FORMAT_TRACK = &H4001
  1170.  
  1171. '  flags for dwFlags parameter of MCI_PLAY command message
  1172. Global Const MCI_VD_PLAY_REVERSE = &H10000
  1173. Global Const MCI_VD_PLAY_FAST = &H20000
  1174. Global Const MCI_VD_PLAY_SPEED = &H40000
  1175. Global Const MCI_VD_PLAY_SCAN = &H80000
  1176. Global Const MCI_VD_PLAY_SLOW = &H100000
  1177.  
  1178. '  flag for dwFlags parameter of MCI_SEEK command message
  1179. Global Const MCI_VD_SEEK_REVERSE = &H10000
  1180.  
  1181. '  flags for dwItem field of MCI_STATUS_PARMS parameter block
  1182. Global Const MCI_VD_STATUS_SPEED = &H4002&
  1183. Global Const MCI_VD_STATUS_FORWARD = &H4003&
  1184. Global Const MCI_VD_STATUS_MEDIA_TYPE = &H4004&
  1185. Global Const MCI_VD_STATUS_SIDE = &H4005&
  1186. Global Const MCI_VD_STATUS_DISC_SIZE = &H4006&
  1187.  
  1188. '  flags for dwFlags parameter of MCI_GETDEVCAPS command message
  1189. Global Const MCI_VD_GETDEVCAPS_CLV = &H10000
  1190. Global Const MCI_VD_GETDEVCAPS_CAV = &H20000
  1191.  
  1192. Global Const MCI_VD_SPIN_UP = &H10000
  1193. Global Const MCI_VD_SPIN_DOWN = &H20000
  1194.  
  1195. '  flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
  1196. Global Const MCI_VD_GETDEVCAPS_CAN_REVERSE = &H4002&
  1197. Global Const MCI_VD_GETDEVCAPS_FAST_RATE = &H4003&
  1198. Global Const MCI_VD_GETDEVCAPS_SLOW_RATE = &H4004&
  1199. Global Const MCI_VD_GETDEVCAPS_NORMAL_RATE = &H4005&
  1200.  
  1201. '  flags for the dwFlags parameter of MCI_STEP command message
  1202. Global Const MCI_VD_STEP_FRAMES = &H10000
  1203. Global Const MCI_VD_STEP_REVERSE = &H20000
  1204.  
  1205. '  flag for the MCI_ESCAPE command message
  1206. Global Const MCI_VD_ESCAPE_STRING = &H100&
  1207.  
  1208. '  parameter block for MCI_PLAY command message
  1209. Type MCI_VD_PLAY_PARMS
  1210.     dwCallback As Long
  1211.     dwFrom As Long
  1212.     dwTo As Long
  1213.     dwSpeed As Long
  1214. End Type
  1215.  
  1216. '  parameter block for MCI_STEP command message
  1217. Type MCI_VD_STEP_PARMS
  1218.     dwCallback As Long
  1219.     dwFrames As Long
  1220. End Type
  1221.  
  1222. '  parameter block for MCI_ESCAPE command message
  1223. Type MCI_VD_ESCAPE_PARMS
  1224.     dwCallback As Long
  1225.     lpstrCommand As String
  1226. End Type
  1227.  
  1228.  
  1229. '  MCI extensions for waveform audio devices
  1230.  
  1231. '  flags for the dwFlags parameter of MCI_OPEN command message
  1232. Global Const MCI_WAVE_OPEN_BUFFER = &H10000
  1233.  
  1234. '  flags for the dwFlags parameter of MCI_SET command message
  1235. Global Const MCI_WAVE_SET_FORMATTAG = &H10000
  1236. Global Const MCI_WAVE_SET_CHANNELS = &H20000
  1237. Global Const MCI_WAVE_SET_SAMPLESPERSEC = &H40000
  1238. Global Const MCI_WAVE_SET_AVGBYTESPERSEC = &H80000
  1239. Global Const MCI_WAVE_SET_BLOCKALIGN = &H100000
  1240. Global Const MCI_WAVE_SET_BITSPERSAMPLE = &H200000
  1241.  
  1242. '  flags for the dwFlags parameter of MCI_STATUS, MCI_SET command messages
  1243. Global Const MCI_WAVE_INPUT = &H400000
  1244. Global Const MCI_WAVE_OUTPUT = &H800000
  1245.  
  1246. '  flags for the dwItem field of MCI_STATUS_PARMS parameter block
  1247. Global Const MCI_WAVE_STATUS_FORMATTAG = &H4001&
  1248. Global Const MCI_WAVE_STATUS_CHANNELS = &H4002&
  1249. Global Const MCI_WAVE_STATUS_SAMPLESPERSEC = &H4003&
  1250. Global Const MCI_WAVE_STATUS_AVGBYTESPERSEC = &H4004&
  1251. Global Const MCI_WAVE_STATUS_BLOCKALIGN = &H4005&
  1252. Global Const MCI_WAVE_STATUS_BITSPERSAMPLE = &H4006&
  1253. Global Const MCI_WAVE_STATUS_LEVEL = &H4007&
  1254.  
  1255. '  flags for the dwFlags parameter of MCI_SET command message
  1256. Global Const MCI_WAVE_SET_ANYINPUT = &H4000000
  1257. Global Const MCI_WAVE_SET_ANYOUTPUT = &H8000000
  1258.  
  1259. '  flags for the dwFlags parameter of MCI_GETDEVCAPS command message
  1260. Global Const MCI_WAVE_GETDEVCAPS_INPUTS = &H4001&
  1261. Global Const MCI_WAVE_GETDEVCAPS_OUTPUTS = &H4002&
  1262.  
  1263. '  parameter block for MCI_OPEN command message
  1264. Type MCI_WAVE_OPEN_PARMS
  1265.     dwCallback As Long
  1266.     wDeviceID As Integer
  1267.     wReserved0 As Integer
  1268.     lpstrDeviceType As String
  1269.     lpstrElementName As String
  1270.     lpstrAlias As String
  1271.     dwBufferSeconds As Long
  1272. End Type
  1273.  
  1274. '  parameter block for MCI_DELETE command message
  1275. Type MCI_WAVE_DELETE_PARMS
  1276.     dwCallback As Long
  1277.     dwFrom As Long
  1278.     dwTo As Long
  1279. End Type
  1280. ' typedef MCI_WAVE_DELETE_PARMS FAR *LPMCI_WAVE_DELETE_PARMS;
  1281.  
  1282. '  parameter block for MCI_SET command message
  1283. Type MCI_WAVE_SET_PARMS
  1284.     dwCallback As Long
  1285.     dwTimeFormat As Long
  1286.     dwAudio As Long
  1287.     wInput As Integer
  1288.     wReserved0 As Integer
  1289.     wOutput As Integer
  1290.     wReserved1 As Integer
  1291.     wFormatTag As Integer
  1292.     wReserved2 As Integer
  1293.     nChannels As Integer
  1294.     wReserved3 As Integer
  1295.     nSamplesPerSec As Long
  1296.     nAvgBytesPerSec As Long
  1297.     nBlockAlign As Integer
  1298.     wReserved4 As Integer
  1299.     wBitsPerSample As Integer
  1300.     wReserved5 As Integer
  1301. End Type
  1302.  
  1303.  
  1304. '  MCI extensions for MIDI sequencer devices
  1305.  
  1306. '  flags for the dwReturn field of MCI_STATUS_PARMS parameter block
  1307. Global Const MCI_SEQ_DIV_PPQN = (0 + MCI_SEQ_OFFSET)
  1308. Global Const MCI_SEQ_DIV_SMPTE_24 = (1 + MCI_SEQ_OFFSET)
  1309. Global Const MCI_SEQ_DIV_SMPTE_25 = (2 + MCI_SEQ_OFFSET)
  1310. Global Const MCI_SEQ_DIV_SMPTE_30DROP = (3 + MCI_SEQ_OFFSET)
  1311. Global Const MCI_SEQ_DIV_SMPTE_30 = (4 + MCI_SEQ_OFFSET)
  1312.  
  1313. '  flags for the dwMaster field of MCI_SEQ_SET_PARMS parameter block
  1314. Global Const MCI_SEQ_FORMAT_SONGPTR = &H4001
  1315. Global Const MCI_SEQ_FILE = &H4002
  1316. Global Const MCI_SEQ_MIDI = &H4003
  1317. Global Const MCI_SEQ_SMPTE = &H4004
  1318. Global Const MCI_SEQ_NONE = 65533
  1319.  
  1320. '  flags for the dwItem field of MCI_STATUS_PARMS parameter block
  1321. Global Const MCI_SEQ_STATUS_TEMPO = &H4002&
  1322. Global Const MCI_SEQ_STATUS_PORT = &H4003&
  1323. Global Const MCI_SEQ_STATUS_SLAVE = &H4007&
  1324. Global Const MCI_SEQ_STATUS_MASTER = &H4008&
  1325. Global Const MCI_SEQ_STATUS_OFFSET = &H4009&
  1326. Global Const MCI_SEQ_STATUS_DIVTYPE = &H400A&
  1327.  
  1328. '  flags for the dwFlags parameter of MCI_SET command message
  1329. Global Const MCI_SEQ_SET_TEMPO = &H10000
  1330. Global Const MCI_SEQ_SET_PORT = &H20000
  1331. Global Const MCI_SEQ_SET_SLAVE = &H40000
  1332. Global Const MCI_SEQ_SET_MASTER = &H80000
  1333. Global Const MCI_SEQ_SET_OFFSET = &H1000000
  1334.  
  1335. '  parameter block for MCI_SET command message
  1336. Type MCI_SEQ_SET_PARMS
  1337.     dwCallback As Long
  1338.     dwTimeFormat As Long
  1339.     dwAudio As Long
  1340.     dwTempo As Long
  1341.     dwPort As Long
  1342.     dwSlave As Long
  1343.     dwMaster As Long
  1344.     dwOffset As Long
  1345. End Type
  1346.  
  1347.  
  1348. '  MCI extensions for animation devices
  1349.  
  1350. '  flags for dwFlags parameter of MCI_OPEN command message
  1351. Global Const MCI_ANIM_OPEN_WS = &H10000
  1352. Global Const MCI_ANIM_OPEN_PARENT = &H20000
  1353. Global Const MCI_ANIM_OPEN_NOSTATIC = &H40000
  1354.  
  1355. '  flags for dwFlags parameter of MCI_PLAY command message
  1356. Global Const MCI_ANIM_PLAY_SPEED = &H10000
  1357. Global Const MCI_ANIM_PLAY_REVERSE = &H20000
  1358. Global Const MCI_ANIM_PLAY_FAST = &H40000
  1359. Global Const MCI_ANIM_PLAY_SLOW = &H80000
  1360. Global Const MCI_ANIM_PLAY_SCAN = &H100000
  1361.  
  1362. '  flags for dwFlags parameter of MCI_STEP command message
  1363. Global Const MCI_ANIM_STEP_REVERSE = &H10000
  1364. Global Const MCI_ANIM_STEP_FRAMES = &H20000
  1365.  
  1366. '  flags for dwItem field of MCI_STATUS_PARMS parameter block
  1367. Global Const MCI_ANIM_STATUS_SPEED = &H4001&
  1368. Global Const MCI_ANIM_STATUS_FORWARD = &H4002&
  1369. Global Const MCI_ANIM_STATUS_HWND = &H4003&
  1370. Global Const MCI_ANIM_STATUS_HPAL = &H4004&
  1371. Global Const MCI_ANIM_STATUS_STRETCH = &H4005&
  1372.  
  1373. '  flags for the dwFlags parameter of MCI_INFO command message
  1374. Global Const MCI_ANIM_INFO_TEXT = &H10000
  1375.  
  1376. '  flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
  1377. Global Const MCI_ANIM_GETDEVCAPS_CAN_REVERSE = &H4001&
  1378. Global Const MCI_ANIM_GETDEVCAPS_FAST_RATE = &H4002&
  1379. Global Const MCI_ANIM_GETDEVCAPS_SLOW_RATE = &H4003&
  1380. Global Const MCI_ANIM_GETDEVCAPS_NORMAL_RATE = &H4004&
  1381. Global Const MCI_ANIM_GETDEVCAPS_PALETTES = &H4006&
  1382. Global Const MCI_ANIM_GETDEVCAPS_CAN_STRETCH = &H4007&
  1383. Global Const MCI_ANIM_GETDEVCAPS_MAX_WINDOWS = &H4008&
  1384.  
  1385. '  flags for the MCI_REALIZE command message
  1386. Global Const MCI_ANIM_REALIZE_NORM = &H10000
  1387. Global Const MCI_ANIM_REALIZE_BKGD = &H20000
  1388.  
  1389. '  flags for dwFlags parameter of MCI_WINDOW command message
  1390. Global Const MCI_ANIM_WINDOW_HWND = &H10000
  1391. Global Const MCI_ANIM_WINDOW_STATE = &H40000
  1392. Global Const MCI_ANIM_WINDOW_TEXT = &H80000
  1393. Global Const MCI_ANIM_WINDOW_ENABLE_STRETCH = &H100000
  1394. Global Const MCI_ANIM_WINDOW_DISABLE_STRETCH = &H200000
  1395.  
  1396. '  flags for hWnd field of MCI_ANIM_WINDOW_PARMS parameter block
  1397. Global Const MCI_ANIM_WINDOW_DEFAULT = &H0&
  1398.  
  1399. '  flags for dwFlags parameter of MCI_PUT command message
  1400. Global Const MCI_ANIM_RECT = &H10000
  1401. Global Const MCI_ANIM_PUT_SOURCE = &H20000
  1402. Global Const MCI_ANIM_PUT_DESTINATION = &H40000
  1403.  
  1404. '  flags for dwFlags parameter of MCI_WHERE command message
  1405. Global Const MCI_ANIM_WHERE_SOURCE = &H20000
  1406. Global Const MCI_ANIM_WHERE_DESTINATION = &H40000
  1407.  
  1408. '  flags for dwFlags parameter of MCI_UPDATE command message
  1409. Global Const MCI_ANIM_UPDATE_HDC = &H20000
  1410.  
  1411. '  parameter block for MCI_OPEN command message
  1412. Type MCI_ANIM_OPEN_PARMS
  1413.     dwCallback As Long
  1414.     wDeviceID As Integer
  1415.     wReserved0 As Integer
  1416.     lpstrDeviceType As String
  1417.     lpstrElementName As String
  1418.     lpstrAlias As String
  1419.     dwStyle As Long
  1420.     hWndParent As Integer
  1421.     wReserved1 As Integer
  1422. End Type
  1423.  
  1424. '  parameter block for MCI_PLAY command message
  1425. Type MCI_ANIM_PLAY_PARMS
  1426.     dwCallback As Long
  1427.     dwFrom As Long
  1428.     dwTo As Long
  1429.     dwSpeed As Long
  1430. End Type
  1431.  
  1432. '  parameter block for MCI_STEP command message
  1433. Type MCI_ANIM_STEP_PARMS
  1434.     dwCallback As Long
  1435.     dwFrames As Long
  1436. End Type
  1437.  
  1438. '  parameter block for MCI_WINDOW command message
  1439. Type MCI_ANIM_WINDOW_PARMS
  1440.     dwCallback As Long
  1441.     hWnd As Integer
  1442.     wReserved1 As Integer
  1443.     nCmdShow As Integer
  1444.     wReserved2 As Integer
  1445.     lpstrText As String
  1446. End Type
  1447.  
  1448. '  parameter block for MCI_PUT, MCI_UPDATE, MCI_WHERE command messages
  1449. Type MCI_ANIM_RECT_PARMS
  1450.     dwCallback As Long
  1451.     rc As RECT
  1452. End Type
  1453.  
  1454. '  parameter block for MCI_UPDATE PARMS
  1455. Type MCI_ANIM_UPDATE_PARMS
  1456.     dwCallback As Long
  1457.     rc As RECT
  1458.     hDC As Integer
  1459. End Type
  1460.  
  1461.  
  1462. '  MCI extensions for video overlay devices
  1463.  
  1464. '  flags for dwFlags parameter of MCI_OPEN command message
  1465. Global Const MCI_OVLY_OPEN_WS = &H10000
  1466. Global Const MCI_OVLY_OPEN_PARENT = &H20000
  1467.  
  1468. '  flags for dwFlags parameter of MCI_STATUS command message
  1469. Global Const MCI_OVLY_STATUS_HWND = &H4001&
  1470. Global Const MCI_OVLY_STATUS_STRETCH = &H4002&
  1471.  
  1472. '  flags for dwFlags parameter of MCI_INFO command message
  1473. Global Const MCI_OVLY_INFO_TEXT = &H10000
  1474.  
  1475. '  flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
  1476. Global Const MCI_OVLY_GETDEVCAPS_CAN_STRETCH = &H4001&
  1477. Global Const MCI_OVLY_GETDEVCAPS_CAN_FREEZE = &H4002&
  1478. Global Const MCI_OVLY_GETDEVCAPS_MAX_WINDOWS = &H4003&
  1479.  
  1480. '  flags for dwFlags parameter of MCI_WINDOW command message
  1481. Global Const MCI_OVLY_WINDOW_HWND = &H10000
  1482. Global Const MCI_OVLY_WINDOW_STATE = &H40000
  1483. Global Const MCI_OVLY_WINDOW_TEXT = &H80000
  1484. Global Const MCI_OVLY_WINDOW_ENABLE_STRETCH = &H100000
  1485. Global Const MCI_OVLY_WINDOW_DISABLE_STRETCH = &H200000
  1486.  
  1487. '  flags for hWnd parameter of MCI_OVLY_WINDOW_PARMS parameter block
  1488. Global Const MCI_OVLY_WINDOW_DEFAULT = &H0&
  1489.  
  1490. '  flags for dwFlags parameter of MCI_PUT command message
  1491. Global Const MCI_OVLY_RECT = &H10000
  1492. Global Const MCI_OVLY_PUT_SOURCE = &H20000
  1493. Global Const MCI_OVLY_PUT_DESTINATION = &H40000
  1494. Global Const MCI_OVLY_PUT_FRAME = &H80000
  1495. Global Const MCI_OVLY_PUT_VIDEO = &H100000
  1496.  
  1497. '  flags for dwFlags parameter of MCI_WHERE command message
  1498. Global Const MCI_OVLY_WHERE_SOURCE = &H20000
  1499. Global Const MCI_OVLY_WHERE_DESTINATION = &H40000
  1500. Global Const MCI_OVLY_WHERE_FRAME = &H80000
  1501. Global Const MCI_OVLY_WHERE_VIDEO = &H100000
  1502.  
  1503. '  parameter block for MCI_OPEN command message
  1504. Type MCI_OVLY_OPEN_PARMS
  1505.     dwCallback As Long
  1506.     wDeviceID As Integer
  1507.     wReserved0 As Integer
  1508.     lpstrDeviceType As String
  1509.     lpstrElementName As String
  1510.     lpstrAlias As String
  1511.     dwStyle As Long
  1512.     hWndParent As Integer
  1513.     wReserved1 As Integer
  1514. End Type
  1515.  
  1516. '  parameter block for MCI_WINDOW command message
  1517. Type MCI_OVLY_WINDOW_PARMS
  1518.     dwCallback As Long
  1519.     hWnd As Integer
  1520.     wReserved1 As Integer
  1521.     nCmdShow As Integer
  1522.     wReserved2 As Integer
  1523.     lpstrText As String
  1524. End Type
  1525.  
  1526. '  parameter block for MCI_PUT, MCI_UPDATE, and MCI_WHERE command messages
  1527. Type MCI_OVLY_RECT_PARMS
  1528.     dwCallback As Long
  1529.     rc As RECT
  1530. End Type
  1531.  
  1532. '  parameter block for MCI_SAVE command message
  1533. Type MCI_OVLY_SAVE_PARMS
  1534.     dwCallback As Long
  1535.     lpfilename As String
  1536.     rc As RECT
  1537. End Type
  1538.  
  1539. '  parameter block for MCI_LOAD command message
  1540. Type MCI_OVLY_LOAD_PARMS
  1541.     dwCallback As Long
  1542.     lpfilename As String
  1543.     rc As RECT
  1544. End Type
  1545.  
  1546.  
  1547. ' ***************************************************************************
  1548.  
  1549. '                         DISPLAY Driver extensions
  1550.  
  1551. ' ****************************************************************************/
  1552.  
  1553. Global Const CAPS1 = 94                     '  other caps
  1554. Global Const C1_TRANSPARENT = &H1           '  new raster cap
  1555. Global Const NEWTRANSPARENT = 3             '  use with SetBkMode()
  1556. Global Const QUERYROPSUPPORT = 40           '  use to determine ROP support
  1557.  
  1558. ' ***************************************************************************
  1559.  
  1560. '                         DIB Driver extensions
  1561.  
  1562. ' ****************************************************************************/
  1563.  
  1564. Global Const SELECTDIB = 41                             '  DIB.DRV select dib escape
  1565.  
  1566.  
  1567. ' ***************************************************************************
  1568.  
  1569. '                         ScreenSaver support
  1570.  
  1571. '     The current application will receive a syscommand of SC_SCREENSAVE just
  1572. '     before the screen saver is invoked.  If the app wishes to prevent a
  1573. '     screen save, return non-zero value, otherwise call DefWindowProc().
  1574.  
  1575. ' ****************************************************************************/
  1576.  
  1577.  
  1578. Global Const SC_SCREENSAVE = &HF140
  1579.  
  1580.