Quality options for Streamlink (#103)

* added quality options for streamlink

* wrong default value
This commit is contained in:
Confuseh
2017-09-11 22:35:59 +01:00
committed by fourtf
parent 7db45aa7f2
commit 6ec8f6e032
8 changed files with 188 additions and 10 deletions
+29 -1
View File
@@ -313,7 +313,14 @@ void SettingsDialog::addTabs()
auto scroll = new QSlider(Qt::Horizontal);
form->addRow("Mouse scroll speed:", scroll);
form->addRow("Streamlink Path", createLineEdit(settings.streamlinkPath));
form->addRow("Streamlink path:", createLineEdit(settings.streamlinkPath));
form->addRow(this->createCombobox(
"Preferred quality:", settings.preferredQuality,
{"Choose", "Source", "High", "Medium", "Low", "Audio only"},
[](const QString &newValue, pajlada::Settings::Setting<std::string> &setting) {
setting = newValue.toStdString();
})
);
// v->addWidget(scroll);
// v->addStretch(1);
@@ -586,6 +593,27 @@ QHBoxLayout *SettingsDialog::createCombobox(
return box;
}
QHBoxLayout *SettingsDialog::createCombobox(
const QString &title, pajlada::Settings::Setting<std::string> &setting, QStringList items,
std::function<void(QString, pajlada::Settings::Setting<std::string> &)> cb)
{
auto box = new QHBoxLayout();
auto label = new QLabel(title);
auto widget = new QComboBox();
widget->addItems(items);
widget->setCurrentText(QString::fromStdString(setting.getValue()));
QObject::connect(widget, &QComboBox::currentTextChanged, this,
[&setting, cb](const QString &newValue) {
cb(newValue, setting); //
});
box->addWidget(label);
box->addWidget(widget);
return box;
}
QLineEdit *SettingsDialog::createLineEdit(pajlada::Settings::Setting<std::string> &setting)
{
auto widget = new QLineEdit(QString::fromStdString(setting.getValue()));