4b708a80eba56285dd00c1daf87178b86e00b306
[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
102 /* misc.c */
103
104 BOOL
105 CreateCompatiblePin(
106 IN HANDLE hFilter,
107 IN DWORD PinId,
108 IN BOOL bLoop,
109 IN LPWAVEFORMATEX WaveFormatEx,
110 OUT LPWAVEFORMATEX WaveFormatOut,
111 OUT PHANDLE hPin);
112
113
114 DWORD
115 SyncOverlappedDeviceIoControl(
116 IN HANDLE Handle,
117 IN DWORD IoControlCode,
118 IN LPVOID InBuffer,
119 IN DWORD InBufferSize,
120 OUT LPVOID OutBuffer,
121 IN DWORD OutBufferSize,
122 OUT LPDWORD BytesTransferred OPTIONAL);
123
124 DWORD
125 PrimaryDirectSoundBuffer_Write(
126 LPDIRECTSOUNDBUFFER8 iface,
127 LPVOID Buffer,
128 DWORD BufferSize);
129
130
131 DWORD
132 OpenPin(
133 HANDLE hFilter,
134 ULONG PinId,
135 LPWAVEFORMATEX WaveFormatEx,
136 PHANDLE hPin,
137 BOOL bLoop);
138
139 DWORD
140 OpenFilter(
141 IN LPCWSTR lpFileName,
142 IN PHANDLE OutHandle);
143
144 DWORD
145 GetFilterPinCount(
146 IN HANDLE hFilter,
147 OUT PULONG NumPins);
148
149 DWORD
150 GetFilterPinCommunication(
151 IN HANDLE hFilter,
152 IN ULONG PinId,
153 OUT PKSPIN_COMMUNICATION Communication);
154
155 DWORD
156 GetFilterPinDataFlow(
157 IN HANDLE hFilter,
158 IN ULONG PinId,
159 OUT PKSPIN_DATAFLOW DataFlow);
160
161 /* primary.c */
162
163 HRESULT
164 PrimaryDirectSoundBuffer_GetPosition(
165 LPDIRECTSOUNDBUFFER8 iface,
166 LPDWORD pdwCurrentPlayCursor,
167 LPDWORD pdwCurrentWriteCursor);
168
169 VOID
170 PrimaryDirectSoundBuffer_SetState(
171 LPDIRECTSOUNDBUFFER8 iface,
172 KSSTATE State);
173
174 HRESULT
175 NewPrimarySoundBuffer(
176 LPDIRECTSOUNDBUFFER8 *OutBuffer,
177 LPFILTERINFO Filter,
178 DWORD dwLevel);
179
180 HRESULT
181 PrimaryDirectSoundBuffer_SetFormat(
182 LPDIRECTSOUNDBUFFER8 iface,
183 LPWAVEFORMATEX pcfxFormat,
184 BOOL bLooped);
185
186 VOID
187 PrimaryDirectSoundBuffer_AcquireLock(
188 LPDIRECTSOUNDBUFFER8 iface);
189
190 VOID
191 PrimaryDirectSoundBuffer_ReleaseLock(
192 LPDIRECTSOUNDBUFFER8 iface);
193
194 /* secondary.c */
195
196 HRESULT
197 NewSecondarySoundBuffer(
198 LPDIRECTSOUNDBUFFER8 *OutBuffer,
199 LPFILTERINFO Filter,
200 DWORD dwLevel,
201 LPCDSBUFFERDESC lpcDSBufferDesc,
202 LPDIRECTSOUNDBUFFER8 PrimaryBuffer);
203
204 /* property.c */
205 HRESULT
206 CALLBACK
207 NewKsPropertySet(
208 IUnknown* pUnkOuter,
209 REFIID riid,
210 LPVOID* ppvObject);
211
212 /* capture.c */
213
214 HRESULT
215 CALLBACK
216 NewDirectSoundCapture(
217 IUnknown* pUnkOuter,
218 REFIID riid,
219 LPVOID* ppvObject);
220
221
222 /* capturebuffer.c */
223 HRESULT
224 NewDirectSoundCaptureBuffer(
225 LPDIRECTSOUNDCAPTUREBUFFER8 *OutBuffer,
226 LPFILTERINFO Filter,
227 LPCDSCBUFFERDESC lpcDSBufferDesc);
228
229 #endif