1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
3 /*****************************************************************************
4 * Copyright 1998, Luiz Otavio L. Zorzella
8 * Purpose: multimedia declarations (internal to WINMM & MMSYSTEM DLLs)
10 *****************************************************************************
15 typedef DWORD
WINAPI (*MessageProc16
)(UINT16 wDevID
, UINT16 wMsg
, DWORD dwUser
, DWORD dwParam1
, DWORD dwParam2
);
16 typedef DWORD
WINAPI (*MessageProc32
)(UINT wDevID
, UINT wMsg
, DWORD dwUser
, DWORD dwParam1
, DWORD dwParam2
);
18 typedef struct tagWINE_MLD
{
19 /* EPP struct tagWINE_MLD* lpNext; */ /* not used so far */
22 UINT mmdIndex
; /* index to low-level driver in MMDrvs table */
23 DWORD dwDriverInstance
; /* this value is driver related, as opposed to
24 * opendesc.dwInstance which is client (callback) related */
28 DWORD dwClientInstance
;
29 } WINE_MLD
, *LPWINE_MLD
;
33 } WINE_WAVE
, *LPWINE_WAVE
;
37 MIDIOPENDESC mod
; /* FIXME: should be removed */
38 } WINE_MIDI
, *LPWINE_MIDI
;
42 } WINE_MIXER
, *LPWINE_MIXER
;
44 extern BOOL
MMDRV_Init(void);
45 extern UINT
MMDRV_GetNum(UINT
);
46 extern LPWINE_MLD
MMDRV_Alloc(UINT size
, UINT type
, LPHANDLE hndl
, DWORD
* dwFlags
,
47 DWORD
* dwCallback
, DWORD
* dwInstance
, BOOL bFrom32
);
48 extern void MMDRV_Free(HANDLE hndl
, LPWINE_MLD mld
);
49 extern DWORD
MMDRV_Open(LPWINE_MLD mld
, UINT wMsg
, DWORD dwParam1
, DWORD dwParam2
);
50 extern DWORD
MMDRV_Close(LPWINE_MLD mld
, UINT wMsg
);
51 extern LPWINE_MLD
MMDRV_Get(HANDLE hndl
, UINT type
, BOOL bCanBeID
);
52 extern LPWINE_MLD
MMDRV_GetRelated(HANDLE hndl
, UINT srcType
, BOOL bSrcCanBeID
, UINT dstTyped
);
53 extern DWORD
MMDRV_Message(LPWINE_MLD mld
, WORD wMsg
, DWORD dwParam1
, DWORD dwParam2
, BOOL bFrom32
);
54 extern UINT
MMDRV_PhysicalFeatures(LPWINE_MLD mld
, UINT uMsg
, DWORD dwParam1
, DWORD dwParam2
);
58 #define MMDRV_MIDIIN 2
59 #define MMDRV_MIDIOUT 3
60 #define MMDRV_WAVEIN 4
61 #define MMDRV_WAVEOUT 5
64 #define WINE_MMTHREAD_CREATED 0x4153494C /* "BSIL" */
65 #define WINE_MMTHREAD_DELETED 0xDEADDEAD
68 DWORD dwSignature
; /* 00 "BSIL" when ok, 0xDEADDEAD when being deleted */
69 DWORD dwCounter
; /* 04 > 1 when in mmThread functions */
70 HANDLE hThread
; /* 08 hThread */
71 DWORD dwThreadID
; /* 0C */
72 FARPROC16 fpThread
; /* 10 address of thread proc (segptr or lin depending on dwFlags) */
73 DWORD dwThreadPmt
; /* 14 parameter to be passed upon thread creation to fpThread */
74 DWORD dwSignalCount
; /* 18 counter used for signaling */
75 HANDLE hEvent
; /* 1C event */
76 HANDLE hVxD
; /* 20 return from OpenVxDHandle */
77 DWORD dwStatus
; /* 24 0x00, 0x10, 0x20, 0x30 */
78 DWORD dwFlags
; /* 28 dwFlags upon creation */
79 HANDLE16 hTask
; /* 2C handle to created task */
82 typedef struct tagWINE_MCIDRIVER
{
85 LPSTR lpstrElementName
;
86 LPSTR lpstrDeviceType
;
89 DRIVERPROC16 driverProc
;
91 YIELDPROC lpfnYieldProc
;
96 UINT uSpecificCmdTable
;
97 struct tagWINE_MCIDRIVER
*lpNext
;
98 } WINE_MCIDRIVER
, *LPWINE_MCIDRIVER
;
100 #define WINE_TIMER_IS32 0x80
102 typedef struct tagWINE_TIMERENTRY
{
110 struct tagWINE_TIMERENTRY
* lpNext
;
111 } WINE_TIMERENTRY
, *LPWINE_TIMERENTRY
;
113 typedef struct tagWINE_MMIO
{
115 struct IOProcList
* ioProc
;
119 struct tagWINE_MMIO
* lpNext
;
120 } WINE_MMIO
, *LPWINE_MMIO
;
122 typedef struct tagWINE_MM_IDATA
{
123 /* iData reference */
125 struct tagWINE_MM_IDATA
* lpNextIData
;
127 HANDLE hWinMM32Instance
;
128 HANDLE hWinMM16Instance
;
134 LPWINE_TIMERENTRY lpTimerList
;
136 LPWINE_TIMERENTRY lpTimers
;
138 LPWINE_MCIDRIVER lpMciDrvs
;
139 /* low level drivers (unused yet) */
140 /* LPWINE_WAVE lpWave; */
141 /* LPWINE_MIDI lpMidi; */
142 /* LPWINE_MIXER lpMixer; */
145 } WINE_MM_IDATA
, *LPWINE_MM_IDATA
;
147 /* function prototypes */
149 typedef LONG (*MCIPROC16
)(DWORD
, HDRVR16
, WORD
, DWORD
, DWORD
);
150 typedef LONG (*MCIPROC
)(DWORD
, HDRVR
, DWORD
, DWORD
, DWORD
);
152 extern LPWINE_MCIDRIVER
MCI_GetDriver(UINT16 uDevID
);
153 extern UINT
MCI_GetDriverFromString(LPCSTR str
);
154 extern DWORD
MCI_WriteString(LPSTR lpDstStr
, DWORD dstSize
, LPCSTR lpSrcStr
);
155 extern const char* MCI_MessageToString(UINT16 wMsg
);
157 extern UINT16 WINAPI
MCI_DefYieldProc(UINT16 wDevID
, DWORD data
);
159 extern LRESULT
MCI_CleanUp(LRESULT dwRet
, UINT wMsg
, DWORD dwParam2
, BOOL bIs32
);
161 extern DWORD
MCI_SendCommand(UINT wDevID
, UINT16 wMsg
, DWORD dwParam1
, DWORD dwParam2
, BOOL bFrom32
);
162 extern DWORD
MCI_SendCommandFrom32(UINT wDevID
, UINT16 wMsg
, DWORD dwParam1
, DWORD dwParam2
);
163 extern DWORD
MCI_SendCommandFrom16(UINT wDevID
, UINT16 wMsg
, DWORD dwParam1
, DWORD dwParam2
);
164 extern DWORD
MCI_SendCommandAsync(UINT wDevID
, UINT wMsg
, DWORD dwParam1
, DWORD dwParam2
, UINT size
);
166 void CALLBACK
WINE_mmThreadEntryPoint(DWORD _pmt
);
168 void MMSYSTEM_MMTIME16to32(LPMMTIME mmt32
, const MMTIME16
* mmt16
);
169 void MMSYSTEM_MMTIME32to16(LPMMTIME16 mmt16
, const MMTIME
* mmt32
);
171 BOOL
MULTIMEDIA_MciInit(void);
172 LPWINE_MM_IDATA
MULTIMEDIA_GetIData(void);