libspotify
Data Structures | Typedefs | Functions
Playlist subsystem

Data Structures

struct  sp_playlist_callbacks
 
struct  sp_playlistcontainer_callbacks
 

Typedefs

typedef struct
sp_playlist_callbacks 
sp_playlist_callbacks
 
typedef struct
sp_playlistcontainer_callbacks 
sp_playlistcontainer_callbacks
 

Functions

bool sp_playlist_is_loaded (sp_playlist *playlist)
 
sp_error sp_playlist_add_callbacks (sp_playlist *playlist, sp_playlist_callbacks *callbacks, void *userdata)
 
sp_error sp_playlist_remove_callbacks (sp_playlist *playlist, sp_playlist_callbacks *callbacks, void *userdata)
 
int sp_playlist_num_tracks (sp_playlist *playlist)
 
sp_tracksp_playlist_track (sp_playlist *playlist, int index)
 
int sp_playlist_track_create_time (sp_playlist *playlist, int index)
 
sp_usersp_playlist_track_creator (sp_playlist *playlist, int index)
 
bool sp_playlist_track_seen (sp_playlist *playlist, int index)
 
sp_error sp_playlist_track_set_seen (sp_playlist *playlist, int index, bool seen)
 
const char * sp_playlist_track_message (sp_playlist *playlist, int index)
 
const char * sp_playlist_name (sp_playlist *playlist)
 
sp_error sp_playlist_rename (sp_playlist *playlist, const char *new_name)
 
sp_usersp_playlist_owner (sp_playlist *playlist)
 
bool sp_playlist_is_collaborative (sp_playlist *playlist)
 
sp_error sp_playlist_set_collaborative (sp_playlist *playlist, bool collaborative)
 
sp_error sp_playlist_set_autolink_tracks (sp_playlist *playlist, bool link)
 
const char * sp_playlist_get_description (sp_playlist *playlist)
 
bool sp_playlist_get_image (sp_playlist *playlist, byte image[20])
 
bool sp_playlist_has_pending_changes (sp_playlist *playlist)
 
sp_error sp_playlist_add_tracks (sp_playlist *playlist, sp_track *const *tracks, int num_tracks, int position, sp_session *session)
 
sp_error sp_playlist_remove_tracks (sp_playlist *playlist, const int *tracks, int num_tracks)
 
sp_error sp_playlist_reorder_tracks (sp_playlist *playlist, const int *tracks, int num_tracks, int new_position)
 
unsigned int sp_playlist_num_subscribers (sp_playlist *playlist)
 
sp_subscriberssp_playlist_subscribers (sp_playlist *playlist)
 
sp_error sp_playlist_subscribers_free (sp_subscribers *subscribers)
 
sp_error sp_playlist_update_subscribers (sp_session *session, sp_playlist *playlist)
 
bool sp_playlist_is_in_ram (sp_session *session, sp_playlist *playlist)
 
sp_error sp_playlist_set_in_ram (sp_session *session, sp_playlist *playlist, bool in_ram)
 
sp_playlistsp_playlist_create (sp_session *session, sp_link *link)
 
sp_error sp_playlist_set_offline_mode (sp_session *session, sp_playlist *playlist, bool offline)
 
sp_playlist_offline_status sp_playlist_get_offline_status (sp_session *session, sp_playlist *playlist)
 
int sp_playlist_get_offline_download_completed (sp_session *session, sp_playlist *playlist)
 
sp_error sp_playlist_add_ref (sp_playlist *playlist)
 
sp_error sp_playlist_release (sp_playlist *playlist)
 
sp_error sp_playlistcontainer_add_callbacks (sp_playlistcontainer *pc, sp_playlistcontainer_callbacks *callbacks, void *userdata)
 
sp_error sp_playlistcontainer_remove_callbacks (sp_playlistcontainer *pc, sp_playlistcontainer_callbacks *callbacks, void *userdata)
 
int sp_playlistcontainer_num_playlists (sp_playlistcontainer *pc)
 
