X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=playlist_selector.c;h=c40976d4635f1fb04fd0ebae422410e4c6651b23;hp=010c9d21e05a6bbde2092e6433d458d65e7657c7;hb=b71d1e5ef301b21c2bb33c1a205c971b0a51b769;hpb=c2708c767b300a33c8636681ed4550d4f3be0ce0 diff --git a/playlist_selector.c b/playlist_selector.c index 010c9d21..c40976d4 100644 --- a/playlist_selector.c +++ b/playlist_selector.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Andre Noll + * Copyright (C) 2006-2007 Andre Noll * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +25,7 @@ #include "string.h" #include "ipc.h" #include "user_list.h" +#include "playlist_selector_command_list.h" /** * structure used for transmission of the playlist @@ -62,34 +63,8 @@ static unsigned playlist_len, playlist_size, current_playlist_entry; static char **playlist; static struct audio_file_selector *self; -static int com_ppl(int, int, char **); -static int com_lpl(int, int, char **); extern struct misc_meta_data *mmd; -/* array of supported commands */ -static struct server_command cmds[] = { -{ -.name = "ppl", -.handler = com_ppl, -.perms = DB_READ, -.description = "print playlist", -.synopsis = "ppl", -.help = -"Print out the current playlist" -}, { -.name = "lpl", -.handler = com_lpl, -.perms = DB_WRITE, -.description = "load playlist", -.synopsis = "lpl", -.help = -"Read a new playlist from stdin. Example:\n" -"\tfind /audio -name '*.mp3' | para_client lpl" -}, { -.name = NULL, -} -}; - static void playlist_add(char *path) { if (playlist_len >= playlist_size) { @@ -143,7 +118,7 @@ out: return ret; } -static int com_lpl(int fd, __a_unused int argc, __a_unused char *argv[]) +int com_lpl(int fd, __a_unused int argc, __a_unused char *argv[]) { unsigned loaded = 0; size_t bufsize = 4096; /* guess that's enough */ @@ -174,7 +149,7 @@ out: return ret; } -static int com_ppl(int fd, __a_unused int argc, __a_unused char *argv[]) +int com_ppl(int fd, __a_unused int argc, __a_unused char *argv[]) { unsigned i; @@ -316,7 +291,7 @@ int playlist_selector_init(struct audio_file_selector *db) void *shm = NULL; self = db; - db->cmd_list = cmds; + db->cmd_list = playlist_selector_cmds; db->get_audio_file_list = pls_get_audio_file_list; db->shutdown = pls_shutdown; db->post_select = pls_post_select;