playlist_save: added spl_save_playlist()

spl_save_playlist() is a wrapper for spl_save_queue().
This commit is contained in:
Max Kellermann 2009-02-04 22:15:37 +01:00
parent 19397a84cc
commit 94685aa9bd
3 changed files with 13 additions and 1 deletions

View File

@ -663,7 +663,7 @@ handle_save(struct client *client,
{
enum playlist_result result;
result = spl_save_queue(argv[1], playlist_get_queue(&g_playlist));
result = spl_save_playlist(argv[1], &g_playlist);
return print_playlist_result(client, result);
}

View File

@ -97,6 +97,12 @@ spl_save_queue(const char *name_utf8, const struct queue *queue)
return PLAYLIST_RESULT_SUCCESS;
}
enum playlist_result
spl_save_playlist(const char *name_utf8, const struct playlist *playlist)
{
return spl_save_queue(name_utf8, &playlist->queue);
}
enum playlist_result
playlist_load_spl(struct playlist *playlist, const char *name_utf8)
{

View File

@ -37,6 +37,12 @@ playlist_print_uri(FILE *fp, const char *uri);
enum playlist_result
spl_save_queue(const char *name_utf8, const struct queue *queue);
/**
* Saves a playlist object into a stored playlist file.
*/
enum playlist_result
spl_save_playlist(const char *name_utf8, const struct playlist *playlist);
/**
* Loads a stored playlist file, and append all songs to the global
* playlist.