1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
3 /*****************************************************************************
4 * Copyright 1998, Luiz Otavio L. Zorzella
7 * Purpose: multimedia declarations (internal to WINMM & MMSYSTEM DLLs)
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *****************************************************************************
27 typedef DWORD (WINAPI
*MessageProc16
)(UINT16 wDevID
, UINT16 wMsg
, DWORD dwUser
, DWORD dwParam1
, DWORD dwParam2
);
28 typedef DWORD (WINAPI
*MessageProc32
)(UINT wDevID
, UINT wMsg
, DWORD dwUser
, DWORD dwParam1
, DWORD dwParam2
);
30 /* Who said goofy boy ? */
31 #define WINE_DI_MAGIC 0x900F1B01
33 typedef struct tagWINE_DRIVER
36 /* as usual LPWINE_DRIVER == hDriver32 */
48 struct tagWINE_DRIVER
* lpPrevItem
;
49 struct tagWINE_DRIVER
* lpNextItem
;
50 } WINE_DRIVER
, *LPWINE_DRIVER
;
52 typedef struct tagWINE_MLD
{
53 /* EPP struct tagWINE_MLD* lpNext; */ /* not used so far */
56 UINT mmdIndex
; /* index to low-level driver in MMDrvs table */
57 DWORD dwDriverInstance
; /* this value is driver related, as opposed to
58 * opendesc.dwInstance which is client (callback) related */
62 DWORD dwClientInstance
;
63 } WINE_MLD
, *LPWINE_MLD
;
67 } WINE_WAVE
, *LPWINE_WAVE
;
71 MIDIOPENDESC mod
; /* FIXME: should be removed */
72 } WINE_MIDI
, *LPWINE_MIDI
;
76 } WINE_MIXER
, *LPWINE_MIXER
;
78 extern BOOL
MMDRV_Init(void);
79 extern UINT
MMDRV_GetNum(UINT
);
80 extern LPWINE_MLD
MMDRV_Alloc(UINT size
, UINT type
, LPHANDLE hndl
, DWORD
* dwFlags
,
81 DWORD
* dwCallback
, DWORD
* dwInstance
, BOOL bFrom32
);
82 extern void MMDRV_Free(HANDLE hndl
, LPWINE_MLD mld
);
83 extern DWORD
MMDRV_Open(LPWINE_MLD mld
, UINT wMsg
, DWORD dwParam1
, DWORD dwParam2
);
84 extern DWORD
MMDRV_Close(LPWINE_MLD mld
, UINT wMsg
);
85 extern LPWINE_MLD
MMDRV_Get(HANDLE hndl
, UINT type
, BOOL bCanBeID
);
86 extern LPWINE_MLD
MMDRV_GetRelated(HANDLE hndl
, UINT srcType
, BOOL bSrcCanBeID
, UINT dstTyped
);
87 extern DWORD
MMDRV_Message(LPWINE_MLD mld
, WORD wMsg
, DWORD dwParam1
, DWORD dwParam2
, BOOL bFrom32
);
88 extern UINT
MMDRV_PhysicalFeatures(LPWINE_MLD mld
, UINT uMsg
, DWORD dwParam1
, DWORD dwParam2
);
92 #define MMDRV_MIDIIN 2
93 #define MMDRV_MIDIOUT 3
94 #define MMDRV_WAVEIN 4
95 #define MMDRV_WAVEOUT 5
98 #define WINE_MMTHREAD_CREATED 0x4153494C /* "BSIL" */
99 #define WINE_MMTHREAD_DELETED 0xDEADDEAD
102 DWORD dwSignature
; /* 00 "BSIL" when ok, 0xDEADDEAD when being deleted */
103 DWORD dwCounter
; /* 04 > 1 when in mmThread functions */
104 HANDLE hThread
; /* 08 hThread */
105 DWORD dwThreadID
; /* 0C */
106 FARPROC16 fpThread
; /* 10 address of thread proc (segptr or lin depending on dwFlags) */
107 DWORD dwThreadPmt
; /* 14 parameter to be passed upon thread creation to fpThread */
108 DWORD dwSignalCount
; /* 18 counter used for signaling */
109 HANDLE hEvent
; /* 1C event */
110 HANDLE hVxD
; /* 20 return from OpenVxDHandle */
111 DWORD dwStatus
; /* 24 0x00, 0x10, 0x20, 0x30 */
112 DWORD dwFlags
; /* 28 dwFlags upon creation */
113 HANDLE16 hTask
; /* 2C handle to created task */
116 typedef struct tagWINE_MCIDRIVER
{
119 LPSTR lpstrElementName
;
120 LPSTR lpstrDeviceType
;
123 DRIVERPROC16 driverProc
;
125 YIELDPROC lpfnYieldProc
;
128 HTASK16 hCreatorTask
;
130 UINT uSpecificCmdTable
;
131 struct tagWINE_MCIDRIVER
*lpNext
;
132 } WINE_MCIDRIVER
, *LPWINE_MCIDRIVER
;
134 #define WINE_TIMER_IS32 0x80
136 typedef struct tagWINE_TIMERENTRY
{
144 struct tagWINE_TIMERENTRY
* lpNext
;
145 } WINE_TIMERENTRY
, *LPWINE_TIMERENTRY
;
147 typedef struct tagWINE_MMIO
{
149 struct IOProcList
* ioProc
;
153 struct tagWINE_MMIO
* lpNext
;
156 } WINE_MMIO
, *LPWINE_MMIO
;
158 typedef struct tagWINE_PLAYSOUND
{
164 struct tagWINE_PLAYSOUND
* lpNext
;
165 } WINE_PLAYSOUND
, *LPWINE_PLAYSOUND
;
167 typedef struct tagWINE_MM_IDATA
{
168 /* iData reference */
170 struct tagWINE_MM_IDATA
* lpNextIData
;
172 HANDLE hWinMM32Instance
;
173 HANDLE hWinMM16Instance
;
179 LPWINE_TIMERENTRY lpTimerList
;
181 LPWINE_TIMERENTRY lpTimers
;
183 LPWINE_MCIDRIVER lpMciDrvs
;
184 /* low level drivers (unused yet) */
185 /* LPWINE_WAVE lpWave; */
186 /* LPWINE_MIDI lpMidi; */
187 /* LPWINE_MIXER lpMixer; */
190 /* playsound and sndPlaySound */
191 WINE_PLAYSOUND
* lpPlaySound
;
194 } WINE_MM_IDATA
, *LPWINE_MM_IDATA
;
196 /* function prototypes */
198 typedef LONG (*MCIPROC16
)(DWORD
, HDRVR16
, WORD
, DWORD
, DWORD
);
199 typedef LONG (*MCIPROC
)(DWORD
, HDRVR
, DWORD
, DWORD
, DWORD
);
201 extern LPWINE_DRIVER
DRIVER_FindFromHDrvr(HDRVR hDrvr
);
202 extern BOOL
DRIVER_GetLibName(LPCSTR keyName
, LPCSTR sectName
, LPSTR buf
, int sz
);
203 extern LPWINE_DRIVER
DRIVER_TryOpenDriver32(LPCSTR fn
, LPARAM lParam2
);
205 extern LPWINE_MCIDRIVER
MCI_GetDriver(UINT16 uDevID
);
206 extern UINT
MCI_GetDriverFromString(LPCSTR str
);
207 extern DWORD
MCI_WriteString(LPSTR lpDstStr
, DWORD dstSize
, LPCSTR lpSrcStr
);
208 extern const char* MCI_MessageToString(UINT16 wMsg
);
210 extern UINT WINAPI
MCI_DefYieldProc(MCIDEVICEID wDevID
, DWORD data
);
212 extern LRESULT
MCI_CleanUp(LRESULT dwRet
, UINT wMsg
, DWORD dwParam2
, BOOL bIs32
);
214 extern DWORD
MCI_SendCommand(UINT wDevID
, UINT16 wMsg
, DWORD dwParam1
, DWORD dwParam2
, BOOL bFrom32
);
215 extern DWORD
MCI_SendCommandFrom32(UINT wDevID
, UINT16 wMsg
, DWORD dwParam1
, DWORD dwParam2
);
216 extern DWORD
MCI_SendCommandFrom16(UINT wDevID
, UINT16 wMsg
, DWORD dwParam1
, DWORD dwParam2
);
218 void CALLBACK
WINE_mmThreadEntryPoint(DWORD _pmt
);
220 void MMSYSTEM_MMTIME16to32(LPMMTIME mmt32
, const MMTIME16
* mmt16
);
221 void MMSYSTEM_MMTIME32to16(LPMMTIME16 mmt16
, const MMTIME
* mmt32
);
223 BOOL
MULTIMEDIA_MciInit(void);
224 LPWINE_MM_IDATA
MULTIMEDIA_GetIData(void);
226 LPWINE_MM_IDATA
TIME_MMTimeStart(void);
227 void TIME_MMTimeStop(void);