Remove redundant check for old == new
Windows already does that for us and won't generate events in that case
This commit is contained in:
parent
e53e7bc600
commit
89dc4a8b76
1 changed files with 2 additions and 10 deletions
|
@ -417,22 +417,14 @@ bool SystemvolumePlugin::receivePacket(const NetworkPacket &np)
|
|||
HRESULT unregisterSuccess = sink.first->UnregisterControlChangeNotify(sink.second);
|
||||
|
||||
if (np.has(QStringLiteral("volume"))) {
|
||||
float currentVolume;
|
||||
sink.first->GetMasterVolumeLevelScalar(¤tVolume);
|
||||
float requestedVolume = (float)np.get<int>(QStringLiteral("volume"), 100) / 100;
|
||||
if (currentVolume != requestedVolume) {
|
||||
sinkList[name].first->SetMasterVolumeLevelScalar(requestedVolume, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (np.has(QStringLiteral("muted"))) {
|
||||
BOOL currentMuteStatus;
|
||||
sink.first->GetMute(¤tMuteStatus);
|
||||
BOOL requestedMuteStatus = np.get<bool>(QStringLiteral("muted"), false);
|
||||
if (currentMuteStatus != requestedMuteStatus) {
|
||||
sinkList[name].first->SetMute(requestedMuteStatus, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (np.has(QStringLiteral("enabled"))) {
|
||||
// get the current default device ID
|
||||
|
|
Loading…
Reference in a new issue