Compare strings like regular human beings
This commit is contained in:
parent
39050f9844
commit
92f0e467ae
1 changed files with 2 additions and 2 deletions
|
@ -72,6 +72,7 @@ public:
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE OnNotify(PAUDIO_VOLUME_NOTIFICATION_DATA pNotify) override
|
HRESULT STDMETHODCALLTYPE OnNotify(PAUDIO_VOLUME_NOTIFICATION_DATA pNotify) override
|
||||||
{
|
{
|
||||||
|
qWarning("OnNotify");
|
||||||
NetworkPacket np(PACKET_TYPE_SYSTEMVOLUME);
|
NetworkPacket np(PACKET_TYPE_SYSTEMVOLUME);
|
||||||
np.set<int>(QStringLiteral("volume"), (int)(pNotify->fMasterVolume * 100));
|
np.set<int>(QStringLiteral("volume"), (int)(pNotify->fMasterVolume * 100));
|
||||||
np.set<bool>(QStringLiteral("muted"), pNotify->bMuted);
|
np.set<bool>(QStringLiteral("muted"), pNotify->bMuted);
|
||||||
|
@ -433,8 +434,7 @@ bool SystemvolumePlugin::receivePacket(const NetworkPacket &np)
|
||||||
// get current sink's device ID
|
// get current sink's device ID
|
||||||
QString qDefaultId = QString::fromWCharArray(defaultId);
|
QString qDefaultId = QString::fromWCharArray(defaultId);
|
||||||
QString currentDeviceId = idToNameMap.key(name);
|
QString currentDeviceId = idToNameMap.key(name);
|
||||||
|
if (qDefaultId != currentDeviceId) {
|
||||||
if ((bool)qDefaultId.compare(currentDeviceId)) {
|
|
||||||
setDefaultAudioPlaybackDevice(name, np.get<bool>(QStringLiteral("enabled")));
|
setDefaultAudioPlaybackDevice(name, np.get<bool>(QStringLiteral("enabled")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue