Miam-Player  0.8.0
A nice music player
coverartprovider.h
Go to the documentation of this file.
1 #ifndef COVERARTPROVIDER_H
2 #define COVERARTPROVIDER_H
3 
4 #include <QNetworkReply>
5 #include <QObject>
6 #include <QUrl>
7 
9 
16 {
17  Q_OBJECT
18 private:
19  Q_ENUMS(Fetch_Operations)
20  Q_ENUMS(ProviderType)
21 
22 protected:
23  QNetworkAccessManager *_manager;
24 
25 public:
26  enum Fetch_Operations : int
27  {
28  FO_GetReleases = 0,
29  FO_DownloadCover = 1,
30  FO_Search = 2
31  };
32 
33  enum ProviderType : int
34  {
35  PT_MusicBrainz = 0,
36  PT_Amazon = 1,
37  PT_Discogs = 2,
38  PT_LastFM = 3
39  };
40 
41  explicit CoverArtProvider(QNetworkAccessManager *manager) : QObject(manager), _manager(manager) {}
42 
43  virtual QUrl query(const QString &artist, const QString &album) = 0;
44 
45  virtual QUrl album(const QString &) = 0;
46 
47  virtual ProviderType type() = 0;
48 
49 public slots:
50  virtual void dispatchReply(QNetworkReply *reply) = 0;
51 
52 signals:
53  void aboutToCreateCover(const QString &album, const QByteArray &coverByteArray);
54 };
55 
56 #endif // COVERARTPROVIDER_H
QNetworkAccessManager * _manager
Definition: coverartprovider.h:23
#define MIAMCOVERFETCHER_LIBRARY
Definition: miamcoverfetcher_global.hpp:8
CoverArtProvider(QNetworkAccessManager *manager)
Definition: coverartprovider.h:41
ProviderType
Definition: coverartprovider.h:33
Fetch_Operations
Definition: coverartprovider.h:26
The CoverArtProvider class is an abstract class for registering various webservices.
Definition: coverartprovider.h:15