xmllite/tests: Fix a memory leak (Valgrind).
[wine.git] / include / audioclient.idl
blob72b3ae942ebbba0cc464ecdfa39fdf20499015e8
1 /*
2 * Core Audio audioclient definitions
4 * Copyright 2009 Maarten Lankhorst
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.
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.
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
22 import "wtypes.idl";
23 import "unknwn.idl";
24 import "audiosessiontypes.h";
26 /* Forward declarations */
27 interface IAudioClient;
28 interface IAudioRenderClient;
29 interface IAudioCaptureClient;
30 interface IAudioClock;
31 interface IAudioClock2;
32 interface IAudioClockAdjustment;
33 interface ISimpleAudioVolume;
34 interface IAudioStreamVolume;
35 interface IChannelAudioVolume;
37 cpp_quote("#if 0")
38 typedef struct WAVEFORMATEX /*[hidden,restricted]*/
40 WORD wFormatTag;
41 WORD nChannels;
42 DWORD nSamplesPerSec;
43 DWORD nAvgBytesPerSec;
44 WORD nBlockAlign;
45 WORD wBitsPerSample;
46 WORD cbSize;
47 } WAVEFORMATEX;
48 cpp_quote("#else")
49 cpp_quote("#include <mmreg.h>")
50 cpp_quote("#endif")
52 cpp_quote("#if 0")
53 typedef LONGLONG /*[hidden,restricted]*/ REFERENCE_TIME;
54 cpp_quote("#else")
55 cpp_quote("#define _IKsControl_")
56 cpp_quote("#include <ks.h>")
57 cpp_quote("#include <ksmedia.h>")
58 cpp_quote("#endif")
60 enum _AUDCLNT_BUFFERFLAGS
62 AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY = 0x1,
63 AUDCLNT_BUFFERFLAGS_SILENT = 0x2,
64 AUDCLNT_BUFFERFLAGS_TIMESTAMP_ERROR = 0x4
68 local,
69 pointer_default(unique),
70 uuid(1cb9ad4c-dbfa-4c32-b178-c2f568a703b2),
71 object,
73 interface IAudioClient : IUnknown
75 HRESULT Initialize(
76 [in] AUDCLNT_SHAREMODE ShareMode,
77 [in] DWORD StreamFlags,
78 [in] REFERENCE_TIME hnsBufferDuration,
79 [in] REFERENCE_TIME hnsPeriodicity,
80 [in] const WAVEFORMATEX *pFormat,
81 [in] LPCGUID AudioSessionGuid
83 HRESULT GetBufferSize(
84 [out] UINT32 *pNumBufferFrames
86 HRESULT GetStreamLatency(
87 [out] REFERENCE_TIME *phnsLatency
89 HRESULT GetCurrentPadding(
90 [out] UINT32 *pNumPaddingFrames
92 HRESULT IsFormatSupported(
93 [in] AUDCLNT_SHAREMODE ShareMode,
94 [in] const WAVEFORMATEX *pFormat,
95 [out,unique] WAVEFORMATEX **ppClosestMatch
97 HRESULT GetMixFormat(
98 [out] WAVEFORMATEX **ppDeviceFormat
100 HRESULT GetDevicePeriod(
101 [out] REFERENCE_TIME *phnsDefaultDevicePeriod,
102 [out] REFERENCE_TIME *phnsMinimumDevicePeriod
104 HRESULT Start(void);
105 HRESULT Stop(void);
106 HRESULT Reset(void);
107 HRESULT SetEventHandle([in] HANDLE eventHandle);
108 HRESULT GetService(
109 [in] REFIID riid,
110 [iid_is(riid),out] void **ppv
115 local,
116 pointer_default(unique),
117 uuid(f294acfc-3146-4483-a7bf-addca7c260e2),
118 object,
120 interface IAudioRenderClient : IUnknown
122 HRESULT GetBuffer(
123 [in] UINT32 NumFramesRequested,
124 [out] BYTE **ppData
126 HRESULT ReleaseBuffer(
127 [in] UINT32 NumFramesWritten,
128 [in] DWORD dwFlags
133 local,
134 pointer_default(unique),
135 uuid(c8adbd64-e71e-48a0-a4de-185c395cd317),
136 object,
138 interface IAudioCaptureClient : IUnknown
140 HRESULT GetBuffer(
141 [out] BYTE **ppData,
142 [out] UINT32 *pNumFramesToRead,
143 [out] DWORD *pdwFlags,
144 [unique,out] UINT64 *pu64DevicePosition,
145 [unique,out] UINT64 *pu64QPCPosition
147 HRESULT ReleaseBuffer(
148 [in] UINT32 NumFramesRead
150 HRESULT GetNextPacketSize(
151 [out] UINT32 *pNumFramesInNextPacket
155 cpp_quote("#define AUDIOCLOCK_CHARACTERISTIC_FIXED_FREQ 0x00000001")
158 local,
159 pointer_default(unique),
160 uuid("cd63314f-3fba-4a1b-812c-ef96358728e7"),
161 object,
163 interface IAudioClock : IUnknown
165 HRESULT GetFrequency(
166 [out] UINT64 *pu64Frequency
168 HRESULT GetPosition(
169 [out] UINT64 *pu64Position,
170 [out,unique] UINT64 *pu64QPCPosition
172 HRESULT GetCharacteristics(
173 [out] DWORD *pdwCharacteristics
178 local,
179 pointer_default(unique),
180 uuid("6f49ff73-6727-49ac-a008-d98cf5e70048"),
181 object,
183 interface IAudioClock2 : IUnknown
185 HRESULT GetPosition(
186 [out] UINT64 *DevicePosition,
187 [out,unique] UINT64 *QPCPosition
192 local,
193 pointer_default(unique),
194 uuid("f6e4c0a0-46d9-4fb9-be21-57a3ef2b626c"),
195 object,
197 interface IAudioClockAdjustment : IUnknown
199 HRESULT SetSampleRate(
200 [in] float flSampleRate
205 local,
206 pointer_default(unique),
207 uuid("87ce5498-68d6-44e5-9215-6da47ef883d8"),
208 object,
210 interface ISimpleAudioVolume : IUnknown
212 HRESULT SetMasterVolume(
213 [in] float fLevel,
214 [unique,in] LPCGUID EventContext
216 HRESULT GetMasterVolume(
217 [out] float *pfLevel
219 HRESULT SetMute(
220 [in] const BOOL bMute,
221 [unique,in] LPCGUID EventContext
223 HRESULT GetMute(
224 [out] BOOL *pbMute
229 local,
230 pointer_default(unique),
231 uuid("93014887-242d-4068-8a15-cf5e93b90fe3"),
232 object,
234 interface IAudioStreamVolume : IUnknown
236 HRESULT GetChannelCount(
237 [out] UINT32 *pdwCount
239 HRESULT SetChannelVolume(
240 [in] UINT32 dwIndex,
241 [in] const float fLevel
243 HRESULT GetChannelVolume(
244 [in] UINT32 dwIndex,
245 [out] float *pfLevel
247 HRESULT SetAllVolumes(
248 [in] UINT32 dwCount,
249 [size_is(dwCount),in] const float *pfVolumes
251 HRESULT GetAllVolumes(
252 [in] UINT32 dwCount,
253 [size_is(dwCount),out] float *pfVolumes
258 local,
259 pointer_default(unique),
260 uuid("1c158861-b533-4b30-b1cf-e853e51c59b8"),
261 object,
263 interface IChannelAudioVolume : IUnknown
265 HRESULT GetChannelCount(
266 [out] UINT32 *pdwCount
268 HRESULT SetChannelVolume(
269 [in] UINT32 dwIndex,
270 [in] const float fLevel,
271 [unique,in] LPCGUID EventContext
273 HRESULT GetChannelVolume(
274 [in] UINT32 dwIndex,
275 [out] float *pfLevel
277 HRESULT SetAllVolumes(
278 [in] UINT32 dwCount,
279 [size_is(dwCount),in] const float *pfVolumes,
280 [unique,in] LPCGUID EventContext
282 HRESULT GetAllVolumes(
283 [in] UINT32 dwCount,
284 [size_is(dwCount),out] float *pfVolumes
288 cpp_quote("#define AUDCLNT_ERR(n) MAKE_HRESULT(SEVERITY_ERROR, FACILITY_AUDCLNT, n)")
289 cpp_quote("#define AUDCLNT_SUCCESS(n) MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_AUDCLNT, n)")
290 cpp_quote("#define AUDCLNT_E_NOT_INITIALIZED AUDCLNT_ERR(1)")
291 cpp_quote("#define AUDCLNT_E_ALREADY_INITIALIZED AUDCLNT_ERR(2)")
292 cpp_quote("#define AUDCLNT_E_WRONG_ENDPOINT_TYPE AUDCLNT_ERR(3)")
293 cpp_quote("#define AUDCLNT_E_DEVICE_INVALIDATED AUDCLNT_ERR(4)")
294 cpp_quote("#define AUDCLNT_E_NOT_STOPPED AUDCLNT_ERR(5)")
295 cpp_quote("#define AUDCLNT_E_BUFFER_TOO_LARGE AUDCLNT_ERR(6)")
296 cpp_quote("#define AUDCLNT_E_OUT_OF_ORDER AUDCLNT_ERR(7)")
297 cpp_quote("#define AUDCLNT_E_UNSUPPORTED_FORMAT AUDCLNT_ERR(8)")
298 cpp_quote("#define AUDCLNT_E_INVALID_SIZE AUDCLNT_ERR(9)")
299 cpp_quote("#define AUDCLNT_E_DEVICE_IN_USE AUDCLNT_ERR(0x0a)")
300 cpp_quote("#define AUDCLNT_E_BUFFER_OPERATION_PENDING AUDCLNT_ERR(0x0b)")
301 cpp_quote("#define AUDCLNT_E_THREAD_NOT_REGISTERED AUDCLNT_ERR(0x0c)")
302 /* Not defined? cpp_quote("#define AUDCLNT_E_UNKNOWN_XXX1 AUDCLNT_ERR(0x0d)") */
303 cpp_quote("#define AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED AUDCLNT_ERR(0x0e)")
304 cpp_quote("#define AUDCLNT_E_ENDPOINT_CREATE_FAILED AUDCLNT_ERR(0x0f)")
305 cpp_quote("#define AUDCLNT_E_SERVICE_NOT_RUNNING AUDCLNT_ERR(0x10)")
306 cpp_quote("#define AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED AUDCLNT_ERR(0x11)")
307 cpp_quote("#define AUDCLNT_E_EXCLUSIVE_MODE_ONLY AUDCLNT_ERR(0x12)")
308 cpp_quote("#define AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL AUDCLNT_ERR(0x13)")
309 cpp_quote("#define AUDCLNT_E_EVENTHANDLE_NOT_SET AUDCLNT_ERR(0x14)")
310 cpp_quote("#define AUDCLNT_E_INCORRECT_BUFFER_SIZE AUDCLNT_ERR(0x15)")
311 cpp_quote("#define AUDCLNT_E_BUFFER_SIZE_ERROR AUDCLNT_ERR(0x16)")
312 cpp_quote("#define AUDCLNT_E_CPUUSAGE_EXCEEDED AUDCLNT_ERR(0x17)")
313 cpp_quote("#define AUDCLNT_E_BUFFER_ERROR AUDCLNT_ERR(0x18)")
314 cpp_quote("#define AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED AUDCLNT_ERR(0x19)")
315 /* Hex fail */
316 cpp_quote("#define AUDCLNT_E_INVALID_DEVICE_PERIOD AUDCLNT_ERR(0x20)")
317 cpp_quote("#define AUDCLNT_E_INVALID_STREAM_FLAG AUDCLNT_ERR(0x021)")
318 cpp_quote("#define AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE AUDCLNT_ERR(0x022)")
319 cpp_quote("#define AUDCLNT_E_OUT_OF_OFFLOAD_RESOURCES AUDCLNT_ERR(0x023)")
320 cpp_quote("#define AUDCLNT_E_OFFLOAD_MODE_ONLY AUDCLNT_ERR(0x024)")
321 cpp_quote("#define AUDCLNT_E_NONOFFLOAD_MODE_ONLY AUDCLNT_ERR(0x025)")
322 cpp_quote("#define AUDCLNT_E_RESOURCES_INVALIDATED AUDCLNT_ERR(0x026)")
324 cpp_quote("#define AUDCLNT_S_BUFFER_EMPTY AUDCLNT_SUCCESS(0x1)")
325 cpp_quote("#define AUDCLNT_S_THREAD_ALREADY_REGISTERED AUDCLNT_SUCCESS(0x2)")
326 cpp_quote("#define AUDCLNT_S_POSITION_STALLED AUDCLNT_SUCCESS(0x3)")