aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-02-25 00:08:48 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-02-25 00:08:48 +0000
commitaaf4282654277b26fa7889e9a4b36aa8080fd9e3 (patch)
treed5135ecf49dbfa508ce3daebe97d5c7a8c4a8b28 /src/command.c
parent068d307a711bbcefc6868ff97fdf931269d13b44 (diff)
downloadmpd-aaf4282654277b26fa7889e9a4b36aa8080fd9e3.tar.gz
mpd-aaf4282654277b26fa7889e9a4b36aa8080fd9e3.tar.xz
mpd-aaf4282654277b26fa7889e9a4b36aa8080fd9e3.zip
have pause take an optional arugment
git-svn-id: https://svn.musicpd.org/mpd/trunk@43 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/command.c b/src/command.c
index 6cc49eee6..9d0fca603 100644
--- a/src/command.c
+++ b/src/command.c
@@ -144,6 +144,16 @@ int handleStop(FILE * fp, unsigned int * permission, int argArrayLength,
int handlePause(FILE * fp, unsigned int * permission,
int argArrayLength, char ** argArray)
{
+ if(argArrayLength==2) {
+ char * test;
+ int pause = strtol(argArray[1],&test,10);
+ if(*test!='\0' || (pause!=0 && pause!=1)) {
+ myfprintf(fp,"%s \%s\" is not 0 or 1\n",
+ COMMAND_RESPOND_ERROR,pause);
+ return -1;
+ }
+ return playerSetPause(fp,pause);
+ }
return playerPause(fp);
}
@@ -524,7 +534,7 @@ void initCommands() {
addCommand(COMMAND_PLAY ,PERMISSION_CONTROL, 0, 1,handlePlay);
addCommand(COMMAND_STOP ,PERMISSION_CONTROL, 0, 0,handleStop);
- addCommand(COMMAND_PAUSE ,PERMISSION_CONTROL, 0, 0,handlePause);
+ addCommand(COMMAND_PAUSE ,PERMISSION_CONTROL, 0, 1,handlePause);
addCommand(COMMAND_STATUS ,PERMISSION_READ, 0, 0,commandStatus);
addCommand(COMMAND_KILL ,PERMISSION_ADMIN, -1,-1,handleKill);
addCommand(COMMAND_CLOSE ,0, -1,-1,handleClose);