| 1 |
/* |
| 2 |
* Core Audio audioclient definitions |
| 3 |
* |
| 4 |
* (c) 2013 Corrected, and extended by mingw-w64 team |
| 5 |
* base on version Copyright 2009 Maarten Lankhorst |
| 6 |
* |
| 7 |
* This library is free software; you can redistribute it and/or |
| 8 |
* modify it under the terms of the GNU Lesser General Public |
| 9 |
* License as published by the Free Software Foundation; either |
| 10 |
* version 2.1 of the License, or (at your option) any later version. |
| 11 |
* |
| 12 |
* This library is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
* Lesser General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU Lesser General Public |
| 18 |
* License along with this library; if not, write to the Free Software |
| 19 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
| 20 |
* |
| 21 |
*/ |
| 22 |
|
| 23 |
cpp_quote("#include <winapifamily.h>") |
| 24 |
cpp_quote("") |
| 25 |
|
| 26 |
import "wtypes.idl"; |
| 27 |
import "unknwn.idl"; |
| 28 |
|
| 29 |
cpp_quote("") |
| 30 |
cpp_quote("#if 0") |
| 31 |
typedef [restricted, hidden] struct WAVEFORMATEX { |
| 32 |
WORD wFormatTag; |
| 33 |
WORD nChannels; |
| 34 |
DWORD nSamplesPerSec; |
| 35 |
DWORD nAvgBytesPerSec; |
| 36 |
WORD nBlockAlign; |
| 37 |
WORD wBitsPerSample; |
| 38 |
WORD cbSize; |
| 39 |
} WAVEFORMATEX; |
| 40 |
|
| 41 |
cpp_quote("") |
| 42 |
typedef [restricted, hidden] LONGLONG REFERENCE_TIME; |
| 43 |
cpp_quote("#else") |
| 44 |
cpp_quote("#define _IKsControl_") |
| 45 |
cpp_quote("") |
| 46 |
cpp_quote("#include <mmreg.h>") |
| 47 |
cpp_quote("#include <ks.h>") |
| 48 |
cpp_quote("#include <ksmedia.h>") |
| 49 |
cpp_quote("#endif") |
| 50 |
|
| 51 |
cpp_quote("") |
| 52 |
|
| 53 |
import "audiosessiontypes.h"; |
| 54 |
|
| 55 |
cpp_quote("") |
| 56 |
cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)") |
| 57 |
enum _AUDCLNT_BUFFERFLAGS { |
| 58 |
AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY = 0x1, |
| 59 |
AUDCLNT_BUFFERFLAGS_SILENT = 0x2, |
| 60 |
AUDCLNT_BUFFERFLAGS_TIMESTAMP_ERROR = 0x4 |
| 61 |
}; |
| 62 |
|
| 63 |
typedef [v1_enum] enum AUDCLNT_STREAMOPTIONS { |
| 64 |
AUDCLNT_STREAMOPTIONS_NONE = 0x0, |
| 65 |
AUDCLNT_STREAMOPTIONS_RAW = 0x1, |
| 66 |
AUDCLNT_STREAMOPTIONS_MATCH_FORMAT = 0x2, |
| 67 |
AUDCLNT_STREAMOPTIONS_AMBISONICS = 0x4 |
| 68 |
} AUDCLNT_STREAMOPTIONS; |
| 69 |
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(AUDCLNT_STREAMOPTIONS);") |
| 70 |
|
| 71 |
typedef enum AMBISONICS_TYPE { |
| 72 |
AMBISONICS_TYPE_FULL3D = 0x0 |
| 73 |
} AMBISONICS_TYPE; |
| 74 |
|
| 75 |
typedef enum AMBISONICS_CHANNEL_ORDERING { |
| 76 |
AMBISONICS_CHANNEL_ORDERING_ACN = 0x0 |
| 77 |
} AMBISONICS_CHANNEL_ORDERING; |
| 78 |
|
| 79 |
typedef enum AMBISONICS_NORMALIZATION { |
| 80 |
AMBISONICS_NORMALIZATION_SN3D = 0x0, |
| 81 |
AMBISONICS_NORMALIZATION_N3D = 0x1 |
| 82 |
} AMBISONICS_NORMALIZATION; |
| 83 |
|
| 84 |
cpp_quote("") |
| 85 |
typedef struct AudioClientProperties { |
| 86 |
UINT32 cbSize; |
| 87 |
WINBOOL bIsOffload; |
| 88 |
AUDIO_STREAM_CATEGORY eCategory; |
| 89 |
AUDCLNT_STREAMOPTIONS Options; |
| 90 |
} AudioClientProperties; |
| 91 |
|
| 92 |
typedef struct AudioClient3ActivationParams { |
| 93 |
GUID tracingContextId; |
| 94 |
} AudioClient3ActivationParams; |
| 95 |
|
| 96 |
typedef struct AMBISONICS_PARAMS { |
| 97 |
UINT32 u32Size; |
| 98 |
UINT32 u32Version; |
| 99 |
AMBISONICS_TYPE u32Type; |
| 100 |
AMBISONICS_CHANNEL_ORDERING u32ChannelOrdering; |
| 101 |
AMBISONICS_NORMALIZATION u32Normalization; |
| 102 |
UINT32 u32Order; |
| 103 |
UINT32 u32NumChannels; |
| 104 |
UINT32 *pu32ChannelMap; |
| 105 |
} AMBISONICS_PARAMS; |
| 106 |
|
| 107 |
cpp_quote("") |
| 108 |
[object, local, uuid (1cb9ad4c-DBFA-4c32-B178-C2F568A703B2), pointer_default (unique)] |
| 109 |
interface IAudioClient : IUnknown { |
| 110 |
HRESULT Initialize ([in] AUDCLNT_SHAREMODE ShareMode,[in] DWORD StreamFlags,[in] REFERENCE_TIME hnsBufferDuration,[in] REFERENCE_TIME hnsPeriodicity,[in] const WAVEFORMATEX *pFormat,[in] LPCGUID AudioSessionGuid); |
| 111 |
HRESULT GetBufferSize ([out] UINT32 *pNumBufferFrames); |
| 112 |
HRESULT GetStreamLatency ([out] REFERENCE_TIME *phnsLatency); |
| 113 |
HRESULT GetCurrentPadding ([out] UINT32 *pNumPaddingFrames); |
| 114 |
HRESULT IsFormatSupported ([in] AUDCLNT_SHAREMODE ShareMode,[in] const WAVEFORMATEX *pFormat,[out, unique] WAVEFORMATEX **ppClosestMatch); |
| 115 |
HRESULT GetMixFormat ([out] WAVEFORMATEX **ppDeviceFormat); |
| 116 |
HRESULT GetDevicePeriod ([out] REFERENCE_TIME *phnsDefaultDevicePeriod,[out] REFERENCE_TIME *phnsMinimumDevicePeriod); |
| 117 |
HRESULT Start (); |
| 118 |
HRESULT Stop (); |
| 119 |
HRESULT Reset (); |
| 120 |
HRESULT SetEventHandle ([in] HANDLE eventHandle); |
| 121 |
HRESULT GetService ([in] REFIID riid,[out, iid_is (riid)] void **ppv); |
| 122 |
} |
| 123 |
|
| 124 |
cpp_quote("") |
| 125 |
[object, local, uuid (726778cd-F60A-4eda-82de-E47610CD78AA), pointer_default (unique)] |
| 126 |
interface IAudioClient2 : IAudioClient { |
| 127 |
HRESULT IsOffloadCapable ([in] AUDIO_STREAM_CATEGORY Category,[in] WINBOOL *pbOffloadCapable); |
| 128 |
HRESULT SetClientProperties ([in] const AudioClientProperties *pProperties); |
| 129 |
HRESULT GetBufferSizeLimits ([in] const WAVEFORMATEX *pFormat,[in] WINBOOL bEventDriven,[in] REFERENCE_TIME *phnsMinBufferDuration,[in] REFERENCE_TIME *phnsMaxBufferDuration); |
| 130 |
} |
| 131 |
|
| 132 |
[object, local, uuid (7ed4ee07-8e67-4cd4-8c1a-2b7a5987ad42), pointer_default (unique)] |
| 133 |
interface IAudioClient3 : IAudioClient2 { |
| 134 |
HRESULT GetSharedModeEnginePeriod ([in] const WAVEFORMATEX *pFormat, [out] UINT32 *pDefaultPeriodInFrames, [out] UINT32 *pFundamentalPeriodInFrames, [out] UINT32 *pMinPeriodInFrames, [out] UINT32 *pMaxPeriodInFrames); |
| 135 |
HRESULT GetCurrentSharedModeEnginePeriod ([out, unique] WAVEFORMATEX **ppFormat, [out] UINT32 *pCurrentPeriodInFrames); |
| 136 |
HRESULT InitializeSharedAudioStream ([in] DWORD StreamFlags, [in] UINT32 PeriodInFrames, [in] const WAVEFORMATEX *pFormat, [in] LPCGUID AudioSessionGuid); |
| 137 |
} |
| 138 |
|
| 139 |
cpp_quote("") |
| 140 |
[object, local, uuid (F294ACFC-3146-4483-A7BF-ADDCA7C260E2), helpstring ("IAudioRenderClient Interface"), pointer_default (unique)] |
| 141 |
interface IAudioRenderClient : IUnknown { |
| 142 |
HRESULT GetBuffer ([in] UINT32 NumFramesRequested,[out] BYTE **ppData); |
| 143 |
HRESULT ReleaseBuffer ([in] UINT32 NumFramesWritten,[in] DWORD dwFlags); |
| 144 |
} |
| 145 |
|
| 146 |
cpp_quote("") |
| 147 |
[object, local, uuid (C8ADBD64-E71E-48a0-A4DE-185c395cd317), helpstring ("IAudioCaptureClient Interface"), pointer_default (unique)] |
| 148 |
interface IAudioCaptureClient : IUnknown { |
| 149 |
HRESULT GetBuffer ([out] BYTE **ppData,[out] UINT32 *pNumFramesToRead,[out] DWORD *pdwFlags,[out, unique] UINT64 *pu64DevicePosition,[out, unique] UINT64 *pu64QPCPosition); |
| 150 |
HRESULT ReleaseBuffer ([in] UINT32 NumFramesRead); |
| 151 |
HRESULT GetNextPacketSize ([out] UINT32 *pNumFramesInNextPacket); |
| 152 |
} |
| 153 |
|
| 154 |
cpp_quote("") |
| 155 |
cpp_quote("#define AUDIOCLOCK_CHARACTERISTIC_FIXED_FREQ 0x1") |
| 156 |
|
| 157 |
cpp_quote("") |
| 158 |
[object, local, uuid (CD63314F-3fba-4a1b-812c-EF96358728E7), pointer_default (unique)] |
| 159 |
interface IAudioClock : IUnknown { |
| 160 |
HRESULT GetFrequency ([out] UINT64 *pu64Frequency); |
| 161 |
HRESULT GetPosition ([out] UINT64 *pu64Position,[out, unique] UINT64 *pu64QPCPosition); |
| 162 |
HRESULT GetCharacteristics ([out] DWORD *pdwCharacteristics); |
| 163 |
}; |
| 164 |
cpp_quote("#endif") |
| 165 |
|
| 166 |
cpp_quote("") |
| 167 |
cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)") |
| 168 |
[object, local, uuid (6f49ff73-6727-49ac-a008-d98cf5e70048), pointer_default (unique)] |
| 169 |
interface IAudioClock2 : IUnknown { |
| 170 |
HRESULT GetDevicePosition ([out] UINT64 *DevicePosition,[out, unique] UINT64 *QPCPosition); |
| 171 |
}; |
| 172 |
|
| 173 |
cpp_quote("") |
| 174 |
[local, uuid (f6e4c0a0-46d9-4fb8-be21-57a3ef2b626c), pointer_default (unique)] |
| 175 |
interface IAudioClockAdjustment : IUnknown { |
| 176 |
HRESULT SetSampleRate ([in] float flSampleRate); |
| 177 |
}; |
| 178 |
cpp_quote("#endif") |
| 179 |
|
| 180 |
cpp_quote("") |
| 181 |
cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)") |
| 182 |
[object, local, uuid (87ce5498-68d6-44e5-9215-6da47ef883d8), pointer_default (unique)] |
| 183 |
interface ISimpleAudioVolume : IUnknown { |
| 184 |
HRESULT SetMasterVolume ([in] float fLevel,[in, unique] LPCGUID EventContext); |
| 185 |
HRESULT GetMasterVolume ([out] float *pfLevel); |
| 186 |
HRESULT SetMute ([in] const WINBOOL bMute,[in, unique] LPCGUID EventContext); |
| 187 |
HRESULT GetMute ([out] WINBOOL *pbMute); |
| 188 |
} |
| 189 |
cpp_quote("#endif") |
| 190 |
cpp_quote("") |
| 191 |
cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)") |
| 192 |
[object, local, uuid (93014887-242d-4068-8a15-CF5E93B90FE3), pointer_default (unique)] |
| 193 |
interface IAudioStreamVolume : IUnknown { |
| 194 |
HRESULT GetChannelCount ([out] UINT32 *pdwCount); |
| 195 |
HRESULT SetChannelVolume ([in] UINT32 dwIndex,[in] const float fLevel); |
| 196 |
HRESULT GetChannelVolume ([in] UINT32 dwIndex,[out] float *pfLevel); |
| 197 |
HRESULT SetAllVolumes ([in] UINT32 dwCount,[in, size_is (dwCount)] const float *pfVolumes); |
| 198 |
HRESULT GetAllVolumes ([in] UINT32 dwCount,[out, size_is (dwCount),] float *pfVolumes); |
| 199 |
} |
| 200 |
|
| 201 |
[object, local, uuid (28724c91-df35-4856-9f76-d6a26413f3df), pointer_default (unique)] |
| 202 |
interface IAudioAmbisonicsControl : IUnknown { |
| 203 |
HRESULT SetData([in] const AMBISONICS_PARAMS *pAmbisonicsParams, [in] UINT32 cbAmbisonicsParams); |
| 204 |
HRESULT SetHeadTracking([in] WINBOOL bEnableHeadTracking); |
| 205 |
HRESULT GetHeadTracking([out] WINBOOL *pbEnableHeadTracking); |
| 206 |
HRESULT SetRotation([in] float X, [in] float Y, [in] float Z, [in] float W); |
| 207 |
} |
| 208 |
|
| 209 |
cpp_quote("") |
| 210 |
[object, local, uuid (1c158861-B533-4b30-B1CF-E853E51C59B8), pointer_default (unique)] |
| 211 |
interface IChannelAudioVolume : IUnknown { |
| 212 |
HRESULT GetChannelCount ([out] UINT32 *pdwCount); |
| 213 |
HRESULT SetChannelVolume ([in] UINT32 dwIndex,[in] const float fLevel,[in, unique] LPCGUID EventContext); |
| 214 |
HRESULT GetChannelVolume ([in] UINT32 dwIndex,[out] float *pfLevel); |
| 215 |
HRESULT SetAllVolumes ([in] UINT32 dwCount,[in, size_is (dwCount)] const float *pfVolumes,[in, unique] LPCGUID EventContext); |
| 216 |
HRESULT GetAllVolumes ([in] UINT32 dwCount,[out, size_is (dwCount),] float *pfVolumes); |
| 217 |
} |
| 218 |
cpp_quote("#endif") |
| 219 |
cpp_quote("") |
| 220 |
cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)") |
| 221 |
cpp_quote("#define AUDCLNT_ERR(n) MAKE_HRESULT(SEVERITY_ERROR, FACILITY_AUDCLNT, n)") |
| 222 |
cpp_quote("#define AUDCLNT_SUCCESS(n) MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_AUDCLNT, n)") |
| 223 |
cpp_quote("") |
| 224 |
cpp_quote("#define AUDCLNT_E_NOT_INITIALIZED AUDCLNT_ERR(0x1)") |
| 225 |
cpp_quote("#define AUDCLNT_E_ALREADY_INITIALIZED AUDCLNT_ERR(0x2)") |
| 226 |
cpp_quote("#define AUDCLNT_E_WRONG_ENDPOINT_TYPE AUDCLNT_ERR(0x3)") |
| 227 |
cpp_quote("#define AUDCLNT_E_DEVICE_INVALIDATED AUDCLNT_ERR(0x4)") |
| 228 |
cpp_quote("#define AUDCLNT_E_NOT_STOPPED AUDCLNT_ERR(0x5)") |
| 229 |
cpp_quote("#define AUDCLNT_E_BUFFER_TOO_LARGE AUDCLNT_ERR(0x6)") |
| 230 |
cpp_quote("#define AUDCLNT_E_OUT_OF_ORDER AUDCLNT_ERR(0x7)") |
| 231 |
cpp_quote("#define AUDCLNT_E_UNSUPPORTED_FORMAT AUDCLNT_ERR(0x8)") |
| 232 |
cpp_quote("#define AUDCLNT_E_INVALID_SIZE AUDCLNT_ERR(0x9)") |
| 233 |
cpp_quote("#define AUDCLNT_E_DEVICE_IN_USE AUDCLNT_ERR(0xa)") |
| 234 |
cpp_quote("#define AUDCLNT_E_BUFFER_OPERATION_PENDING AUDCLNT_ERR(0xb)") |
| 235 |
cpp_quote("#define AUDCLNT_E_THREAD_NOT_REGISTERED AUDCLNT_ERR(0xc)") |
| 236 |
cpp_quote("#define AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED AUDCLNT_ERR(0xe)") |
| 237 |
cpp_quote("#define AUDCLNT_E_ENDPOINT_CREATE_FAILED AUDCLNT_ERR(0xf)") |
| 238 |
cpp_quote("#define AUDCLNT_E_SERVICE_NOT_RUNNING AUDCLNT_ERR(0x10)") |
| 239 |
cpp_quote("#define AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED AUDCLNT_ERR(0x11)") |
| 240 |
cpp_quote("#define AUDCLNT_E_EXCLUSIVE_MODE_ONLY AUDCLNT_ERR(0x12)") |
| 241 |
cpp_quote("#define AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL AUDCLNT_ERR(0x13)") |
| 242 |
cpp_quote("#define AUDCLNT_E_EVENTHANDLE_NOT_SET AUDCLNT_ERR(0x14)") |
| 243 |
cpp_quote("#define AUDCLNT_E_INCORRECT_BUFFER_SIZE AUDCLNT_ERR(0x15)") |
| 244 |
cpp_quote("#define AUDCLNT_E_BUFFER_SIZE_ERROR AUDCLNT_ERR(0x16)") |
| 245 |
cpp_quote("#define AUDCLNT_E_CPUUSAGE_EXCEEDED AUDCLNT_ERR(0x17)") |
| 246 |
cpp_quote("#define AUDCLNT_E_BUFFER_ERROR AUDCLNT_ERR(0x18)") |
| 247 |
cpp_quote("#define AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED AUDCLNT_ERR(0x19)") |
| 248 |
cpp_quote("#define AUDCLNT_E_INVALID_DEVICE_PERIOD AUDCLNT_ERR(0x20)") |
| 249 |
cpp_quote("#define AUDCLNT_E_INVALID_STREAM_FLAG AUDCLNT_ERR(0x21)") |
| 250 |
cpp_quote("#define AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE AUDCLNT_ERR(0x22)") |
| 251 |
cpp_quote("#define AUDCLNT_E_OUT_OF_OFFLOAD_RESOURCES AUDCLNT_ERR(0x23)") |
| 252 |
cpp_quote("#define AUDCLNT_E_OFFLOAD_MODE_ONLY AUDCLNT_ERR(0x24)") |
| 253 |
cpp_quote("#define AUDCLNT_E_NONOFFLOAD_MODE_ONLY AUDCLNT_ERR(0x25)") |
| 254 |
cpp_quote("#define AUDCLNT_E_RESOURCES_INVALIDATED AUDCLNT_ERR(0x26)") |
| 255 |
cpp_quote("#define AUDCLNT_E_RAW_MODE_UNSUPPORTED AUDCLNT_ERR(0x027)") |
| 256 |
cpp_quote("#define AUDCLNT_E_ENGINE_PERIODICITY_LOCKED AUDCLNT_ERR(0x028)") |
| 257 |
cpp_quote("#define AUDCLNT_E_ENGINE_FORMAT_LOCKED AUDCLNT_ERR(0x029)") |
| 258 |
cpp_quote("#define AUDCLNT_E_HEADTRACKING_ENABLED AUDCLNT_ERR(0x030)") |
| 259 |
cpp_quote("#define AUDCLNT_E_HEADTRACKING_UNSUPPORTED AUDCLNT_ERR(0x040)") |
| 260 |
cpp_quote("#define AUDCLNT_S_BUFFER_EMPTY AUDCLNT_SUCCESS(0x1)") |
| 261 |
cpp_quote("#define AUDCLNT_S_THREAD_ALREADY_REGISTERED AUDCLNT_SUCCESS(0x2)") |
| 262 |
cpp_quote("#define AUDCLNT_S_POSITION_STALLED AUDCLNT_SUCCESS(0x3)") |
| 263 |
|
| 264 |
cpp_quote("#endif") |