bool sp_playlistcontainer_is_loaded (sp_playlistcontainer *pc)
 
sp_playlistsp_playlistcontainer_playlist (sp_playlistcontainer *pc, int index)
 
sp_playlist_type sp_playlistcontainer_playlist_type (sp_playlistcontainer *pc, int index)
 
sp_error sp_playlistcontainer_playlist_folder_name (sp_playlistcontainer *pc, int index, char *buffer, int buffer_size)
 
sp_uint64 sp_playlistcontainer_playlist_folder_id (sp_playlistcontainer *pc, int index)
 
sp_playlistsp_playlistcontainer_add_new_playlist (sp_playlistcontainer *pc, const char *name)
 
sp_playlistsp_playlistcontainer_add_playlist (sp_playlistcontainer *pc, sp_link *link)
 
sp_error sp_playlistcontainer_remove_playlist (sp_playlistcontainer *pc, int index)
 
sp_error sp_playlistcontainer_move_playlist (sp_playlistcontainer *pc, int index, int new_position, bool dry_run)
 
sp_error sp_playlistcontainer_add_folder (sp_playlistcontainer *pc, int index, const char *name)
 
sp_usersp_playlistcontainer_owner (sp_playlistcontainer *pc)
 
sp_error sp_playlistcontainer_add_ref (sp_playlistcontainer *pc)
 
sp_error sp_playlistcontainer_release (sp_playlistcontainer *pc)
 
int sp_playlistcontainer_get_unseen_tracks (sp_playlistcontainer *pc, sp_playlist *playlist, sp_track **tracks, int num_tracks)
 
int sp_playlistcontainer_clear_unseen_tracks (sp_playlistcontainer *pc, sp_playlist *playlist)
 

Detailed Description

The playlist subsystem handles playlists and playlist containers (list of playlists).

The playlist container functions are always valid, but your playlists are not guaranteed to be loaded until the sp_session_callbacks::logged_in callback has been issued.

Typedef Documentation

Playlist callbacks

Used to get notifications when playlists are updated. If some callbacks should not be of interest, set them to NULL.

Playlist container callbacks. If some callbacks should not be of interest, set them to NULL.

See Also
sp_playlistcontainer_add_callbacks
sp_playlistcontainer_remove_callbacks

Function Documentation

sp_error sp_playlist_add_callbacks ( sp_playlist playlist,
sp_playlist_callbacks callbacks,
void *  userdata 
)

Register interest in the given playlist

Here is a snippet from jukebox.c:

sp_playlist_add_callbacks(pl, &pl_callbacks, NULL);

Parameters
[in]playlistPlaylist object
[in]callbacksCallbacks, see sp_playlist_callbacks
[in]userdataUserdata to be passed to callbacks
See Also
sp_playlist_remove_callbacks
Examples:
browse.c, and jukebox.c.
sp_error sp_playlist_add_ref ( sp_playlist playlist)

Increase the reference count of a playlist

Parameters
[in]playlistThe playlist object
Returns
One of the following errors, from sp_error SP_ERROR_OK
sp_error sp_playlist_add_tracks ( sp_playlist playlist,
sp_track *const *  tracks,
int  num_tracks,
int  position,
sp_session session 
)

Add tracks to a playlist

Parameters
[in]playlistPlaylist object
[in]tracksArray of pointer to tracks.
[in]num_tracksLength of tracks array
[in]positionStart position in playlist where to insert the tracks
[in]sessionYour session object
Returns
One of the following errors, from sp_error SP_ERROR_OK SP_ERROR_INVALID_INDATA - position is > current playlist length SP_ERROR_PERMISSION_DENIED
sp_playlist* sp_playlist_create ( sp_session session,
sp_link link 
)

Load an already existing playlist without adding it to a playlistcontainer.

