Hi guys,
I was missing this feature so I wrote a simple patch to enhance mpc a
little. I think you may find it useful too.
diff --git a/doc/mpc.1 b/doc/mpc.1
index aad3c27..a257fbb 100644
--- a/doc/mpc.1
+++ b/doc/mpc.1
@@ -170,8 +170,9 @@ Pauses playing.
.B play <position>
Starts playing the song-number specified. If none is specified, plays number 1.
.TP
-.B playlist
-Prints entire playlist.
+.B playlist [<playlist>]
+Lists all songs in <playlist>. If no <playlist> is specified, lists all songs
+in the current playlist.
.TP
.B prev
Starts playing previous song.
diff --git a/src/main.c b/src/main.c
index a3ad346..fc072d1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -84,7 +84,7 @@ static struct command {
{"move", 2, 2, 0, cmd_move, "<from> <to>", "Move
song in playlist"},
/* mv is an alias for move */
{"mv", 2, 2, 0, cmd_move, "<from> <to>", NULL},
- {"playlist", 0, 0, 0, cmd_playlist, "", "Print the current
playlist"},
+ {"playlist", 0, 1, 0, cmd_playlist, "[<playlist>]", "Print
<playlist>"},
{"listall", 0, -1, 2, cmd_listall, "[<file>]", "List all
songs in the music dir"},
{"ls", 0, -1, 2, cmd_ls, "[<directory>]", "List
the contents of <directory>"},
{"lsplaylists", 0, -1, 2, cmd_lsplaylists, "", "List currently
available playlists"},
diff --git a/src/queue.c b/src/queue.c
index 68f1655..a801c0c 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -197,9 +197,13 @@ cmd_del(int argc, char **argv, struct mpd_connection *conn)
}
int
-cmd_playlist(gcc_unused int argc, gcc_unused char **argv, struct
mpd_connection *conn)
+cmd_playlist(int argc, char **argv, struct mpd_connection *conn)
{
- if (!mpd_send_list_queue_meta(conn))
+ bool ret = argc > 0
+ ? mpd_send_list_playlist_meta(conn, argv[0])
+ : mpd_send_list_queue_meta(conn);
+
+ if (ret == false)
printErrorAndExit(conn);
struct mpd_song *song;
_______________________________________________
mpd-devel mailing list
[email protected]
http://mailman.blarg.de/listinfo/mpd-devel