aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorQball Cow <qball@qballcow.nl>2006-03-26 13:46:05 +0000
committerQball Cow <qball@qballcow.nl>2006-03-26 13:46:05 +0000
commit09929b6f821a38d6f6a15c555dc1bd1f40273850 (patch)
tree8a9187ee38f43b3e5ff11b367d8ebe62294ef56e /src/command.c
parent19021e9cc60a98c900c986c242d1816ebdddee23 (diff)
downloadmpd-09929b6f821a38d6f6a15c555dc1bd1f40273850.tar.gz
mpd-09929b6f821a38d6f6a15c555dc1bd1f40273850.tar.xz
mpd-09929b6f821a38d6f6a15c555dc1bd1f40273850.zip
Support for fetching the content of a stored playlist (patch by qball), this adds listPlaylist and listPlaylistInfo
git-svn-id: https://svn.musicpd.org/mpd/trunk@3947 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/command.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c
index 156e02197..8596e3791 100644
--- a/src/command.c
+++ b/src/command.c
@@ -53,6 +53,8 @@
#define COMMAND_CLEAR "clear"
#define COMMAND_SAVE "save"
#define COMMAND_LOAD "load"
+#define COMMAND_LISTPLAYLIST "listPlaylist"
+#define COMMAND_LISTPLAYLISTINFO "listPlaylistInfo"
#define COMMAND_LSINFO "lsinfo"
#define COMMAND_RM "rm"
#define COMMAND_PLAYLISTINFO "playlistinfo"
@@ -367,6 +369,16 @@ int handleLoad(FILE * fp, unsigned int * permission, int argArrayLength,
{
return loadPlaylist(fp,argArray[1]);
}
+int handleListPlaylist(FILE * fp, unsigned int * permission, int argArrayLength,
+ char ** argArray)
+{
+ return PlaylistInfo(fp,argArray[1],0);
+}
+int handleListPlaylistInfo(FILE * fp, unsigned int * permission, int argArrayLength,
+ char ** argArray)
+{
+ return PlaylistInfo(fp,argArray[1], 1);
+}
int handleLsInfo(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray)
@@ -928,6 +940,8 @@ void initCommands() {
addCommand(COMMAND_CLEAR ,PERMISSION_CONTROL, 0, 0,handleClear,NULL);
addCommand(COMMAND_SAVE ,PERMISSION_CONTROL, 1, 1,handleSave,NULL);
addCommand(COMMAND_LOAD ,PERMISSION_ADD, 1, 1,handleLoad,NULL);
+ addCommand(COMMAND_LISTPLAYLIST,PERMISSION_READ, 1, 1,handleListPlaylist,NULL);
+ addCommand(COMMAND_LISTPLAYLISTINFO,PERMISSION_READ, 1, 1,handleListPlaylistInfo,NULL);
addCommand(COMMAND_LSINFO ,PERMISSION_READ, 0, 1,handleLsInfo,NULL);
addCommand(COMMAND_RM ,PERMISSION_CONTROL, 1, 1,handleRm,NULL);
addCommand(COMMAND_PLAYLISTINFO,PERMISSION_READ, 0, 1,handlePlaylistInfo,NULL);