An interface to last.fm for retrieving album art.
More...
#include <last_fm.h>
|
| | LastFM () |
| | LastFM constructor.
|
| |
| void | init () override |
| | Retrieves the last.fm API key as an environment variable.
|
| |
| 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 = "http://ws.audioscrobbler.com/2.0/" |
| | The last.fm API base URL.
|
| |
|
| static std::string | method_name (const Method method) |
| | Conversion method to convert a LastFM::Method to a string.
|
| |
| static std::string | url (const Method method, const std::map< std::string, std::string > ¶ms) |
| | Calls url_with_params() after adding additional parameters in params. These additional parameters set the last.fm API key and method name.
|
| |
|
| static std::string | _api_key |
| | last.fm API key.
|
| |
An interface to last.fm for retrieving album art.
Definition at line 31 of file last_fm.h.
◆ Method
last.fm API methods.
Definition at line 35 of file last_fm.h.
◆ LastFM()
◆ album_art()
| std::vector< AlbumArtProvider::AlbumArt > LastFM::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 21 of file last_fm.cc.
◆ init()
◆ method_name()
| std::string LastFM::method_name |
( |
const Method | method | ) |
|
|
staticprivate |
Conversion method to convert a LastFM::Method to a string.
- Parameters
-
| [in] | method | last.fm method. |
- Returns
- method as a string.
Definition at line 86 of file last_fm.cc.
◆ url()
| std::string LastFM::url |
( |
const Method | method, |
|
|
const std::map< std::string, std::string > & | params ) |
|
staticprivate |
Calls url_with_params() after adding additional parameters in params. These additional parameters set the last.fm API key and method name.
- Parameters
-
| [in] | method | The last.fm method. |
| [in] | params | Method parameters only. |
- Returns
- last.fm API endpoint URL.
Definition at line 94 of file last_fm.cc.
◆ _api_key
| std::string LastFM::_api_key |
|
staticprivate |
last.fm API key.
Definition at line 70 of file last_fm.h.
◆ BASE_URL
| const char* LastFM::BASE_URL = "http://ws.audioscrobbler.com/2.0/" |
|
staticconstexpr |
The last.fm API base URL.
Definition at line 40 of file last_fm.h.
The documentation for this class was generated from the following files: