typedef void search_complete_cb(sp_search *result, void *userdata) |
The type of a callback used in sp_search_create()
When this callback is called, the sp_track_is_loaded(), sp_album_is_loaded(), and sp_artist_is_loaded() functions will return non-zero for the objects contained in the search result.
[in] | result | The same pointer returned by sp_search_create() |
[in] | userdata | The opaque pointer given to sp_search_create() |
Increase the reference count of a search result
[in] | search | The search result object |
Return the album at the given index in the given search object
[in] | search | Search object |
[in] | index | Index of the wanted album. Should be in the interval [0, sp_search_num_albums() - 1] |
Return the artist at the given index in the given search object
[in] | search | Search object |
[in] | index | Index of the wanted artist. Should be in the interval [0, sp_search_num_artists() - 1] |
sp_search* sp_search_create | ( | sp_session * | session, | |
const char * | query, | |||
int | track_offset, | |||
int | track_count, | |||
int | album_offset, | |||
int | album_count, | |||
int | artist_offset, | |||
int | artist_count, | |||
int | playlist_offset, | |||
int | playlist_count, | |||
sp_search_type | search_type, | |||
search_complete_cb * | callback, | |||
void * | userdata | |||
) |
Create a search object from the given query
[in] | session | Session |
[in] | query | Query search string, e.g. 'The Rolling Stones' or 'album:"The Black Album"' |
[in] | track_offset | The offset among the tracks of the result |
[in] | track_count | The number of tracks to ask for |
[in] | album_offset | The offset among the albums of the result |
[in] | album_count | The number of albums to ask for |
[in] | artist_offset | The offset among the artists of the result |
[in] | artist_count | The number of artists to ask for |
[in] | playlist_offset | The offset among the playlists of the result |
[in] | playlist_count | The number of playlists to ask for |
[in] | search_type | Type of search, can be used for suggest searches |
[in] | callback | Callback that will be called once the search operation is complete. Pass NULL if you are not interested in this event. |
[in] | userdata | Opaque pointer passed to callback |
const char* sp_search_did_you_mean | ( | sp_search * | search | ) |
Return the "Did you mean" query for the given search object
[in] | search | Search object |
bool sp_search_is_loaded | ( | sp_search * | search | ) |
Get load status for the specified search. Before it is loaded, it will behave as an empty search result.
[in] | search | Search object |
int sp_search_num_albums | ( | sp_search * | search | ) |
Get the number of albums for the specified search
[in] | search | Search object |
int sp_search_num_artists | ( | sp_search * | search | ) |
Get the number of artists for the specified search
[in] | search | Search object |
int sp_search_num_playlists | ( | sp_search * | search | ) |
Get the number of playlists for the specified search
[in] | search | Search object |
int sp_search_num_tracks | ( | sp_search * | search | ) |
Get the number of tracks for the specified search
[in] | search | Search object |
sp_playlist* sp_search_playlist | ( | sp_search * | search, | |
int | index | |||
) |
Load the playlist at the given index in the given search object
[in] | search | Search object |
[in] | index | Index of the wanted playlist. Should be in the interval [0, sp_search_num_playlists() - 1] |
const char* sp_search_playlist_image_uri | ( | sp_search * | search, | |
int | index | |||
) |
Return the image_uri of a playlist at the given index in the given search object
[in] | search | Search object |
[in] | index | Index of the wanted playlist. Should be in the interval [0, sp_search_num_playlists() - 1] |
const char* sp_search_playlist_name | ( | sp_search * | search, | |
int | index | |||
) |
Return the playlist at the given index in the given search object
[in] | search | Search object |
[in] | index | Index of the wanted playlist. Should be in the interval [0, sp_search_num_playlists() - 1] |
const char* sp_search_playlist_uri | ( | sp_search * | search, | |
int | index | |||
) |
Return the uri of a playlist at the given index in the given search object
[in] | search | Search object |
[in] | index | Index of the wanted playlist. Should be in the interval [0, sp_search_num_playlists() - 1] |
const char* sp_search_query | ( | sp_search * | search | ) |
Return the search query for the given search object
[in] | search | Search object |
int sp_search_total_albums | ( | sp_search * | search | ) |
Return the total number of albums for the search query - regardless of the interval requested at creation. If this value is larger than the interval specified at creation of the search object, more search results are available. To fetch these, create a new search object with a new interval.
[in] | search | Search object |
int sp_search_total_artists | ( | sp_search * | search | ) |
Return the total number of artists for the search query - regardless of the interval requested at creation. If this value is larger than the interval specified at creation of the search object, more search results are available. To fetch these, create a new search object with a new interval.
[in] | search | Search object |
int sp_search_total_playlists | ( | sp_search * | search | ) |
Return the total number of playlists for the search query - regardless of the interval requested at creation. If this value is larger than the interval specified at creation of the search object, more search results are available. To fetch these, create a new search object with a new interval.
[in] | search | Search object |
int sp_search_total_tracks | ( | sp_search * | search | ) |
Return the total number of tracks for the search query - regardless of the interval requested at creation. If this value is larger than the interval specified at creation of the search object, more search results are available. To fetch these, create a new search object with a new interval.
[in] | search | Search object |
Return the track at the given index in the given search object
[in] | search | Search object |
[in] | index | Index of the wanted track. Should be in the interval [0, sp_search_num_tracks() - 1] |