WASAPI: Add PaWaspi_GetIMMDevice function
The IMMDevice pointer enables access to audio device capabiltiies not exposed by PortAudio. https://docs.microsoft.com/en-us/windows/win32/api/mmdeviceapi/nn-mmdeviceapi-immdevice
This commit is contained in:
parent
0f26679b88
commit
38eba25bcc
4 changed files with 33 additions and 0 deletions
|
|
@ -2614,6 +2614,27 @@ int PaWasapi_GetDeviceRole( PaDeviceIndex device )
|
|||
return paWasapi->devInfo[ index ].formFactor;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
int PaWasapi_GetIMMDevice( PaDeviceIndex device, void **pIMMDevice )
|
||||
{
|
||||
PaError ret;
|
||||
PaDeviceIndex index;
|
||||
|
||||
PaWasapiHostApiRepresentation *paWasapi = _GetHostApi(&ret);
|
||||
if (paWasapi == NULL)
|
||||
return paNotInitialized;
|
||||
|
||||
ret = PaUtil_DeviceIndexToHostApiDeviceIndex(&index, device, &paWasapi->inheritedHostApiRep);
|
||||
if (ret != paNoError)
|
||||
return ret;
|
||||
|
||||
if ((UINT32)index >= paWasapi->deviceCount)
|
||||
return paInvalidDevice;
|
||||
|
||||
*pIMMDevice = paWasapi->devInfo[ index ].device;
|
||||
return paNoError;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
PaError PaWasapi_GetFramesPerHostBuffer( PaStream *pStream, unsigned int *pInput, unsigned int *pOutput )
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue