[DSOUND]
[reactos.git] / reactos / dll / directx / dsound_new / precomp.h
1 #ifndef PRECOMP_H__
2 #define PRECOMP_H__
3
4 #define COBJMACROS
5 #define NONAMELESSUNION
6 #define NONAMELESSSTRUCT
7
8 #include <windows.h>
9 #include <setupapi.h>
10 #include <mmddk.h>
11 #include <objbase.h>
12 #include <olectl.h>
13 #include <unknwn.h>
14 #include <dsound.h>
15 #include <dsconf.h>
16 #include <vfwmsgs.h>
17 #include <setupapi.h>
18 #define YDEBUG
19 #include <debug.h>
20 #include <ks.h>
21 #include <ksmedia.h>
22 #include <limits.h>
23 #include <stdio.h>
24
25 #include "resource.h"
26
27
28 /* factory method */
29 typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject);
30
31 /* factory table */
32 typedef struct
33 {
34 REFIID riid;
35 LPFNCREATEINSTANCE lpfnCI;
36 } INTERFACE_TABLE;
37
38
39 typedef struct tagFILTERINFO
40 {
41 SP_DEVINFO_DATA DeviceData;
42 WCHAR DevicePath[MAX_PATH];
43 HANDLE hFilter;
44 ULONG PinCount;
45 PULONG Pin;
46 GUID DeviceGuid[2];
47 ULONG MappedId[2];
48
49 struct tagFILTERINFO *lpNext;
50 }FILTERINFO, *LPFILTERINFO;
51
52 #define INIT_GUID(guid, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
53 guid.Data1 = l; guid.Data2 = w1; guid.Data3 = w2; \
54 guid.Data4[0] = b1; guid.Data4[1] = b2; guid.Data4[2] = b3; \
55 guid.Data4[3] = b4; guid.Data4[4] = b5; guid.Data4[5] = b6; \
56 guid.Data4[6] = b7; guid.Data4[7] = b8;
57
58 typedef enum
59 {
60 PIN_TYPE_NONE = 0,
61 PIN_TYPE_PLAYBACK = 1,
62 PIN_TYPE_RECORDING = 2
63 }PIN_TYPE;
64
65 /* globals */
66 extern HINSTANCE dsound_hInstance;
67 extern LPFILTERINFO RootInfo;
68
69 /* classfactory.c */
70
71 IClassFactory *
72 IClassFactory_fnConstructor(
73 LPFNCREATEINSTANCE lpfnCI,
74 PLONG pcRefDll,
75 REFIID riidInst);
76
77
78 /* devicelist.c */
79
80 HRESULT
81 EnumAudioDeviceInterfaces(
82 LPFILTERINFO *OutRootInfo);
83
84 BOOL
85 FindDeviceByGuid(
86 LPCGUID pGuidSrc,
87 LPFILTERINFO *Filter);
88
89 BOOL
90 FindDeviceByMappedId(
91 IN ULONG DeviceID,
92 LPFILTERINFO *Filter,
93 BOOL bPlayback);
94
95 ULONG
96 GetPinIdFromFilter(
97 LPFILTERINFO Filter,
98 BOOL bCapture,
99 ULONG Offset);
100
101 /* directsound.c */
102
103 HRESULT
104 CALLBACK
105 NewDirectSound(
106 IUnknown* pUnkOuter,
107 REFIID riid,
108 LPVOID* ppvObject);
109
110
111 /* misc.c */
112
113 BOOL
114 CreateCompatiblePin(
115 IN HANDLE hFilter,
116 IN DWORD PinId,
117 IN BOOL bLoop,
118 IN LPWAVEFORMATEX WaveFormatEx,
119 OUT LPWAVEFORMATEX WaveFormatOut,
120 OUT PHANDLE hPin);
121
122
123 DWORD
124 SyncOverlappedDeviceIoControl(
125 IN HANDLE Handle,
126 IN DWORD IoControlCode,
127 IN LPVOID InBuffer,
128 IN DWORD InBufferSize,
129 OUT LPVOID OutBuffer,
130 IN DWORD OutBufferSize,
131 OUT LPDWORD BytesTransferred OPTIONAL);
132
133 DWORD
134 PrimaryDirectSoundBuffer_Write(
135 LPDIRECTSOUNDBUFFER8 iface,
136 LPVOID Buffer,
137 DWORD BufferSize);
138
139
140 DWORD
141 OpenPin(
142 HANDLE hFilter,
143 ULONG PinId,
144 LPWAVEFORMATEX WaveFormatEx,
145 PHANDLE hPin,
146 BOOL bLoop);
147
148 DWORD
149 OpenFilter(
150 IN LPCWSTR lpFileName,
151 IN PHANDLE OutHandle);
152
153 DWORD
154 GetFilterPinCount(
155 IN HANDLE hFilter,
156 OUT PULONG NumPins);
157
158 DWORD
159 GetFilterPinCommunication(
160 IN HANDLE hFilter,
161 IN ULONG PinId,
162 OUT PKSPIN_COMMUNICATION Communication);
163
164 DWORD
165 GetFilterPinDataFlow(
166 IN HANDLE hFilter,
167 IN ULONG PinId,
168 OUT PKSPIN_DATAFLOW DataFlow);
169
170 /* primary.c */
171
172 HRESULT
173 PrimaryDirectSoundBuffer_GetPosition(
174 LPDIRECTSOUNDBUFFER8 iface,
175 LPDWORD pdwCurrentPlayCursor,
176 LPDWORD pdwCurrentWriteCursor);
177
178 VOID
179 PrimaryDirectSoundBuffer_SetState(
180 LPDIRECTSOUNDBUFFER8 iface,
181 KSSTATE State);
182
183 HRESULT
184 NewPrimarySoundBuffer(
185 LPDIRECTSOUNDBUFFER8 *OutBuffer,
186 LPFILTERINFO Filter,
187 DWORD dwLevel);
188
189 HRESULT
190 PrimaryDirectSoundBuffer_SetFormat(
191 LPDIRECTSOUNDBUFFER8 iface,
192 LPWAVEFORMATEX pcfxFormat,
193 BOOL bLooped);
194
195 VOID
196 PrimaryDirectSoundBuffer_AcquireLock(
197 LPDIRECTSOUNDBUFFER8 iface);
198
199 VOID
200 PrimaryDirectSoundBuffer_ReleaseLock(
201 LPDIRECTSOUNDBUFFER8 iface);
202
203 /* secondary.c */
204
205 HRESULT
206 NewSecondarySoundBuffer(
207 LPDIRECTSOUNDBUFFER8 *OutBuffer,
208 LPFILTERINFO Filter,
209 DWORD dwLevel,
210 LPCDSBUFFERDESC lpcDSBufferDesc,
211 LPDIRECTSOUNDBUFFER8 PrimaryBuffer);
212
213 /* property.c */
214 HRESULT
215 CALLBACK
216 NewKsPropertySet(
217 IUnknown* pUnkOuter,
218 REFIID riid,
219 LPVOID* ppvObject);
220
221 /* capture.c */
222
223 HRESULT
224 CALLBACK
225 NewDirectSoundCapture(
226 IUnknown* pUnkOuter,
227 REFIID riid,
228 LPVOID* ppvObject);
229
230
231 /* capturebuffer.c */
232 HRESULT
233 NewDirectSoundCaptureBuffer(
234 LPDIRECTSOUNDCAPTUREBUFFER8 *OutBuffer,
235 LPFILTERINFO Filter,
236 LPCDSCBUFFERDESC lpcDSBufferDesc);
237
238 #endif