xref: /reactos/sdk/lib/drivers/sound/mmixer/mmixer.h (revision c2c66aff)
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 MMixerClose(
151     IN PMIXER_CONTEXT MixerContext,
152     IN ULONG MixerId,
153     IN PVOID MixerEventContext,
154     IN PMIXER_EVENT MixerEventRoutine);
155 
156 MIXER_STATUS
157 MMixerGetLineInfo(
158     IN PMIXER_CONTEXT MixerContext,
159     IN HANDLE MixerHandle,
160     IN ULONG MixerId,
161     IN  ULONG Flags,
162     OUT LPMIXERLINEW MixerLine);
163 
164 MIXER_STATUS
165 MMixerGetLineControls(
166     IN PMIXER_CONTEXT MixerContext,
167     IN HANDLE MixerHandle,
168     IN ULONG MixerId,
169     IN ULONG Flags,
170     OUT LPMIXERLINECONTROLSW MixerLineControls);
171 
172 MIXER_STATUS
173 MMixerSetControlDetails(
174     IN PMIXER_CONTEXT MixerContext,
175     IN HANDLE MixerHandle,
176     IN ULONG MixerId,
177     IN ULONG Flags,
178     OUT LPMIXERCONTROLDETAILS MixerControlDetails);
179 
180 MIXER_STATUS
181 MMixerGetControlDetails(
182     IN PMIXER_CONTEXT MixerContext,
183     IN HANDLE MixerHandle,
184     IN ULONG MixerId,
185     IN ULONG Flags,
186     OUT LPMIXERCONTROLDETAILS MixerControlDetails);
187 
188 MIXER_STATUS
189 MMixerWaveOutCapabilities(
190     IN PMIXER_CONTEXT MixerContext,
191     IN ULONG DeviceIndex,
192     OUT LPWAVEOUTCAPSW Caps);
193 
194 MIXER_STATUS
195 MMixerWaveInCapabilities(
196     IN PMIXER_CONTEXT MixerContext,
197     IN ULONG DeviceIndex,
198     OUT LPWAVEINCAPSW Caps);
199 
200 MIXER_STATUS
201 MMixerOpenWave(
202     IN PMIXER_CONTEXT MixerContext,
203     IN ULONG DeviceIndex,
204     IN ULONG bWaveIn,
205     IN LPWAVEFORMATEX WaveFormat,
206     IN PIN_CREATE_CALLBACK CreateCallback,
207     IN PVOID Context,
208     OUT PHANDLE PinHandle);
209 
210 MIXER_STATUS
211 MMixerSetWaveStatus(
212     IN PMIXER_CONTEXT MixerContext,
213     IN HANDLE PinHandle,
214     IN KSSTATE State);
215 
216 MIXER_STATUS
217 MMixerSetWaveResetState(
218     IN PMIXER_CONTEXT MixerContext,
219     IN HANDLE PinHandle,
220     IN ULONG bBegin);
221 
222 MIXER_STATUS
223 MMixerGetWaveDevicePath(
224     IN PMIXER_CONTEXT MixerContext,
225     IN ULONG bWaveIn,
226     IN ULONG DeviceId,
227     OUT LPWSTR * DevicePath);
228 
229 MIXER_STATUS
230 MMixerMidiOutCapabilities(
231     IN PMIXER_CONTEXT MixerContext,
232     IN ULONG DeviceIndex,
233     OUT LPMIDIOUTCAPSW Caps);
234 
235 MIXER_STATUS
236 MMixerMidiInCapabilities(
237     IN PMIXER_CONTEXT MixerContext,
238     IN ULONG DeviceIndex,
239     OUT LPMIDIINCAPSW Caps);
240 
241 MIXER_STATUS
242 MMixerGetMidiDevicePath(
243     IN PMIXER_CONTEXT MixerContext,
244     IN ULONG bMidiIn,
245     IN ULONG DeviceId,
246     OUT LPWSTR * DevicePath);
247 
248 MIXER_STATUS
249 MMixerSetMidiStatus(
250     IN PMIXER_CONTEXT MixerContext,
251     IN HANDLE PinHandle,
252     IN KSSTATE State);
253 
254 MIXER_STATUS
255 MMixerOpenMidi(
256     IN PMIXER_CONTEXT MixerContext,
257     IN ULONG DeviceIndex,
258     IN ULONG bMidiIn,
259     IN PIN_CREATE_CALLBACK CreateCallback,
260     IN PVOID Context,
261     OUT PHANDLE PinHandle);
262