|
|
1.1 ! root 1: /****************************************************************************/ ! 2: /* */ ! 3: /* MMDDK.H - Include file for Multimedia Device Development Kit */ ! 4: /* */ ! 5: /* Note: You must include the WINDOWS.H and MMSYSTEM.H header files */ ! 6: /* before including this file. */ ! 7: /* */ ! 8: /* Copyright (c) 1990-1991, Microsoft Corp. All rights reserved. */ ! 9: /* */ ! 10: /****************************************************************************/ ! 11: ! 12: #ifndef _INC_MMDDK ! 13: #define _INC_MMDDK ! 14: ! 15: #ifdef __cplusplus ! 16: extern "C" { ! 17: #endif /* __cplusplus */ ! 18: ! 19: /* If defined, the following flags inhibit inclusion ! 20: * of the indicated items: ! 21: * ! 22: * MMNOMIDIDEV - MIDI support ! 23: * MMNOWAVEDEV - Waveform support ! 24: * MMNOAUXDEV - Auxiliary output support ! 25: * MMNOTIMERDEV - Timer support ! 26: * MMNOJOYDEV - Joystick support ! 27: * MMNOMCIDEV - MCI support ! 28: * MMNOTASKDEV - Task support ! 29: */ ! 30: #ifdef MMNOTIMER ! 31: #define MMNOTIMERDEV ! 32: #endif ! 33: #ifdef MMNOWAVE ! 34: #define MMNOWAVEDEV ! 35: #endif ! 36: #ifdef MMNOMIDI ! 37: #define MMNOMIDIDEV ! 38: #endif ! 39: #ifdef MMNOAUX ! 40: #define MMNOAUXDEV ! 41: #endif ! 42: #ifdef MMNOJOY ! 43: #define MMNOJOYDEV ! 44: #endif ! 45: #ifdef MMNOMMIO ! 46: #define MMNOMMIODEV ! 47: #endif ! 48: #ifdef MMNOMCI ! 49: #define MMNOMCIDEV ! 50: #endif ! 51: ! 52: #ifdef NOMIDIDEV /* ;Internal */ ! 53: #define MMNOMIDIDEV /* ;Internal */ ! 54: #endif /* ;Internal */ ! 55: #ifdef NOWAVEDEV /* ;Internal */ ! 56: #define MMNOWAVEDEV /* ;Internal */ ! 57: #endif /* ;Internal */ ! 58: #ifdef NOAUXDEV /* ;Internal */ ! 59: #define MMNOAUXDEV /* ;Internal */ ! 60: #endif /* ;Internal */ ! 61: #ifdef NOTIMERDEV /* ;Internal */ ! 62: #define MMNOTIMERDEV /* ;Internal */ ! 63: #endif /* ;Internal */ ! 64: #ifdef NOJOYDEV /* ;Internal */ ! 65: #define MMNOJOYDEV /* ;Internal */ ! 66: #endif /* ;Internal */ ! 67: #ifdef NOMCIDEV /* ;Internal */ ! 68: #define MMNOMCIDEV /* ;Internal */ ! 69: #endif /* ;Internal */ ! 70: #ifdef NOTASKDEV /* ;Internal */ ! 71: #define MMNOTASKDEV /* ;Internal */ ! 72: #endif /* ;Internal */ ! 73: ! 74: /*************************************************************************** ! 75: ! 76: Helper functions for drivers ! 77: ! 78: ***************************************************************************/ ! 79: ! 80: #ifndef NODRIVERS ! 81: #define DRV_LOAD 0x0001 ! 82: #define DRV_ENABLE 0x0002 ! 83: #define DRV_OPEN 0x0003 ! 84: #define DRV_CLOSE 0x0004 ! 85: #define DRV_DISABLE 0x0005 ! 86: #define DRV_FREE 0x0006 ! 87: #define DRV_CONFIGURE 0x0007 ! 88: #define DRV_QUERYCONFIGURE 0x0008 ! 89: #define DRV_INSTALL 0x0009 ! 90: #define DRV_REMOVE 0x000A ! 91: ! 92: #define DRV_RESERVED 0x0800 ! 93: #define DRV_USER 0x4000 ! 94: ! 95: #define DRIVERS_SECTION TEXT("DRIVERS32") // Section name for installed drivers ! 96: #define MCI_SECTION TEXT("MCI32") // Section name for installed MCI drivers ! 97: ! 98: LONG FAR PASCAL DefDriverProc(DWORD dwDriverIdentifier, HANDLE driverID, UINT message, LONG lParam1, LONG lParam2); ! 99: #endif /* !NODRIVERS */ ! 100: ! 101: #define DCB_NOSWITCH 0x0008 // don't switch stacks for callback ! 102: #define DCB_TYPEMASK 0x0007 // callback type mask ! 103: #define DCB_NULL 0x0000 // unknown callback type ! 104: ! 105: // flags for wFlags parameter of DriverCallback() ! 106: #define DCB_WINDOW 0x0001 // dwCallback is a HWND ! 107: #define DCB_TASK 0x0002 // dwCallback is a HTASK ! 108: #define DCB_FUNCTION 0x0003 // dwCallback is a FARPROC ! 109: ! 110: BOOL APIENTRY DriverCallback(DWORD dwCallback, DWORD dwFlags, ! 111: HDRVR hDevice, DWORD dwMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2); ! 112: ! 113: // generic prototype for audio device driver entry-point functions ! 114: // midMessage(), modMessage(), widMessage(), wodMessage(), auxMessage() ! 115: //typedef DWORD (SOUNDDEVMSGPROC)(WORD, WORD, DWORD, DWORD, DWORD); ! 116: //typedef SOUNDDEVMSGPROC FAR *LPSOUNDDEVMSGPROC; ! 117: ! 118: // device ID for 386 AUTODMA VxD ! 119: #define VADMAD_Device_ID 0X0444 ! 120: ! 121: #ifndef MMNOWAVEDEV ! 122: /**************************************************************************** ! 123: ! 124: Waveform device driver support ! 125: ! 126: ****************************************************************************/ ! 127: ! 128: // maximum number of wave device drivers loaded ! 129: #ifndef NOWIN31 ! 130: #define MAXWAVEDRIVERS 10 ! 131: #else ! 132: #define MAXWAVEDRIVERS 4 ! 133: #endif ! 134: ! 135: ! 136: // waveform input and output device open information structure ! 137: typedef struct waveopendesc_tag { ! 138: HWAVE hWave; // handle ! 139: LPWAVEFORMAT lpFormat; // format of wave data ! 140: DWORD dwCallback; // callback ! 141: DWORD dwInstance; // app's private instance information ! 142: } WAVEOPENDESC; ! 143: typedef WAVEOPENDESC FAR *LPWAVEOPENDESC; ! 144: ! 145: // messages sent to wodMessage() entry-point function ! 146: #define WODM_GETNUMDEVS 3 ! 147: #define WODM_GETDEVCAPS 4 ! 148: #define WODM_OPEN 5 ! 149: #define WODM_CLOSE 6 ! 150: #define WODM_PREPARE 7 ! 151: #define WODM_UNPREPARE 8 ! 152: #define WODM_WRITE 9 ! 153: #define WODM_PAUSE 10 ! 154: #define WODM_RESTART 11 ! 155: #define WODM_RESET 12 ! 156: #define WODM_GETPOS 13 ! 157: #define WODM_GETPITCH 14 ! 158: #define WODM_SETPITCH 15 ! 159: #define WODM_GETVOLUME 16 ! 160: #define WODM_SETVOLUME 17 ! 161: #define WODM_GETPLAYBACKRATE 18 ! 162: #define WODM_SETPLAYBACKRATE 19 ! 163: #define WODM_BREAKLOOP 20 ! 164: #define WODM_BUSY 21 ! 165: ! 166: // messages sent to widMessage() entry-point function ! 167: #define WIDM_GETNUMDEVS 50 ! 168: #define WIDM_GETDEVCAPS 51 ! 169: #define WIDM_OPEN 52 ! 170: #define WIDM_CLOSE 53 ! 171: #define WIDM_PREPARE 54 ! 172: #define WIDM_UNPREPARE 55 ! 173: #define WIDM_ADDBUFFER 56 ! 174: #define WIDM_START 57 ! 175: #define WIDM_STOP 58 ! 176: #define WIDM_RESET 59 ! 177: #define WIDM_GETPOS 60 ! 178: ! 179: #endif // ifndef MMNOWAVEDEV ! 180: ! 181: ! 182: #ifndef MMNOMIDIDEV ! 183: /**************************************************************************** ! 184: ! 185: MIDI device driver support ! 186: ! 187: ****************************************************************************/ ! 188: ! 189: // maximum number of MIDI device drivers loaded ! 190: #ifndef NOWIN31 ! 191: #define MAXMIDIDRIVERS 10 ! 192: #else ! 193: #define MAXMIDIDRIVERS 4 ! 194: #endif ! 195: ! 196: #ifndef MMNOMIDI // This protects the definition of HMIDI in WINMM.H ! 197: // Win 3.1 works the same way ! 198: // MIDI input and output device open information structure ! 199: typedef struct midiopendesc_tag { ! 200: HMIDI hMidi; // handle ! 201: DWORD dwCallback; // callback ! 202: DWORD dwInstance; // app's private instance information ! 203: } MIDIOPENDESC; ! 204: typedef MIDIOPENDESC FAR *LPMIDIOPENDESC; ! 205: #endif // MMNOMIDI ! 206: ! 207: // messages sent to modMessage() entry-point function ! 208: #define MODM_GETNUMDEVS 1 ! 209: #define MODM_GETDEVCAPS 2 ! 210: #define MODM_OPEN 3 ! 211: #define MODM_CLOSE 4 ! 212: #define MODM_PREPARE 5 ! 213: #define MODM_UNPREPARE 6 ! 214: #define MODM_DATA 7 ! 215: #define MODM_LONGDATA 8 ! 216: #define MODM_RESET 9 ! 217: #define MODM_GETVOLUME 10 ! 218: #define MODM_SETVOLUME 11 ! 219: #define MODM_CACHEPATCHES 12 ! 220: #define MODM_CACHEDRUMPATCHES 13 ! 221: ! 222: // messages sent to midMessage() entry-point function ! 223: #define MIDM_GETNUMDEVS 53 ! 224: #define MIDM_GETDEVCAPS 54 ! 225: #define MIDM_OPEN 55 ! 226: #define MIDM_CLOSE 56 ! 227: #define MIDM_PREPARE 57 ! 228: #define MIDM_UNPREPARE 58 ! 229: #define MIDM_ADDBUFFER 59 ! 230: #define MIDM_START 60 ! 231: #define MIDM_STOP 61 ! 232: #define MIDM_RESET 62 ! 233: ! 234: #endif // ifndef MMNOMIDIDEV ! 235: ! 236: ! 237: #ifndef MMNOAUXDEV ! 238: /**************************************************************************** ! 239: ! 240: Auxiliary audio device driver support ! 241: ! 242: ****************************************************************************/ ! 243: ! 244: // maximum number of auxiliary device drivers loaded ! 245: #ifndef NOWIN31 ! 246: #define MAXAUXDRIVERS 10 ! 247: #else ! 248: #define MAXAUXDRIVERS 4 ! 249: #endif ! 250: ! 251: // messages sent to auxMessage() entry-point function ! 252: #define AUXDM_GETNUMDEVS 3 ! 253: #define AUXDM_GETDEVCAPS 4 ! 254: #define AUXDM_GETVOLUME 5 ! 255: #define AUXDM_SETVOLUME 6 ! 256: ! 257: #endif // ifndef MMNOAUXDEV ! 258: ! 259: ! 260: #if !defined(MMNOTIMERDEV) ! 261: /**************************************************************************** ! 262: ! 263: Timer device driver support ! 264: ! 265: ****************************************************************************/ ! 266: ! 267: typedef struct timerevent_tag { ! 268: WORD wDelay; // delay required ! 269: WORD wResolution; // resolution required ! 270: LPTIMECALLBACK lpFunction; // ptr to callback function ! 271: DWORD dwUser; // user DWORD ! 272: WORD wFlags; // defines how to program event ! 273: } TIMEREVENT; ! 274: typedef TIMEREVENT FAR *LPTIMEREVENT; ! 275: ! 276: // messages sent to tddMessage() function ! 277: #define TDD_KILLTIMEREVENT DRV_RESERVED+0 // indices into a table of ! 278: #define TDD_SETTIMEREVENT DRV_RESERVED+4 // functions; thus offset by ! 279: #define TDD_GETSYSTEMTIME DRV_RESERVED+8 // four each time... ! 280: #define TDD_GETDEVCAPS DRV_RESERVED+12 // room for future expansion ! 281: #define TDD_BEGINMINPERIOD DRV_RESERVED+16 // room for future expansion ! 282: #define TDD_ENDMINPERIOD DRV_RESERVED+20 // room for future expansion ! 283: ! 284: #endif // ifndef MMNOTIMERDEV ! 285: ! 286: ! 287: #ifndef MMNOJOYDEV ! 288: /**************************************************************************** ! 289: ! 290: Joystick device driver support ! 291: ! 292: ****************************************************************************/ ! 293: ! 294: // joystick calibration info structure ! 295: typedef struct joycalibrate_tag { ! 296: WORD wXbase; ! 297: WORD wXdelta; ! 298: WORD wYbase; ! 299: WORD wYdelta; ! 300: WORD wZbase; ! 301: WORD wZdelta; ! 302: } JOYCALIBRATE; ! 303: typedef JOYCALIBRATE FAR *LPJOYCALIBRATE; ! 304: ! 305: // prototype for joystick message function ! 306: typedef DWORD (JOYDEVMSGPROC)(DWORD, UINT, LONG, LONG); ! 307: typedef JOYDEVMSGPROC FAR *LPJOYDEVMSGPROC; ! 308: ! 309: // messages sent to joystick driver's DriverProc() function ! 310: #define JDD_GETNUMDEVS DRV_RESERVED+0x0001 ! 311: #define JDD_GETDEVCAPS DRV_RESERVED+0x0002 ! 312: #define JDD_GETPOS DRV_RESERVED+0x0101 ! 313: #define JDD_SETCALIBRATION DRV_RESERVED+0x0102 ! 314: ! 315: #endif // ifndef MMNOJOYDEV ! 316: ! 317: #ifndef MAKELRESULT ! 318: #define MAKELRESULT(low, high) ((LRESULT)MAKELONG(low, high)) ! 319: #endif//MAKELRESULT ! 320: ! 321: ! 322: #ifndef MMNOMCIDEV ! 323: /**************************************************************************** ! 324: ! 325: MCI device driver support ! 326: ! 327: ****************************************************************************/ ! 328: ! 329: ! 330: // internal MCI messages ! 331: #define MCI_OPEN_DRIVER 0x0801 ! 332: #define MCI_CLOSE_DRIVER 0x0802 ! 333: ! 334: #define MAKEMCIRESOURCE(wRet, wRes) MAKELRESULT((wRet), (wRes)) ! 335: ! 336: // string return values only used with MAKEMCIRESOURCE ! 337: #define MCI_FALSE (MCI_STRING_OFFSET + 19) ! 338: #define MCI_TRUE (MCI_STRING_OFFSET + 20) ! 339: ! 340: // resource string return values ! 341: #define MCI_FORMAT_RETURN_BASE MCI_FORMAT_MILLISECONDS_S ! 342: #define MCI_FORMAT_MILLISECONDS_S (MCI_STRING_OFFSET + 21) ! 343: #define MCI_FORMAT_HMS_S (MCI_STRING_OFFSET + 22) ! 344: #define MCI_FORMAT_MSF_S (MCI_STRING_OFFSET + 23) ! 345: #define MCI_FORMAT_FRAMES_S (MCI_STRING_OFFSET + 24) ! 346: #define MCI_FORMAT_SMPTE_24_S (MCI_STRING_OFFSET + 25) ! 347: #define MCI_FORMAT_SMPTE_25_S (MCI_STRING_OFFSET + 26) ! 348: #define MCI_FORMAT_SMPTE_30_S (MCI_STRING_OFFSET + 27) ! 349: #define MCI_FORMAT_SMPTE_30DROP_S (MCI_STRING_OFFSET + 28) ! 350: #define MCI_FORMAT_BYTES_S (MCI_STRING_OFFSET + 29) ! 351: #define MCI_FORMAT_SAMPLES_S (MCI_STRING_OFFSET + 30) ! 352: #define MCI_FORMAT_TMSF_S (MCI_STRING_OFFSET + 31) ! 353: ! 354: #define MCI_VD_FORMAT_TRACK_S (MCI_VD_OFFSET + 5) ! 355: ! 356: #define WAVE_FORMAT_PCM_S (MCI_WAVE_OFFSET + 0) ! 357: #define WAVE_MAPPER_S (MCI_WAVE_OFFSET + 1) ! 358: ! 359: #define MCI_SEQ_MAPPER_S (MCI_SEQ_OFFSET + 5) ! 360: #define MCI_SEQ_FILE_S (MCI_SEQ_OFFSET + 6) ! 361: #define MCI_SEQ_MIDI_S (MCI_SEQ_OFFSET + 7) ! 362: #define MCI_SEQ_SMPTE_S (MCI_SEQ_OFFSET + 8) ! 363: #define MCI_SEQ_FORMAT_SONGPTR_S (MCI_SEQ_OFFSET + 9) ! 364: #define MCI_SEQ_NONE_S (MCI_SEQ_OFFSET + 10) ! 365: #define MIDIMAPPER_S (MCI_SEQ_OFFSET + 11) ! 366: ! 367: #define MCI_TABLE_NOT_PRESENT ((UINT)-1) ! 368: // parameters for internal version of MCI_OPEN message sent from ! 369: // mciOpenDevice() to the driver ! 370: typedef struct { ! 371: MCIDEVICEID wDeviceID; // device ID ! 372: LPCWSTR lpstrParams; // parameter string for entry in SYSTEM.INI ! 373: UINT wCustomCommandTable; // custom command table ((-1) if none) ! 374: // filled in by the driver ! 375: UINT wType; // driver type ! 376: // filled in by the driver ! 377: } MCI_OPEN_DRIVER_PARMS; ! 378: typedef MCI_OPEN_DRIVER_PARMS FAR * LPMCI_OPEN_DRIVER_PARMS; ! 379: ! 380: // maximum length of an MCI device type ! 381: #define MCI_MAX_DEVICE_TYPE_LENGTH 80 ! 382: ! 383: // flags for mciSendCommandInternal() which direct mciSendString() how to ! 384: // interpret the return value ! 385: #define MCI_RESOURCE_RETURNED 0x00010000 // resource ID ! 386: #define MCI_COLONIZED3_RETURN 0x00020000 // colonized ID, 3 bytes data ! 387: #define MCI_COLONIZED4_RETURN 0x00040000 // colonized ID, 4 bytes data ! 388: #define MCI_INTEGER_RETURNED 0x00080000 // integer conversion needed ! 389: #define MCI_RESOURCE_DRIVER 0x00100000 // driver owns returned resource ! 390: ! 391: // invalid command table ID ! 392: #define MCI_NO_COMMAND_TABLE ((UINT)(-1)) ! 393: ! 394: // command table information type tags ! 395: #define MCI_COMMAND_HEAD 0 ! 396: #define MCI_STRING 1 ! 397: #define MCI_INTEGER 2 ! 398: #define MCI_END_COMMAND 3 ! 399: #define MCI_RETURN 4 ! 400: #define MCI_FLAG 5 ! 401: #define MCI_END_COMMAND_LIST 6 ! 402: #define MCI_RECT 7 ! 403: #define MCI_CONSTANT 8 ! 404: #define MCI_END_CONSTANT 9 ! 405: #define MCI_HWND 10 ! 406: #define MCI_HPAL 11 ! 407: #define MCI_HDC 12 ! 408: ! 409: // function prototypes for MCI driver functions ! 410: DWORD APIENTRY mciGetDriverData(MCIDEVICEID wDeviceID); ! 411: BOOL APIENTRY mciSetDriverData(MCIDEVICEID wDeviceID, DWORD dwData); ! 412: UINT APIENTRY mciDriverYield (MCIDEVICEID wDeviceID); ! 413: BOOL APIENTRY mciDriverNotify (HANDLE hwndCallback, MCIDEVICEID wDeviceID, ! 414: UINT uStatus); ! 415: UINT APIENTRY mciLoadCommandResource(HANDLE hInstance, ! 416: LPCWSTR lpResName, UINT wType); ! 417: BOOL APIENTRY mciFreeCommandResource(UINT wTable); ! 418: ! 419: #endif // ifndef MMNOMCIDEV ! 420: ! 421: ! 422: #ifndef MMNOTASKDEV ! 423: /***************************************************************************** ! 424: ! 425: Task support ! 426: ! 427: *****************************************************************************/ ! 428: ! 429: // error return values ! 430: #define TASKERR_NOTASKSUPPORT 1 ! 431: #define TASKERR_OUTOFMEMORY 2 ! 432: ! 433: // task support function prototypes ! 434: #ifdef BUILDDLL /* ;Internal */ ! 435: typedef VOID (FAR PASCAL TASKCALLBACK) (DWORD dwInst); /* ;Internal */ ! 436: #else /* ;Internal */ ! 437: typedef VOID (TASKCALLBACK) (DWORD dwInst); ! 438: #endif // ifdef BUILDDLL /* ;Internal */ ! 439: ! 440: typedef TASKCALLBACK FAR *LPTASKCALLBACK; ! 441: ! 442: UINT APIENTRY mmTaskCreate(LPTASKCALLBACK lpfn, HANDLE FAR * lph, DWORD dwInst); ! 443: VOID APIENTRY mmTaskBlock(DWORD h); ! 444: BOOL APIENTRY mmTaskSignal(DWORD h); ! 445: VOID APIENTRY mmTaskYield(VOID); ! 446: DWORD APIENTRY mmGetCurrentTask(VOID); ! 447: ! 448: #endif // endif MMNOTASKDEV ! 449: ! 450: #define MMDDKINC ! 451: ! 452: #ifdef __cplusplus ! 453: } ! 454: #endif /* __cplusplus */ ! 455: ! 456: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.