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;
121 } WINE_MMIO, *LPWINE_MMIO;
123 typedef struct tagWINE_MM_IDATA {
124 /* iData reference */
126 struct tagWINE_MM_IDATA* lpNextIData;
128 HANDLE hWinMM32Instance;
129 HANDLE hWinMM16Instance;
135 LPWINE_TIMERENTRY lpTimerList;
137 LPWINE_TIMERENTRY lpTimers;
139 LPWINE_MCIDRIVER lpMciDrvs;
140 /* low level drivers (unused yet) */
141 /* LPWINE_WAVE lpWave; */
142 /* LPWINE_MIDI lpMidi; */
143 /* LPWINE_MIXER lpMixer; */
146 } WINE_MM_IDATA, *LPWINE_MM_IDATA;
148 /* function prototypes */
150 typedef LONG (*MCIPROC16)(DWORD, HDRVR16, WORD, DWORD, DWORD);
151 typedef LONG (*MCIPROC)(DWORD, HDRVR, DWORD, DWORD, DWORD);
153 extern LPWINE_MCIDRIVER MCI_GetDriver(UINT16 uDevID);
154 extern UINT MCI_GetDriverFromString(LPCSTR str);
155 extern DWORD MCI_WriteString(LPSTR lpDstStr, DWORD dstSize, LPCSTR lpSrcStr);
156 extern const char* MCI_MessageToString(UINT16 wMsg);
158 extern UINT WINAPI MCI_DefYieldProc(MCIDEVICEID wDevID, DWORD data);
160 extern LRESULT MCI_CleanUp(LRESULT dwRet, UINT wMsg, DWORD dwParam2, BOOL bIs32);
162 extern DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32);
163 extern DWORD MCI_SendCommandFrom32(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2);
164 extern DWORD MCI_SendCommandFrom16(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2);
165 extern DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2, UINT size);
167 void CALLBACK WINE_mmThreadEntryPoint(DWORD _pmt);
169 void MMSYSTEM_MMTIME16to32(LPMMTIME mmt32, const MMTIME16* mmt16);
170 void MMSYSTEM_MMTIME32to16(LPMMTIME16 mmt16, const MMTIME* mmt32);
172 BOOL MULTIMEDIA_MciInit(void);
173 LPWINE_MM_IDATA MULTIMEDIA_GetIData(void);