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() ...@@ -778,13 +778,19 @@ void SettingsWidget::setConnections()
connect(ui->recordPathButton, &QAbstractButton::clicked, this, &SettingsWidget::openRecordFolderSlot); 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); connect(ui->hardwareAccelCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::slotSetHardwareAccel);
} }
// ************************* General Settings ************************* // ************************* General Settings *************************
QString getRecordQualityString(int value)
{
return value ? QString::number(static_cast<float>(value) / 100, 'f', 1) + " Mbps" : "Default";
}
void SettingsWidget::populateGeneralSettings() void SettingsWidget::populateGeneralSettings()
{ {
QSettings settings("jami.net", "Jami"); QSettings settings("jami.net", "Jami");
...@@ -809,7 +815,7 @@ void SettingsWidget::populateGeneralSettings() ...@@ -809,7 +815,7 @@ void SettingsWidget::populateGeneralSettings()
ui->recordPreviewCheckBox->setChecked(recordPreview); ui->recordPreviewCheckBox->setChecked(recordPreview);
auto recordQuality = LRCInstance::avModel().getRecordQuality(); auto recordQuality = LRCInstance::avModel().getRecordQuality();
ui->recordQualityValueLabel->setText(QString::number(recordQuality / 1000) + " MB/s"); ui->recordQualityValueLabel->setText(getRecordQualityString(recordQuality));
ui->recordQualitySlider->setValue(recordQuality); ui->recordQualitySlider->setValue(recordQuality);
if (LRCInstance::avModel().getRecordPath().empty()) { if (LRCInstance::avModel().getRecordPath().empty()) {
...@@ -894,10 +900,16 @@ void SettingsWidget::slotRecordPreviewClicked(bool state) ...@@ -894,10 +900,16 @@ void SettingsWidget::slotRecordPreviewClicked(bool state)
LRCInstance::avModel().setRecordPreview(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"); auto value = ui->recordQualitySlider->value();
LRCInstance::avModel().setRecordQuality(value); // 0 - 500 -> 0 - 50000
LRCInstance::avModel().setRecordQuality(value * 100);
} }
// ************************* Audio/Visual Settings ************recordQuality************* // ************************* Audio/Visual Settings ************recordQuality*************
......
...@@ -133,7 +133,8 @@ private slots: ...@@ -133,7 +133,8 @@ private slots:
void openRecordFolderSlot(); void openRecordFolderSlot();
void slotAlwaysRecordingClicked(bool state); void slotAlwaysRecordingClicked(bool state);
void slotRecordPreviewClicked(bool state); void slotRecordPreviewClicked(bool state);
void slotRecordQualityChanged(int value); void slotRecordQualitySliderValueChanged(int value);
void slotRecordQualitySliderSliderReleased();
void slotSetUpdateAutomatic(bool state); void slotSetUpdateAutomatic(bool state);
void outputDevIndexChangedSlot(int index); void outputDevIndexChangedSlot(int index);
void inputdevIndexChangedSlot(int index); void inputdevIndexChangedSlot(int index);
......
...@@ -971,13 +971,13 @@ ...@@ -971,13 +971,13 @@
</size> </size>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>50000</number> <number>500</number>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<number>10</number> <number>1</number>
</property> </property>
<property name="pageStep"> <property name="pageStep">
<number>500</number> <number>10</number>
</property> </property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
...@@ -989,7 +989,7 @@ ...@@ -989,7 +989,7 @@
<enum>QSlider::TicksBothSides</enum> <enum>QSlider::TicksBothSides</enum>
</property> </property>
<property name="tickInterval"> <property name="tickInterval">
<number>5000</number> <number>50</number>
</property> </property>
</widget> </widget>
</item> </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