Defines | |
#define | NJB_PL_END 0 |
#define | NJB_PL_START 1 |
Functions | |
void | NJB_Reset_Get_Playlist (njb_t *njb) |
njb_playlist_t * | NJB_Get_Playlist (njb_t *njb) |
int | NJB_Delete_Playlist (njb_t *njb, u_int32_t plid) |
int | NJB_Update_Playlist (njb_t *njb, njb_playlist_t *pl) |
njb_playlist_t * | NJB_Playlist_New (void) |
void | NJB_Playlist_Destroy (njb_playlist_t *pl) |
void | NJB_Playlist_Addtrack (njb_playlist_t *pl, njb_playlist_track_t *track, unsigned int pos) |
void | NJB_Playlist_Reset_Gettrack (njb_playlist_t *pl) |
njb_playlist_track_t * | NJB_Playlist_Gettrack (njb_playlist_t *pl) |
int | NJB_Playlist_Set_Name (njb_playlist_t *pl, const char *name) |
void | NJB_Playlist_Deltrack (njb_playlist_t *pl, unsigned int pos) |
void | NJB_Playlist_Deltrack_TrackID (njb_playlist_t *pl, u_int32_t trackid) |
njb_playlist_track_t * | NJB_Playlist_Track_New (u_int32_t trackid) |
void | NJB_Playlist_Track_Destroy (njb_playlist_track_t *track) |
|
This deletes a playlist from the device.
|
|
This gets a playlist from the device. The device should first be rewound using the
|
|
This function adds a playlist track (a data structure representing a track that is part of a playlist) to a playlist data structure.
|
|
This function deletes a track from a playlist.
|
|
This function removes a track from a playlist by way of the track ID (as opposed to the position in the playlist). This function can be called even on playlists that don't have this track in them - this is useful for e.g. looping through all playlists and removing a certain track before deleting the track itself from the device.
You need to call the
Typical use to remove a track with ID
njb_playlist_t *playlist;
NJB_Reset_Get_Playlist(njb); while (playlist = NJB_Get_Playlist(njb)) { NJB_Playlist_Deltrack_TrackID(playlist, id); // If the playlist changed, update it if (NJB_Update_Playlist(njb, playlist) == -1) NJB_Error_Dump(njb, stderr); } NJB_Playlist_Destroy(playlist); } if (NJB_Error_Pending(njb)) { NJB_Error_Dump(njb, stderr); }
|
|
This function destroys a playlist and frees up the memory used by it. All tracks that are part of the playlist will also be destroyed.
|
|
Returns a track from a playlist. The playlist has an internal structure to keep track of the constituent tracks, so the tracks will be retrieved in order. This function should typically be called repeatedly after an initial
|
|
This function creates a new playlist data structure to hold a name and a number of tracks.
|
|
Resets the internal counter used when retrieveing tracks from a playlist. Should typically be called first, before any subsequent calls to NJB_Playlist_Gettrack().
|
|
This function sets the name of the playlist. The name will be duplicated and stored internally, so the string is only needed during the function call.
|
|
This destroys a playlist track entry and frees any memory used by it.
|
|
This creates a new track entry for playlists. The
|
|
This resets the playlist retrieveal function. The playlists can then be retrieved one by one using the Typical usage:
njb_t *njb; njb_playlist_t *pl;
NJB_Reset_Get_Playlist(njb); while ( (pl = NJB_Get_Playlist(njb)) != NULL ) { // Do something with all the playlists... NJB_Playlist_Destroy(pl); }
|
|
This writes back an updated (modified) or new playlist to the device.
This function may modify the playlist ID, i.e. the
|