12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #ifndef SONG_H
- #define SONG_H
-
- #include <QObject>
- #include <QString>
- #include <QTime>
- #include <QUrl>
- #include <QNetworkAccessManager>
- #include <QNetworkReply>
- #include <QNetworkRequest>
- #include <QPixmap>
-
- class Song : public QObject
- {
- Q_OBJECT
- public:
- explicit Song(QObject *parent = 0);
-
- QString getArtist() const;
- QString getTitle() const;
- QUrl getCoverUrl() const;
- int getDuration() const;
-
- signals:
- void coverDownloaded(QPixmap);
-
- public slots:
- void setArtist(QString a);
- void setTitle(QString t);
- void setCoverUrl(QUrl u);
- void setDuration(int d);
-
- void downloadCover();
-
- void setNetworkManager(QNetworkAccessManager* m);
-
- private slots:
- void onCoverFinished();
- void onCoverError(QNetworkReply::NetworkError);
-
- private:
- QString artist;
- QString title;
- QUrl coverUrl;
- int duration;
- QPixmap cover;
-
- QNetworkAccessManager* mgr;
- int tries;
- };
-
- #endif // SONG_H
|