mmddk.h revision 930b5f872e89407f445d4000d4e4aaecaa6a0998
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Copyright 1998, Luiz Otavio L. Zorzella
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * 1999, Eric Pouech
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Purpose: multimedia declarations (external to WINMM & MMSYSTEM DLLs
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * for other DLLs (MCI, drivers...))
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * This library is free software; you can redistribute it and/or
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * modify it under the terms of the GNU Lesser General Public
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * License as published by the Free Software Foundation; either
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * version 2.1 of the License, or (at your option) any later version.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * This library is distributed in the hope that it will be useful,
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * but WITHOUT ANY WARRANTY; without even the implied warranty of
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Lesser General Public License for more details.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * You should have received a copy of the GNU Lesser General Public
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * License along with this library; if not, write to the Free Software
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * a choice of LGPL license versions is made available with the language indicating
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * that LGPLv2 or any later version may be used, or where a choice of which version
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * of the LGPL is applied is otherwise unspecified.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncextern "C" {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* For now I'm making 16 the maximum number of midi devices one can
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * have. This should be more than enough for everybody. But as a purist,
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * I intend to make it unbounded in the future, as soon as I figure
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * a good way to do so.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* ==================================
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Multimedia DDK compatible part
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * ================================== */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* messages that have IOCTL format
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * dw1 = NULL or handle
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * dw2 = NULL or ptr to DRVM_IOCTL_DATA
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * return is MMRESULT
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync DWORD dwCmd; /* IOCTL command code, 0x80000000 and above reserved for system */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* command code ranges for dwCmd field of DRVM_IOCTL message
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * - codes from 0 to 0x7FFFFFFF are user defined
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * - codes from 0x80000000 to 0xFFFFFFFF are reserved for future definition by microsoft
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define DRVM_IOCTL_CMD_USER __MSABI_LONG(0x00000000)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define DRVM_IOCTL_CMD_SYSTEM __MSABI_LONG(0x80000000)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define DRVM_MAPPER_CONSOLEVOICECOM_GET (DRVM_MAPPER+23)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define DRV_QUERYDEVICEINTERFACE (DRV_RESERVED + 12)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define DRV_QUERYDEVICEINTERFACESIZE (DRV_RESERVED + 13)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define DRV_QUERYFUNCTIONINSTANCEID (DRV_RESERVED + 17)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define DRV_QUERYFUNCTIONINSTANCEIDSIZE (DRV_RESERVED + 18)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define DRVM_MAPPER_PREFERRED_FLAGS_PREFERREDONLY 0x00000001
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* pre-defined joystick types */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* calibration flags */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_ISCAL_XY __MSABI_LONG(0x00000001) /* XY are calibrated */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_ISCAL_Z __MSABI_LONG(0x00000002) /* Z is calibrated */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_ISCAL_R __MSABI_LONG(0x00000004) /* R is calibrated */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_ISCAL_U __MSABI_LONG(0x00000008) /* U is calibrated */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_ISCAL_V __MSABI_LONG(0x00000010) /* V is calibrated */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_ISCAL_POV __MSABI_LONG(0x00000020) /* POV is calibrated */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* point of view constants */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* Specific settings for joystick hardware */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_HASZ __MSABI_LONG(0x00000001) /* has Z info? */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_HASPOV __MSABI_LONG(0x00000002) /* point of view hat present */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_POVISBUTTONCOMBOS __MSABI_LONG(0x00000004) /* pov done through combo of buttons */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_POVISPOLL __MSABI_LONG(0x00000008) /* pov done through polling */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_ISYOKE __MSABI_LONG(0x00000010) /* joystick is a flight yoke */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_ISGAMEPAD __MSABI_LONG(0x00000020) /* joystick is a game pad */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_ISCARCTRL __MSABI_LONG(0x00000040) /* joystick is a car controller */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* X defaults to J1 X axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_XISJ1Y __MSABI_LONG(0x00000080) /* X is on J1 Y axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_XISJ2X __MSABI_LONG(0x00000100) /* X is on J2 X axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_XISJ2Y __MSABI_LONG(0x00000200) /* X is on J2 Y axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* Y defaults to J1 Y axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_YISJ1X __MSABI_LONG(0x00000400) /* Y is on J1 X axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_YISJ2X __MSABI_LONG(0x00000800) /* Y is on J2 X axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_YISJ2Y __MSABI_LONG(0x00001000) /* Y is on J2 Y axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* Z defaults to J2 Y axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_ZISJ1X __MSABI_LONG(0x00002000) /* Z is on J1 X axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_ZISJ1Y __MSABI_LONG(0x00004000) /* Z is on J1 Y axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_ZISJ2X __MSABI_LONG(0x00008000) /* Z is on J2 X axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* POV defaults to J2 Y axis, if it is not button based */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_POVISJ1X __MSABI_LONG(0x00010000) /* pov done through J1 X axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_POVISJ1Y __MSABI_LONG(0x00020000) /* pov done through J1 Y axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_POVISJ2X __MSABI_LONG(0x00040000) /* pov done through J2 X axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* R defaults to J2 X axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_HASR __MSABI_LONG(0x00080000) /* has R (4th axis) info */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_RISJ1X __MSABI_LONG(0x00100000) /* R done through J1 X axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_RISJ1Y __MSABI_LONG(0x00200000) /* R done through J1 Y axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_RISJ2Y __MSABI_LONG(0x00400000) /* R done through J2 X axis */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* U & V for future hardware */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_HASU __MSABI_LONG(0x00800000) /* has U (5th axis) info */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_HWS_HASV __MSABI_LONG(0x01000000) /* has V (6th axis) info */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* Usage settings */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_US_HASRUDDER __MSABI_LONG(0x00000001) /* joystick configured with rudder */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_US_PRESENT __MSABI_LONG(0x00000002) /* is joystick actually present? */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define JOY_US_ISOEM __MSABI_LONG(0x00000004) /* joystick is an OEM defined type */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* struct for storing x,y, z, and rudder values */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct joypos_tag {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* struct for storing ranges */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct joyrange_tag {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct joyreguservalues_tag {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync DWORD dwTimeOut; /* value at which to timeout joystick polling */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync JOYRANGE jrvRanges; /* range of values app wants returned for axes */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync JOYPOS jpDeadZone; /* area around center to be considered
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync as "dead". specified as a percentage
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync (0-100). Only X & Y handled by system driver */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct joyreghwsettings_tag {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* range of values returned by the hardware (filled in by calibration) */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct joyreghwvalues_tag {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync JOYRANGE jrvHardware; /* values returned by hardware */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync DWORD dwPOVValues[JOY_POV_NUMDIRS];/* POV values returned by hardware */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* hardware configuration */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct joyreghwconfig_tag {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync JOYREGHWVALUES hwv; /* values returned by hardware */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* joystick calibration info structure */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct joycalibrate_tag {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* prototype for joystick message function */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef UINT (CALLBACK * JOYDEVMSGPROC)(DWORD dwID, UINT uMessage, LPARAM lParam1, LPARAM lParam2);
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/* messages sent to joystick driver's DriverProc() function */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_FORMAT_RETURN_BASE MCI_FORMAT_MILLISECONDS_S
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_FORMAT_MILLISECONDS_S (MCI_STRING_OFFSET + 21)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_FORMAT_FRAMES_S (MCI_STRING_OFFSET + 24)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_FORMAT_SMPTE_24_S (MCI_STRING_OFFSET + 25)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_FORMAT_SMPTE_25_S (MCI_STRING_OFFSET + 26)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_FORMAT_SMPTE_30_S (MCI_STRING_OFFSET + 27)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_FORMAT_SMPTE_30DROP_S (MCI_STRING_OFFSET + 28)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_FORMAT_SAMPLES_S (MCI_STRING_OFFSET + 30)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_SEQ_FORMAT_SONGPTR_S (MCI_SEQ_OFFSET + 9)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_RESOURCE_RETURNED 0x00010000 /* resource ID */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_COLONIZED3_RETURN 0x00020000 /* colonized ID, 3 bytes data */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_COLONIZED4_RETURN 0x00040000 /* colonized ID, 4 bytes data */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_INTEGER_RETURNED 0x00080000 /* integer conversion needed */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MCI_RESOURCE_DRIVER 0x00100000 /* driver owns returned resource */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#endif /* _WIN64 */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define MAKEMCIRESOURCE(wRet, wRes) MAKELRESULT((wRet), (wRes))
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync LPSTR lpstrParams; /* parameter string for entry in SYSTEM.INI */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync UINT wCustomCommandTable; /* custom command table (0xFFFF if none) * filled in by the driver */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync UINT wType; /* driver type (filled in by the driver) */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync} MCI_OPEN_DRIVER_PARMSA, *LPMCI_OPEN_DRIVER_PARMSA;
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync LPWSTR lpstrParams; /* parameter string for entry in SYSTEM.INI */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync UINT wCustomCommandTable; /* custom command table (0xFFFF if none) * filled in by the driver */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync UINT wType; /* driver type (filled in by the driver) */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync} MCI_OPEN_DRIVER_PARMSW, *LPMCI_OPEN_DRIVER_PARMSW;
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncBOOL WINAPI mciSetDriverData(UINT uDeviceID, DWORD_PTR dwData);
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncBOOL WINAPI mciDriverNotify(HWND hwndCallback, UINT uDeviceID,
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncUINT WINAPI mciLoadCommandResource(HINSTANCE hInstance,
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define DCB_WINDOW 0x0001 /* dwCallback is a HWND */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define DCB_FUNCTION 0x0003 /* dwCallback is a FARPROC */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define DCB_EVENT 0x0005 /* dwCallback is an EVENT Handler */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define DCB_NOSWITCH 0x0008 /* don't switch stacks for callback */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncBOOL WINAPI DriverCallback(DWORD_PTR dwCallBack, DWORD uFlags, HDRVR hDev,
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync DWORD wMsg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncUINT WINAPI mmTaskCreate(LPTASKCALLBACK, HANDLE*, DWORD_PTR);
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#endif /* __MMDDK_H */