Parameters
[in]sessionSession object
[in]linkLink object referring to a playlist
Returns
A playlist. The reference is owned by the caller and should be released with sp_playlist_release()
Examples:
browse.c.
const char* sp_playlist_get_description ( sp_playlist playlist)

Get description for a playlist

Parameters
[in]playlistPlaylist object
Returns
Playlist description or NULL if unset
bool sp_playlist_get_image ( sp_playlist playlist,
byte  image[20] 
)

Get description for a playlist

Parameters
[in]playlistPlaylist object
[out]image20 byte image id
Returns
TRUE if playlist has an image, FALSE if not
int sp_playlist_get_offline_download_completed ( sp_session session,
sp_playlist playlist 
)

Get download progress for an offline playlist

Parameters
[in]sessionSession object
[in]playlistPlaylist object
Returns
Value from 0 - 100 that indicates amount of playlist that is downloaded or 0 if the playlist is not in the SP_PLAYLIST_OFFLINE_STATUS_DOWNLOADING mode.
See Also
sp_playlist_offline_status()
sp_playlist_offline_status sp_playlist_get_offline_status ( sp_session session,
sp_playlist playlist 
)

Get offline status for a playlist

Parameters
[in]sessionSession object
[in]playlistPlaylist object
Returns
sp_playlist_offline_status
See Also
When in SP_PLAYLIST_OFFLINE_STATUS_DOWNLOADING mode the sp_playlist_get_offline_download_completed() method can be used to query progress of the download
bool sp_playlist_has_pending_changes ( sp_playlist playlist)

Check if a playlist has pending changes

Pending changes are local changes that have not yet been acknowledged by the server.

Parameters
[in]playlistPlaylist object
Returns
A flag representing if there are pending changes or not
bool sp_playlist_is_collaborative ( sp_playlist playlist)

Return collaborative status for a playlist.

A playlist in collaborative state can be modifed by all users, not only the user owning the list

Parameters
[in]playlistPlaylist object
Returns
true if playlist is collaborative, otherwise false
bool sp_playlist_is_in_ram ( sp_session session,
sp_playlist playlist 
)

Return whether a playlist is loaded in RAM (as opposed to only stored on disk)

Parameters
[in]sessionSession object
[in]playlistPlaylist object
Returns
True iff playlist is in RAM, False otherwise
Note
When a playlist is no longer in RAM it will appear empty. However, libspotify will retain information about the list metadata (owner, title, picture, etc) in RAM. There is one caveat tough: If libspotify has never seen the playlist before this metadata will also be unset. In order for libspotify to get the metadata the playlist needs to be loaded at least once. In order words, if libspotify starts with an empty playlist cache and the application has set 'initially_unload_playlists' config parameter to True all playlists will be empty. It will not be possible to generate URI's to the playlists nor extract playlist title until the application calls sp_playlist_set_in_ram(..., true). So an application that needs to stay within a low memory profile would need to cycle thru all new playlists in order to extract metadata.

The easiest way to detect this case is when sp_playlist_is_in_ram() returns false and sp_link_create_from_playlist() returns NULL

bool sp_playlist_is_loaded ( sp_playlist playlist)

Get load status for the specified playlist. If it's false, you have to wait until playlist_state_changed happens, and check again if is_loaded has changed

Parameters
[in]playlistPlaylist object
Returns
True if playlist is loaded, otherwise false
Examples:
browse.c.
const char* sp_playlist_name ( sp_playlist playlist)

Return name of given playlist

Parameters
[in]playlistPlaylist object
Returns
The name of the given playlist
Examples:
browse.c, and jukebox.c.
unsigned int sp_playlist_num_subscribers ( sp_playlist playlist)

Return number of subscribers for a given playlist

Parameters
[in]playlistPlaylist object
Returns
Number of subscribers
int sp_playlist_num_tracks ( sp_playlist playlist)

Return number of tracks in the given playlist

Parameters
[in]playlistPlaylist object
Returns
The number of tracks in the playlist
Examples:
browse.c, and jukebox.c.
sp_user* sp_playlist_owner ( sp_playlist playlist)

