mshtml: Fix leak when moving to next char in range point.
[wine.git] / include / audioclient.idl
blob754ae58f78c9a014c5990250fa739c711902c819
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
114 typedef enum _AUDCLNT_STREAMOPTIONS
116 AUDCLNT_STREAMOPTIONS_NONE = 0x0,
117 AUDCLNT_STREAMOPTIONS_RAW = 0x1,
118 AUDCLNT_STREAMOPTIONS_MATCH_FORMAT = 0x2,
119 AUDCLNT_STREAMOPTIONS_AMBISONICS = 0x4
120 } AUDCLNT_STREAMOPTIONS;
121 cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(AUDCLNT_STREAMOPTIONS);")
123 typedef struct _AudioClientProperties
125 UINT32 cbSize;
126 BOOL bIsOffload;
127 AUDIO_STREAM_CATEGORY eCategory;
128 AUDCLNT_STREAMOPTIONS Options;
129 } AudioClientProperties;
131 typedef struct _Win8AudioClientProperties
133 UINT32 cbSize;
134 BOOL bIsOffload;
135 AUDIO_STREAM_CATEGORY eCategory;
136 /* Options field added in Win 8.1 */
137 } Win8AudioClientProperties;
140 local,
141 pointer_default(unique),
142 uuid(726778cd-f60a-4eda-82de-e47610cd78aa),
143 object,
145 interface IAudioClient2 : IAudioClient
147 HRESULT IsOffloadCapable(
148 AUDIO_STREAM_CATEGORY category,
149 [out] BOOL *offload_capable
152 HRESULT SetClientProperties(
153 [in] const AudioClientProperties *prop
156 HRESULT GetBufferSizeLimits(
157 [in] const WAVEFORMATEX *format,
158 BOOL event_driven,
159 [out] REFERENCE_TIME *min_duration,
160 [out] REFERENCE_TIME *max_duration
165 local,
166 pointer_default(unique),
167 uuid(7ed4ee07-8e67-4cd4-8c1a-2b7a5987ad42),
168 object,
170 interface IAudioClient3 : IAudioClient2
172 HRESULT GetSharedModeEnginePeriod(
173 [in] const WAVEFORMATEX *format,
174 [out] UINT32 *default_period_frames,
175 [out] UINT32 *unit_period_frames,
176 [out] UINT32 *min_period_frames,
177 [out] UINT32 *max_period_frames
180 HRESULT GetCurrentSharedModeEnginePeriod(
181 [out] WAVEFORMATEX **cur_format,
182 [out] UINT32 *cur_period_frames
185 HRESULT InitializeSharedAudioStream(
186 [in] DWORD flags,
187 [in] UINT32 period_frames,
188 [in] const WAVEFORMATEX *format,
189 [in] const GUID *session_guid
194 local,
195 pointer_default(unique),
196 uuid(f294acfc-3146-4483-a7bf-addca7c260e2),
197 object,
199 interface IAudioRenderClient : IUnknown
201 HRESULT GetBuffer(
202 [in] UINT32 NumFramesRequested,
203 [out] BYTE **ppData
205 HRESULT ReleaseBuffer(
206 [in] UINT32 NumFramesWritten,
207 [in] DWORD dwFlags
212 local,
213 pointer_default(unique),
214 uuid(c8adbd64-e71e-48a0-a4de-185c395cd317),
215 object,
217 interface IAudioCaptureClient : IUnknown
219 HRESULT GetBuffer(
220 [out] BYTE **ppData,
221 [out] UINT32 *pNumFramesToRead,
222 [out] DWORD *pdwFlags,
223 [unique,out] UINT64 *pu64DevicePosition,
224 [unique,out] UINT64 *pu64QPCPosition
226 HRESULT ReleaseBuffer(
227 [in] UINT32 NumFramesRead
229 HRESULT GetNextPacketSize(
230 [out] UINT32 *pNumFramesInNextPacket
234 cpp_quote("#define AUDIOCLOCK_CHARACTERISTIC_FIXED_FREQ 0x00000001")
237 local,
238 pointer_default(unique),
239 uuid("cd63314f-3fba-4a1b-812c-ef96358728e7"),
240 object,
242 interface IAudioClock : IUnknown
244 HRESULT GetFrequency(
245 [out] UINT64 *pu64Frequency
247 HRESULT GetPosition(
248 [out] UINT64 *pu64Position,
249 [out,unique] UINT64 *pu64QPCPosition
251 HRESULT GetCharacteristics(
252 [out] DWORD *pdwCharacteristics
257 local,
258 pointer_default(unique),
259 uuid("6f49ff73-6727-49ac-a008-d98cf5e70048"),
260 object,
262 interface IAudioClock2 : IUnknown
264 HRESULT GetPosition(
265 [out] UINT64 *DevicePosition,
266 [out,unique] UINT64 *QPCPosition
271 local,
272 pointer_default(unique),
273 uuid("f6e4c0a0-46d9-4fb8-be21-57a3ef2b626c"),
274 object,
276 interface IAudioClockAdjustment : IUnknown
278 HRESULT SetSampleRate(
279 [in] float flSampleRate
284 local,
285 pointer_default(unique),
286 uuid("87ce5498-68d6-44e5-9215-6da47ef883d8"),
287 object,
289 interface ISimpleAudioVolume : IUnknown
291 HRESULT SetMasterVolume(
292 [in] float fLevel,
293 [unique,in] LPCGUID EventContext
295 HRESULT GetMasterVolume(
296 [out] float *pfLevel
298 HRESULT SetMute(
299 [in] const BOOL bMute,
300 [unique,in] LPCGUID EventContext
302 HRESULT GetMute(
303 [out] BOOL *pbMute
308 local,
309 pointer_default(unique),
310 uuid("93014887-242d-4068-8a15-cf5e93b90fe3"),
311 object,
313 interface IAudioStreamVolume : IUnknown
315 HRESULT GetChannelCount(
316 [out] UINT32 *pdwCount
318 HRESULT SetChannelVolume(
319 [in] UINT32 dwIndex,
320 [in] const float fLevel
322 HRESULT GetChannelVolume(
323 [in] UINT32 dwIndex,
324 [out] float *pfLevel
326 HRESULT SetAllVolumes(
327 [in] UINT32 dwCount,
328 [size_is(dwCount),in] const float *pfVolumes
330 HRESULT GetAllVolumes(
331 [in] UINT32 dwCount,
332 [size_is(dwCount),out] float *pfVolumes
336 typedef enum AMBISONICS_TYPE
338 AMBISONICS_TYPE_FULL3D = 0x0,
339 } AMBISONICS_TYPE;
341 typedef enum AMBISONICS_CHANNEL_ORDERING
343 AMBISONICS_CHANNEL_ORDERING_ACN = 0x0,
344 } AMBISONICS_CHANNEL_ORDERING;
346 typedef enum AMBISONICS_NORMALIZATION
348 AMBISONICS_NORMALIZATION_SN3D = 0x0,
349 AMBISONICS_NORMALIZATION_N3D = 0x1,
350 } AMBISONICS_NORMALIZATION;
352 typedef struct AMBISONICS_PARAMS
354 UINT32 u32Size;
355 UINT32 u32Version;
356 AMBISONICS_TYPE u32Type;
357 AMBISONICS_CHANNEL_ORDERING u32ChannelOrdering;
358 AMBISONICS_NORMALIZATION u32Normalization;
359 UINT32 u32Order;
360 UINT32 u32NumChannels;
361 UINT32 *pu32ChannelMap;
362 } AMBISONICS_PARAMS;
365 local,
366 pointer_default(unique),
367 uuid(28724c91-df35-4856-9f76-d6a26413f3df),
368 object,
370 interface IAudioAmbisonicsControl : IUnknown
372 HRESULT SetData(
373 [in] const AMBISONICS_PARAMS *param,
374 [in] UINT32 size
376 HRESULT SetHeadTracking(
377 [in] BOOL enable
379 HRESULT GetHeadTracking(
380 [out] BOOL *enable
382 HRESULT SetRotation(
383 [in] float x,
384 [in] float y,
385 [in] float z,
386 [in] float w
391 local,
392 pointer_default(unique),
393 uuid("1c158861-b533-4b30-b1cf-e853e51c59b8"),
394 object,
396 interface IChannelAudioVolume : IUnknown
398 HRESULT GetChannelCount(
399 [out] UINT32 *pdwCount
401 HRESULT SetChannelVolume(
402 [in] UINT32 dwIndex,
403 [in] const float fLevel,
404 [unique,in] LPCGUID EventContext
406 HRESULT GetChannelVolume(
407 [in] UINT32 dwIndex,
408 [out] float *pfLevel
410 HRESULT SetAllVolumes(
411 [in] UINT32 dwCount,
412 [size_is(dwCount),in] const float *pfVolumes,
413 [unique,in] LPCGUID EventContext
415 HRESULT GetAllVolumes(
416 [in] UINT32 dwCount,
417 [size_is(dwCount),out] float *pfVolumes
421 cpp_quote("#define AUDCLNT_ERR(n) MAKE_HRESULT(SEVERITY_ERROR, FACILITY_AUDCLNT, n)")
422 cpp_quote("#define AUDCLNT_SUCCESS(n) MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_AUDCLNT, n)")
423 cpp_quote("#define AUDCLNT_E_NOT_INITIALIZED AUDCLNT_ERR(1)")
424 cpp_quote("#define AUDCLNT_E_ALREADY_INITIALIZED AUDCLNT_ERR(2)")
425 cpp_quote("#define AUDCLNT_E_WRONG_ENDPOINT_TYPE AUDCLNT_ERR(3)")
426 cpp_quote("#define AUDCLNT_E_DEVICE_INVALIDATED AUDCLNT_ERR(4)")
427 cpp_quote("#define AUDCLNT_E_NOT_STOPPED AUDCLNT_ERR(5)")
428 cpp_quote("#define AUDCLNT_E_BUFFER_TOO_LARGE AUDCLNT_ERR(6)")
429 cpp_quote("#define AUDCLNT_E_OUT_OF_ORDER AUDCLNT_ERR(7)")
430 cpp_quote("#define AUDCLNT_E_UNSUPPORTED_FORMAT AUDCLNT_ERR(8)")
431 cpp_quote("#define AUDCLNT_E_INVALID_SIZE AUDCLNT_ERR(9)")
432 cpp_quote("#define AUDCLNT_E_DEVICE_IN_USE AUDCLNT_ERR(0x0a)")
433 cpp_quote("#define AUDCLNT_E_BUFFER_OPERATION_PENDING AUDCLNT_ERR(0x0b)")
434 cpp_quote("#define AUDCLNT_E_THREAD_NOT_REGISTERED AUDCLNT_ERR(0x0c)")
435 /* Not defined? cpp_quote("#define AUDCLNT_E_UNKNOWN_XXX1 AUDCLNT_ERR(0x0d)") */
436 cpp_quote("#define AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED AUDCLNT_ERR(0x0e)")
437 cpp_quote("#define AUDCLNT_E_ENDPOINT_CREATE_FAILED AUDCLNT_ERR(0x0f)")
438 cpp_quote("#define AUDCLNT_E_SERVICE_NOT_RUNNING AUDCLNT_ERR(0x10)")
439 cpp_quote("#define AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED AUDCLNT_ERR(0x11)")
440 cpp_quote("#define AUDCLNT_E_EXCLUSIVE_MODE_ONLY AUDCLNT_ERR(0x12)")
441 cpp_quote("#define AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL AUDCLNT_ERR(0x13)")
442 cpp_quote("#define AUDCLNT_E_EVENTHANDLE_NOT_SET AUDCLNT_ERR(0x14)")
443 cpp_quote("#define AUDCLNT_E_INCORRECT_BUFFER_SIZE AUDCLNT_ERR(0x15)")
444 cpp_quote("#define AUDCLNT_E_BUFFER_SIZE_ERROR AUDCLNT_ERR(0x16)")
445 cpp_quote("#define AUDCLNT_E_CPUUSAGE_EXCEEDED AUDCLNT_ERR(0x17)")
446 cpp_quote("#define AUDCLNT_E_BUFFER_ERROR AUDCLNT_ERR(0x18)")
447 cpp_quote("#define AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED AUDCLNT_ERR(0x19)")
448 /* Hex fail */
449 cpp_quote("#define AUDCLNT_E_INVALID_DEVICE_PERIOD AUDCLNT_ERR(0x20)")
450 cpp_quote("#define AUDCLNT_E_INVALID_STREAM_FLAG AUDCLNT_ERR(0x021)")
451 cpp_quote("#define AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE AUDCLNT_ERR(0x022)")
452 cpp_quote("#define AUDCLNT_E_OUT_OF_OFFLOAD_RESOURCES AUDCLNT_ERR(0x023)")
453 cpp_quote("#define AUDCLNT_E_OFFLOAD_MODE_ONLY AUDCLNT_ERR(0x024)")
454 cpp_quote("#define AUDCLNT_E_NONOFFLOAD_MODE_ONLY AUDCLNT_ERR(0x025)")
455 cpp_quote("#define AUDCLNT_E_RESOURCES_INVALIDATED AUDCLNT_ERR(0x026)")
456 cpp_quote("#define AUDCLNT_E_RAW_MODE_UNSUPPORTED AUDCLNT_ERR(0x027)")
457 cpp_quote("#define AUDCLNT_E_ENGINE_PERIODICITY_LOCKED AUDCLNT_ERR(0x028)")
458 cpp_quote("#define AUDCLNT_E_ENGINE_FORMAT_LOCKED AUDCLNT_ERR(0x029)")
459 cpp_quote("#define AUDCLNT_E_HEADTRACKING_ENABLED AUDCLNT_ERR(0x030)")
460 cpp_quote("#define AUDCLNT_E_HEADTRACKING_UNSUPPORTED AUDCLNT_ERR(0x040)")
462 cpp_quote("#define AUDCLNT_S_BUFFER_EMPTY AUDCLNT_SUCCESS(0x1)")
463 cpp_quote("#define AUDCLNT_S_THREAD_ALREADY_REGISTERED AUDCLNT_SUCCESS(0x2)")
464 cpp_quote("#define AUDCLNT_S_POSITION_STALLED AUDCLNT_SUCCESS(0x3)")