📄 mmsystem.inc
字号:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; MMSYSTEM.INC - Multimedia assembly language structures & constants
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; If defined, the following flags inhibit inclusion
; of the indicated items:
;
; MMNODRV - Installable driver support
; MMNOSOUND - Sound support
; MMNOWAVE - Waveform support
; MMNOMIDI - MIDI support
; MMNOAUX - Auxiliary audio support
; MMNOTIMER - Timer support
; MMNOJOY - Joystick support
; MMNOMCI - MCI support
; MMNOMMIO - Multimedia file I/O support
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; General constants and data types
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; general constants
MAXPNAMELEN equ 32 ; max product name length (including NULL)
MAXERRORLENGTH equ 128 ; max error text length (including NULL)
; MMTIME data structure
MMTIME struc
mmt_wType dw ? ; indicates the contents of the union
mmt_TimeUnion dd ? ; union
MMTIME ends
SMPTE struc
smpte_hour db ? ; hours
smpte_min db ? ; minutes
smpte_sec db ? ; seconds
smpte_frame db ? ; frames
smpte_fps db ? ; frames per second
smpte_reserved db ? ; pad
SMPTE ends
; types for wType field in MMTIME struct
TIME_MS equ 0001h ; time in milliseconds
TIME_SAMPLES equ 0002h ; number of wave samples
TIME_BYTES equ 0004h ; current byte offset
TIME_SMPTE equ 0008h ; SMPTE time
TIME_MIDI equ 0010h ; MIDI time
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Multimedia Extensions Window Messages
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MM_JOY1MOVE equ 3A0h ; joystick
MM_JOY2MOVE equ 3A1h
MM_JOY1ZMOVE equ 3A2h
MM_JOY2ZMOVE equ 3A3h
MM_JOY1BUTTONDOWN equ 3B5h
MM_JOY2BUTTONDOWN equ 3B6h
MM_JOY1BUTTONUP equ 3B7h
MM_JOY2BUTTONUP equ 3B8h
MM_MCINOTIFY equ 3B9h ; MCI
MM_MCISYSTEM_STRING equ 3CAh
MM_WOM_OPEN equ 3BBh ; waveform output
MM_WOM_CLOSE equ 3BCh
MM_WOM_DONE equ 3BDh
MM_WIM_OPEN equ 3BEh ; waveform input
MM_WIM_CLOSE equ 3BFh
MM_WIM_DATA equ 3C0h
MM_MIM_OPEN equ 3C1h ; MIDI input
MM_MIM_CLOSE equ 3C2h
MM_MIM_DATA equ 3C3h
MM_MIM_LONGDATA equ 3C4h
MM_MIM_ERROR equ 3C5h
MM_MIM_LONGERROR equ 3C6h
MM_MOM_OPEN equ 3C7h ; MIDI output
MM_MOM_CLOSE equ 3C8h
MM_MOM_DONE equ 3C9h
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; String resource number bases (internal use)
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MMSYSERR_BASE equ 0
WAVERR_BASE equ 32
MIDIERR_BASE equ 64
TIMERR_BASE equ 96
JOYERR_BASE equ 160
MCIERR_BASE equ 256
MCI_STRING_OFFSET equ 512
MCI_VD_OFFSET equ 1024
MCI_CD_OFFSET equ 1088
MCI_WAVE_OFFSET equ 1152
MCI_SEQ_OFFSET equ 1216
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; General error return values
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; general error return values
MMSYSERR_NOERROR equ 0 ; no error
MMSYSERR_ERROR equ (MMSYSERR_BASE + 1) ; unspecified error
MMSYSERR_BADDEVICEID equ (MMSYSERR_BASE + 2) ; device ID out of range
MMSYSERR_NOTENABLED equ (MMSYSERR_BASE + 3) ; driver failed enable
MMSYSERR_ALLOCATED equ (MMSYSERR_BASE + 4) ; device already allocated
MMSYSERR_INVALHANDLE equ (MMSYSERR_BASE + 5) ; device handle is invalid
MMSYSERR_NODRIVER equ (MMSYSERR_BASE + 6) ; no device driver present
MMSYSERR_NOMEM equ (MMSYSERR_BASE + 7) ; memory allocation error
MMSYSERR_NOTSUPPORTED equ (MMSYSERR_BASE + 8) ; function isn't supported
MMSYSERR_BADERRNUM equ (MMSYSERR_BASE + 9) ; error value out of range
MMSYSERR_INVALFLAG equ (MMSYSERR_BASE + 10) ; invalid flags passed
MMSYSERR_INVALPARAM equ (MMSYSERR_BASE + 11) ; invalid parameter passed
MMSYSERR_LASTERROR equ (MMSYSERR_BASE + 11) ; last error in range
ifndef MMNODRV
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Installable driver support
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DRV_MCI_FIRST equ DRV_RESERVED
DRV_MCI_LAST equ (DRV_RESERVED + 0FFFh)
endif ;ifndef MMNODRV
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Driver callback support
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and
; midiOutOpen() to specify the type of the dwCallback parameter.
CALLBACK_TYPEMASK equ 00070000h ; callback type mask
CALLBACK_NULL equ 00000000h ; no callback
CALLBACK_WINDOW equ 00010000h ; dwCallback is a HWND
CALLBACK_TASK equ 00020000h ; dwCallback is a HTASK
CALLBACK_FUNCTION equ 00030000h ; dwCallback is a FARPROC
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Manufacturer and product IDs
;
; Used with wMid and wPid fields in WAVEOUTCAPS, WAVEINCAPS,
; MIDIOUTCAPS, MIDIINCAPS, AUXCAPS, JOYCAPS structures.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; manufacturer IDs
MM_MICROSOFT equ 1 ; Microsoft Corp.
; product IDs
MM_MIDI_MAPPER equ 1 ; MIDI Mapper
MM_WAVE_MAPPER equ 2 ; Wave Mapper
MM_SNDBLST_MIDIOUT equ 3 ; Sound Blaster MIDI output port
MM_SNDBLST_MIDIIN equ 4 ; Sound Blaster MIDI input port
MM_SNDBLST_SYNTH equ 5 ; Sound Blaster internal synthesizer
MM_SNDBLST_WAVEOUT equ 6 ; Sound Blaster waveform output
MM_SNDBLST_WAVEIN equ 7 ; Sound Blaster waveform input
MM_ADLIB equ 9 ; Ad Lib-compatible synthesizer
MM_MPU401_MIDIOUT equ 10 ; MPU401-compatible MIDI output port
MM_MPU401_MIDIIN equ 11 ; MPU401-compatible MIDI input port
MM_PC_JOYSTICK equ 12 ; Joystick adapter
ifndef MMNOSOUND
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Sound support
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; flag values for wFlags parameter
SND_SYNC equ 0000h ; play synchronously (default)
SND_ASYNC equ 0001h ; play asynchronously
SND_NODEFAULT equ 0002h ; don't use default sound
SND_MEMORY equ 0004h ; lpszSoundName points to a memory file
SND_LOOP equ 0008h ; loop the sound until next sndPlaySound
SND_NOSTOP equ 0010h ; don't stop any currently playing sound
endif ;ifndef MMNOSOUND
ifndef MMNOWAVE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Waveform audio support
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; waveform audio error return values
WAVERR_BADFORMAT equ (WAVERR_BASE + 0) ; unsupported wave format
WAVERR_STILLPLAYING equ (WAVERR_BASE + 1) ; still something playing
WAVERR_UNPREPARED equ (WAVERR_BASE + 2) ; header not prepared
WAVERR_SYNC equ (WAVERR_BASE + 3) ; device is synchronous
WAVERR_LASTERROR equ (WAVERR_BASE + 3) ; last error in range
; wave callback messages
WOM_OPEN equ MM_WOM_OPEN
WOM_CLOSE equ MM_WOM_CLOSE
WOM_DONE equ MM_WOM_DONE
WIM_OPEN equ MM_WIM_OPEN
WIM_CLOSE equ MM_WIM_CLOSE
WIM_DATA equ MM_WIM_DATA
; device ID for wave device mapper
WAVE_MAPPER equ (-1)
; flags for dwFlags parameter in waveOutOpen() and waveInOpen()
WAVE_FORMAT_QUERY equ 0001h
WAVE_ALLOWSYNC equ 0002h
; wave data block header
WAVEHDR struc
lpWaveData dd ? ; pointer to locked data buffer
dwWaveBufferLength dd ? ; length of data buffer
dwWaveBytesRecorded dd ? ; used for input only
dwWaveUser dd ? ; for client's use
dwWaveFlags dd ? ; assorted flags (see defines)
dwWaveLoops dd ? ; loop control counter
lpWaveNext dd ? ; reserved for driver
Wavereserved dd ? ; reserved for driver
WAVEHDR ends
; flags for dwFlags field of WAVEHDR
WHDR_DONE equ 00000001h ; done bit
WHDR_PREPARED equ 00000002h ; set if this header has been prepared
WHDR_BEGINLOOP equ 00000004h ; loop start block
WHDR_ENDLOOP equ 00000008h ; loop end block
WHDR_INQUEUE equ 00000010h ; reserved for driver
; waveform output device capabilities structure
WAVEOUTCAPS struc
woc_wMid dw ? ; manufacturer ID
woc_wPid dw ? ; product ID
woc_vDriverVersion dw ? ; version of the driver
woc_szPname db MAXPNAMELEN dup (?) ; product name (NULL terminated string)
woc_dwFormats dd ? ; formats supported
woc_wChannels dw ? ; number of sources supported
woc_dwSupport dd ? ; functionality supported by driver
WAVEOUTCAPS ends
; flags for dwSupport field of WAVEOUTCAPS
WAVECAPS_PITCH equ 0001h ; supports pitch control
WAVECAPS_PLAYBACKRATE equ 0002h ; supports playback rate control
WAVECAPS_VOLUME equ 0004h ; supports volume control
WAVECAPS_LRVOLUME equ 0008h ; separate left-right volume control
WAVECAPS_SYNC equ 0010h
; waveform input device capabilities structure
WAVEINCAPS struc
wic_wMid dw ? ; manufacturer ID
wic_wPid dw ? ; product ID
wic_vDriverVersion dw ? ; version of the driver
wic_szPname db MAXPNAMELEN dup (?) ; product name (NULL terminated string)
wic_dwFormats dd ? ; formats supported
wic_wChannels dw ? ; number of channels supported
WAVEINCAPS ends
; defines for dwFormat field of WAVEINCAPS and WAVEOUTCAPS
WAVE_INVALIDFORMAT equ 00000000h ; invalid format
WAVE_FORMAT_1M08 equ 00000001h ; 11.025 kHz, Mono, 8-bit
WAVE_FORMAT_1S08 equ 00000002h ; 11.025 kHz, Stereo, 8-bit
WAVE_FORMAT_1M16 equ 00000004h ; 11.025 kHz, Mono, 16-bit
WAVE_FORMAT_1S16 equ 00000008h ; 11.025 kHz, Stereo, 16-bit
WAVE_FORMAT_2M08 equ 00000010h ; 22.05 kHz, Mono, 8-bit
WAVE_FORMAT_2S08 equ 00000020h ; 22.05 kHz, Stereo, 8-bit
WAVE_FORMAT_2M16 equ 00000040h ; 22.05 kHz, Mono, 16-bit
WAVE_FORMAT_2S16 equ 00000080h ; 22.05 kHz, Stereo, 16-bit
WAVE_FORMAT_4M08 equ 00000100h ; 44.1 kHz, Mono, 8-bit
WAVE_FORMAT_4S08 equ 00000200h ; 44.1 kHz, Stereo, 8-bit
WAVE_FORMAT_4M16 equ 00000400h ; 44.1 kHz, Mono, 16-bit
WAVE_FORMAT_4S16 equ 00000800h ; 44.1 kHz, Stereo, 16-bit
; general waveform format structure (information common to all formats)
WAVEFORMAT struc
wfmt_wFormatTag dw ? ; format type
wfmt_nChannels dw ? ; number of channels (i.e. mono, stereo, etc.)
wfmt_nSamplesPerSec dd ? ; sample rate
wfmt_nAvgBytesPerSec dd ? ; for buffer estimation
wfmt_nBlockAlign dw ? ; block size of data
WAVEFORMAT ends
; flags for wFormatTag field of WAVEFORMAT
WAVE_FORMAT_PCM equ 1
; specific waveform format structure for PCM data
PCMWAVEFORMAT struc
pcm_wf db (SIZE WAVEFORMAT) dup (?)
pcm_wBitsPerSample dw ?
PCMWAVEFORMAT ends
endif ;ifndef MMNOWAVE
ifndef MMNOMIDI
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; MIDI audio support
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MIDI error return values
MIDIERR_UNPREPARED equ (MIDIERR_BASE + 0) ; header not prepared
MIDIERR_STILLPLAYING equ (MIDIERR_BASE + 1) ; still something playing
MIDIERR_NOMAP equ (MIDIERR_BASE + 2) ; no current map
MIDIERR_NOTREADY equ (MIDIERR_BASE + 3) ; hardware is still busy
MIDIERR_NODEVICE equ (MIDIERR_BASE + 4) ; port no longer connected
MIDIERR_INVALIDSETUP equ (MIDIERR_BASE + 5) ; invalid setup
MIDIERR_LASTERROR equ (MIDIERR_BASE + 5) ; last error in range
; MIDI audio data types
MIDIPATCHSIZE equ 128
; MIDI callback messages
MIM_OPEN equ MM_MIM_OPEN
MIM_CLOSE equ MM_MIM_CLOSE
MIM_DATA equ MM_MIM_DATA
MIM_LONGDATA equ MM_MIM_LONGDATA
MIM_ERROR equ MM_MIM_ERROR
MIM_LONGERROR equ MM_MIM_LONGERROR
MOM_OPEN equ MM_MOM_OPEN
MOM_CLOSE equ MM_MOM_CLOSE
MOM_DONE equ MM_MOM_DONE
; device ID for MIDI mapper
MIDIMAPPER equ (-1)
MIDI_MAPPER equ (-1)
; flags for wFlags parm of midiOutCachePatches(),
; midiOutCacheDrumPatches()
MIDI_CACHE_ALL equ 1
MIDI_CACHE_BESTFIT equ 2
MIDI_CACHE_QUERY equ 3
MIDI_UNCACHE equ 4
; MIDI output device capabilities structure
MIDIOUTCAPS struc
moc_wMid dw ? ; manufacturer ID
moc_wPid dw ? ; product ID
moc_vDriverVersion dw ? ; version of the driver
moc_szPname db MAXPNAMELEN dup (?) ; product name (NULL terminated string)
moc_wTechnology dw ? ; type of device
moc_wVoices dw ? ; # of voices (internal synth only)
moc_wNotes dw ? ; max # of notes (internal synth only)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -