1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Cleanup duplicate slider slots in AVForm

See #2528
This commit is contained in:
tux3 2015-11-08 13:40:32 +01:00
parent b6d752fd4b
commit a8746e6857
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
2 changed files with 8 additions and 18 deletions

View File

@ -64,8 +64,8 @@ AVForm::AVForm() :
connect(bodyUI->filterAudio, &QCheckBox::toggled, this, &AVForm::onFilterAudioToggled);
connect(bodyUI->rescanButton, &QPushButton::clicked, this, [=](){getAudioInDevices(); getAudioOutDevices();});
connect(bodyUI->playbackSlider, &QSlider::valueChanged, this, &AVForm::onPlaybackSliderReleased);
connect(bodyUI->microphoneSlider, &QSlider::valueChanged, this, &AVForm::onMicrophoneSliderReleased);
connect(bodyUI->playbackSlider, &QSlider::valueChanged, this, &AVForm::onPlaybackValueChanged);
connect(bodyUI->microphoneSlider, &QSlider::valueChanged, this, &AVForm::onMicrophoneValueChanged);
bodyUI->playbackSlider->setValue(Settings::getInstance().getOutVolume());
bodyUI->microphoneSlider->setValue(Settings::getInstance().getInVolume());
@ -344,26 +344,18 @@ void AVForm::onFilterAudioToggled(bool filterAudio)
Settings::getInstance().setFilterAudio(filterAudio);
}
void AVForm::on_playbackSlider_valueChanged(int value)
void AVForm::onPlaybackValueChanged(int value)
{
Audio::getInstance().setOutputVolume(value / 100.0);
Settings::getInstance().setOutVolume(bodyUI->playbackSlider->value());
bodyUI->playbackMax->setText(QString::number(value));
}
void AVForm::on_microphoneSlider_valueChanged(int value)
void AVForm::onMicrophoneValueChanged(int value)
{
Audio::getInstance().setInputVolume(value / 100.0);
bodyUI->microphoneMax->setText(QString::number(value));
}
void AVForm::onPlaybackSliderReleased()
{
Settings::getInstance().setOutVolume(bodyUI->playbackSlider->value());
}
void AVForm::onMicrophoneSliderReleased()
{
Settings::getInstance().setInVolume(bodyUI->microphoneSlider->value());
bodyUI->microphoneMax->setText(QString::number(value));
}
bool AVForm::eventFilter(QObject *o, QEvent *e)

View File

@ -57,10 +57,8 @@ private slots:
void onInDevChanged(QString deviceDescriptor);
void onOutDevChanged(QString deviceDescriptor);
void onFilterAudioToggled(bool filterAudio);
void on_playbackSlider_valueChanged(int value);
void on_microphoneSlider_valueChanged(int value);
void onPlaybackSliderReleased();
void onMicrophoneSliderReleased();
void onPlaybackValueChanged(int value);
void onMicrophoneValueChanged(int value);
// camera
void onVideoDevChanged(int index);