Commit ae7ead01 authored by Andreas Traczyk's avatar Andreas Traczyk

call recording: enable recording ui

- provides toggle for 'always recording'
- provides toggle for 'record preview'
- provides slider to control recording quality

Change-Id: I33180397d4795f7aa6998570ec43b7382ff9f481
parent 01da004a
......@@ -772,7 +772,13 @@ void SettingsWidget::setConnections()
// audio / visual settings
connect(ui->recordPathButton, &QPushButton::clicked, this, &SettingsWidget::openRecordFolderSlot);
connect(ui->alwaysRecordingCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::slotAlwaysRecordingClicked);
connect(ui->recordPreviewCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::slotRecordPreviewClicked);
connect(ui->recordPathButton, &QAbstractButton::clicked, this, &SettingsWidget::openRecordFolderSlot);
connect(ui->recordQualitySlider, &QAbstractSlider::valueChanged, this, &SettingsWidget::slotRecordQualityChanged);
connect(ui->hardwareAccelCheckBox, &QAbstractButton::clicked, this, &SettingsWidget::slotSetHardwareAccel);
}
......@@ -795,7 +801,17 @@ void SettingsWidget::populateGeneralSettings()
auto notifs = settings.value(SettingsKey::enableNotifications).toBool();
ui->notificationCheckBox->setChecked(notifs);
//recordings
// recording
auto alwaysRecord = LRCInstance::avModel().getAlwaysRecord();
ui->alwaysRecordingCheckBox->setChecked(alwaysRecord);
auto recordPreview = LRCInstance::avModel().getRecordPreview();
ui->recordPreviewCheckBox->setChecked(recordPreview);
auto recordQuality = LRCInstance::avModel().getRecordQuality();
ui->recordQualityValueLabel->setText(QString::number(recordQuality / 1000) + " MB/s");
ui->recordQualitySlider->setValue(recordQuality);
if (LRCInstance::avModel().getRecordPath().empty()) {
QString recordPath = QDir::toNativeSeparators(
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
......@@ -805,6 +821,7 @@ void SettingsWidget::populateGeneralSettings()
Utils::setElidedText(ui->recordPathButton,
QString::fromStdString(LRCInstance::avModel().getRecordPath()));
// updates
#ifdef Q_OS_WIN
ui->autoUpdateCheckBox->setChecked(settings.value(SettingsKey::autoUpdate).toBool());
#endif
......@@ -867,7 +884,23 @@ void SettingsWidget::openRecordFolderSlot()
}
}
// ************************* Audio/Visual Settings *************************
void SettingsWidget::slotAlwaysRecordingClicked(bool state)
{
LRCInstance::avModel().setAlwaysRecord(state);
}
void SettingsWidget::slotRecordPreviewClicked(bool state)
{
LRCInstance::avModel().setRecordPreview(state);
}
void SettingsWidget::slotRecordQualityChanged(int value)
{
ui->recordQualityValueLabel->setText(QString::number(value / 1000) + " MB/s");
LRCInstance::avModel().setRecordQuality(value);
}
// ************************* Audio/Visual Settings ************recordQuality*************
void SettingsWidget::populateAVSettings()
{
......
......@@ -115,7 +115,7 @@ private slots:
void verifyRegisteredNameSlot();
void beforeNameLookup();
void receiveRegNameSlot(const std::string& accountID, lrc::api::account::LookupStatus status,
const std::string& address, const std::string& name);
const std::string& address, const std::string& name);
void slotRegisterName();
void setAccEnableSlot(int state);
void delAccountSlot();
......@@ -131,6 +131,9 @@ private slots:
void slotSetClosedOrMin(bool state);
void openDownloadFolderSlot();
void openRecordFolderSlot();
void slotAlwaysRecordingClicked(bool state);
void slotRecordPreviewClicked(bool state);
void slotRecordQualityChanged(int value);
void slotSetUpdateAutomatic(bool state);
void outputDevIndexChangedSlot(int index);
void inputdevIndexChangedSlot(int index);
......
......@@ -753,7 +753,7 @@
<item>
<widget class="QLabel" name="label_2">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="font">
<font>
......@@ -789,6 +789,212 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_18">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="ToggleSwitch" name="alwaysRecordingCheckBox" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Toggle automatic updates</string>
</property>
<property name="text" stdset="0">
<string>Always record calls</string>
</property>
<property name="checked" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_19">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="ToggleSwitch" name="recordPreviewCheckBox" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Toggle automatic updates</string>
</property>
<property name="text" stdset="0">
<string>Record preview video for a call</string>
</property>
<property name="checked" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_20">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_8">
<property name="enabled">
<bool>true</bool>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Quality</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_26">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_33">
<property name="spacing">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer_38">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="recordQualityValueLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>VALUE</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_37">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QSlider" name="recordQualitySlider">
<property name="minimumSize">
<size>
<width>320</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>30</height>
</size>
</property>
<property name="maximum">
<number>50000</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="pageStep">
<number>500</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBothSides</enum>
</property>
<property name="tickInterval">
<number>5000</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_29">
<property name="leftMargin">
......@@ -800,7 +1006,7 @@
<item>
<widget class="QLabel" name="label_5">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="font">
<font>
......@@ -831,7 +1037,7 @@
<item>
<widget class="QPushButton" name="recordPathButton">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
......
......@@ -43,8 +43,6 @@ VideoOverlay::VideoOverlay(QWidget* parent) :
ui->onHoldLabel->setVisible(false);
ui->recButton->setVisible(false);
ui->transferCallButton->setVisible(false);
ui->transferCallButton->setCheckable(true);
......
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