man NJB_Update_Playlist (Fonctions bibliothèques) - Create or update a playlist on the NJB

NAME

NJB_Update_Playlist - Create or update a playlist on the NJB

LIBRARY

libnjb

SYNOPSIS

#include <libnjb.h>

extern int njb_error

int NJB_Update_Playlist (njb_t *njb",playlist_t *pl)

DESCRIPTION

This command creates, renames or updates a playlist on the NJB. The operation is dependant upon the pl parameter, which defines the playlist, and how it was created.

If the playlist was created by the host via the playlist_new(3) function, then a new playlist is created on the NJB. The playlist ID is stored in pl->plid so that the host can update any local cache files.

If pl points to a playlist structure that was obtained via a Get_Playlist(3) function, then the playlist is updated on the NJB. Whether a rename or a rewrite of the playlist takes place is based on whether or not the tracks were modified in the playlist, itself. If only the name is changed, the a rename is done. If the track list was modified, then the old playlist is deleted and a new playlist is written out.

RETURN VALUES

This function returns 0 on success. If an error occurs, it returns -1 and sets njb_error

EO_BADSTATUS
A non-zero status was returned when updating the playlist EO_BADSTATUS Could not delete the old playlist from the NJB EO_NOMEM Couldn't allocate memory for the playlist block EO_RDSHORT Fewer bytes than expected were received on the bulk data pipe EO_TOOBIG The playlist is too large. EO_USBBLK An I/O error occurred on the bulk data pipe EO_USBCTL An I/O error occurred on the control pipe EO_WRSHORT Fewer bytes than requested were written to the bulk data pipe

SEE ALSO

BUGS