aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-10 04:13:23 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-10 04:13:23 +0000
commit491027a5fcdb0c9e6c13362adc2a026360bf2a50 (patch)
treeaad3b0b9949f27d83f697540c1b00cdef036165a
parent051cfc228d89d95cd050daacbf7a73cd259a4a2e (diff)
downloadmpd-491027a5fcdb0c9e6c13362adc2a026360bf2a50.tar.gz
mpd-491027a5fcdb0c9e6c13362adc2a026360bf2a50.tar.xz
mpd-491027a5fcdb0c9e6c13362adc2a026360bf2a50.zip
todo update
git-svn-id: https://svn.musicpd.org/mpd/trunk@1433 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--TODO4
-rw-r--r--src/command.c13
2 files changed, 13 insertions, 4 deletions
diff --git a/TODO b/TODO
index 74a48426d..1d55edf5a 100644
--- a/TODO
+++ b/TODO
@@ -2,14 +2,10 @@
*) Fix charset errors so they don't goto stderr/out
-*) Add a timeout for streams (how long? 1 minutes?)
-
*) compute time of vorbis from actual number of samples played
*) remove previous hack for streams
-*) add "plversion" and "currentsong" commands
-
Post-1.0
--------
1) crosslink "list" stuff, for example, artists are crosslinked to alubms and
diff --git a/src/command.c b/src/command.c
index b3d2acbcd..9014ccccc 100644
--- a/src/command.c
+++ b/src/command.c
@@ -81,6 +81,7 @@
#define COMMAND_CROSSFADE "crossfade"
#define COMMAND_URL_HANDLERS "urlhandlers"
#define COMMAND_PLCHANGES "plchanges"
+#define COMMAND_CURRENT "current"
#define COMMAND_STATUS_VOLUME "volume"
#define COMMAND_STATUS_STATE "state"
@@ -193,6 +194,17 @@ int handleStop(FILE * fp, unsigned int * permission, int argArrayLength,
return stopPlaylist(fp);
}
+int handleCurrent(FILE * fp, unsigned int * permission, int argArrayLength,
+ char ** argArray)
+{
+ int song = getPlaylistCurrentSong();
+
+ if(song >= 0) {
+ return playlistInfo(fp, song);
+ }
+ else return 0;
+}
+
int handlePause(FILE * fp, unsigned int * permission,
int argArrayLength, char ** argArray)
{
@@ -749,6 +761,7 @@ void initCommands() {
addCommand(COMMAND_PLAY ,PERMISSION_CONTROL, 0, 1,handlePlay,NULL);
addCommand(COMMAND_PLAYID ,PERMISSION_CONTROL, 0, 1,handlePlayId,NULL);
addCommand(COMMAND_STOP ,PERMISSION_CONTROL, 0, 0,handleStop,NULL);
+ addCommand(COMMAND_CURRENT ,PERMISSION_READ , 0, 0,handleCurrent,NULL);
addCommand(COMMAND_PAUSE ,PERMISSION_CONTROL, 0, 1,handlePause,NULL);
addCommand(COMMAND_STATUS ,PERMISSION_READ, 0, 0,commandStatus,NULL);
addCommand(COMMAND_KILL ,PERMISSION_ADMIN, -1,-1,handleKill,NULL);