1 | /*
|
---|
2 | * Core Audio audioclient definitions
|
---|
3 | *
|
---|
4 | * Copyright 2009 Maarten Lankhorst
|
---|
5 | *
|
---|
6 | * This library is free software; you can redistribute it and/or
|
---|
7 | * modify it under the terms of the GNU Lesser General Public
|
---|
8 | * License as published by the Free Software Foundation; either
|
---|
9 | * version 2.1 of the License, or (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This library is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
14 | * Lesser General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU Lesser General Public
|
---|
17 | * License along with this library; if not, write to the Free Software
|
---|
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
19 | *
|
---|
20 | */
|
---|
21 |
|
---|
22 | /*
|
---|
23 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
24 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
25 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
26 | * a choice of LGPL license versions is made available with the language indicating
|
---|
27 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
28 | * of the LGPL is applied is otherwise unspecified.
|
---|
29 | */
|
---|
30 |
|
---|
31 | import "wtypes.idl";
|
---|
32 | import "unknwn.idl";
|
---|
33 | import "audiosessiontypes.h";
|
---|
34 |
|
---|
35 | /* Forward declarations */
|
---|
36 | interface IAudioClient;
|
---|
37 | interface IAudioRenderClient;
|
---|
38 | interface IAudioCaptureClient;
|
---|
39 | interface IAudioClock;
|
---|
40 | interface IAudioClock2;
|
---|
41 | interface IAudioClockAdjustment;
|
---|
42 | interface ISimpleAudioVolume;
|
---|
43 | interface IAudioStreamVolume;
|
---|
44 | interface IChannelAudioVolume;
|
---|
45 |
|
---|
46 | cpp_quote("#if 0")
|
---|
47 | typedef struct WAVEFORMATEX /*[hidden,restricted]*/
|
---|
48 | {
|
---|
49 | WORD wFormatTag;
|
---|
50 | WORD nChannels;
|
---|
51 | DWORD nSamplesPerSec;
|
---|
52 | DWORD nAvgBytesPerSec;
|
---|
53 | WORD nBlockAlign;
|
---|
54 | WORD wBitsPerSample;
|
---|
55 | WORD cbSize;
|
---|
56 | } WAVEFORMATEX;
|
---|
57 | cpp_quote("#else")
|
---|
58 | cpp_quote("#include <mmreg.h>")
|
---|
59 | cpp_quote("#endif")
|
---|
60 |
|
---|
61 | cpp_quote("#if 0")
|
---|
62 | typedef LONGLONG /*[hidden,restricted]*/ REFERENCE_TIME;
|
---|
63 | cpp_quote("#else")
|
---|
64 | cpp_quote("#define _IKsControl_")
|
---|
65 | cpp_quote("#include <ks.h>")
|
---|
66 | cpp_quote("#include <ksmedia.h>")
|
---|
67 | cpp_quote("#endif")
|
---|
68 |
|
---|
69 | enum _AUDCLNT_BUFFERFLAGS
|
---|
70 | {
|
---|
71 | AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY = 0x1,
|
---|
72 | AUDCLNT_BUFFERFLAGS_SILENT = 0x2,
|
---|
73 | AUDCLNT_BUFFERFLAGS_TIMESTAMP_ERROR = 0x4
|
---|
74 | };
|
---|
75 |
|
---|
76 | [
|
---|
77 | local,
|
---|
78 | pointer_default(unique),
|
---|
79 | uuid(1cb9ad4c-dbfa-4c32-b178-c2f568a703b2),
|
---|
80 | object,
|
---|
81 | ]
|
---|
82 | interface IAudioClient : IUnknown
|
---|
83 | {
|
---|
84 | HRESULT Initialize(
|
---|
85 | [in] AUDCLNT_SHAREMODE ShareMode,
|
---|
86 | [in] DWORD StreamFlags,
|
---|
87 | [in] REFERENCE_TIME hnsBufferDuration,
|
---|
88 | [in] REFERENCE_TIME hnsPeriodicity,
|
---|
89 | [in] const WAVEFORMATEX *pFormat,
|
---|
90 | [in] LPCGUID AudioSessionGuid
|
---|
91 | );
|
---|
92 | HRESULT GetBufferSize(
|
---|
93 | [out] UINT32 *pNumBufferFrames
|
---|
94 | );
|
---|
95 | HRESULT GetStreamLatency(
|
---|
96 | [out] REFERENCE_TIME *phnsLatency
|
---|
97 | );
|
---|
98 | HRESULT GetCurrentPadding(
|
---|
99 | [out] UINT32 *pNumPaddingFrames
|
---|
100 | );
|
---|
101 | HRESULT IsFormatSupported(
|
---|
102 | [in] AUDCLNT_SHAREMODE ShareMode,
|
---|
103 | [in] const WAVEFORMATEX *pFormat,
|
---|
104 | [out,unique] WAVEFORMATEX **ppClosestMatch
|
---|
105 | );
|
---|
106 | HRESULT GetMixFormat(
|
---|
107 | [out] WAVEFORMATEX **ppDeviceFormat
|
---|
108 | );
|
---|
109 | HRESULT GetDevicePeriod(
|
---|
110 | [out] REFERENCE_TIME *phnsDefaultDevicePeriod,
|
---|
111 | [out] REFERENCE_TIME *phnsMinimumDevicePeriod
|
---|
112 | );
|
---|
113 | HRESULT Start(void);
|
---|
114 | HRESULT Stop(void);
|
---|
115 | HRESULT Reset(void);
|
---|
116 | HRESULT SetEventHandle([in] HANDLE eventHandle);
|
---|
117 | HRESULT GetService(
|
---|
118 | [in] REFIID riid,
|
---|
119 | [iid_is(riid),out] void **ppv
|
---|
120 | );
|
---|
121 | }
|
---|
122 |
|
---|
123 | [
|
---|
124 | local,
|
---|
125 | pointer_default(unique),
|
---|
126 | uuid(f294acfc-3146-4483-a7bf-addca7c260e2),
|
---|
127 | object,
|
---|
128 | ]
|
---|
129 | interface IAudioRenderClient : IUnknown
|
---|
130 | {
|
---|
131 | HRESULT GetBuffer(
|
---|
132 | [in] UINT32 NumFramesRequested,
|
---|
133 | [out] BYTE **ppData
|
---|
134 | );
|
---|
135 | HRESULT ReleaseBuffer(
|
---|
136 | [in] UINT32 NumFramesWritten,
|
---|
137 | [in] DWORD dwFlags
|
---|
138 | );
|
---|
139 | }
|
---|
140 |
|
---|
141 | [
|
---|
142 | local,
|
---|
143 | pointer_default(unique),
|
---|
144 | uuid(c8adbd64-e71e-48a0-a4de-185c395cd317),
|
---|
145 | object,
|
---|
146 | ]
|
---|
147 | interface IAudioCaptureClient : IUnknown
|
---|
148 | {
|
---|
149 | HRESULT GetBuffer(
|
---|
150 | [out] BYTE **ppData,
|
---|
151 | [out] UINT32 *pNumFramesToRead,
|
---|
152 | [out] DWORD *pdwFlags,
|
---|
153 | [unique,out] UINT64 *pu64DevicePosition,
|
---|
154 | [unique,out] UINT64 *pu64QPCPosition
|
---|
155 | );
|
---|
156 | HRESULT ReleaseBuffer(
|
---|
157 | [in] UINT32 NumFramesRead
|
---|
158 | );
|
---|
159 | HRESULT GetNextPacketSize(
|
---|
160 | [out] UINT32 *pNumFramesInNextPacket
|
---|
161 | );
|
---|
162 | }
|
---|
163 |
|
---|
164 | cpp_quote("#define AUDIOCLOCK_CHARACTERISTIC_FIXED_FREQ 0x00000001")
|
---|
165 |
|
---|
166 | [
|
---|
167 | local,
|
---|
168 | pointer_default(unique),
|
---|
169 | uuid("cd63314f-3fba-4a1b-812c-ef96358728e7"),
|
---|
170 | object,
|
---|
171 | ]
|
---|
172 | interface IAudioClock : IUnknown
|
---|
173 | {
|
---|
174 | HRESULT GetFrequency(
|
---|
175 | [out] UINT64 *pu64Frequency
|
---|
176 | );
|
---|
177 | HRESULT GetPosition(
|
---|
178 | [out] UINT64 *pu64Position,
|
---|
179 | [out,unique] UINT64 *pu64QPCPosition
|
---|
180 | );
|
---|
181 | HRESULT GetCharacteristics(
|
---|
182 | [out] DWORD *pdwCharacteristics
|
---|
183 | );
|
---|
184 | }
|
---|
185 |
|
---|
186 | [
|
---|
187 | local,
|
---|
188 | pointer_default(unique),
|
---|
189 | uuid("6f49ff73-6727-49ac-a008-d98cf5e70048"),
|
---|
190 | object,
|
---|
191 | ]
|
---|
192 | interface IAudioClock2 : IUnknown
|
---|
193 | {
|
---|
194 | HRESULT GetPosition(
|
---|
195 | [out] UINT64 *DevicePosition,
|
---|
196 | [out,unique] UINT64 *QPCPosition
|
---|
197 | );
|
---|
198 | }
|
---|
199 |
|
---|
200 | [
|
---|
201 | local,
|
---|
202 | pointer_default(unique),
|
---|
203 | uuid("f6e4c0a0-46d9-4fb9-be21-57a3ef2b626c"),
|
---|
204 | object,
|
---|
205 | ]
|
---|
206 | interface IAudioClockAdjustment : IUnknown
|
---|
207 | {
|
---|
208 | HRESULT SetSampleRate(
|
---|
209 | [in] float flSampleRate
|
---|
210 | );
|
---|
211 | }
|
---|
212 |
|
---|
213 | [
|
---|
214 | local,
|
---|
215 | pointer_default(unique),
|
---|
216 | uuid("87ce5498-68d6-44e5-9215-6da47ef883d8"),
|
---|
217 | object,
|
---|
218 | ]
|
---|
219 | interface ISimpleAudioVolume : IUnknown
|
---|
220 | {
|
---|
221 | HRESULT SetMasterVolume(
|
---|
222 | [in] float fLevel,
|
---|
223 | [unique,in] LPCGUID EventContext
|
---|
224 | );
|
---|
225 | HRESULT GetMasterVolume(
|
---|
226 | [out] float *pfLevel
|
---|
227 | );
|
---|
228 | HRESULT SetMute(
|
---|
229 | [in] const BOOL bMute,
|
---|
230 | [unique,in] LPCGUID EventContext
|
---|
231 | );
|
---|
232 | HRESULT GetMute(
|
---|
233 | [out] BOOL *pbMute
|
---|
234 | );
|
---|
235 | }
|
---|
236 |
|
---|
237 | [
|
---|
238 | local,
|
---|
239 | pointer_default(unique),
|
---|
240 | uuid("93014887-242d-4068-8a15-cf5e93b90fe3"),
|
---|
241 | object,
|
---|
242 | ]
|
---|
243 | interface IAudioStreamVolume : IUnknown
|
---|
244 | {
|
---|
245 | HRESULT GetChannelCount(
|
---|
246 | [out] UINT32 *pdwCount
|
---|
247 | );
|
---|
248 | HRESULT SetChannelVolume(
|
---|
249 | [in] UINT32 dwIndex,
|
---|
250 | [in] const float fLevel
|
---|
251 | );
|
---|
252 | HRESULT GetChannelVolume(
|
---|
253 | [in] UINT32 dwIndex,
|
---|
254 | [out] float *pfLevel
|
---|
255 | );
|
---|
256 | HRESULT SetAllVolumes(
|
---|
257 | [in] UINT32 dwCount,
|
---|
258 | [size_is(dwCount),in] const float *pfVolumes
|
---|
259 | );
|
---|
260 | HRESULT GetAllVolumes(
|
---|
261 | [in] UINT32 dwCount,
|
---|
262 | [size_is(dwCount),out] float *pfVolumes
|
---|
263 | );
|
---|
264 | }
|
---|
265 |
|
---|
266 | [
|
---|
267 | local,
|
---|
268 | pointer_default(unique),
|
---|
269 | uuid("1c158861-b533-4b30-b1cf-e853e51c59b8"),
|
---|
270 | object,
|
---|
271 | ]
|
---|
272 | interface IChannelAudioVolume : IUnknown
|
---|
273 | {
|
---|
274 | HRESULT GetChannelCount(
|
---|
275 | [out] UINT32 *pdwCount
|
---|
276 | );
|
---|
277 | HRESULT SetChannelVolume(
|
---|
278 | [in] UINT32 dwIndex,
|
---|
279 | [in] const float fLevel,
|
---|
280 | [unique,in] LPCGUID EventContext
|
---|
281 | );
|
---|
282 | HRESULT GetChannelVolume(
|
---|
283 | [in] UINT32 dwIndex,
|
---|
284 | [out] float *pfLevel
|
---|
285 | );
|
---|
286 | HRESULT SetAllVolumes(
|
---|
287 | [in] UINT32 dwCount,
|
---|
288 | [size_is(dwCount),in] const float *pfVolumes,
|
---|
289 | [unique,in] LPCGUID EventContext
|
---|
290 | );
|
---|
291 | HRESULT GetAllVolumes(
|
---|
292 | [in] UINT32 dwCount,
|
---|
293 | [size_is(dwCount),out] float *pfVolumes
|
---|
294 | );
|
---|
295 | }
|
---|
296 |
|
---|
297 | cpp_quote("#define FACILIY_AUDCLNT 0x889")
|
---|
298 | cpp_quote("#define AUDCLNT_ERR(n) MAKE_HRESULT(SEVERITY_ERROR, FACILIY_AUDCLNT, n)")
|
---|
299 | cpp_quote("#define AUDCLNT_SUCCESS(n) MAKE_SCODE(SEVERITY_SUCCESS, FACILIY_AUDCLNT, n)")
|
---|
300 | cpp_quote("#define AUDCLNT_E_NOT_INITIALIZED AUDCLNT_ERR(1)")
|
---|
301 | cpp_quote("#define AUDCLNT_E_ALREADY_INITIALIZED AUDCLNT_ERR(2)")
|
---|
302 | cpp_quote("#define AUDCLNT_E_WRONG_ENDPOINT_TYPE AUDCLNT_ERR(3)")
|
---|
303 | cpp_quote("#define AUDCLNT_E_DEVICE_INVALIDATED AUDCLNT_ERR(4)")
|
---|
304 | cpp_quote("#define AUDCLNT_E_NOT_STOPPED AUDCLNT_ERR(5)")
|
---|
305 | cpp_quote("#define AUDCLNT_E_BUFFER_TOO_LARGE AUDCLNT_ERR(6)")
|
---|
306 | cpp_quote("#define AUDCLNT_E_OUT_OF_ORDER AUDCLNT_ERR(7)")
|
---|
307 | cpp_quote("#define AUDCLNT_E_UNSUPPORTED_FORMAT AUDCLNT_ERR(8)")
|
---|
308 | cpp_quote("#define AUDCLNT_E_INVALID_SIZE AUDCLNT_ERR(9)")
|
---|
309 | cpp_quote("#define AUDCLNT_E_DEVICE_IN_USE AUDCLNT_ERR(0x0a)")
|
---|
310 | cpp_quote("#define AUDCLNT_E_BUFFER_OPERATION_PENDING AUDCLNT_ERR(0x0b)")
|
---|
311 | cpp_quote("#define AUDCLNT_E_THREAD_NOT_REGISTERED AUDCLNT_ERR(0x0c)")
|
---|
312 | /* Not defined? cpp_quote("#define AUDCLNT_E_UNKNOWN_XXX1 AUDCLNT_ERR(0x0d)") */
|
---|
313 | cpp_quote("#define AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED AUDCLNT_ERR(0x0e)")
|
---|
314 | cpp_quote("#define AUDCLNT_E_ENDPOINT_CREATE_FAILED AUDCLNT_ERR(0x0f)")
|
---|
315 | cpp_quote("#define AUDCLNT_E_SERVICE_NOT_RUNNING AUDCLNT_ERR(0x10)")
|
---|
316 | cpp_quote("#define AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED AUDCLNT_ERR(0x11)")
|
---|
317 | cpp_quote("#define AUDCLNT_E_EXCLUSIVE_MODE_ONLY AUDCLNT_ERR(0x12)")
|
---|
318 | cpp_quote("#define AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL AUDCLNT_ERR(0x13)")
|
---|
319 | cpp_quote("#define AUDCLNT_E_EVENTHANDLE_NOT_SET AUDCLNT_ERR(0x14)")
|
---|
320 | cpp_quote("#define AUDCLNT_E_INCORRECT_BUFFER_SIZE AUDCLNT_ERR(0x15)")
|
---|
321 | cpp_quote("#define AUDCLNT_E_BUFFER_SIZE_ERROR AUDCLNT_ERR(0x16)")
|
---|
322 | cpp_quote("#define AUDCLNT_E_CPUUSAGE_EXCEEDED AUDCLNT_ERR(0x17)")
|
---|
323 | cpp_quote("#define AUDCLNT_E_BUFFER_ERROR AUDCLNT_ERR(0x18)")
|
---|
324 | cpp_quote("#define AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED AUDCLNT_ERR(0x19)")
|
---|
325 | /* Hex fail */
|
---|
326 | cpp_quote("#define AUDCLNT_E_INVALID_DEVICE_PERIOD AUDCLNT_ERR(0x20)")
|
---|
327 | cpp_quote("#define AUDCLNT_E_INVALID_STREAM_FLAG AUDCLNT_ERR(0x021)")
|
---|
328 | cpp_quote("#define AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE AUDCLNT_ERR(0x022)")
|
---|
329 | cpp_quote("#define AUDCLNT_E_OUT_OF_OFFLOAD_RESOURCES AUDCLNT_ERR(0x023)")
|
---|
330 | cpp_quote("#define AUDCLNT_E_OFFLOAD_MODE_ONLY AUDCLNT_ERR(0x024)")
|
---|
331 | cpp_quote("#define AUDCLNT_E_NONOFFLOAD_MODE_ONLY AUDCLNT_ERR(0x025)")
|
---|
332 | cpp_quote("#define AUDCLNT_E_RESOURCES_INVALIDATED AUDCLNT_ERR(0x026)")
|
---|
333 |
|
---|
334 | cpp_quote("#define AUDCLNT_S_BUFFER_EMPTY AUDCLNT_SUCCESS(0x1)")
|
---|
335 | cpp_quote("#define AUDCLNT_S_THREAD_ALREADY_REGISTERED AUDCLNT_SUCCESS(0x2)")
|
---|
336 | cpp_quote("#define AUDCLNT_S_POSITION_STALLED AUDCLNT_SUCCESS(0x3)")
|
---|