Return a pointer to the user for the given playlist

Parameters
[in]playlistPlaylist object
Returns
User object
sp_error sp_playlist_release ( sp_playlist playlist)

Decrease the reference count of a playlist

Parameters
[in]playlistThe playlist object
Returns
One of the following errors, from sp_error SP_ERROR_OK
Examples:
browse.c.
sp_error sp_playlist_remove_callbacks ( sp_playlist playlist,
sp_playlist_callbacks callbacks,
void *  userdata 
)

Unregister interest in the given playlist

The combination of (callbacks, userdata) is used to find the entry to be removed

Here is a snippet from jukebox.c:

sp_playlist_remove_callbacks(pl, &pl_callbacks, NULL);

Parameters
[in]playlistPlaylist object
[in]callbacksCallbacks, see sp_playlist_callbacks
[in]userdataUserdata to be passed to callbacks
See Also
sp_playlist_add_callbacks
Returns
One of the following errors, from sp_error SP_ERROR_OK
Examples:
browse.c, and jukebox.c.
sp_error sp_playlist_remove_tracks ( sp_playlist playlist,
const int *  tracks,
int  num_tracks 
)

Remove tracks from a playlist

Parameters
[in]playlistPlaylist object
[in]tracksArray of pointer to track indices. A certain track index should be present at most once, e.g. [0, 1, 2] is valid indata, whereas [0, 1, 1] is invalid.
[in]num_tracksLength of tracks array
Returns
One of the following errors, from sp_error SP_ERROR_OK SP_ERROR_PERMISSION_DENIED
Examples:
jukebox.c.
sp_error sp_playlist_rename ( sp_playlist playlist,
const char *  new_name 
)

Rename the given playlist The name must not consist of only spaces and it must be shorter than 256 characters.

Parameters
[in]playlistPlaylist object
[in]new_nameNew name for playlist
Returns
One of the following errors, from sp_error SP_ERROR_OK SP_ERROR_INVALID_INDATA SP_ERROR_PERMISSION_DENIED
sp_error sp_playlist_reorder_tracks ( sp_playlist playlist,
const int *  tracks,
int  num_tracks,
int  new_position 
)

Move tracks in playlist

Parameters
[in]playlistPlaylist object
[in]tracksArray of pointer to track indices to be moved. A certain track index should be present at most once, e.g. [0, 1, 2] is valid indata, whereas [0, 1, 1] is invalid.
[in]num_tracksLength of tracks array
[in]new_positionNew position for tracks
Returns
One of the following errors, from sp_error SP_ERROR_OK SP_ERROR_INVALID_INDATA - position is > current playlist length SP_ERROR_PERMISSION_DENIED
sp_error sp_playlist_set_autolink_tracks ( sp_playlist playlist,
bool  link 
)

Set autolinking state for a playlist.

If a playlist is autolinked, unplayable tracks will be made playable by linking them to other Spotify tracks, where possible.

Parameters
[in]playlistPlaylist object
[in]linkTrue or false
Returns
One of the following errors, from sp_error SP_ERROR_OK
sp_error sp_playlist_set_collaborative ( sp_playlist playlist,
bool  collaborative 
)

Set collaborative status for a playlist.

A playlist in collaborative state can be modified by all users, not only the user owning the list

Parameters
[in]playlistPlaylist object
[in]collaborativeTrue or false
Returns
One of the following errors, from sp_error SP_ERROR_OK
sp_error sp_playlist_set_in_ram ( sp_session session,
sp_playlist playlist,
bool  in_ram 
)

Return whether a playlist is loaded in RAM (as opposed to only stored on disk)

Parameters
[in]sessionSession object
[in]playlistPlaylist object
[in]in_ramControls whether or not to keep the list in RAM
Returns
One of the following errors, from sp_error SP_ERROR_OK
sp_error sp_playlist_set_offline_mode ( sp_session session,
sp_playlist playlist,
bool  offline 
)

