An interface to Spotify for retrieving album art.
More...
#include <spotify.h>
|
| | Spotify () |
| | Spotify constructor.
|
| |
| void | init () override |
| | Retrieves the Spotify client ID and secret as environment variables.
|
| |
| std::vector< AlbumArt > | album_art (const std::string &artist, const std::string &title, const int width, const int height) override |
| | Retrieves all album art matching the artist and title.
|
| |
| AlbumArt | album_art (const std::string &url, const int width, const int height) |
| | Retrieves the album art image at a given URL.
|
| |
|
| static constexpr const char * | BASE_URL = "https://api.spotify.com/v1/" |
| | The Spotify API base URL.
|
| |
|
| static std::string | method_name (const Method method) |
| | Conversion method to convert a Spotify::Method to a string.
|
| |
| static std::string | base64_encode (const std::string &input) |
| | Encodes a string into base64. Used to encode an HTTP authorization header.
|
| |
| static std::string | url (const Method method, const std::map< std::string, std::string > ¶ms) |
| | Calls url_with_params() with the Spotify API method URL.
|
| |
An interface to Spotify for retrieving album art.
Definition at line 31 of file spotify.h.
◆ Method
◆ Spotify()
◆ album_art()
| std::vector< AlbumArtProvider::AlbumArt > Spotify::album_art |
( |
const std::string & | artist, |
|
|
const std::string & | title, |
|
|
const int | width, |
|
|
const int | height ) |
|
overridevirtual |
Retrieves all album art matching the artist and title.
- Parameters
-
| [in] | artist | Album artist. |
| [in] | title | Album title. |
| [in] | width | Width of the returned images. |
| [in] | height | Height of the returned images. |
- Returns
- List of album art images.
Implements AlbumArtProvider.
Definition at line 46 of file spotify.cc.
◆ base64_encode()
| std::string Spotify::base64_encode |
( |
const std::string & | input | ) |
|
|
staticprivate |
Encodes a string into base64. Used to encode an HTTP authorization header.
- Parameters
-
| [in] | input | An arbitrary string. |
- Returns
- The base64-encoded input.
Definition at line 127 of file spotify.cc.
◆ init()
◆ method_name()
| std::string Spotify::method_name |
( |
const Method | method | ) |
|
|
staticprivate |
Conversion method to convert a Spotify::Method to a string.
- Parameters
-
- Returns
- method as a string.
Definition at line 147 of file spotify.cc.
◆ url()
| std::string Spotify::url |
( |
const Method | method, |
|
|
const std::map< std::string, std::string > & | params ) |
|
staticprivate |
◆ _accessToken
| std::string Spotify::_accessToken |
|
staticprivate |
◆ BASE_URL
| const char* Spotify::BASE_URL = "https://api.spotify.com/v1/" |
|
staticconstexpr |
The documentation for this class was generated from the following files: