command: use queue_print_*()

Replaced several wrapper functions from playlist.c, and make command.c
use the queue print functions directly.
This commit is contained in:
Max Kellermann
2009-01-24 14:52:04 +01:00
parent d449d6abab
commit 627d590ce5
4 changed files with 51 additions and 82 deletions

View File

@@ -157,12 +157,6 @@ void clearPlaylist(void)
incrPlaylistVersion();
}
void showPlaylist(struct client *client)
{
queue_print_uris(client, &playlist.queue,
0, queue_length(&playlist.queue));
}
void savePlaylistState(FILE *fp)
{
fprintf(fp, "%s", PLAYLIST_STATE_FILE_STATE);
@@ -288,48 +282,6 @@ void readPlaylistState(FILE *fp)
setPlaylistRandomStatus(random_mode);
}
int playlistChanges(struct client *client, uint32_t version)
{
queue_print_changes_info(client, &playlist.queue, version);
return 0;
}
int playlistChangesPosId(struct client *client, uint32_t version)
{
queue_print_changes_position(client, &playlist.queue, version);
return 0;
}
enum playlist_result
playlistInfo(struct client *client, unsigned start, unsigned end)
{
if (end > queue_length(&playlist.queue))
end = queue_length(&playlist.queue);
if (start > end)
return PLAYLIST_RESULT_BAD_RANGE;
queue_print_info(client, &playlist.queue, start, end);
return PLAYLIST_RESULT_SUCCESS;
}
enum playlist_result playlistId(struct client *client, int id)
{
int begin = 0;
unsigned end = queue_length(&playlist.queue);
if (id >= 0) {
begin = queue_id_to_position(&playlist.queue, id);
if (begin < 0)
return PLAYLIST_RESULT_NO_SUCH_SONG;
end = begin + 1;
}
queue_print_info(client, &playlist.queue, begin, end);
return PLAYLIST_RESULT_SUCCESS;
}
/**
* Queue a song, addressed by its order number.
*/