Keep mute state from getting out of sync with reality
This commit is contained in:
		
							parent
							
								
									20cb8b1e0f
								
							
						
					
					
						commit
						ad6d781c1a
					
				
					 2 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -35,6 +35,9 @@ void AChannel::setVolume(long value) {
 | 
				
			||||||
bool AChannel::isMuted() {
 | 
					bool AChannel::isMuted() {
 | 
				
			||||||
  int val;
 | 
					  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);
 | 
					  snd_mixer_selem_get_playback_switch(aItem->aElem, (SNDCHID_T) id, &val);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (! (bool) val);
 | 
					  return (! (bool) val);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -464,8 +464,8 @@ void Mixer::setVolume(int button, int volume)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Mixer::toggleMute(int button)
 | 
					void Mixer::toggleMute(int button)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  mVolumeMute[button] = !mVolumeMute[button];
 | 
					 | 
				
			||||||
  aMixer->itemToggleMute(button);
 | 
					  aMixer->itemToggleMute(button);
 | 
				
			||||||
 | 
					  mVolumeMute[button] = aMixer->itemIsMuted(button);
 | 
				
			||||||
  setButtonType(button);
 | 
					  setButtonType(button);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue