Keep mute state from getting out of sync with reality
This commit is contained in:
parent
20cb8b1e0f
commit
ad6d781c1a
|
@ -35,6 +35,9 @@ void AChannel::setVolume(long value) {
|
|||
bool AChannel::isMuted() {
|
||||
int val;
|
||||
|
||||
if (!snd_mixer_selem_has_playback_switch(aItem->aElem)) {
|
||||
return (false); /* can't be muted? isn't muted. */
|
||||
}
|
||||
snd_mixer_selem_get_playback_switch(aItem->aElem, (SNDCHID_T) id, &val);
|
||||
|
||||
return (! (bool) val);
|
||||
|
|
|
@ -464,8 +464,8 @@ void Mixer::setVolume(int button, int volume)
|
|||
|
||||
void Mixer::toggleMute(int button)
|
||||
{
|
||||
mVolumeMute[button] = !mVolumeMute[button];
|
||||
aMixer->itemToggleMute(button);
|
||||
mVolumeMute[button] = aMixer->itemIsMuted(button);
|
||||
setButtonType(button);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue