Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/sanear.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/AudioDeviceManager.cpp')
-rw-r--r--src/AudioDeviceManager.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/AudioDeviceManager.cpp b/src/AudioDeviceManager.cpp
index 727b8d1..1e7320e 100644
--- a/src/AudioDeviceManager.cpp
+++ b/src/AudioDeviceManager.cpp
@@ -35,6 +35,20 @@ namespace SaneAudioRenderer
return ret;
}
+ UINT32 GetDevicePropertyUint(IPropertyStore* pStore, REFPROPERTYKEY key)
+ {
+ assert(pStore);
+
+ PROPVARIANT prop;
+ PropVariantInit(&prop);
+ ThrowIfFailed(pStore->GetValue(key, &prop));
+ assert(prop.vt == VT_UI4);
+ UINT32 ret = prop.uintVal;
+ PropVariantClear(&prop);
+
+ return ret;
+ }
+
SharedString GetDevicePropertyString(IPropertyStore* pStore, REFPROPERTYKEY key)
{
assert(pStore);
@@ -96,6 +110,11 @@ namespace SaneAudioRenderer
backend.adapterName = GetDevicePropertyString(devicePropertyStore, PKEY_DeviceInterface_FriendlyName);
backend.endpointName = GetDevicePropertyString(devicePropertyStore, PKEY_Device_DeviceDesc);
+ static const PROPERTYKEY formFactorKey = { // PKEY_AudioEndpoint_FormFactor
+ {0x1da5d803, 0xd492, 0x4edd, {0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e}}, 0
+ };
+ backend.endpointFormFactor = GetDevicePropertyUint(devicePropertyStore, formFactorKey);
+
ThrowIfFailed(device->Activate(__uuidof(IAudioClient),
CLSCTX_INPROC_SERVER, nullptr, (void**)&backend.audioClient));
}