2020-05-08 18:35:36 +02:00
|
|
|
/*
|
|
|
|
* Strawberry Music Player
|
2021-03-20 21:14:47 +01:00
|
|
|
* Copyright 2018-2021, Jonas Kvinge <jonas@jkvinge.net>
|
2020-05-08 18:35:36 +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 CHARTLYRICSPROVIDER_H
|
|
|
|
#define CHARTLYRICSPROVIDER_H
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
2020-05-12 21:28:42 +02:00
|
|
|
#include <QList>
|
2020-05-08 18:35:36 +02:00
|
|
|
#include <QVariant>
|
|
|
|
#include <QString>
|
|
|
|
|
2023-07-21 05:55:24 +02:00
|
|
|
#include "core/shared_ptr.h"
|
2020-05-08 18:35:36 +02:00
|
|
|
#include "lyricsprovider.h"
|
|
|
|
#include "lyricsfetcher.h"
|
|
|
|
|
2020-05-12 21:28:42 +02:00
|
|
|
class QNetworkReply;
|
2020-12-09 18:39:37 +01:00
|
|
|
class NetworkAccessManager;
|
2020-05-12 21:28:42 +02:00
|
|
|
|
2020-05-08 18:35:36 +02:00
|
|
|
class ChartLyricsProvider : public LyricsProvider {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2023-07-21 05:55:24 +02:00
|
|
|
explicit ChartLyricsProvider(SharedPtr<NetworkAccessManager> network, QObject *parent = nullptr);
|
2020-06-15 21:55:05 +02:00
|
|
|
~ChartLyricsProvider() override;
|
2020-05-08 18:35:36 +02:00
|
|
|
|
2023-03-06 21:42:59 +01:00
|
|
|
bool StartSearch(const int id, const LyricsSearchRequest &request) override;
|
2021-10-30 02:21:29 +02:00
|
|
|
void CancelSearch(int id) override;
|
2020-05-08 18:35:36 +02:00
|
|
|
|
|
|
|
private:
|
2020-06-15 21:55:05 +02:00
|
|
|
void Error(const QString &error, const QVariant &debug = QVariant()) override;
|
2020-05-08 18:35:36 +02:00
|
|
|
|
|
|
|
private slots:
|
2023-03-06 21:42:59 +01:00
|
|
|
void HandleSearchReply(QNetworkReply *reply, const int id, const LyricsSearchRequest &request);
|
2020-05-08 18:35:36 +02:00
|
|
|
|
|
|
|
private:
|
2020-05-12 21:28:42 +02:00
|
|
|
QList<QNetworkReply*> replies_;
|
2020-05-08 18:35:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CHARTLYRICSPROVIDER_H
|