Typedefs |
typedef void | artistbrowse_complete_cb (sp_artistbrowse *result, void *userdata) |
Functions |
sp_artistbrowse * | sp_artistbrowse_create (sp_session *session, sp_artist *artist, sp_artistbrowse_type type, artistbrowse_complete_cb *callback, void *userdata) |
bool | sp_artistbrowse_is_loaded (sp_artistbrowse *arb) |
sp_error | sp_artistbrowse_error (sp_artistbrowse *arb) |
sp_artist * | sp_artistbrowse_artist (sp_artistbrowse *arb) |
int | sp_artistbrowse_num_portraits (sp_artistbrowse *arb) |
const byte * | sp_artistbrowse_portrait (sp_artistbrowse *arb, int index) |
int | sp_artistbrowse_num_tracks (sp_artistbrowse *arb) |
sp_track * | sp_artistbrowse_track (sp_artistbrowse *arb, int index) |
int | sp_artistbrowse_num_tophit_tracks (sp_artistbrowse *arb) |
sp_track * | sp_artistbrowse_tophit_track (sp_artistbrowse *arb, int index) |
int | sp_artistbrowse_num_albums (sp_artistbrowse *arb) |
sp_album * | sp_artistbrowse_album (sp_artistbrowse *arb, int index) |
int | sp_artistbrowse_num_similar_artists (sp_artistbrowse *arb) |
sp_artist * | sp_artistbrowse_similar_artist (sp_artistbrowse *arb, int index) |
const char * | sp_artistbrowse_biography (sp_artistbrowse *arb) |
int | sp_artistbrowse_backend_request_duration (sp_artistbrowse *arb) |
sp_error | sp_artistbrowse_add_ref (sp_artistbrowse *arb) |
sp_error | sp_artistbrowse_release (sp_artistbrowse *arb) |
Detailed Description
Artist browsing initiates the fetching of information for a certain artist.
- Note:
- There is currently no built-in functionality available for getting the albums belonging to an artist. For now, just iterate over all tracks and note the album to build a list of all albums. This feature will be added in a future version of the library.
Typedef Documentation
The type of a callback used in sp_artistbrowse_create()
When the callback is called, the metadata of all tracks belonging to it will have been loaded, so sp_track_is_loaded() will return non-zero. The same goes for the similar artist data.
- Parameters:
-
Function Documentation
Increase the reference count of an artist browse result
- Parameters:
-
[in] | arb | The artist browse result object |
- Returns:
- One of the following errors, from sp_error SP_ERROR_OK
Given an artist browse object, return one of its albums
- Parameters:
-
- Returns:
- A album object, or NULL if the index is out of range.
- See also:
- Album subsystem
Given an artist browse object, return a pointer to its artist object
- Parameters:
-
[in] | arb | Artist browse object |
- Returns:
- Artist object
- Examples:
- browse.c.
Return the time (in ms) that was spent waiting for the Spotify backend to serve the request
- Parameters:
-
[in] | arb | Artist browse object |
- Returns:
- -1 if the request was served from the local cache If the result is not yet loaded the return value is undefined
Given an artist browse object, return the artists biography
- Note:
- This function must be called from the same thread that did sp_session_create()
- Parameters:
-
[in] | arb | Artist browse object |
- Returns:
- Biography string in UTF-8 format. Returned string is valid as long as the album object stays allocated and no longer than the next call to sp_session_process_events()
- Examples:
- browse.c.
Initiate a request for browsing an artist
The user is responsible for freeing the returned artist browse using sp_artistbrowse_release(). This can be done in the callback.
- Parameters:
-
[in] | session | Session object |
[in] | artist | Artist to be browsed. The artist metadata does not have to be loaded |
[in] | type | Type of data requested, see the sp_artistbrowse_type enum for details |
[in] | callback | Callback to be invoked when browsing has been completed. Pass NULL if you are not interested in this event. |
[in] | userdata | Userdata passed to callback. |
- Returns:
- Artist browse object
- See also:
- artistbrowse_complete_cb
- Examples:
- browse.c.
Check if browsing returned an error code.
- Parameters:
-
[in] | arb | Artist browse object |
- Returns:
- One of the following errors, from sp_error SP_ERROR_OK SP_ERROR_IS_LOADING SP_ERROR_OTHER_PERMANENT SP_ERROR_OTHER_TRANSIENT
- Examples:
- browse.c.
Check if an artist browse request is completed
- Parameters:
-
[in] | arb | Artist browse object |
- Returns:
- True if browsing is completed, false if not
Given an artist browse object, return number of albums
- Parameters:
-
[in] | arb | Artist browse object |
- Returns:
- Number of albums for given artist
Given an artist browse object, return number of portraits available
- Parameters:
-
[in] | arb | Artist browse object |
- Returns:
- Number of portraits for given artist
- Examples:
- browse.c.
Given an artist browse object, return number of similar artists
- Parameters:
-
[in] | arb | Artist browse object |
- Returns:
- Number of similar artists for given artist
- Examples:
- browse.c.
Given an artist browse object, return number of tophit tracks This is a set of tracks for the artist with highest popularity
- Parameters:
-
[in] | arb | Artist browse object |
- Returns:
- Number of tophit tracks for given artist
Given an artist browse object, return number of tracks
- Parameters:
-
[in] | arb | Artist browse object |
- Returns:
- Number of tracks for given artist
- Examples:
- browse.c.
Decrease the reference count of an artist browse result
- Parameters:
-
[in] | arb | The artist browse result object |
- Returns:
- One of the following errors, from sp_error SP_ERROR_OK
- Examples:
- browse.c.
Given an artist browse object, return a similar artist by index
- Parameters:
-
- Returns:
- A pointer to an artist object.
- See also:
- Artist subsystem
- Examples:
- browse.c.
Given an artist browse object, return one of its tophit tracks This is a set of tracks for the artist with highest popularity
- Parameters:
-
- Returns:
- A track object, or NULL if the index is out of range.
- See also:
- Track subsystem
Given an artist browse object, return one of its tracks
- Parameters:
-
- Returns:
- A track object, or NULL if the index is out of range.
- See also:
- Track subsystem
- Examples:
- browse.c.