Mark a playlist to be synchronized for offline playback. The playlist must be in the users playlistcontainer

Parameters
[in]sessionSession object
[in]playlistPlaylist object
[in]offlineTrue iff playlist should be offline, false otherwise
Returns
One of the following errors, from sp_error SP_ERROR_OK
sp_subscribers* sp_playlist_subscribers ( sp_playlist playlist)

Return subscribers for a playlist

Parameters
[in]playlistPlaylist object
Returns
sp_subscribers struct with array of canonical usernames. This object should be free'd using sp_playlist_subscribers_free()
Note
The count returned for this function may be less than those returned by sp_playlist_num_subscribers(). Spotify does not track each user subscribed to a playlist for playlist with many (>500) subscribers.
sp_error sp_playlist_subscribers_free ( sp_subscribers subscribers)

Free object returned from sp_playlist_subscribers()

Parameters
[in]subscribersSubscribers object
Returns
One of the following errors, from sp_error SP_ERROR_OK
sp_track* sp_playlist_track ( sp_playlist playlist,
int  index 
)

Return the track at the given index in a playlist

Parameters
[in]playlistPlaylist object
[in]indexIndex into playlist container. Should be in the interval [0, sp_playlist_num_tracks() - 1]
Returns
The track at the given index
Examples:
browse.c, and jukebox.c.
int sp_playlist_track_create_time ( sp_playlist playlist,
int  index 
)

Return when the given index was added to the playlist

Parameters
[in]playlistPlaylist object
[in]indexIndex into playlist container. Should be in the interval [0, sp_playlist_num_tracks() - 1]
Returns
Time, Seconds since unix epoch.
sp_user* sp_playlist_track_creator ( sp_playlist playlist,
int  index 
)

Return user that added the given index in the playlist

Parameters
[in]playlistPlaylist object
[in]indexIndex into playlist container. Should be in the interval [0, sp_playlist_num_tracks() - 1]
Returns
User object
const char* sp_playlist_track_message ( sp_playlist playlist,
int  index 
)

Return a message attached to a playlist item. Typically used on inbox.

Parameters
[in]playlistPlaylist object
[in]indexIndex into playlist container. Should be in the interval [0, sp_playlist_num_tracks() - 1]
Returns
UTF-8 encoded message, or NULL if no message is present
bool sp_playlist_track_seen ( sp_playlist playlist,
int  index 
)

Return if a playlist entry is marked as seen or not

Parameters
[in]playlistPlaylist object
[in]indexIndex into playlist container. Should be in the interval [0, sp_playlist_num_tracks() - 1]
Returns
Seen state
sp_error sp_playlist_track_set_seen ( sp_playlist playlist,
int  index,
bool  seen 
)

Set seen status of a playlist entry

Parameters
[in]playlistPlaylist object
[in]indexIndex into playlist container. Should be in the interval [0, sp_playlist_num_tracks() - 1]
[in]seenSeen status to be set
Returns
error One of the following errors, from sp_error SP_ERROR_OK SP_ERROR_INDEX_OUT_OF_RANGE
sp_error sp_playlist_update_subscribers ( sp_session session,
sp_playlist playlist 
)

Ask library to update the subscription count for a playlist

When the subscription info has been fetched from the Spotify backend the playlist subscribers_changed() callback will be invoked. In that callback use sp_playlist_num_subscribers() and/or sp_playlist_subscribers() to get information about the subscribers. You can call those two functions anytime you want but the information might not be up to date in such cases

Parameters
[in]sessionSession object
[in]playlistPlaylist object
Returns
One of the following errors, from sp_error SP_ERROR_OK
sp_error sp_playlistcontainer_add_callbacks ( sp_playlistcontainer pc,
sp_playlistcontainer_callbacks callbacks,
void *  userdata 
)

Register interest in changes to a playlist container

