📄 winmm.odl
字号:
[
uuid(5467404E-3A82-101B-8181-00AA003743D3),
helpstring("Windows Multimedia Functions"),
#ifdef WIN32
dllname("WINMM.DLL")
#else
dllname("MMSYSTEM.DLL")
#endif
]
module Multimedia {
/*
// ******* Multimedia messages *******
const UINT MM_JOY1MOVE = 0x3A0; // joystick
const UINT MM_JOY2MOVE = 0x3A1;
const UINT MM_JOY1ZMOVE = 0x3A2;
const UINT MM_JOY2ZMOVE = 0x3A3;
const UINT MM_JOY1BUTTONDOWN = 0x3B5;
const UINT MM_JOY2BUTTONDOWN = 0x3B6;
const UINT MM_JOY1BUTTONUP = 0x3B7;
const UINT MM_JOY2BUTTONUP = 0x3B8;
const UINT MM_MCINOTIFY = 0x3B9; // MCI
const UINT MM_WOM_OPEN = 0x3BB; // waveform output
const UINT MM_WOM_CLOSE = 0x3BC;
const UINT MM_WOM_DONE = 0x3BD;
const UINT MM_WIM_OPEN = 0x3BE; // waveform input
const UINT MM_WIM_CLOSE = 0x3BF;
const UINT MM_WIM_DATA = 0x3C0;
const UINT MM_MIM_OPEN = 0x3C1; // MIDI input
const UINT MM_MIM_CLOSE = 0x3C2;
const UINT MM_MIM_DATA = 0x3C3;
const UINT MM_MIM_LONGDATA = 0x3C4;
const UINT MM_MIM_ERROR = 0x3C5;
const UINT MM_MIM_LONGERROR = 0x3C6;
const UINT MM_MOM_OPEN = 0x3C7; // MIDI output
const UINT MM_MOM_CLOSE = 0x3C8;
const UINT MM_MOM_DONE = 0x3C9;
// ****** String resource number bases (internal use) *****
const int MMSYSERR_BASE = 0;
const int WAVERR_BASE = 32;
const int MIDIERR_BASE = 64;
const int TIMERR_BASE = 96;
const int JOYERR_BASE = 160;
const int MCIERR_BASE = 256;
const int MCI_STRING_OFFSET = 512;
const int MCI_VD_OFFSET = 1024;
const int MCI_CD_OFFSET = 1088;
const int MCI_WAVE_OFFSET = 1152;
const int MCI_SEQ_OFFSET = 1216;
// ******* General error return values ********
// general error return values
const int MMSYSERR_NOERROR = 0; // no error
//define MMSYSERR_ERROR (MMSYSERR_BASE + 1) // unspecified error
//define MMSYSERR_BADDEVICEID (MMSYSERR_BASE + 2) // device ID out of range
//define MMSYSERR_NOTENABLED (MMSYSERR_BASE + 3) // driver failed enable
//define MMSYSERR_ALLOCATED (MMSYSERR_BASE + 4) // device already allocated
//define MMSYSERR_INVALHANDLE (MMSYSERR_BASE + 5) // device handle is invalid
//define MMSYSERR_NODRIVER (MMSYSERR_BASE + 6) // no device driver present
//define MMSYSERR_NOMEM (MMSYSERR_BASE + 7) // memory allocation error
//define MMSYSERR_NOTSUPPORTED (MMSYSERR_BASE + 8) // function isn't supported
//define MMSYSERR_BADERRNUM (MMSYSERR_BASE + 9) // error value out of range
//define MMSYSERR_INVALFLAG (MMSYSERR_BASE + 10) // invalid flag passed
//define MMSYSERR_INVALPARAM (MMSYSERR_BASE + 11) // invalid parameter passed
//define MMSYSERR_LASTERROR (MMSYSERR_BASE + 11) // last error in range
*/
// ******** Omit Installable driver support *****
// ******* Omit Driver callback support ******
// ******* Manufacturer and product IDs *****
/*
// Used with wMid and wPid fields in WAVEOUTCAPS, WAVEINCAPS,
// MIDIOUTCAPS, MIDIINCAPS, AUXCAPS, JOYCAPS structures.
// manufacturer IDs
const int MM_MICROSOFT = 1; // Microsoft Corp.
// product IDs
const int MM_MIDI_MAPPER = 1; // MIDI Mapper
const int MM_WAVE_MAPPER = 2; // Wave Mapper
const int MM_SNDBLST_MIDIOUT = 3; // Sound Blaster MIDI output port
const int MM_SNDBLST_MIDIIN = 4; // Sound Blaster MIDI input port
const int MM_SNDBLST_SYNTH = 5; // Sound Blaster internal synthesizer
const int MM_SNDBLST_WAVEOUT = 6; // Sound Blaster waveform output
const int MM_SNDBLST_WAVEIN = 7; // Sound Blaster waveform input
const int MM_ADLIB = 9 ; // Ad Lib-compatible synthesizer
const int MM_MPU401_MIDIOUT = 10; // MPU401-compatible MIDI output port
const int MM_MPU401_MIDIIN = 11; // MPU401-compatible MIDI input port
//define MM_PC_JOYSTICK 12 // Joystick adapter
*/
// ****** General MMSYSTEM support *******
/*
WORD WINAPI mmsystemGetVersion(void);
*/
// ****** Sound support ******
[
#ifdef WIN32
usesgetlasterror,
entry("sndPlaySoundA"),
#else
entry("sndPlaySound"),
#endif
helpstring("Plays a sound pointer according to flags"),
]
BOOL WINAPI sndPlaySound([in] LPSTR lpszSound, [in] UINT uFlags);
[
#ifdef WIN32
usesgetlasterror,
entry("sndPlaySoundA"),
#else
entry("sndPlaySound"),
#endif
helpstring("Plays a sound string according to flags"),
]
BOOL WINAPI sndPlaySoundAsBytes([in] BYTE FAR * lpbSoundName, [in] UINT uFlags);
[
#ifdef WIN32
usesgetlasterror,
entry("sndPlaySoundA"),
#else
entry("sndPlaySound"),
#endif
helpstring("Plays a sound pointer according to flags"),
]
BOOL WINAPI sndPlaySoundAsLp([in] DWORD dwSound, [in] UINT uFlags);
// flag values for wFlags parameter
[ helpstring("sndPlaySound: Play synchronously (default)") ]
const UINT SND_SYNC = 0x0000;
[ helpstring("sndPlaySound: Play asynchronously") ]
const UINT SND_ASYNC = 0x0001;
[ helpstring("sndPlaySound: Don't use default sound") ]
const UINT SND_NODEFAULT = 0x0002;
[ helpstring("sndPlaySound: String parameter points to sound in memory") ]
const UINT SND_MEMORY = 0x0004;
[ helpstring("sndPlaySound: Loop the sound until next sndPlaySound") ]
const UINT SND_LOOP = 0x0008;
[ helpstring("sndPlaySound: Don't stop any currently playing sound") ]
const UINT SND_NOSTOP = 0x0010;
// ****** Waveform audio support ******
/*
// waveform audio error return values
//define WAVERR_BADFORMAT (WAVERR_BASE + 0) // unsupported wave format
//define WAVERR_STILLPLAYING (WAVERR_BASE + 1) // still something playing
//define WAVERR_UNPREPARED (WAVERR_BASE + 2) // header not prepared
//define WAVERR_SYNC (WAVERR_BASE + 3) // device is synchronous
//define WAVERR_LASTERROR (WAVERR_BASE + 3) // last error in range
// waveform audio data types
DECLARE_HANDLE(HWAVE);
DECLARE_HANDLE(HWAVEIN);
DECLARE_HANDLE(HWAVEOUT);
typedef HWAVEIN FAR *LPHWAVEIN;
typedef HWAVEOUT FAR *LPHWAVEOUT;
typedef DRVCALLBACK WAVECALLBACK;
typedef WAVECALLBACK FAR *LPWAVECALLBACK;
// Omit wave callback messages
// device ID for wave device mapper
//define WAVE_MAPPER (-1)
// flags for dwFlags parameter in waveOutOpen() and waveInOpen()
//define WAVE_FORMAT_QUERY 0x0001
//define WAVE_ALLOWSYNC 0x0002
// wave data block header
typedef struct wavehdr_tag {
LPSTR lpData; // pointer to locked data buffer
DWORD dwBufferLength; // length of data buffer
DWORD dwBytesRecorded; // used for input only
DWORD dwUser; // for client's use
DWORD dwFlags; // assorted flags (see defines)
DWORD dwLoops; // loop control counter
struct wavehdr_tag far *lpNext; // reserved for driver
DWORD reserved; // reserved for driver
} WAVEHDR;
typedef WAVEHDR *PWAVEHDR;
typedef WAVEHDR NEAR *NPWAVEHDR;
typedef WAVEHDR FAR *LPWAVEHDR;
// flags for dwFlags field of WAVEHDR
//define WHDR_DONE 0x00000001 // done bit
//define WHDR_PREPARED 0x00000002 // set if this header has been prepared
//define WHDR_BEGINLOOP 0x00000004 // loop start block
//define WHDR_ENDLOOP 0x00000008 // loop end block
//define WHDR_INQUEUE 0x00000010 // reserved for driver
// waveform output device capabilities structure
typedef struct waveoutcaps_tag {
UINT wMid; // manufacturer ID
UINT wPid; // product ID
VERSION vDriverVersion; // version of the driver
char szPname[MAXPNAMELEN]; // product name (NULL terminated string)
DWORD dwFormats; // formats supported
UINT wChannels; // number of sources supported
DWORD dwSupport; // functionality supported by driver
} WAVEOUTCAPS;
typedef WAVEOUTCAPS *PWAVEOUTCAPS;
typedef WAVEOUTCAPS NEAR *NPWAVEOUTCAPS;
typedef WAVEOUTCAPS FAR *LPWAVEOUTCAPS;
// flags for dwSupport field of WAVEOUTCAPS
//define WAVECAPS_PITCH 0x0001 // supports pitch control
//define WAVECAPS_PLAYBACKRATE 0x0002 // supports playback rate control
//define WAVECAPS_VOLUME 0x0004 // supports volume control
//define WAVECAPS_LRVOLUME 0x0008 // separate left-right volume control
//define WAVECAPS_SYNC 0x0010
// waveform input device capabilities structure
typedef struct waveincaps_tag {
UINT wMid; // manufacturer ID
UINT wPid; // product ID
VERSION vDriverVersion; // version of the driver
char szPname[MAXPNAMELEN]; // product name (NULL terminated string)
DWORD dwFormats; // formats supported
UINT wChannels; // number of channels supported
} WAVEINCAPS;
typedef WAVEINCAPS *PWAVEINCAPS;
typedef WAVEINCAPS NEAR *NPWAVEINCAPS;
typedef WAVEINCAPS FAR *LPWAVEINCAPS;
// defines for dwFormat field of WAVEINCAPS and WAVEOUTCAPS
//define WAVE_INVALIDFORMAT 0x00000000 // invalid format
//define WAVE_FORMAT_1M08 0x00000001 // 11.025 kHz, Mono, 8-bit
//define WAVE_FORMAT_1S08 0x00000002 // 11.025 kHz, Stereo, 8-bit
//define WAVE_FORMAT_1M16 0x00000004 // 11.025 kHz, Mono, 16-bit
//define WAVE_FORMAT_1S16 0x00000008 // 11.025 kHz, Stereo, 16-bit
//define WAVE_FORMAT_2M08 0x00000010 // 22.05 kHz, Mono, 8-bit
//define WAVE_FORMAT_2S08 0x00000020 // 22.05 kHz, Stereo, 8-bit
//define WAVE_FORMAT_2M16 0x00000040 // 22.05 kHz, Mono, 16-bit
//define WAVE_FORMAT_2S16 0x00000080 // 22.05 kHz, Stereo, 16-bit
//define WAVE_FORMAT_4M08 0x00000100 // 44.1 kHz, Mono, 8-bit
//define WAVE_FORMAT_4S08 0x00000200 // 44.1 kHz, Stereo, 8-bit
//define WAVE_FORMAT_4M16 0x00000400 // 44.1 kHz, Mono, 16-bit
//define WAVE_FORMAT_4S16 0x00000800 // 44.1 kHz, Stereo, 16-bit
// general waveform format structure (information common to all formats)
typedef struct waveformat_tag {
WORD wFormatTag; // format type
WORD nChannels; // number of channels (i.e. mono, stereo, etc.)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -