📄 mmsystem.h
字号:
/****************************************************************************/
/* */
/* MMSYSTEM.H - Include file for Multimedia APIs */
/* */
/****************************************************************************/
/* 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
* MMNOMMSYSTEM - General MMSYSTEM functions
*/
#ifndef __MMSYSTEM_H /* prevent multiple includes */
#define __MMSYSTEM_H
#ifndef __WINDOWS_H
#include <windows.h> /* <windows.h> must be included */
#endif /* __WINDOWS_H */
#if !defined(WINVER) || (WINVER < 0x030a)
#error Multimedia APIs require Windows 3.1
#endif
#ifndef RC_INVOKED
#pragma option -a- /* Assume byte packing throughout */
#endif
#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++ */
#endif /* __cplusplus */
/****************************************************************************
General constants and data types
****************************************************************************/
/* general constants */
#define MAXPNAMELEN 32 /* max product name length (including NULL) */
#define MAXERRORLENGTH 128 /* max error text length (including NULL) */
/* general data types */
typedef WORD VERSION; /* major (high byte), minor (low byte) */
/* MMTIME data structure */
typedef struct mmtime_tag {
UINT wType; /* indicates the contents of the union */
union {
DWORD ms; /* milliseconds */
DWORD sample; /* samples */
DWORD cb; /* byte count */
struct { /* SMPTE */
BYTE hour; /* hours */
BYTE min; /* minutes */
BYTE sec; /* seconds */
BYTE frame; /* frames */
BYTE fps; /* frames per second */
BYTE dummy; /* pad */
} smpte;
struct { /* MIDI */
DWORD songptrpos; /* song pointer position */
} midi;
} u;
} MMTIME;
typedef MMTIME *PMMTIME;
typedef MMTIME NEAR *NPMMTIME;
typedef MMTIME FAR *LPMMTIME;
/* types for wType field in MMTIME struct */
#define TIME_MS 0x0001 /* time in milliseconds */
#define TIME_SAMPLES 0x0002 /* number of wave samples */
#define TIME_BYTES 0x0004 /* current byte offset */
#define TIME_SMPTE 0x0008 /* SMPTE time */
#define TIME_MIDI 0x0010 /* MIDI time */
/****************************************************************************
Multimedia Extensions Window Messages
****************************************************************************/
#define MM_JOY1MOVE 0x3A0 /* joystick */
#define MM_JOY2MOVE 0x3A1
#define MM_JOY1ZMOVE 0x3A2
#define MM_JOY2ZMOVE 0x3A3
#define MM_JOY1BUTTONDOWN 0x3B5
#define MM_JOY2BUTTONDOWN 0x3B6
#define MM_JOY1BUTTONUP 0x3B7
#define MM_JOY2BUTTONUP 0x3B8
#define MM_MCINOTIFY 0x3B9 /* MCI */
#define MM_WOM_OPEN 0x3BB /* waveform output */
#define MM_WOM_CLOSE 0x3BC
#define MM_WOM_DONE 0x3BD
#define MM_WIM_OPEN 0x3BE /* waveform input */
#define MM_WIM_CLOSE 0x3BF
#define MM_WIM_DATA 0x3C0
#define MM_MIM_OPEN 0x3C1 /* MIDI input */
#define MM_MIM_CLOSE 0x3C2
#define MM_MIM_DATA 0x3C3
#define MM_MIM_LONGDATA 0x3C4
#define MM_MIM_ERROR 0x3C5
#define MM_MIM_LONGERROR 0x3C6
#define MM_MOM_OPEN 0x3C7 /* MIDI output */
#define MM_MOM_CLOSE 0x3C8
#define MM_MOM_DONE 0x3C9
/****************************************************************************
String resource number bases (internal use)
****************************************************************************/
#define MMSYSERR_BASE 0
#define WAVERR_BASE 32
#define MIDIERR_BASE 64
#define TIMERR_BASE 96
#define JOYERR_BASE 160
#define MCIERR_BASE 256
#define MCI_STRING_OFFSET 512
#define MCI_VD_OFFSET 1024
#define MCI_CD_OFFSET 1088
#define MCI_WAVE_OFFSET 1152
#define MCI_SEQ_OFFSET 1216
/****************************************************************************
General error return values
****************************************************************************/
/* general error return values */
#define 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 */
/* If included with the 3.0 windows.h, define compatible aliases */
#if !defined(WINVER) || (WINVER < 0x030a)
DECLARE_HANDLE(HDRVR);
#endif /* WIN3.0 */
#ifndef MMNODRV
/****************************************************************************
Installable driver support
****************************************************************************/
/* If included with the 3.0 windows.h, define compatible aliases */
#if !defined(WINVER) || (WINVER < 0x030a)
/* return values from DriverProc() function */
#define DRV_CANCEL 0x0000
#define DRV_OK 0x0001
#define DRV_RESTART 0x0002
/* Driver messages */
#define DRV_LOAD 0x0001
#define DRV_ENABLE 0x0002
#define DRV_OPEN 0x0003
#define DRV_CLOSE 0x0004
#define DRV_DISABLE 0x0005
#define DRV_FREE 0x0006
#define DRV_CONFIGURE 0x0007
#define DRV_QUERYCONFIGURE 0x0008
#define DRV_INSTALL 0x0009
#define DRV_REMOVE 0x000A
#define DRV_RESERVED 0x0800
#define DRV_USER 0x4000
/* LPARAM of DRV_CONFIGURE message */
typedef struct tagDRVCONFIGINFO {
DWORD dwDCISize;
LPCSTR lpszDCISectionName;
LPCSTR lpszDCIAliasName;
} DRVCONFIGINFO;
typedef DRVCONFIGINFO *PDRVCONFIGINFO;
typedef DRVCONFIGINFO NEAR *NPDRVCONFIGINFO;
typedef DRVCONFIGINFO FAR *LPDRVCONFIGINFO;
/* installable driver function prototypes */
LRESULT WINAPI DrvClose(HDRVR hDriver, LPARAM lParam1, LPARAM lParam2);
HDRVR WINAPI DrvOpen(LPCSTR szDriverName, LPCSTR szSectionName,
LPARAM lParam2);
LRESULT WINAPI DrvSendMessage(HDRVR hDriver, UINT uMessage,
LPARAM lParam1, LPARAM lParam2);
HINSTANCE WINAPI DrvGetModuleHandle(HDRVR hDriver);
LRESULT WINAPI DrvDefDriverProc(DWORD dwDriverIdentifier, HDRVR driverID,
UINT uMessage, LPARAM lParam1, LPARAM lParam2);
#define DefDriverProc DrvDefDriverProc
#endif /* WIN3.0 */
#if defined(WINVER) && (WINVER >= 0x030a)
/* return values from DriverProc() function */
#define DRV_CANCEL DRVCNF_CANCEL
#define DRV_OK DRVCNF_OK
#define DRV_RESTART DRVCNF_RESTART
#endif /* WINVER >= 0x030a */
#define DRV_MCI_FIRST DRV_RESERVED
#define DRV_MCI_LAST (DRV_RESERVED + 0xFFF)
#endif /* ifndef MMNODRV */
/****************************************************************************
Driver callback support
****************************************************************************/
/* flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and */
/* midiOutOpen() to specify the type of the dwCallback parameter. */
#define CALLBACK_TYPEMASK 0x00070000l /* callback type mask */
#define CALLBACK_NULL 0x00000000l /* no callback */
#define CALLBACK_WINDOW 0x00010000l /* dwCallback is a HWND */
#define CALLBACK_TASK 0x00020000l /* dwCallback is a HTASK */
#define CALLBACK_FUNCTION 0x00030000l /* dwCallback is a FARPROC */
/* driver callback prototypes */
typedef void (CALLBACK DRVCALLBACK) (HDRVR h, UINT uMessage, DWORD dwUser, DWORD dw1, DWORD dw2);
typedef DRVCALLBACK FAR *LPDRVCALLBACK;
/****************************************************************************
Manufacturer and product IDs
Used with wMid and wPid fields in WAVEOUTCAPS, WAVEINCAPS,
MIDIOUTCAPS, MIDIINCAPS, AUXCAPS, JOYCAPS structures.
****************************************************************************/
/* manufacturer IDs */
#define MM_MICROSOFT 1 /* Microsoft Corp. */
/* product IDs */
#define MM_MIDI_MAPPER 1 /* MIDI Mapper */
#define MM_WAVE_MAPPER 2 /* Wave Mapper */
#define MM_SNDBLST_MIDIOUT 3 /* Sound Blaster MIDI output port */
#define MM_SNDBLST_MIDIIN 4 /* Sound Blaster MIDI input port */
#define MM_SNDBLST_SYNTH 5 /* Sound Blaster internal synthesizer */
#define MM_SNDBLST_WAVEOUT 6 /* Sound Blaster waveform output */
#define MM_SNDBLST_WAVEIN 7 /* Sound Blaster waveform input */
#define MM_ADLIB 9 /* Ad Lib-compatible synthesizer */
#define MM_MPU401_MIDIOUT 10 /* MPU401-compatible MIDI output port */
#define MM_MPU401_MIDIIN 11 /* MPU401-compatible MIDI input port */
#define MM_PC_JOYSTICK 12 /* Joystick adapter */
#ifndef MMNOMMSYSTEM
/****************************************************************************
General MMSYSTEM support
****************************************************************************/
WORD WINAPI mmsystemGetVersion(void);
void WINAPI OutputDebugStr(LPCSTR);
#endif /* ifndef MMNOMMSYSTEM */
#ifndef MMNOSOUND
/****************************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -