2018-02-27 18:06:05 +01:00
|
|
|
/*
|
|
|
|
* Strawberry Music Player
|
|
|
|
* Copyright 2013, Jonas Kvinge <jonas@strawbs.net>
|
|
|
|
*
|
|
|
|
* Strawberry 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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Strawberry 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 Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
2018-08-09 18:39:44 +02:00
|
|
|
*
|
2018-02-27 18:06:05 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BACKENDSETTINGSPAGE_H
|
|
|
|
#define BACKENDSETTINGSPAGE_H
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2018-05-01 00:41:33 +02:00
|
|
|
#include <QObject>
|
|
|
|
#include <QVariant>
|
2018-02-27 18:06:05 +01:00
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
#include "engine/enginetype.h"
|
2018-04-05 21:40:05 +02:00
|
|
|
#include "dialogs/errordialog.h"
|
2018-05-01 00:41:33 +02:00
|
|
|
#include "settingspage.h"
|
2018-06-28 01:15:32 +02:00
|
|
|
|
|
|
|
#include "core/application.h"
|
|
|
|
#include "core/player.h"
|
2020-02-09 02:29:35 +01:00
|
|
|
#include "engine/engine_fwd.h"
|
2018-04-05 21:40:05 +02:00
|
|
|
|
2018-05-01 00:41:33 +02:00
|
|
|
class SettingsDialog;
|
2018-02-27 18:06:05 +01:00
|
|
|
class Ui_BackendSettingsPage;
|
|
|
|
|
|
|
|
class BackendSettingsPage : public SettingsPage {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-04-07 16:49:15 +02:00
|
|
|
explicit BackendSettingsPage(SettingsDialog *dialog);
|
2020-06-15 21:55:05 +02:00
|
|
|
~BackendSettingsPage() override;
|
2018-10-02 00:38:52 +02:00
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
static const char *kSettingsGroup;
|
2020-10-07 20:29:26 +02:00
|
|
|
static const qint64 kDefaultBufferDuration;
|
|
|
|
static const double kDefaultBufferLowWatermark;
|
|
|
|
static const double kDefaultBufferHighWatermark;
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2020-06-15 21:55:05 +02:00
|
|
|
void Load() override;
|
|
|
|
void Save() override;
|
|
|
|
void Cancel() override;
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2018-06-28 01:15:32 +02:00
|
|
|
EngineBase *engine() const { return dialog()->app()->player()->engine(); }
|
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
private slots:
|
2020-10-07 20:29:26 +02:00
|
|
|
void EngineChanged(const int index);
|
|
|
|
void OutputChanged(const int index);
|
|
|
|
void DeviceSelectionChanged(const int index);
|
2018-02-27 18:06:05 +01:00
|
|
|
void DeviceStringChanged();
|
2020-10-07 20:29:26 +02:00
|
|
|
void RgPreampChanged(const int value);
|
|
|
|
void radiobutton_alsa_hw_clicked(const bool checked);
|
|
|
|
void radiobutton_alsa_plughw_clicked(const bool checked);
|
2019-01-09 20:02:40 +01:00
|
|
|
void FadingOptionsChanged();
|
2020-10-07 20:29:26 +02:00
|
|
|
void BufferDefaults();
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
private:
|
2019-03-09 16:48:45 +01:00
|
|
|
#ifdef HAVE_ALSA
|
2018-09-21 23:29:00 +02:00
|
|
|
enum alsa_plugin {
|
|
|
|
alsa_hw = 1,
|
|
|
|
alsa_plughw = 2
|
|
|
|
};
|
2019-03-09 16:48:45 +01:00
|
|
|
#endif
|
2018-09-21 23:29:00 +02:00
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
Ui_BackendSettingsPage *ui_;
|
2018-07-01 01:29:52 +02:00
|
|
|
|
2018-06-28 01:15:32 +02:00
|
|
|
bool EngineInitialised();
|
2018-07-01 01:29:52 +02:00
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
void EngineChanged(Engine::EngineType enginetype);
|
2018-04-05 21:40:05 +02:00
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
void Load_Engine(Engine::EngineType enginetype);
|
2018-06-28 01:15:32 +02:00
|
|
|
void Load_Output(QString output, QVariant device);
|
2020-10-07 20:29:26 +02:00
|
|
|
void Load_Device(const QString &output, const QVariant &device);
|
2019-03-09 16:48:45 +01:00
|
|
|
#ifdef HAVE_ALSA
|
2020-10-07 20:29:26 +02:00
|
|
|
void SwitchALSADevices(const alsa_plugin alsaplugin);
|
2019-03-09 16:48:45 +01:00
|
|
|
#endif
|
2018-07-01 01:29:52 +02:00
|
|
|
|
2018-06-28 01:15:32 +02:00
|
|
|
bool configloaded_;
|
|
|
|
bool engineloaded_;
|
2018-07-01 01:29:52 +02:00
|
|
|
ErrorDialog errordialog_;
|
|
|
|
|
|
|
|
Engine::EngineType enginetype_current_;
|
|
|
|
QString output_current_;
|
|
|
|
QVariant device_current_;
|
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BACKENDSETTINGSPAGE_H
|