Always retrieve Callout routines using GetProcAddress().
[wine/testsucceed.git] / include / multimedia.h
blobf5114f1344cda685bcba609d9c98e15b4a4d208a
1 /* -*- tab-width: 8; c-basic-offset: 4 -*- */
3 /*****************************************************************************
4 * Copyright 1998, Luiz Otavio L. Zorzella
5 * 1999, Eric Pouech
7 * File: multimedia.h
8 * Purpose: multimedia declarations (internal to multimedia DLLs)
10 *****************************************************************************
12 #ifndef __WINE_MULTIMEDIA_H
13 #define __WINE_MULTIMEDIA_H
15 #include "mmsystem.h"
16 #include "winbase.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>
32 #endif
34 #ifdef HAVE_SYS_ERRNO_H
35 #include <sys/errno.h>
36 #endif
38 #ifdef HAVE_OSS
39 #define MIDI_SEQ "/dev/sequencer"
40 #else
41 #define MIDI_DEV "/dev/midi"
42 #endif
44 #ifdef SOUND_VERSION
45 #define IOCTL(a,b,c) ioctl(a,b,&c)
46 #else
47 #define IOCTL(a,b,c) (c = ioctl(a,b,c))
48 #endif
50 #define WINE_MMTHREAD_CREATED 0x4153494C /* "BSIL" */
51 #define WINE_MMTHREAD_DELETED 0xDEADDEAD
53 typedef struct {
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 */
66 } WINE_MMTHREAD;
68 typedef struct tagWINE_MCIDRIVER {
69 UINT wDeviceID;
70 UINT wType;
71 LPSTR lpstrElementName;
72 LPSTR lpstrDeviceType;
73 LPSTR lpstrAlias;
74 HDRVR hDrv;
75 DRIVERPROC16 driverProc;
76 DWORD dwPrivate;
77 YIELDPROC lpfnYieldProc;
78 DWORD dwYieldData;
79 BOOL bIs32;
80 HTASK16 hCreatorTask;
81 struct tagWINE_MCIDRIVER* lpNext;
82 } WINE_MCIDRIVER, *LPWINE_MCIDRIVER;
84 typedef enum {
85 MCI_MAP_NOMEM, /* ko, memory problem */
86 MCI_MAP_MSGERROR, /* ko, unknown message */
87 MCI_MAP_OK, /* ok, no memory allocated. to be sent to 16 bit proc. */
88 MCI_MAP_OKMEM, /* ok, some memory allocated, need to call MCI_UnMapMsg32ATo16. to be sent to 16 bit proc. */
89 MCI_MAP_PASS /* ok, no memory allocated. to be sent to 32 bit proc */
90 } MCI_MapType;
92 #define WINE_TIMER_IS32 0x80
94 typedef struct tagTIMERENTRY {
95 UINT wDelay;
96 UINT wResol;
97 FARPROC16 lpFunc;
98 DWORD dwUser;
99 UINT16 wFlags;
100 UINT16 wTimerID;
101 UINT wCurTime;
102 struct tagTIMERENTRY* lpNext;
103 } WINE_TIMERENTRY, *LPWINE_TIMERENTRY;
105 typedef struct tagWINE_MM_IDATA {
106 /* iData reference */
107 DWORD dwThisProcess;
108 struct tagWINE_MM_IDATA* lpNextIData;
109 /* winmm part */
110 HANDLE hWinMM32Instance;
111 HANDLE hWinMM16Instance;
112 HANDLE h16Module32;
113 /* mm timer part */
114 HANDLE hMMTimer;
115 DWORD mmSysTimeMS;
116 LPWINE_TIMERENTRY lpTimerList;
117 CRITICAL_SECTION cs;
118 int nSizeLpTimers;
119 LPWINE_TIMERENTRY lpTimers;
120 /* mci part */
121 LPWINE_MCIDRIVER lpMciDrv;
122 } WINE_MM_IDATA, *LPWINE_MM_IDATA;
124 /* function prototypes */
126 extern MCI_MapType MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam);
127 extern MCI_MapType MCI_UnMapMsg16To32A(WORD uDevTyp, WORD wMsg, DWORD lParam);
129 extern DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSA lpParms);
130 extern DWORD MCI_Close(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms);
131 extern DWORD MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSA lpParms);
132 extern DWORD MCI_Break(UINT uDevID, DWORD dwFlags, LPMCI_BREAK_PARMS lpParms);
134 typedef LONG (*MCIPROC16)(DWORD, HDRVR16, WORD, DWORD, DWORD);
135 typedef LONG (*MCIPROC)(DWORD, HDRVR, DWORD, DWORD, DWORD);
137 extern WORD MCI_GetDevTypeFromString(LPCSTR str);
138 extern LPCSTR MCI_GetStringFromDevType(WORD type);
139 extern LPWINE_MCIDRIVER MCI_GetDriver(UINT16 uDevID);
140 extern UINT MCI_GetDriverFromString(LPCSTR str);
141 extern DWORD MCI_WriteString(LPSTR lpDstStr, DWORD dstSize, LPCSTR lpSrcStr);
142 extern const char* MCI_CommandToString(UINT16 wMsg);
144 extern int mciInstalledCount;
145 extern int mciInstalledListLen;
146 extern LPSTR lpmciInstallNames;
148 extern UINT16 WINAPI MCI_DefYieldProc(UINT16 wDevID, DWORD data);
150 extern LRESULT MCI_CleanUp(LRESULT dwRet, UINT wMsg, DWORD dwParam2, BOOL bIs32);
152 extern DWORD MCI_SendCommandFrom32(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2);
153 extern DWORD MCI_SendCommandFrom16(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2);
154 extern DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2, UINT size);
156 HINSTANCE16 WINAPI mmTaskCreate16(SEGPTR spProc, HINSTANCE16 *lphMmTask, DWORD dwPmt);
157 void WINAPI mmTaskBlock16(HINSTANCE16 hInst);
158 LRESULT WINAPI mmTaskSignal16(HTASK16 ht);
159 void WINAPI mmTaskYield16(void);
161 void CALLBACK WINE_mmThreadEntryPoint(DWORD _pmt);
162 LRESULT WINAPI mmThreadCreate16(FARPROC16 fpThreadAddr, LPHANDLE lpHndl, DWORD dwPmt, DWORD dwFlags);
163 void WINAPI mmThreadSignal16(HANDLE16 hndl);
164 void WINAPI mmThreadBlock16(HANDLE16 hndl);
165 HANDLE16 WINAPI mmThreadGetTask16(HANDLE16 hndl);
166 BOOL16 WINAPI mmThreadIsValid16(HANDLE16 hndl);
167 BOOL16 WINAPI mmThreadIsCurrent16(HANDLE16 hndl);
169 BOOL MULTIMEDIA_MciInit(void);
170 LPWINE_MM_IDATA MULTIMEDIA_GetIData(void);
172 BOOL MULTIMEDIA_MidiInit(void);
174 #endif /* __WINE_MULTIMEDIA_H */