Parameters
[in]pcPlaylist container
[in]callbacksCallbacks, see sp_playlistcontainer_callbacks
[in]userdataOpaque value passed to callbacks.
Note
Every sp_playlistcontainer_add_callbacks() needs to be paired with a corresponding sp_playlistcontainer_remove_callbacks() that is invoked before releasing the last reference you own for the container. In other words, you must make sure to have removed all the callbacks before the container gets destroyed.
See Also
sp_session_playlistcontainer()
sp_playlistcontainer_remove_callbacks
Returns
One of the following errors, from sp_error SP_ERROR_OK
Examples:
jukebox.c.
sp_error sp_playlistcontainer_add_folder ( sp_playlistcontainer pc,
int  index,
const char *  name 
)

Add a playlist folder

Parameters
[in]pcPlaylist container
[in]indexPosition of SP_PLAYLIST_TYPE_START_FOLDER entry
[in]nameName of group
Returns
error One of the following errors, from sp_error SP_ERROR_OK SP_ERROR_INDEX_OUT_OF_RANGE
Note
This operation will actually create two playlists. One of type SP_PLAYLIST_TYPE_START_FOLDER and immediately following a SP_PLAYLIST_TYPE_END_FOLDER one.

To remove a playlist folder both of these must be deleted or the list will be left in an inconsistant state.

There is no way to rename a playlist folder. Instead you need to remove the folder and recreate it again.

sp_playlist* sp_playlistcontainer_add_new_playlist ( sp_playlistcontainer pc,
const char *  name 
)

Add an empty playlist at the end of the playlist container. The name must not consist of only spaces and it must be shorter than 256 characters.

Parameters
[in]pcPlaylist container
[in]nameName of new playlist
Returns
Pointer to the new playlist. Can be NULL if the operation fails.
sp_playlist* sp_playlistcontainer_add_playlist ( sp_playlistcontainer pc,
sp_link link 
)

Add an existing playlist at the end of the given playlist container

Parameters
[in]pcPlaylist container
[in]linkLink object pointing to a playlist
Returns
Pointer to the new playlist. Will be NULL if the playlist already exists.
sp_error sp_playlistcontainer_add_ref ( sp_playlistcontainer pc)

Increase reference count on playlistconatiner object

Parameters
[in]pcPlaylist container.
Returns
One of the following errors, from sp_error SP_ERROR_OK
int sp_playlistcontainer_clear_unseen_tracks ( sp_playlistcontainer pc,
sp_playlist playlist 
)

Clears a playlist from unseen tracks, so that next call to sp_playlistcontainer_get_unseen_tracks() will return 0 until a new track is added to the playslist.

Parameters
[in]pcPlaylist container.
[in]playlistPlaylist object.
Returns
Returns 0 on success and -1 on failure.
int sp_playlistcontainer_get_unseen_tracks ( sp_playlistcontainer pc,
sp_playlist playlist,
sp_track **  tracks,
int  num_tracks 
)

Get the number of new tracks in a playlist since the corresponding function sp_playlistcontainer_clear_unseen_tracks() was called. The function always returns the number of new tracks, and fills the tracks array with the new tracks, but not more than specified in num_tracks. The function will return a negative value on failure.

Parameters
[in]pcPlaylist container.
[in]playlistPlaylist object.
[out]tracksArray of pointer to new tracks (maybe NULL)
[in]num_tracksSize of tracks array
Returns
Returns the number of unseen tracks
bool sp_playlistcontainer_is_loaded ( sp_playlistcontainer pc)

Return true if the playlistcontainer is fully loaded

Parameters
[in]pcPlaylist container
Returns
True if container is loaded
Note
The container_loaded callback will be invoked when this flips to true
sp_error sp_playlistcontainer_move_playlist ( sp_playlistcontainer pc,
int  index,
int  new_position,
bool  dry_run 
)

Move a playlist in the playlist container

