Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //used internally by kit_w32_audio to wrap c++ com interfaces for use in c
- //(i'm making the api intentionally verbose here)
- //interfaces implemented:
- //IMMDeviceEnumerator
- //IMMDeviceCollection
- //IMMDevice
- //IAudioClient
- //IAudioRenderClient
- //IPropertyStore
- #include <_kit_w32_audioCOM.h>
- //IMMDeviceEnumerator
- HRESULT _kit_audioCOM_IMMDeviceEnumerator_EnumAudioEndpoints(IMMDeviceEnumerator* enumerator,
- EDataFlow dataFlow_i, DWORD stateMask_i, IMMDeviceCollection** devices_o)
- { return enumerator->EnumAudioEndpoints(dataFlow_i, stateMask_i, devices_o); }
- HRESULT _kit_audioCOM_IMMDeviceEnumerator_GetDefaultAudioEndpoint(IMMDeviceEnumerator* enumerator,
- EDataFlow dataFlow_i, ERole role_i, IMMDevice** endpoint_o)
- { return enumerator->GetDefaultAudioEndpoint(dataFlow_i, role_i, endpoint_o); }
- HRESULT _kit_audioCOM_IMMDeviceEnumerator_GetDevice(IMMDeviceEnumerator* enumerator,
- LPCWSTR strID_i, IMMDevice** device_o)
- { return enumerator->GetDevice(strID_i, device_o); }
- HRESULT _kit_audioCOM_IMMDeviceEnumerator_RegisterEndpointNotificationCallback(IMMDeviceEnumerator* enumerator,
- IMMNotificationClient* client_i)
- { return enumerator->RegisterEndpointNotificationCallback(client_i); }
- HRESULT _kit_audioCOM_IMMDeviceEnumerator_UnregisterEndpointNotificationCallback(IMMDeviceEnumerator* enumerator,
- IMMNotificationClient* client_i)
- { return enumerator->UnregisterEndpointNotificationCallback(client_i); }
- //
- HRESULT _kit_audioCOM_IMMDeviceEnumerator_QueryInterface(IMMDeviceEnumerator* enumerator,
- IMMDeviceEnumerator** enumerator_o)
- { return enumerator->QueryInterface(enumerator_o); }
- ULONG _kit_audioCOM_IMMDeviceEnumerator_AddRef(IMMDeviceEnumerator* enumerator)
- { return enumerator->AddRef(); }
- ULONG _kit_audioCOM_IMMDeviceEnumerator_Release(IMMDeviceEnumerator* enumerator)
- { return enumerator->Release(); }
- //IMMDeviceCollection
- HRESULT _kit_audioCOM_IMMDeviceCollection_GetCount(IMMDeviceCollection* deviceCollection,
- UINT* devices_o)
- { return deviceCollection->GetCount(devices_o); }
- HRESULT _kit_audioCOM_IMMDeviceCollection_Item(IMMDeviceCollection* deviceCollection,
- UINT deviceNum_i, IMMDevice** device_o)
- { return deviceCollection->Item(deviceNum_i, device_o); }
- //
- HRESULT _kit_audioCOM_IMMDeviceCollection_QueryInterface(IMMDeviceCollection* deviceCollection,
- IMMDeviceCollection** deviceCollection_o)
- { return deviceCollection->QueryInterface(deviceCollection_o); }
- ULONG _kit_audioCOM_IMMDeviceCollection_AddRef(IMMDeviceCollection* deviceCollection)
- { return deviceCollection->AddRef(); }
- ULONG _kit_audioCOM_IMMDeviceCollection_Release(IMMDeviceCollection* deviceCollection)
- { return deviceCollection->Release(); }
- //IMMDevice
- HRESULT _kit_audioCOM_IMMDevice_Activate(IMMDevice* device,
- REFIID iid_i, DWORD clsCtx_i, PROPVARIANT* activationParams_i, void** interface_o)
- { return device->Activate(iid_i, clsCtx_i, activationParams_i, interface_o); }
- HRESULT _kit_audioCOM_IMMDevice_GetId(IMMDevice* device,
- LPWSTR* strID_o)
- { return device->GetId(strID_o); }
- HRESULT _kit_audioCOM_IMMDevice_GetState(IMMDevice* device,
- DWORD* state_o)
- { return device->GetState(state_o); }
- HRESULT _kit_audioCOM_IMMDevice_OpenPropertyStore(IMMDevice* device,
- DWORD access_i, IPropertyStore** properties_o)
- { return device->OpenPropertyStore(access_i, properties_o); }
- HRESULT _kit_audioCOM_IMMDevice_QueryInterface(IMMDevice* device,
- IMMDevice** device_o)
- { return device->QueryInterface(device_o); }
- ULONG _kit_audioCOM_IMMDevice_AddRef(IMMDevice* device)
- { return device->AddRef(); }
- ULONG _kit_audioCOM_IMMDevice_Release(IMMDevice* device)
- { return device->Release(); }
- //IAudioClient
- HRESULT _kit_audioCOM_IAudioClient_GetBufferSize(IAudioClient* audioClient,
- UINT32* numBufferFrames_o)
- { return audioClient->GetBufferSize(numBufferFrames_o); }
- HRESULT _kit_audioCOM_IAudioClient_GetCurrentPadding(IAudioClient* audioClient,
- UINT32* numPaddingFrames_o)
- { return audioClient->GetCurrentPadding(numPaddingFrames_o); }
- HRESULT _kit_audioCOM_IAudioClient_GetDevicePeriod(IAudioClient* audioClient,
- REFERENCE_TIME* defaultDevicePeriod_o, REFERENCE_TIME* minimumDevicePeriod_o)
- { return audioClient->GetDevicePeriod(defaultDevicePeriod_o, minimumDevicePeriod_o); }
- HRESULT _kit_audioCOM_IAudioClient_GetMixFormat(IAudioClient* audioClient,
- WAVEFORMATEX** deviceFormat_o)
- { return audioClient->GetMixFormat(deviceFormat_o); }
- HRESULT _kit_audioCOM_IAudioClient_GetService(IAudioClient* audioClient,
- REFIID riid_i, void** ppv_o)
- { return audioClient->GetService(riid_i, ppv_o); }
- HRESULT _kit_audioCOM_IAudioClient_GetStreamLatency(IAudioClient* audioClient,
- REFERENCE_TIME* latency_o)
- { return audioClient->GetStreamLatency(latency_o); }
- HRESULT _kit_audioCOM_IAudioClient_Initialize(IAudioClient* audioClient,
- AUDCLNT_SHAREMODE shareMode_i, DWORD streamFlags_i, REFERENCE_TIME bufferDuration_i,
- REFERENCE_TIME periodicity_i, const WAVEFORMATEX* format_i, LPCGUID audioSessionGUID_i)
- { return audioClient->Initialize(shareMode_i, streamFlags_i, bufferDuration_i, periodicity_i, format_i, audioSessionGUID_i); }
- HRESULT _kit_audioCOM_IAudioClient_IsFormatSupported(IAudioClient* audioClient,
- AUDCLNT_SHAREMODE shareMode_i, const WAVEFORMATEX* format_i, WAVEFORMATEX** closestMatch_o)
- { return audioClient->IsFormatSupported(shareMode_i, format_i, closestMatch_o); }
- HRESULT _kit_audioCOM_IAudioClient_Reset(IAudioClient* audioClient)
- { return audioClient->Reset(); }
- HRESULT _kit_audioCOM_IAudioClient_SetEventHandle(IAudioClient* audioClient,
- HANDLE eventHandle_i)
- { return audioClient->SetEventHandle(eventHandle_i); }
- HRESULT _kit_audioCOM_IAudioClient_Start(IAudioClient* audioClient)
- { return audioClient->Start(); }
- HRESULT _kit_audioCOM_IAudioClient_Stop(IAudioClient* audioClient)
- { return audioClient->Stop(); }
- HRESULT _kit_audioCOM_IAudioClient_QueryInterface(IAudioClient* audioClient,
- IAudioClient** audioClient_o)
- { return audioClient->QueryInterface(audioClient_o); }
- ULONG _kit_audioCOM_IAudioClient_AddRef(IAudioClient* audioClient)
- { return audioClient->AddRef(); }
- ULONG _kit_audioCOM_IAudioClient_Release(IAudioClient* audioClient)
- { return audioClient->Release(); }
- //IAudioRenderClient
- HRESULT _kit_audioCOM_IAudioRenderClient_GetBuffer(IAudioRenderClient* audioRenderClient,
- UINT32 numFramesRequested_i, BYTE** data)
- { return audioRenderClient->GetBuffer(numFramesRequested_i, data); }
- HRESULT _kit_audioCOM_IAudioRenderClient_ReleaseBuffer(IAudioRenderClient* audioRenderClient,
- UINT32 numFramesWritten_i, DWORD flags_i)
- { return audioRenderClient->ReleaseBuffer(numFramesWritten_i, flags_i); }
- HRESULT _kit_audioCOM_IAudioRenderClient_QueryInterface(IAudioRenderClient* audioRenderClient,
- IAudioRenderClient** audioRenderClient_o)
- { return audioRenderClient->QueryInterface(audioRenderClient_o); }
- ULONG _kit_audioCOM_IAudioRenderClient_AddRef(IAudioRenderClient* audioRenderClient)
- { return audioRenderClient->AddRef(); }
- ULONG _kit_audioCOM_IAudioRenderClient_Release(IAudioRenderClient* audioRenderClient)
- { return audioRenderClient->Release(); }
- //IPropertyStore
- HRESULT _kit_audioCOM_IPropertyStore_Commit(IPropertyStore* properties)
- { return properties->Commit(); }
- HRESULT _kit_audioCOM_IPropertyStore_GetAt(IPropertyStore* properties,
- DWORD propertyKeyIndex_i, PROPERTYKEY* propertyKey_o)
- { return properties->GetAt(propertyKeyIndex_i, propertyKey_o); }
- HRESULT _kit_audioCOM_IPropertyStore_GetCount(IPropertyStore* properties,
- DWORD* numProperties_o)
- { return properties->GetCount(numProperties_o); }
- HRESULT _kit_audioCOM_IPropertyStore_GetValue(IPropertyStore* properties,
- REFPROPERTYKEY key_i, PROPVARIANT* propertyVariant_o)
- { return properties->GetValue(key_i, propertyVariant_o); }
- HRESULT _kit_audioCOM_IPropertyStore_SetValue(IPropertyStore* properties,
- REFPROPERTYKEY key_i, REFPROPVARIANT propertyVariant_i)
- { return properties->SetValue(key_i, propertyVariant_i); }
- HRESULT _kit_audioCOM_IPropertyStore_QueryInterface(IPropertyStore* properties,
- IPropertyStore** properties_o)
- { return properties->QueryInterface(properties_o); }
- ULONG _kit_audioCOM_IPropertyStore_AddRef(IPropertyStore* properties)
- { return properties->AddRef(); }
- ULONG _kit_audioCOM_IPropertyStore_Release(IPropertyStore* properties)
- { return properties->Release(); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement