Functions | |
bool | sp_track_is_loaded (sp_track *track) |
sp_error | sp_track_error (sp_track *track) |
int | sp_track_num_artists (sp_track *track) |
sp_artist * | sp_track_artist (sp_track *track, int index) |
sp_album * | sp_track_album (sp_track *track) |
const char * | sp_track_name (sp_track *track) |
int | sp_track_duration (sp_track *track) |
int | sp_track_popularity (sp_track *track) |
int | sp_track_disc (sp_track *track) |
int | sp_track_index (sp_track *track) |
void | sp_track_add_ref (sp_track *track) |
void | sp_track_release (sp_track *track) |
void sp_track_add_ref | ( | sp_track * | track | ) |
The album of the specified track
[in] | track | A track object |
The artist matching the specified index performing on the current track.
[in] | track | The track whose participating artist you are interested in |
[in] | index | The index for the participating artist. Should be in the interval [0, sp_track_num_artists() - 1] |
int sp_track_disc | ( | sp_track * | track | ) |
Returns the disc number for a track
[in] | track | A track object |
int sp_track_duration | ( | sp_track * | track | ) |
The duration, in milliseconds, of the specified track
Here is a snippet from track.c:
static void print_track(sp_track *track) { int duration = sp_track_duration(track); printf("Track \"%s\" [%d:%02d] has %d artist(s), %d%% popularity\n", sp_track_name(track), duration / 60000, (duration / 1000) / 60, sp_track_num_artists(track), sp_track_popularity(track)); }
[in] | track | A track object |
Return an error code associated with a track. For example if it could not load
[in] | track | The track |
int sp_track_index | ( | sp_track * | track | ) |
Returns the position of a track on its disc
[in] | track | A track object |
bool sp_track_is_loaded | ( | sp_track * | track | ) |
Get load status for the specified track. If the track is not loaded yet, all other functions operating on the track return default values.
Here is a snippet from track.c:
if (!g_track || !sp_track_is_loaded(g_track)) return; print_track(g_track); request_cover(session, g_track); // We increased the reference count in session_ready(), better decrease it here. sp_track_release(g_track); g_track = NULL;
[in] | track | The track whose load status you are interested in |
const char* sp_track_name | ( | sp_track * | track | ) |
The string representation of the specified track's name
Here is a snippet from track.c:
static void print_track(sp_track *track) { int duration = sp_track_duration(track); printf("Track \"%s\" [%d:%02d] has %d artist(s), %d%% popularity\n", sp_track_name(track), duration / 60000, (duration / 1000) / 60, sp_track_num_artists(track), sp_track_popularity(track)); }
[in] | track | A track object |
int sp_track_num_artists | ( | sp_track * | track | ) |
The number of artists performing on the specified track
[in] | track | The track whose number of participating artists you are interested in |
int sp_track_popularity | ( | sp_track * | track | ) |
void sp_track_release | ( | sp_track * | track | ) |