Commit fb6e9740 authored by Andreas Traczyk's avatar Andreas Traczyk

recording: improve recording quality slider

Change-Id: Ib4857a27d5e1d1e07e2ab0d11d1ebf6558276135
parent d017c8ae
......@@ -778,13 +778,19 @@ void SettingsWidget::setConnections()
connect(ui->recordPathButton, &QAbstractButton::clicked, this, &SettingsWidget::openRecordFolderSlot);
connect(ui->recordQualitySlider, &QAbstractSlider::valueChanged, this, &SettingsWidget::slotRecordQualityChanged);
connect(ui->recordQualitySlider, &QAbstractSlider::valueChanged, this, &SettingsWidget::slotRecordQualitySliderValueChanged);
connect(ui->recordQualitySlider, &QAbstractSlider::sliderReleased, this, &SettingsWidget::slotRecordQualitySliderSliderReleased);
connect(ui->hardwareAccelCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::slotSetHardwareAccel);
}
// ************************* General Settings *************************
QString getRecordQualityString(int value)
{
return value ? QString::number(static_cast<float>(value) / 100, 'f', 1) + " Mbps" : "Default";
}
void SettingsWidget::populateGeneralSettings()
{
QSettings settings("jami.net", "Jami");
......@@ -809,7 +815,7 @@ void SettingsWidget::populateGeneralSettings()
ui->recordPreviewCheckBox->setChecked(recordPreview);
auto recordQuality = LRCInstance::avModel().getRecordQuality();
ui->recordQualityValueLabel->setText(QString::number(recordQuality / 1000) + " MB/s");
ui->recordQualityValueLabel->setText(getRecordQualityString(recordQuality));
ui->recordQualitySlider->setValue(recordQuality);
if (LRCInstance::avModel().getRecordPath().empty()) {
......@@ -894,10 +900,16 @@ void SettingsWidget::slotRecordPreviewClicked(bool state)
LRCInstance::avModel().setRecordPreview(state);
}
void SettingsWidget::slotRecordQualityChanged(int value)
void SettingsWidget::slotRecordQualitySliderValueChanged(int value)
{
ui->recordQualityValueLabel->setText(getRecordQualityString(value));
}
void SettingsWidget::slotRecordQualitySliderSliderReleased()
{
ui->recordQualityValueLabel->setText(QString::number(value / 1000) + " MB/s");
LRCInstance::avModel().setRecordQuality(value);
auto value = ui->recordQualitySlider->value();
// 0 - 500 -> 0 - 50000
LRCInstance::avModel().setRecordQuality(value * 100);
}
// ************************* Audio/Visual Settings ************recordQuality*************
......
......@@ -133,7 +133,8 @@ private slots:
void openRecordFolderSlot();
void slotAlwaysRecordingClicked(bool state);
void slotRecordPreviewClicked(bool state);
void slotRecordQualityChanged(int value);
void slotRecordQualitySliderValueChanged(int value);
void slotRecordQualitySliderSliderReleased();
void slotSetUpdateAutomatic(bool state);
void outputDevIndexChangedSlot(int index);
void inputdevIndexChangedSlot(int index);
......
......@@ -971,13 +971,13 @@
</size>
</property>
<property name="maximum">
<number>50000</number>
<number>500</number>
</property>
<property name="singleStep">
<number>10</number>
<number>1</number>
</property>
<property name="pageStep">
<number>500</number>
<number>10</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
......@@ -989,7 +989,7 @@
<enum>QSlider::TicksBothSides</enum>
</property>
<property name="tickInterval">
<number>5000</number>
<number>50</number>
</property>
</widget>
</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment