From 0c67831b4e6bce1c59588737bc383a4545ac2561 Mon Sep 17 00:00:00 2001 From: Jason Papakostas Date: Thu, 24 Mar 2016 05:38:22 -0500 Subject: [PATCH] fix sound sliders not saving when moved by keyboard closes #2866 --- src/widget/form/settings/avform.cpp | 22 ++++++---------------- src/widget/form/settings/avform.h | 2 -- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/widget/form/settings/avform.cpp b/src/widget/form/settings/avform.cpp index 98603e922..a3e612c7f 100644 --- a/src/widget/form/settings/avform.cpp +++ b/src/widget/form/settings/avform.cpp @@ -63,14 +63,10 @@ AVForm::AVForm() : bodyUI->playbackSlider->setTracking(false); bodyUI->playbackSlider->installEventFilter(this); - connect(bodyUI->playbackSlider, &QSlider::sliderMoved, - this, &AVForm::onPlaybackSliderMoved); connect(bodyUI->playbackSlider, &QSlider::valueChanged, this, &AVForm::onPlaybackValueChanged); bodyUI->microphoneSlider->setTracking(false); bodyUI->microphoneSlider->installEventFilter(this); - connect(bodyUI->microphoneSlider, &QSlider::sliderMoved, - this, &AVForm::onMicrophoneSliderMoved); connect(bodyUI->microphoneSlider, &QSlider::valueChanged, this, &AVForm::onMicrophoneValueChanged); @@ -402,8 +398,10 @@ void AVForm::onFilterAudioToggled(bool filterAudio) Settings::getInstance().setFilterAudio(filterAudio); } -void AVForm::onPlaybackSliderMoved(int value) +void AVForm::onPlaybackValueChanged(int value) { + Settings::getInstance().setOutVolume(value); + Audio& audio = Audio::getInstance(); if (audio.isOutputReady()) { const qreal percentage = value / 100.0; @@ -414,20 +412,12 @@ void AVForm::onPlaybackSliderMoved(int value) } } -void AVForm::onPlaybackValueChanged(int value) -{ - Settings::getInstance().setOutVolume(value); -} - -void AVForm::onMicrophoneSliderMoved(int value) -{ - const qreal percentage = value / 100.0; - Audio::getInstance().setInputVolume(percentage); -} - void AVForm::onMicrophoneValueChanged(int value) { Settings::getInstance().setInVolume(value); + + const qreal percentage = value / 100.0; + Audio::getInstance().setInputVolume(percentage); } void AVForm::createVideoSurface() diff --git a/src/widget/form/settings/avform.h b/src/widget/form/settings/avform.h index 56e627f38..f02af4fce 100644 --- a/src/widget/form/settings/avform.h +++ b/src/widget/form/settings/avform.h @@ -57,9 +57,7 @@ private slots: void onInDevChanged(QString deviceDescriptor); void onOutDevChanged(QString deviceDescriptor); void onFilterAudioToggled(bool filterAudio); - void onPlaybackSliderMoved(int value); void onPlaybackValueChanged(int value); - void onMicrophoneSliderMoved(int value); void onMicrophoneValueChanged(int value); // camera