Parameters
[in]pcPlaylist container
[in]indexIndex of playlist to be moved
[in]new_positionNew position for the playlist
[in]dry_runDo not execute the move, only check if it possible
Returns
error One of the following errors, from sp_error SP_ERROR_OK SP_ERROR_INDEX_OUT_OF_RANGE SP_ERROR_INVALID_INDATA - If trying to move a folder into itself
int sp_playlistcontainer_num_playlists ( sp_playlistcontainer pc)

Return the number of playlists in the given playlist container

Parameters
[in]pcPlaylist container
Returns
Number of playlists, -1 if undefined
See Also
sp_session_playlistcontainer()
Examples:
jukebox.c.
sp_user* sp_playlistcontainer_owner ( sp_playlistcontainer pc)

Return a pointer to the user object of the owner.

Parameters
[in]pcPlaylist container.
Returns
The user object or NULL if unknown or none.
sp_playlist* sp_playlistcontainer_playlist ( sp_playlistcontainer pc,
int  index 
)

Return a pointer to the playlist at a specific index

Parameters
[in]pcPlaylist container
[in]indexIndex in playlist container. Should be in the interval [0, sp_playlistcontainer_num_playlists() - 1]
Returns
The playlist object
See Also
sp_session_playlistcontainer()
Examples:
jukebox.c.
sp_uint64 sp_playlistcontainer_playlist_folder_id ( sp_playlistcontainer pc,
int  index 
)

Return the folder id at index

Parameters
[in]pcPlaylist container
[in]indexIndex in playlist container. Should be in the interval [0, sp_playlistcontainer_num_playlists() - 1]
Returns
The group ID of the folder. Returns 0 on index out of range, pc being NULL or indexed item not being a folder
See Also
sp_session_playlistcontainer()
sp_error sp_playlistcontainer_playlist_folder_name ( sp_playlistcontainer pc,
int  index,
char *  buffer,
int  buffer_size 
)

Return the folder name at index

Parameters
[in]pcPlaylist container
[in]indexIndex in playlist container. Should be in the interval [0, sp_playlistcontainer_num_playlists() - 1]. Index should point at a start-folder entry, otherwise the empty string is written to buffer.
[in]bufferPointer to char[] where to store folder name
[in]buffer_sizeSize of array
Returns
One of the following errors, from sp_error SP_ERROR_OK SP_ERROR_INDEX_OUT_OF_RANGE
See Also
sp_session_playlistcontainer()
sp_playlist_type sp_playlistcontainer_playlist_type ( sp_playlistcontainer pc,
int  index 
)

Return the type of the playlist at a index

Parameters
[in]pcPlaylist container
[in]indexIndex in playlist container. Should be in the interval [0, sp_playlistcontainer_num_playlists() - 1]
Returns
Type of the playlist,
See Also
sp_playlist_type
sp_session_playlistcontainer()
sp_error sp_playlistcontainer_release ( sp_playlistcontainer pc)

Release reference count on playlistconatiner object

Parameters
[in]pcPlaylist container.
Returns
One of the following errors, from sp_error SP_ERROR_OK
sp_error sp_playlistcontainer_remove_callbacks ( sp_playlistcontainer pc,
sp_playlistcontainer_callbacks callbacks,
void *  userdata 
)

Unregister interest in changes to a playlist container

Parameters
[in]pcPlaylist container
[in]callbacksCallbacks, see sp_playlistcontainer_callbacks
[in]userdataOpaque value passed to callbacks.
See Also
sp_session_playlistcontainer()
sp_playlistcontainer_add_callbacks
Returns
One of the following errors, from sp_error SP_ERROR_OK
sp_error sp_playlistcontainer_remove_playlist ( sp_playlistcontainer pc,
int  index 
)

Remove playlist at index from the given playlist container

Parameters
[in]pcPlaylist container
[in]indexIndex of playlist to be removed
Returns
error One of the following errors, from sp_error SP_ERROR_OK SP_ERROR_INDEX_OUT_OF_RANGE

Generated on Tue Jun 4 2013 15:11:47.
Copyright © 2006–2013 Spotify Ltd