strawberry-audio-player-win.../src/settings/tidalsettingspage.h

72 lines
1.7 KiB
C
Raw Normal View History

2018-08-09 18:10:03 +02:00
/*
* Strawberry Music Player
* Copyright 2018, Jonas Kvinge <jonas@jkvinge.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/>.
*
*/
#ifndef TIDALSETTINGSPAGE_H
#define TIDALSETTINGSPAGE_H
2020-02-12 00:07:05 +01:00
#include "config.h"
2018-08-09 18:10:03 +02:00
#include <QObject>
#include <QString>
#include "settings/settingspage.h"
2020-02-09 02:29:35 +01:00
class QEvent;
2018-08-09 18:10:03 +02:00
class TidalService;
2020-02-09 02:29:35 +01:00
class SettingsDialog;
2018-08-09 18:10:03 +02:00
class Ui_TidalSettingsPage;
class TidalSettingsPage : public SettingsPage {
Q_OBJECT
public:
explicit TidalSettingsPage(SettingsDialog* parent = nullptr);
~TidalSettingsPage();
static const char *kSettingsGroup;
enum StreamUrlMethod {
StreamUrlMethod_StreamUrl,
StreamUrlMethod_UrlPostPaywall,
StreamUrlMethod_PlaybackInfoPostPaywall,
};
2018-08-09 18:10:03 +02:00
void Load();
void Save();
bool eventFilter(QObject *object, QEvent *event);
2019-05-13 23:49:09 +02:00
signals:
void Login();
2019-06-20 20:49:02 +02:00
void Login(const QString &api_token, const QString &username, const QString &password);
2018-09-10 21:23:50 +02:00
2018-08-09 18:10:03 +02:00
private slots:
2019-06-20 20:49:02 +02:00
void OAuthClicked(const bool enabled);
2018-08-09 18:10:03 +02:00
void LoginClicked();
void LogoutClicked();
void LoginSuccess();
2019-06-20 20:49:02 +02:00
void LoginFailure(const QString &failure_reason);
2018-08-09 18:10:03 +02:00
private:
Ui_TidalSettingsPage* ui_;
TidalService *service_;
};
#endif