-
Notifications
You must be signed in to change notification settings - Fork 13
/
musiccollector.h
59 lines (41 loc) · 1.13 KB
/
musiccollector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef MUSICCOLLECTOR_H
#define MUSICCOLLECTOR_H
#include <QObject>
#include <QPointer>
class QDeclarativeView;
class QNetworkAccessManager;
class QNetworkReply;
class MusicFetcher;
namespace QJson { class Parser; }
class MusicCollector : public QObject
{
Q_OBJECT
Q_PROPERTY(bool loading READ loading NOTIFY loadingChanged)
public:
explicit MusicCollector(QDeclarativeView* parent);
~MusicCollector();
Q_INVOKABLE bool isCollected(const QString& id) const;
Q_INVOKABLE void collectMusic(const QString& id);
Q_INVOKABLE void removeCollection(const QString& id);
Q_INVOKABLE void refresh();
Q_INVOKABLE void loadList();
Q_INVOKABLE void loadFromFetcher(MusicFetcher* fetcher);
bool loading() const;
signals:
void dataChanged();
void loadingChanged();
private slots:
void requestFinished();
private:
void checkNAM();
private:
QDeclarativeView* caller;
QNetworkAccessManager* manager;
QJson::Parser* parser;
QPointer<QNetworkReply> currentReply;
int playlistId;
QList<int> idList;
int nextOperation;
QString operatingId;
};
#endif // MUSICCOLLECTOR_H