aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorAvuton Olrich <avuton@gmail.com>2005-03-14 02:35:46 +0000
committerAvuton Olrich <avuton@gmail.com>2005-03-14 02:35:46 +0000
commit593e1343da918efce047b015e532be54a9e98af5 (patch)
treee866ec4b99c7fc58fc97fe11e40c9c5665f3bb13 /src/command.c
parent094746d82dbaacede7e41e8635ce86bb0db2fda9 (diff)
downloadmpd-593e1343da918efce047b015e532be54a9e98af5.tar.gz
mpd-593e1343da918efce047b015e532be54a9e98af5.tar.xz
mpd-593e1343da918efce047b015e532be54a9e98af5.zip
- Add 'mute' command for testing
- Revamp AUTHORS file git-svn-id: https://svn.musicpd.org/mpd/trunk@3081 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/command.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c
index 2c307e0bb..438b55ffb 100644
--- a/src/command.c
+++ b/src/command.c
@@ -64,6 +64,7 @@
#define COMMAND_PREVIOUS "previous"
#define COMMAND_LISTALL "listall"
#define COMMAND_VOLUME "volume"
+#define COMMAND_MUTE "mute"
#define COMMAND_REPEAT "repeat"
#define COMMAND_RANDOM "random"
#define COMMAND_STATS "stats"
@@ -90,6 +91,7 @@
#define COMMAND_NOTCOMMANDS "notcommands"
#define COMMAND_STATUS_VOLUME "volume"
+#define COMMAND_STATUS_MUTE "mute"
#define COMMAND_STATUS_STATE "state"
#define COMMAND_STATUS_REPEAT "repeat"
#define COMMAND_STATUS_RANDOM "random"
@@ -248,6 +250,7 @@ int commandStatus(FILE * fp, unsigned int * permission, int argArrayLength,
}
myfprintf(fp,"%s: %i\n",COMMAND_STATUS_VOLUME,getVolumeLevel());
+ myfprintf(fp,"%s: %i\n",COMMAND_STATUS_MUTE,getVolumeMuteStatus());
myfprintf(fp,"%s: %i\n",COMMAND_STATUS_REPEAT,getPlaylistRepeatStatus());
myfprintf(fp,"%s: %i\n",COMMAND_STATUS_RANDOM,getPlaylistRandomStatus());
myfprintf(fp,"%s: %li\n",COMMAND_STATUS_PLAYLIST,getPlaylistVersion());
@@ -572,6 +575,20 @@ int handleSetVol(FILE * fp, unsigned int * permission, int argArrayLength,
return changeVolumeLevel(fp,level,0);
}
+int handleMute(FILE * fp, unsigned int * permission, int argArrayLength,
+ char ** argArray)
+{
+ int status;
+ char * test;
+
+ status = strtol(argArray[1],&test,10);
+ if(*test!='\0') {
+ commandError(fp, ACK_ERROR_ARG, "need an integer", NULL);
+ return -1;
+ }
+ return setVolumeMuteStatus(fp,status);
+}
+
int handleRepeat(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray)
{
@@ -942,6 +959,7 @@ void initCommands() {
addCommand(COMMAND_PREVIOUS ,PERMISSION_CONTROL, 0, 0,handlePrevious,NULL);
addCommand(COMMAND_LISTALL ,PERMISSION_READ, 0, 1,handleListAll,NULL);
addCommand(COMMAND_VOLUME ,PERMISSION_CONTROL, 1, 1,handleVolume,NULL);
+ addCommand(COMMAND_MUTE ,PERMISSION_CONTROL, 1, 1,handleMute,NULL);
addCommand(COMMAND_REPEAT ,PERMISSION_CONTROL, 1, 1,handleRepeat,NULL);
addCommand(COMMAND_RANDOM ,PERMISSION_CONTROL, 1, 1,handleRandom,NULL);
addCommand(COMMAND_STATS ,PERMISSION_READ, 0, 0,handleStats,NULL);