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
17 #define MAX_MIDIINDRV (16)
18 /* For now I'm making 16 the maximum number of midi devices one can
19 * have. This should be more than enough for everybody. But as a purist,
20 * I intend to make it unbounded in the future, as soon as I figure
21 * a good way to do so.
23 #define MAX_MIDIOUTDRV (16)
25 #if defined(HAVE_SYS_SOUNDCARD_H)
26 # include <sys/soundcard.h>
27 #elif defined(HAVE_MACHINE_SOUNDCARD_H)
28 # include <machine/soundcard.h>
29 #elif defined(HAVE_SOUNDCARD_H)
30 # include <soundcard.h>
33 #include <sys/errno.h>
36 #define MIDI_SEQ "/dev/sequencer"
38 #define MIDI_DEV "/dev/midi"
42 #define IOCTL(a,b,c) ioctl(a,b,&c)
44 #define IOCTL(a,b,c) (c = ioctl(a,b,c))
49 DRIVERPROC16 driverProc
;
50 MCI_OPEN_DRIVER_PARMS16 modp
;
53 YIELDPROC lpfnYieldProc
;
59 extern WINE_MCIDRIVER mciDrv
[MAXMCIDRIVERS
];
61 #define WINE_MMTHREAD_CREATED 0x4153494C /* "BSIL" */
62 #define WINE_MMTHREAD_DELETED 0xDEADDEAD
65 DWORD dwSignature
; /* 00 "BSIL" when ok, 0xDEADDEAD when being deleted */
66 DWORD dwCounter
; /* 04 > 1 when in mmThread functions */
67 HANDLE hThread
; /* 08 hThread */
68 DWORD dwThreadID
; /* 0C */
69 FARPROC16 fpThread
; /* 10 address of thread proc (segptr or lin depending on dwFlags) */
70 DWORD dwThreadPmt
; /* 14 parameter to be passed upon thread creation to fpThread */
71 DWORD dwSignalCount
; /* 18 counter used for signaling */
72 HANDLE hEvent
; /* 1C event */
73 HANDLE hVxD
; /* 20 return from OpenVxDHandle */
74 DWORD dwStatus
; /* 24 0x00, 0x10, 0x20, 0x30 */
75 DWORD dwFlags
; /* 28 dwFlags upon creation */
76 HANDLE16 hTask
; /* 2C handle to created task */
80 MCI_MAP_NOMEM
, /* ko, memory problem */
81 MCI_MAP_MSGERROR
, /* ko, unknown message */
82 MCI_MAP_OK
, /* ok, no memory allocated. to be sent to 16 bit proc. */
83 MCI_MAP_OKMEM
, /* ok, some memory allocated, need to call MCI_UnMapMsg32ATo16. to be sent to 16 bit proc. */
84 MCI_MAP_PASS
/* ok, no memory allocated. to be sent to 32 bit proc */
87 /* function prototypes */
89 #define MCI_GetDrv(wDevID) (&mciDrv[MCI_DevIDToIndex(wDevID)])
90 #define MCI_GetOpenDrv(wDevID) (&(MCI_GetDrv(wDevID)->mop))
92 extern int MCI_DevIDToIndex(UINT16 wDevID
);
93 extern UINT16
MCI_FirstDevID(void);
94 extern UINT16
MCI_NextDevID(UINT16 wDevID
);
95 extern BOOL
MCI_DevIDValid(UINT16 wDevID
);
97 extern MCI_MapType
MCI_MapMsg16To32A(WORD uDevType
, WORD wMsg
, DWORD
* lParam
);
98 extern MCI_MapType
MCI_UnMapMsg16To32A(WORD uDevTyp
, WORD wMsg
, DWORD lParam
);
100 extern DWORD
MCI_Open(DWORD dwParam
, LPMCI_OPEN_PARMSA lpParms
);
101 extern DWORD
MCI_Close(UINT16 wDevID
, DWORD dwParam
, LPMCI_GENERIC_PARMS lpParms
);
102 extern DWORD
MCI_SysInfo(UINT uDevID
, DWORD dwFlags
, LPMCI_SYSINFO_PARMSA lpParms
);
103 extern DWORD
MCI_Break(UINT uDevID
, DWORD dwFlags
, LPMCI_BREAK_PARMS lpParms
);
105 typedef LONG (*MCIPROC16
)(DWORD
, HDRVR16
, WORD
, DWORD
, DWORD
);
106 typedef LONG (*MCIPROC
)(DWORD
, HDRVR
, DWORD
, DWORD
, DWORD
);
108 extern WORD
MCI_GetDevTypeFromString(LPCSTR str
);
109 extern LPCSTR
MCI_GetStringFromDevType(WORD type
);
111 extern DWORD
MCI_WriteString(LPSTR lpDstStr
, DWORD dstSize
, LPCSTR lpSrcStr
);
112 extern const char* MCI_CommandToString(UINT16 wMsg
);
114 extern int mciInstalledCount
;
115 extern int mciInstalledListLen
;
116 extern LPSTR lpmciInstallNames
;
118 extern UINT16 WINAPI
MCI_DefYieldProc(UINT16 wDevID
, DWORD data
);
120 extern LRESULT
MCI_CleanUp(LRESULT dwRet
, UINT wMsg
, DWORD dwParam2
, BOOL bIs32
);
122 extern DWORD
MCI_SendCommandFrom32(UINT wDevID
, UINT16 wMsg
, DWORD dwParam1
, DWORD dwParam2
);
123 extern DWORD
MCI_SendCommandFrom16(UINT wDevID
, UINT16 wMsg
, DWORD dwParam1
, DWORD dwParam2
);
124 extern DWORD
MCI_SendCommandAsync(UINT wDevID
, UINT wMsg
, DWORD dwParam1
, DWORD dwParam2
, UINT size
);
126 HINSTANCE16 WINAPI
mmTaskCreate16(SEGPTR spProc
, HINSTANCE16
*lphMmTask
, DWORD dwPmt
);
127 void WINAPI
mmTaskBlock16(HINSTANCE16 hInst
);
128 LRESULT WINAPI
mmTaskSignal16(HTASK16 ht
);
129 void WINAPI
mmTaskYield16(void);
131 void CALLBACK
WINE_mmThreadEntryPoint(DWORD _pmt
);
132 LRESULT WINAPI
mmThreadCreate16(FARPROC16 fpThreadAddr
, LPHANDLE lpHndl
, DWORD dwPmt
, DWORD dwFlags
);
133 void WINAPI
mmThreadSignal16(HANDLE16 hndl
);
134 void WINAPI
mmThreadBlock16(HANDLE16 hndl
);
135 HANDLE16 WINAPI
mmThreadGetTask16(HANDLE16 hndl
);
136 BOOL16 WINAPI
mmThreadIsValid16(HANDLE16 hndl
);
137 BOOL16 WINAPI
mmThreadIsCurrent16(HANDLE16 hndl
);
139 BOOL
MULTIMEDIA_MMTimeInit(void);
140 BOOL
MULTIMEDIA_MciInit(void);
141 BOOL
MULTIMEDIA_MidiInit(void);
143 #endif /* __WINE_MULTIMEDIA_H */