1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
3 /*****************************************************************************
4 * Copyright 1998, Luiz Otavio L. Zorzella
8 * Purpose: multimedia declarations (internal to multimedia DLLs)
10 *****************************************************************************
12 #ifndef __WINE_MULTIMEDIA_H
13 #define __WINE_MULTIMEDIA_H
18 #define MAX_MIDIINDRV (16)
19 /* For now I'm making 16 the maximum number of midi devices one can
20 * have. This should be more than enough for everybody. But as a purist,
21 * I intend to make it unbounded in the future, as soon as I figure
22 * a good way to do so.
24 #define MAX_MIDIOUTDRV (16)
26 #if defined(HAVE_SYS_SOUNDCARD_H)
27 # include <sys/soundcard.h>
28 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
29 # include <machine/soundcard.h>
30 #elif defined(HAVE_SOUNDCARD_H)
31 # include <soundcard.h>
34 #ifdef HAVE_SYS_ERRNO_H
35 #include <sys/errno.h>
39 #define MIDI_SEQ "/dev/sequencer"
41 #define MIDI_DEV "/dev/midi"
45 #define IOCTL(a,b,c) ioctl(a,b,&c)
47 #define IOCTL(a,b,c) (c = ioctl(a,b,c))
50 #define WINE_MMTHREAD_CREATED 0x4153494C /* "BSIL" */
51 #define WINE_MMTHREAD_DELETED 0xDEADDEAD
54 DWORD dwSignature; /* 00 "BSIL" when ok, 0xDEADDEAD when being deleted */
55 DWORD dwCounter; /* 04 > 1 when in mmThread functions */
56 HANDLE hThread; /* 08 hThread */
57 DWORD dwThreadID; /* 0C */
58 FARPROC16 fpThread; /* 10 address of thread proc (segptr or lin depending on dwFlags) */
59 DWORD dwThreadPmt; /* 14 parameter to be passed upon thread creation to fpThread */
60 DWORD dwSignalCount; /* 18 counter used for signaling */
61 HANDLE hEvent; /* 1C event */
62 HANDLE hVxD; /* 20 return from OpenVxDHandle */
63 DWORD dwStatus; /* 24 0x00, 0x10, 0x20, 0x30 */
64 DWORD dwFlags; /* 28 dwFlags upon creation */
65 HANDLE16 hTask; /* 2C handle to created task */
68 typedef struct tagWINE_MCIDRIVER {
71 LPSTR lpstrElementName;
72 LPSTR lpstrDeviceType;
75 DRIVERPROC16 driverProc;
77 YIELDPROC lpfnYieldProc;
82 UINT uSpecificCmdTable;
83 struct tagWINE_MCIDRIVER* lpNext;
84 } WINE_MCIDRIVER, *LPWINE_MCIDRIVER;
87 MCI_MAP_NOMEM, /* ko, memory problem */
88 MCI_MAP_MSGERROR, /* ko, unknown message */
89 MCI_MAP_OK, /* ok, no memory allocated. to be sent to 16 bit proc. */
90 MCI_MAP_OKMEM, /* ok, some memory allocated, need to call MCI_UnMapMsg32ATo16. to be sent to 16 bit proc. */
91 MCI_MAP_PASS /* ok, no memory allocated. to be sent to 32 bit proc */
94 #define WINE_TIMER_IS32 0x80
96 typedef struct tagTIMERENTRY {
104 struct tagTIMERENTRY* lpNext;
105 } WINE_TIMERENTRY, *LPWINE_TIMERENTRY;
107 typedef struct tagWINE_MM_IDATA {
108 /* iData reference */
110 struct tagWINE_MM_IDATA* lpNextIData;
112 HANDLE hWinMM32Instance;
113 HANDLE hWinMM16Instance;
119 LPWINE_TIMERENTRY lpTimerList;
121 LPWINE_TIMERENTRY lpTimers;
123 LPWINE_MCIDRIVER lpMciDrv;
124 } WINE_MM_IDATA, *LPWINE_MM_IDATA;
126 /* function prototypes */
128 typedef LONG (*MCIPROC16)(DWORD, HDRVR16, WORD, DWORD, DWORD);
129 typedef LONG (*MCIPROC)(DWORD, HDRVR, DWORD, DWORD, DWORD);
131 extern LPWINE_MCIDRIVER MCI_GetDriver(UINT16 uDevID);
132 extern UINT MCI_GetDriverFromString(LPCSTR str);
133 extern DWORD MCI_WriteString(LPSTR lpDstStr, DWORD dstSize, LPCSTR lpSrcStr);
134 extern const char* MCI_MessageToString(UINT16 wMsg);
136 extern UINT16 WINAPI MCI_DefYieldProc(UINT16 wDevID, DWORD data);
138 extern LRESULT MCI_CleanUp(LRESULT dwRet, UINT wMsg, DWORD dwParam2, BOOL bIs32);
140 extern DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32);
141 extern DWORD MCI_SendCommandFrom32(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2);
142 extern DWORD MCI_SendCommandFrom16(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2);
143 extern DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2, UINT size);
145 HINSTANCE16 WINAPI mmTaskCreate16(SEGPTR spProc, HINSTANCE16 *lphMmTask, DWORD dwPmt);
146 void WINAPI mmTaskBlock16(HINSTANCE16 hInst);
147 LRESULT WINAPI mmTaskSignal16(HTASK16 ht);
148 void WINAPI mmTaskYield16(void);
150 void CALLBACK WINE_mmThreadEntryPoint(DWORD _pmt);
151 LRESULT WINAPI mmThreadCreate16(FARPROC16 fpThreadAddr, LPHANDLE lpHndl, DWORD dwPmt, DWORD dwFlags);
152 void WINAPI mmThreadSignal16(HANDLE16 hndl);
153 void WINAPI mmThreadBlock16(HANDLE16 hndl);
154 HANDLE16 WINAPI mmThreadGetTask16(HANDLE16 hndl);
155 BOOL16 WINAPI mmThreadIsValid16(HANDLE16 hndl);
156 BOOL16 WINAPI mmThreadIsCurrent16(HANDLE16 hndl);
158 BOOL MULTIMEDIA_MciInit(void);
159 LPWINE_MM_IDATA MULTIMEDIA_GetIData(void);
161 BOOL MULTIMEDIA_MidiInit(void);
163 #endif /* __WINE_MULTIMEDIA_H */