diff options
Diffstat (limited to 'src/SinkInputWindow.cc')
-rw-r--r-- | src/SinkInputWindow.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/SinkInputWindow.cc b/src/SinkInputWindow.cc index 5b2365d..784cb90 100644 --- a/src/SinkInputWindow.cc +++ b/src/SinkInputWindow.cc @@ -23,7 +23,8 @@ SinkInputWindow::SinkInputWindow(BaseObjectType* cobject, const Glib::RefPtr<Gno volumeResetButton(NULL), volumeMuteButton(NULL), killButton(NULL), - volumeScale(NULL) { + volumeScale(NULL), + scaleEnabled(true) { refGlade->get_widget("nameLabel", nameLabel); refGlade->get_widget("indexLabel", indexLabel); @@ -92,7 +93,9 @@ void SinkInputWindow::updateInfo(const SinkInputInfo &i) { percent = pa_volume_to_user(i.volume) * 100; db = pa_volume_to_dB(i.volume); + scaleEnabled = false; volumeScale->set_value(percent); + scaleEnabled = true; if (db != PA_DECIBEL_MININFTY) snprintf(t, sizeof(t), "%0.0f%% (%0.2fdB)", percent, db); else @@ -130,7 +133,8 @@ void SinkInputWindow::onToClientButton() { } void SinkInputWindow::onVolumeScaleValueChanged() { - serverInfoManager->setSinkInputVolume(index, pa_volume_from_user(volumeScale->get_value()/100)); + if (scaleEnabled) + serverInfoManager->setSinkInputVolume(index, pa_volume_from_user(volumeScale->get_value()/100)); } void SinkInputWindow::onVolumeResetButton() { |