Miam-Player  0.8.0
A nice music player
amazonprovider.h
Go to the documentation of this file.
1 #ifndef AMAZONPROVIDER_H
2 #define AMAZONPROVIDER_H
3 
4 #include "coverartprovider.h"
5 
12 {
13  Q_OBJECT
14 private:
15  // Amazon has a web crawler that looks for access keys in public source code, so we apply some encryption to these keys.
16  static const char* accessKeyB64;
17  static const char* secretAccessKeyB64;
18  static const char* host;
19  static const char* associateTag;
20 
21 public:
22  explicit AmazonProvider(QNetworkAccessManager *parent);
23 
25  virtual QUrl query(const QString &artist, const QString &album) override;
26 
28  virtual QUrl album(const QString &expr) override;
29 
31  inline virtual ProviderType type() override { return PT_Amazon; }
32 
33 private:
35  static QByteArray hmac(const QByteArray &key, const QByteArray &data);
36 
37  void parseSearchResults(const QString &album, const QByteArray &ba);
38 
39 public slots:
40  virtual void dispatchReply(QNetworkReply *reply) override;
41 };
42 
43 #endif // AMAZONPROVIDER_H
#define MIAMCOVERFETCHER_LIBRARY
Definition: miamcoverfetcher_global.hpp:8
virtual QUrl album(const QString &)=0
ProviderType
Definition: coverartprovider.h:33
Definition: coverartprovider.h:36
virtual ProviderType type() override
Definition: amazonprovider.h:31
The CoverArtProvider class is an abstract class for registering various webservices.
Definition: coverartprovider.h:15
The AmazonProvider class.
Definition: amazonprovider.h:11
virtual QUrl query(const QString &artist, const QString &album)=0
virtual void dispatchReply(QNetworkReply *reply)=0