Qmmp
playlistdownloader.h
1 /***************************************************************************
2  * Copyright (C) 2012-2018 by Ilya Kotov *
3  * forkotov02@ya.ru *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #ifndef PLAYLISTDOWNLOADER_H
22 #define PLAYLISTDOWNLOADER_H
23 
24 #include <QObject>
25 #include <QUrl>
26 #include <QPointer>
27 #include "playlistmodel.h"
28 #include "qmmpui_export.h"
29 
30 class QNetworkAccessManager;
31 class QNetworkReply;
32 
36 class QMMPUI_EXPORT PlayListDownloader : public QObject
37 {
38  Q_OBJECT
39 public:
43  explicit PlayListDownloader(QObject *parent = 0);
44 
45 signals:
51  void finished(bool ok, const QString &message = QString());
52 
53 public slots:
59  void start(const QUrl &url, PlayListModel *model);
60 
61 private slots:
62  void readResponse(QNetworkReply *reply);
63 
64 private:
65  QNetworkAccessManager *m_manager;
66  QUrl m_redirect_url, m_url;
67  QNetworkReply *m_getReply;
68  QByteArray m_ua;
69  QPointer<PlayListModel> m_model;
70 };
71 
72 #endif // PLAYLISTDOWNLOADER_H
The PlayListDownloader class downloads playlist from remote URL and extracts tracks.
Definition: playlistdownloader.h:36
The PlayListModel class provides a data model for the playlist.
Definition: playlistmodel.h:103