1 /* 2 * Structure and enum definitions are from audioclient.h in the Windows 10 SDK 3 * 4 * These should be defined by MinGW, but they aren't yet since they're very new 5 * so we keep a copy in our tree. All definitions are guarded, so it should be 6 * fine to always include this even when building with MSVC. 7 */ 8 #pragma once 9 10 #ifndef __IAudioClient3_FWD_DEFINED__ 11 #define __IAudioClient3_FWD_DEFINED__ 12 typedef interface IAudioClient3 IAudioClient3; 13 14 #endif /* __IAudioClient3_FWD_DEFINED__ */ 15 16 #ifndef __IAudioClient3_INTERFACE_DEFINED__ 17 #define __IAudioClient3_INTERFACE_DEFINED__ 18 19 #ifndef HAVE_AUDCLNT_STREAMOPTIONS 20 typedef enum AUDCLNT_STREAMOPTIONS 21 { 22 AUDCLNT_STREAMOPTIONS_NONE = 0, 23 AUDCLNT_STREAMOPTIONS_RAW = 0x1, 24 AUDCLNT_STREAMOPTIONS_MATCH_FORMAT = 0x2 25 } AUDCLNT_STREAMOPTIONS; 26 #endif 27 28 /* These should be available when the IAudioClient2 interface is defined */ 29 #ifndef __IAudioClient2_FWD_DEFINED__ 30 typedef enum _AUDIO_STREAM_CATEGORY { 31 AudioCategory_Other = 0, 32 AudioCategory_ForegroundOnlyMedia, 33 AudioCategory_BackgroundCapableMedia, 34 AudioCategory_Communications, 35 AudioCategory_Alerts, 36 AudioCategory_SoundEffects, 37 AudioCategory_GameEffects, 38 AudioCategory_GameMedia, 39 AudioCategory_GameChat, 40 AudioCategory_Speech, 41 AudioCategory_Movie, 42 AudioCategory_Media 43 } AUDIO_STREAM_CATEGORY; 44 45 typedef struct AudioClientProperties 46 { 47 UINT32 cbSize; 48 BOOL bIsOffload; 49 AUDIO_STREAM_CATEGORY eCategory; 50 AUDCLNT_STREAMOPTIONS Options; 51 } AudioClientProperties; 52 #endif /* __IAudioClient2_FWD_DEFINED__ */ 53 54 EXTERN_C const IID IID_IAudioClient3; 55 56 typedef struct IAudioClient3Vtbl 57 { 58 BEGIN_INTERFACE 59 60 HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 61 IAudioClient3 * This, 62 REFIID riid, 63 void **ppvObject); 64 65 ULONG ( STDMETHODCALLTYPE *AddRef )( 66 IAudioClient3 * This); 67 68 ULONG ( STDMETHODCALLTYPE *Release )( 69 IAudioClient3 * This); 70 71 HRESULT ( STDMETHODCALLTYPE *Initialize )( 72 IAudioClient3 * This, 73 AUDCLNT_SHAREMODE ShareMode, 74 DWORD StreamFlags, 75 REFERENCE_TIME hnsBufferDuration, 76 REFERENCE_TIME hnsPeriodicity, 77 const WAVEFORMATEX *pFormat, 78 LPCGUID AudioSessionGuid); 79 80 HRESULT ( STDMETHODCALLTYPE *GetBufferSize )( 81 IAudioClient3 * This, 82 UINT32 *pNumBufferFrames); 83 84 HRESULT ( STDMETHODCALLTYPE *GetStreamLatency )( 85 IAudioClient3 * This, 86 REFERENCE_TIME *phnsLatency); 87 88 HRESULT ( STDMETHODCALLTYPE *GetCurrentPadding )( 89 IAudioClient3 * This, 90 UINT32 *pNumPaddingFrames); 91 92 HRESULT ( STDMETHODCALLTYPE *IsFormatSupported )( 93 IAudioClient3 * This, 94 AUDCLNT_SHAREMODE ShareMode, 95 const WAVEFORMATEX *pFormat, 96 WAVEFORMATEX **ppClosestMatch); 97 98 HRESULT ( STDMETHODCALLTYPE *GetMixFormat )( 99 IAudioClient3 * This, 100 WAVEFORMATEX **ppDeviceFormat); 101 102 HRESULT ( STDMETHODCALLTYPE *GetDevicePeriod )( 103 IAudioClient3 * This, 104 REFERENCE_TIME *phnsDefaultDevicePeriod, 105 REFERENCE_TIME *phnsMinimumDevicePeriod); 106 107 HRESULT ( STDMETHODCALLTYPE *Start )( 108 IAudioClient3 * This); 109 110 HRESULT ( STDMETHODCALLTYPE *Stop )( 111 IAudioClient3 * This); 112 113 HRESULT ( STDMETHODCALLTYPE *Reset )( 114 IAudioClient3 * This); 115 116 HRESULT ( STDMETHODCALLTYPE *SetEventHandle )( 117 IAudioClient3 * This, 118 HANDLE eventHandle); 119 120 HRESULT ( STDMETHODCALLTYPE *GetService )( 121 IAudioClient3 * This, 122 REFIID riid, 123 void **ppv); 124 125 HRESULT ( STDMETHODCALLTYPE *IsOffloadCapable )( 126 IAudioClient3 * This, 127 AUDIO_STREAM_CATEGORY Category, 128 BOOL *pbOffloadCapable); 129 130 HRESULT ( STDMETHODCALLTYPE *SetClientProperties )( 131 IAudioClient3 * This, 132 const AudioClientProperties *pProperties); 133 134 HRESULT ( STDMETHODCALLTYPE *GetBufferSizeLimits )( 135 IAudioClient3 * This, 136 const WAVEFORMATEX *pFormat, 137 BOOL bEventDriven, 138 REFERENCE_TIME *phnsMinBufferDuration, 139 REFERENCE_TIME *phnsMaxBufferDuration); 140 141 HRESULT ( STDMETHODCALLTYPE *GetSharedModeEnginePeriod )( 142 IAudioClient3 * This, 143 const WAVEFORMATEX *pFormat, 144 UINT32 *pDefaultPeriodInFrames, 145 UINT32 *pFundamentalPeriodInFrames, 146 UINT32 *pMinPeriodInFrames, 147 UINT32 *pMaxPeriodInFrames); 148 149 HRESULT ( STDMETHODCALLTYPE *GetCurrentSharedModeEnginePeriod )( 150 IAudioClient3 * This, 151 WAVEFORMATEX **ppFormat, 152 UINT32 *pCurrentPeriodInFrames); 153 154 HRESULT ( STDMETHODCALLTYPE *InitializeSharedAudioStream )( 155 IAudioClient3 * This, 156 DWORD StreamFlags, 157 UINT32 PeriodInFrames, 158 const WAVEFORMATEX *pFormat, 159 LPCGUID AudioSessionGuid); 160 161 END_INTERFACE 162 } IAudioClient3Vtbl; 163 164 interface IAudioClient3 165 { 166 CONST_VTBL struct IAudioClient3Vtbl *lpVtbl; 167 }; 168 169 #define IAudioClient3_QueryInterface(This,riid,ppvObject) \ 170 ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 171 172 #define IAudioClient3_AddRef(This) \ 173 ( (This)->lpVtbl -> AddRef(This) ) 174 175 #define IAudioClient3_Release(This) \ 176 ( (This)->lpVtbl -> Release(This) ) 177 178 179 #define IAudioClient3_Initialize(This,ShareMode,StreamFlags,hnsBufferDuration,hnsPeriodicity,pFormat,AudioSessionGuid) \ 180 ( (This)->lpVtbl -> Initialize(This,ShareMode,StreamFlags,hnsBufferDuration,hnsPeriodicity,pFormat,AudioSessionGuid) ) 181 182 #define IAudioClient3_GetBufferSize(This,pNumBufferFrames) \ 183 ( (This)->lpVtbl -> GetBufferSize(This,pNumBufferFrames) ) 184 185 #define IAudioClient3_GetStreamLatency(This,phnsLatency) \ 186 ( (This)->lpVtbl -> GetStreamLatency(This,phnsLatency) ) 187 188 #define IAudioClient3_GetCurrentPadding(This,pNumPaddingFrames) \ 189 ( (This)->lpVtbl -> GetCurrentPadding(This,pNumPaddingFrames) ) 190 191 #define IAudioClient3_IsFormatSupported(This,ShareMode,pFormat,ppClosestMatch) \ 192 ( (This)->lpVtbl -> IsFormatSupported(This,ShareMode,pFormat,ppClosestMatch) ) 193 194 #define IAudioClient3_GetMixFormat(This,ppDeviceFormat) \ 195 ( (This)->lpVtbl -> GetMixFormat(This,ppDeviceFormat) ) 196 197 #define IAudioClient3_GetDevicePeriod(This,phnsDefaultDevicePeriod,phnsMinimumDevicePeriod) \ 198 ( (This)->lpVtbl -> GetDevicePeriod(This,phnsDefaultDevicePeriod,phnsMinimumDevicePeriod) ) 199 200 #define IAudioClient3_Start(This) \ 201 ( (This)->lpVtbl -> Start(This) ) 202 203 #define IAudioClient3_Stop(This) \ 204 ( (This)->lpVtbl -> Stop(This) ) 205 206 #define IAudioClient3_Reset(This) \ 207 ( (This)->lpVtbl -> Reset(This) ) 208 209 #define IAudioClient3_SetEventHandle(This,eventHandle) \ 210 ( (This)->lpVtbl -> SetEventHandle(This,eventHandle) ) 211 212 #define IAudioClient3_GetService(This,riid,ppv) \ 213 ( (This)->lpVtbl -> GetService(This,riid,ppv) ) 214 215 216 #define IAudioClient3_IsOffloadCapable(This,Category,pbOffloadCapable) \ 217 ( (This)->lpVtbl -> IsOffloadCapable(This,Category,pbOffloadCapable) ) 218 219 #define IAudioClient3_SetClientProperties(This,pProperties) \ 220 ( (This)->lpVtbl -> SetClientProperties(This,pProperties) ) 221 222 #define IAudioClient3_GetBufferSizeLimits(This,pFormat,bEventDriven,phnsMinBufferDuration,phnsMaxBufferDuration) \ 223 ( (This)->lpVtbl -> GetBufferSizeLimits(This,pFormat,bEventDriven,phnsMinBufferDuration,phnsMaxBufferDuration) ) 224 225 226 #define IAudioClient3_GetSharedModeEnginePeriod(This,pFormat,pDefaultPeriodInFrames,pFundamentalPeriodInFrames,pMinPeriodInFrames,pMaxPeriodInFrames) \ 227 ( (This)->lpVtbl -> GetSharedModeEnginePeriod(This,pFormat,pDefaultPeriodInFrames,pFundamentalPeriodInFrames,pMinPeriodInFrames,pMaxPeriodInFrames) ) 228 229 #define IAudioClient3_GetCurrentSharedModeEnginePeriod(This,ppFormat,pCurrentPeriodInFrames) \ 230 ( (This)->lpVtbl -> GetCurrentSharedModeEnginePeriod(This,ppFormat,pCurrentPeriodInFrames) ) 231 232 #define IAudioClient3_InitializeSharedAudioStream(This,StreamFlags,PeriodInFrames,pFormat,AudioSessionGuid) \ 233 ( (This)->lpVtbl -> InitializeSharedAudioStream(This,StreamFlags,PeriodInFrames,pFormat,AudioSessionGuid) ) 234 235 236 #endif /* __IAudioClient3_INTERFACE_DEFINED__ */ 237