KMix: fixed setMute() function on PulseAudio mixer.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/19/head
Michele Calgaro 5 years ago
parent b06d352d14
commit bc9049aa6f
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -684,22 +684,25 @@ void Mixer::decreaseVolume(int deviceidx, int percentage)
} }
// @dcop // @dcop
void Mixer::setMute( int deviceidx, bool on ) void Mixer::setMute(int deviceidx, bool on)
{ {
MixDevice *mixdev= mixDeviceByType( deviceidx ); MixDevice *mixdev= mixDeviceByType(deviceidx);
if (!mixdev) return; if (!mixdev)
{
mixdev->setMuted( on ); return;
}
_mixerBackend->writeVolumeToHW(deviceidx, mixdev->getVolume() ); mixdev->setMuted(on);
commitVolumeChange(mixdev);
} }
// @dcop only // @dcop only
void Mixer::setMasterMute( bool on ) void Mixer::setMasterMute(bool on)
{ {
MixDevice *master = masterDevice(); MixDevice *md = masterDevice();
if (master != 0 ) { if (md)
setMute( master->num(), on ); {
setMute(md->num(), on);
} }
} }
@ -757,10 +760,10 @@ bool Mixer::isRecordSource( int deviceidx )
return mixdev->isRecSource(); return mixdev->isRecSource();
} }
/// @DCOP WHAT DOES THIS METHOD?!?!? // @dcop
bool Mixer::isAvailableDevice( int deviceidx ) bool Mixer::isAvailableDevice( int deviceidx )
{ {
return mixDeviceByType( deviceidx ); return (mixDeviceByType(deviceidx) != NULL);
} }
#include "mixer.moc" #include "mixer.moc"

Loading…
Cancel
Save