From 7696ef13c13aea0da9acada8abb149967aaf8a90 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Tue, 3 Jan 2017 18:39:36 +0000 Subject: icecast plugin: added resampler and settings dialog git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6930 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Output/shout/settingsdialog.cpp | 64 +++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/plugins/Output/shout/settingsdialog.cpp (limited to 'src/plugins/Output/shout/settingsdialog.cpp') diff --git a/src/plugins/Output/shout/settingsdialog.cpp b/src/plugins/Output/shout/settingsdialog.cpp new file mode 100644 index 000000000..0e72144ea --- /dev/null +++ b/src/plugins/Output/shout/settingsdialog.cpp @@ -0,0 +1,64 @@ +/*************************************************************************** + * Copyright (C) 2017 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include +#include +#include "settingsdialog.h" +#include "ui_settingsdialog.h" + +SettingsDialog::SettingsDialog(QWidget *parent) : + QDialog(parent), + m_ui(new Ui::SettingsDialog) +{ + m_ui->setupUi(this); + setAttribute(Qt::WA_DeleteOnClose, true); + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("Shout"); + m_ui->hostLineEdit->setText(settings.value("host", "127.0.0.1").toString()); + m_ui->portSpinBox->setValue(settings.value("port", 8000).toInt()); + m_ui->mountPointLineEdit->setText(settings.value("mount", "qmmp.out").toString()); + m_ui->userLineEdit->setText(settings.value("user", "source").toString()); + m_ui->passwLineEdit->setText(settings.value("passw", "hackme").toString()); + m_ui->publicCheckBox->setChecked(settings.value("public", false).toBool()); + m_ui->qualitySpinBox->setValue(settings.value("vorbis_quality", 0.8).toDouble()); + m_ui->srateSpinBox->setValue(settings.value("sample_rate", 44100).toInt()); + settings.endGroup(); +} + +SettingsDialog::~SettingsDialog() +{ + delete m_ui; +} + +void SettingsDialog::accept() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("Shout"); + settings.setValue("host", m_ui->hostLineEdit->text()); + settings.setValue("port", m_ui->portSpinBox->value()); + settings.setValue("mount", m_ui->mountPointLineEdit->text()); + settings.setValue("user", m_ui->userLineEdit->text()); + settings.setValue("passw", m_ui->passwLineEdit->text()); + settings.setValue("public", m_ui->publicCheckBox->isChecked()); + settings.setValue("vorbis_quality", m_ui->qualitySpinBox->value()); + settings.setValue("sample_rate", m_ui->srateSpinBox->value()); + settings.endGroup(); + QDialog::accept(); +} -- cgit v1.2.3-13-gbd6f