1 | /* $Id: multimedia.h,v 1.1 1999-05-24 20:19:15 ktk Exp $ */
|
---|
2 |
|
---|
3 | /* -*- tab-width: 8; c-basic-offset: 4 -*- */
|
---|
4 |
|
---|
5 | /*****************************************************************************
|
---|
6 | * Copyright 1998, Luiz Otavio L. Zorzella
|
---|
7 | *
|
---|
8 | * File: multimedia.h
|
---|
9 | * Purpose: multimedia declarations
|
---|
10 | *
|
---|
11 | *****************************************************************************
|
---|
12 | */
|
---|
13 | #ifndef __WINE_MULTIMEDIA_H
|
---|
14 | #define __WINE_MULTIMEDIA_H
|
---|
15 |
|
---|
16 | #include "mmsystem.h"
|
---|
17 |
|
---|
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.
|
---|
23 | */
|
---|
24 | #define MAX_MIDIOUTDRV (16)
|
---|
25 |
|
---|
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
|
---|
33 |
|
---|
34 | #include <sys/errno.h>
|
---|
35 |
|
---|
36 | #ifdef HAVE_OSS
|
---|
37 | #define MIDI_SEQ "/dev/sequencer"
|
---|
38 | #else
|
---|
39 | #define MIDI_DEV "/dev/midi"
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | #ifdef SOUND_VERSION
|
---|
43 | #define IOCTL(a,b,c) ioctl(a,b,&c)
|
---|
44 | #else
|
---|
45 | #define IOCTL(a,b,c) (c = ioctl(a,b,c))
|
---|
46 | #endif
|
---|
47 |
|
---|
48 | typedef struct {
|
---|
49 | HDRVR16 hDrv;
|
---|
50 | DRIVERPROC16 driverProc;
|
---|
51 | MCI_OPEN_DRIVER_PARMS16 modp;
|
---|
52 | MCI_OPEN_PARMS16 mop;
|
---|
53 | DWORD dwPrivate;
|
---|
54 | YIELDPROC lpfnYieldProc;
|
---|
55 | DWORD dwYieldData;
|
---|
56 | BOOL bIs32;
|
---|
57 | HTASK16 hCreatorTask;
|
---|
58 | } WINE_MCIDRIVER;
|
---|
59 |
|
---|
60 | extern WINE_MCIDRIVER mciDrv[MAXMCIDRIVERS];
|
---|
61 |
|
---|
62 | #define WINE_MMTHREAD_CREATED 0x4153494C /* "BSIL" */
|
---|
63 | #define WINE_MMTHREAD_DELETED 0xDEADDEAD
|
---|
64 |
|
---|
65 | typedef struct {
|
---|
66 | DWORD dwSignature; /* 00 "BSIL" when ok, 0xDEADDEAD when being deleted */
|
---|
67 | DWORD dwCounter; /* 04 */
|
---|
68 | HANDLE hThread; /* 08 hThread */
|
---|
69 | DWORD dwThreadId; /* 0C */
|
---|
70 | FARPROC16 fpThread; /* 10 segmented address of thread proc */
|
---|
71 | DWORD dwThreadPmt; /* 14 parameter to be called upon thread creation */
|
---|
72 | DWORD dwUnknown3; /* 18 increment interlocked ? */
|
---|
73 | DWORD hEvent; /* 1C event */
|
---|
74 | DWORD dwUnknown5; /* 20 */
|
---|
75 | DWORD dwStatus; /* 24 0, 10, 20, 30 */
|
---|
76 | DWORD dwFlags; /* 28 dwFlags upon creation */
|
---|
77 | HANDLE16 hTask; /* 2C handle to created task */
|
---|
78 | } WINE_MMTHREAD;
|
---|
79 |
|
---|
80 | #define MCI_GetDrv(wDevID) (&mciDrv[MCI_DevIDToIndex(wDevID)])
|
---|
81 | #define MCI_GetOpenDrv(wDevID) (&(MCI_GetDrv(wDevID)->mop))
|
---|
82 |
|
---|
83 | /* function prototypes */
|
---|
84 | extern BOOL MULTIMEDIA_Init(void);
|
---|
85 |
|
---|
86 | extern int MCI_DevIDToIndex(UINT16 wDevID);
|
---|
87 | extern UINT16 MCI_FirstDevID(void);
|
---|
88 | extern UINT16 MCI_NextDevID(UINT16 wDevID);
|
---|
89 | extern BOOL MCI_DevIDValid(UINT16 wDevID);
|
---|
90 |
|
---|
91 | extern int MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam);
|
---|
92 | extern int MCI_UnMapMsg16To32A(WORD uDevTyp, WORD wMsg, DWORD lParam);
|
---|
93 |
|
---|
94 | extern DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSA lpParms);
|
---|
95 | extern DWORD MCI_Close(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms);
|
---|
96 | extern DWORD MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSA lpParms);
|
---|
97 |
|
---|
98 | typedef LONG (*MCIPROC16)(DWORD, HDRVR16, WORD, DWORD, DWORD);
|
---|
99 | typedef LONG (*MCIPROC)(DWORD, HDRVR16, DWORD, DWORD, DWORD);
|
---|
100 |
|
---|
101 | extern WORD MCI_GetDevType(LPCSTR str);
|
---|
102 | extern DWORD MCI_WriteString(LPSTR lpDstStr, DWORD dstSize, LPCSTR lpSrcStr);
|
---|
103 | extern const char* MCI_CommandToString(UINT16 wMsg);
|
---|
104 |
|
---|
105 | extern int mciInstalledCount;
|
---|
106 | extern int mciInstalledListLen;
|
---|
107 | extern LPSTR lpmciInstallNames;
|
---|
108 |
|
---|
109 | extern UINT16 MCI_DefYieldProc(UINT16 wDevID, DWORD data);
|
---|
110 |
|
---|
111 | typedef struct {
|
---|
112 | WORD uDevType;
|
---|
113 | char* lpstrName;
|
---|
114 | MCIPROC lpfnProc;
|
---|
115 | } MCI_WineDesc;
|
---|
116 |
|
---|
117 | extern MCI_WineDesc MCI_InternalDescriptors[];
|
---|
118 |
|
---|
119 | extern LRESULT MCI_CleanUp(LRESULT dwRet, UINT wMsg, DWORD dwParam2, BOOL bIs32);
|
---|
120 |
|
---|
121 | extern DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2);
|
---|
122 | extern DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2, UINT size);
|
---|
123 |
|
---|
124 | LONG MCIWAVE_DriverProc(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
---|
125 | DWORD dwParam1, DWORD dwParam2);
|
---|
126 | LONG MCIMIDI_DriverProc(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
---|
127 | DWORD dwParam1, DWORD dwParam2);
|
---|
128 | LONG MCICDAUDIO_DriverProc(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
---|
129 | DWORD dwParam1, DWORD dwParam2);
|
---|
130 | LONG MCIANIM_DriverProc(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
---|
131 | DWORD dwParam1, DWORD dwParam2);
|
---|
132 | LONG MCIAVI_DriverProc(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg,
|
---|
133 | DWORD dwParam1, DWORD dwParam2);
|
---|
134 |
|
---|
135 | #endif /* __WINE_MULTIMEDIA_H */
|
---|