diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2010-02-18 00:12:17 (GMT) |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2010-02-18 00:19:23 (GMT) |
commit | 562eca42906870f5871400d0899c8e8d1fb2576c (patch) | |
tree | b1816e6d9f47bfd2aa872b61a6c41bc3f63edcc0 /src/plugins/mediaservices | |
parent | ad2e68cc20d8515a29930da6a247e21fbed472a4 (diff) | |
download | Qt-562eca42906870f5871400d0899c8e8d1fb2576c.zip Qt-562eca42906870f5871400d0899c8e8d1fb2576c.tar.gz Qt-562eca42906870f5871400d0899c8e8d1fb2576c.tar.bz2 |
Use the IPropertyBag interface to get audio device names.
This is instead of parsing the identifier, which is guaranteed to have
a readable name in it.
Diffstat (limited to 'src/plugins/mediaservices')
-rw-r--r-- | src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp index 4bb7228..570b44a 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp @@ -82,7 +82,21 @@ QList<QString> DirectShowAudioEndpointControl::availableEndpoints() const QString DirectShowAudioEndpointControl::endpointDescription(const QString &name) const { - return name.section(QLatin1Char('\\'), -1); + QString description; + + if (IMoniker *moniker = m_devices.value(name, 0)) { + IPropertyBag *propertyBag = 0; + if (SUCCEEDED(moniker->BindToStorage( + 0, 0, IID_IPropertyBag, reinterpret_cast<void **>(&propertyBag)))) { + VARIANT name; + VariantInit(&name); + if (SUCCEEDED(propertyBag->Read(L"FriendlyName", &name, 0))) + description = QString::fromWCharArray(name.bstrVal); + VariantClear(&name); + propertyBag->Release(); + } + } + return description;; } QString DirectShowAudioEndpointControl::defaultEndpoint() const |