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

73 lines
1.8 KiB
C
Raw Permalink Normal View History

2020-04-13 19:04:06 +02:00
/*
* Strawberry Music Player
2021-03-20 21:14:47 +01:00
* Copyright 2018-2021, Jonas Kvinge <jonas@jkvinge.net>
2020-04-13 19:04:06 +02:00
*
* 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
#include "config.h"
#include <QObject>
#include <QString>
#include "core/shared_ptr.h"
2020-04-13 19:04:06 +02:00
#include "settings/settingspage.h"
class QEvent;
class TidalService;
class SettingsDialog;
class Ui_TidalSettingsPage;
class TidalSettingsPage : public SettingsPage {
Q_OBJECT
public:
2021-06-20 19:04:08 +02:00
explicit TidalSettingsPage(SettingsDialog *dialog, QWidget *parent = nullptr);
2020-06-15 21:55:05 +02:00
~TidalSettingsPage() override;
2020-04-13 19:04:06 +02:00
static const char *kSettingsGroup;
2023-02-18 14:09:27 +01:00
enum class StreamUrlMethod {
StreamUrl,
UrlPostPaywall,
PlaybackInfoPostPaywall
2020-04-13 19:04:06 +02:00
};
2020-06-15 21:55:05 +02:00
void Load() override;
void Save() override;
2020-04-13 19:04:06 +02:00
2020-06-15 21:55:05 +02:00
bool eventFilter(QObject *object, QEvent *event) override;
2020-04-13 19:04:06 +02:00
signals:
void Authorize(const QString &client_id);
void Login(const QString &api_token, const QString &username, const QString &password);
2020-04-13 19:04:06 +02:00
private slots:
void OAuthClicked(const bool enabled);
void LoginClicked();
void LogoutClicked();
void LoginSuccess();
void LoginFailure(const QString &failure_reason);
private:
2021-06-12 20:53:23 +02:00
Ui_TidalSettingsPage *ui_;
SharedPtr<TidalService> service_;
2020-04-13 19:04:06 +02:00
};
2020-06-15 21:55:05 +02:00
#endif // TIDALSETTINGSPAGE_H