4b7b146778874eb1aee5c58c203081012d912c41
[reactos.git] / lib / drivers / sound / mmixer / mmixer.h
1 #pragma once
2
3 typedef enum
4 {
5 MM_STATUS_SUCCESS = 0,
6 MM_STATUS_NOTINITIALIZED,
7 MM_STATUS_NOT_IMPLEMENTED,
8 MM_STATUS_NO_MORE_DEVICES,
9 MM_STATUS_MORE_ENTRIES,
10 MM_STATUS_INVALID_PARAMETER,
11 MM_STATUS_UNSUCCESSFUL,
12 MM_STATUS_NO_MEMORY
13
14
15 }MIXER_STATUS;
16
17
18 typedef PVOID (*PMIXER_ALLOC)(
19 IN ULONG NumberOfBytes);
20
21 typedef VOID (*PMIXER_FREE)(
22 IN PVOID Block);
23
24 typedef MIXER_STATUS (*PMIXER_ENUM)(
25 IN PVOID EnumContext,
26 IN ULONG DeviceIndex,
27 OUT LPWSTR * DeviceName,
28 OUT PHANDLE OutHandle,
29 OUT PHANDLE OutDevInterfaceKey);
30
31 typedef MIXER_STATUS(*PMIXER_DEVICE_CONTROL)(
32 IN HANDLE hMixer,
33 IN ULONG dwIoControlCode,
34 IN PVOID lpInBuffer,
35 IN ULONG nInBufferSize,
36 OUT PVOID lpOutBuffer,
37 ULONG nOutBufferSize,
38 PULONG lpBytesReturned);
39
40 typedef MIXER_STATUS(*PMIXER_OPEN)(
41 IN LPWSTR DevicePath,
42 OUT PHANDLE hDevice);
43
44 typedef MIXER_STATUS(*PMIXER_CLOSE)(
45 IN HANDLE hDevice);
46
47 typedef MIXER_STATUS(*PMIXER_CLOSEKEY)(
48 IN HANDLE hKey);
49
50 typedef VOID (CALLBACK *PMIXER_EVENT)(
51 IN PVOID MixerEventContext,
52 IN HANDLE hMixer,
53 IN ULONG NotificationType,
54 IN ULONG Value);
55
56 typedef VOID (*PMIXER_COPY)(
57 IN PVOID Dst,
58 IN PVOID Src,
59 IN ULONG Length);
60
61 typedef MIXER_STATUS(*PMIXER_QUERY_KEY_VALUE)(
62 IN HANDLE hKey,
63 IN LPWSTR KeyName,
64 OUT PVOID * ResultBuffer,
65 OUT PULONG ResultLength,
66 OUT PULONG KeyType);
67
68 typedef MIXER_STATUS(*PMIXER_OPEN_KEY)(
69 IN HANDLE hKey,
70 IN LPWSTR SubKey,
71 IN ULONG DesiredAccess,
72 OUT PHANDLE OutKey);
73
74 typedef PVOID (*PMIXER_ALLOC_EVENT_DATA)(
75 IN ULONG ExtraBytes);
76
77 typedef VOID (*PMIXER_FREE_EVENT_DATA)(
78 IN PVOID EventData);
79
80 typedef MIXER_STATUS (*PIN_CREATE_CALLBACK)(
81 IN PVOID Context,
82 IN ULONG DeviceId,
83 IN ULONG PinId,
84 IN HANDLE hFilter,
85 IN PKSPIN_CONNECT PinConnect,
86 IN ACCESS_MASK DesiredAccess,
87 OUT PHANDLE PinHandle);
88
89 typedef struct
90 {
91 ULONG SizeOfStruct;
92 PVOID MixerContext;
93
94 PMIXER_ALLOC Alloc;
95 PMIXER_DEVICE_CONTROL Control;
96 PMIXER_FREE Free;
97 PMIXER_OPEN Open;
98 PMIXER_CLOSE Close;
99 PMIXER_COPY Copy;
100 PMIXER_OPEN_KEY OpenKey;
101 PMIXER_QUERY_KEY_VALUE QueryKeyValue;
102 PMIXER_CLOSEKEY CloseKey;
103 PMIXER_ALLOC_EVENT_DATA AllocEventData;
104 PMIXER_FREE_EVENT_DATA FreeEventData;
105 }MIXER_CONTEXT, *PMIXER_CONTEXT;
106
107 MIXER_STATUS
108 MMixerInitialize(
109 IN PMIXER_CONTEXT MixerContext,
110 IN PMIXER_ENUM EnumFunction,
111 IN PVOID EnumContext);
112
113 ULONG
114 MMixerGetCount(
115 IN PMIXER_CONTEXT MixerContext);
116
117 ULONG
118 MMixerGetWaveInCount(
119 IN PMIXER_CONTEXT MixerContext);
120
121 ULONG
122 MMixerGetWaveOutCount(
123 IN PMIXER_CONTEXT MixerContext);
124
125 ULONG
126 MMixerGetMidiInCount(
127 IN PMIXER_CONTEXT MixerContext);
128
129 ULONG
130 MMixerGetMidiOutCount(
131 IN PMIXER_CONTEXT MixerContext);
132
133
134
135 MIXER_STATUS
136 MMixerGetCapabilities(
137 IN PMIXER_CONTEXT MixerContext,
138 IN ULONG MixerIndex,
139 OUT LPMIXERCAPSW MixerCaps);
140
141 MIXER_STATUS
142 MMixerOpen(
143 IN PMIXER_CONTEXT MixerContext,
144 IN ULONG MixerId,
145 IN PVOID MixerEventContext,
146 IN PMIXER_EVENT MixerEventRoutine,
147 OUT PHANDLE MixerHandle);
148
149 MIXER_STATUS
150 MMixerGetLineInfo(
151 IN PMIXER_CONTEXT MixerContext,
152 IN HANDLE MixerHandle,
153 IN ULONG MixerId,
154 IN ULONG Flags,
155 OUT LPMIXERLINEW MixerLine);
156
157 MIXER_STATUS
158 MMixerGetLineControls(
159 IN PMIXER_CONTEXT MixerContext,
160 IN HANDLE MixerHandle,
161 IN ULONG MixerId,
162 IN ULONG Flags,
163 OUT LPMIXERLINECONTROLSW MixerLineControls);
164
165 MIXER_STATUS
166 MMixerSetControlDetails(
167 IN PMIXER_CONTEXT MixerContext,
168 IN HANDLE MixerHandle,
169 IN ULONG MixerId,
170 IN ULONG Flags,
171 OUT LPMIXERCONTROLDETAILS MixerControlDetails);
172
173 MIXER_STATUS
174 MMixerGetControlDetails(
175 IN PMIXER_CONTEXT MixerContext,
176 IN HANDLE MixerHandle,
177 IN ULONG MixerId,
178 IN ULONG Flags,
179 OUT LPMIXERCONTROLDETAILS MixerControlDetails);
180
181 MIXER_STATUS
182 MMixerWaveOutCapabilities(
183 IN PMIXER_CONTEXT MixerContext,
184 IN ULONG DeviceIndex,
185 OUT LPWAVEOUTCAPSW Caps);
186
187 MIXER_STATUS
188 MMixerWaveInCapabilities(
189 IN PMIXER_CONTEXT MixerContext,
190 IN ULONG DeviceIndex,
191 OUT LPWAVEINCAPSW Caps);
192
193 MIXER_STATUS
194 MMixerOpenWave(
195 IN PMIXER_CONTEXT MixerContext,
196 IN ULONG DeviceIndex,
197 IN ULONG bWaveIn,
198 IN LPWAVEFORMATEX WaveFormat,
199 IN PIN_CREATE_CALLBACK CreateCallback,
200 IN PVOID Context,
201 OUT PHANDLE PinHandle);
202
203 MIXER_STATUS
204 MMixerSetWaveStatus(
205 IN PMIXER_CONTEXT MixerContext,
206 IN HANDLE PinHandle,
207 IN KSSTATE State);
208
209 MIXER_STATUS
210 MMixerGetWaveDevicePath(
211 IN PMIXER_CONTEXT MixerContext,
212 IN ULONG bWaveIn,
213 IN ULONG DeviceId,
214 OUT LPWSTR * DevicePath);
215
216 MIXER_STATUS
217 MMixerMidiOutCapabilities(
218 IN PMIXER_CONTEXT MixerContext,
219 IN ULONG DeviceIndex,
220 OUT LPMIDIOUTCAPSW Caps);
221
222 MIXER_STATUS
223 MMixerMidiInCapabilities(
224 IN PMIXER_CONTEXT MixerContext,
225 IN ULONG DeviceIndex,
226 OUT LPMIDIINCAPSW Caps);
227
228 MIXER_STATUS
229 MMixerGetMidiDevicePath(
230 IN PMIXER_CONTEXT MixerContext,
231 IN ULONG bMidiIn,
232 IN ULONG DeviceId,
233 OUT LPWSTR * DevicePath);
234
235 MIXER_STATUS
236 MMixerSetMidiStatus(
237 IN PMIXER_CONTEXT MixerContext,
238 IN HANDLE PinHandle,
239 IN KSSTATE State);
240
241 MIXER_STATUS
242 MMixerOpenMidi(
243 IN PMIXER_CONTEXT MixerContext,
244 IN ULONG DeviceIndex,
245 IN ULONG bMidiIn,
246 IN PIN_CREATE_CALLBACK CreateCallback,
247 IN PVOID Context,
248 OUT PHANDLE PinHandle);