strawberry-audio-player-win.../src/lyrics/jsonlyricsprovider.h

51 lines
1.5 KiB
C
Raw Normal View History

2019-08-12 18:11:01 +02:00
/*
* Strawberry Music Player
2021-03-20 21:14:47 +01:00
* Copyright 2019-2021, Jonas Kvinge <jonas@jkvinge.net>
2019-08-12 18:11:01 +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 JSONLYRICSPROVIDER_H
#define JSONLYRICSPROVIDER_H
#include "config.h"
2020-02-09 02:29:35 +01:00
#include <QtGlobal>
2019-08-12 18:11:01 +02:00
#include <QObject>
#include <QList>
2019-08-12 18:11:01 +02:00
#include <QVariant>
#include <QString>
2020-02-09 02:29:35 +01:00
#include <QJsonObject>
2019-08-12 18:11:01 +02:00
#include "core/shared_ptr.h"
2019-08-12 18:11:01 +02:00
#include "lyricsprovider.h"
2021-08-12 23:00:10 +02:00
class NetworkAccessManager;
2019-08-12 18:11:01 +02:00
class QNetworkReply;
class JsonLyricsProvider : public LyricsProvider {
Q_OBJECT
public:
explicit JsonLyricsProvider(const QString &name, const bool enabled, const bool authentication_required, SharedPtr<NetworkAccessManager> network, QObject *parent = nullptr);
2021-08-12 23:00:10 +02:00
protected:
QByteArray ExtractData(QNetworkReply *reply);
QJsonObject ExtractJsonObj(const QByteArray &data);
QJsonObject ExtractJsonObj(QNetworkReply *reply);
2019-08-12 18:11:01 +02:00
};
#endif // JSONLYRICSPROVIDER_H