diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-11-02 23:08:00 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-11-02 23:08:00 +0000 |
commit | 78c5d884d2c687034d18e4cb77c7c116e1c97b84 (patch) | |
tree | b03bb3b356709672de05453ff1e8c48e02286015 /src/command.c | |
parent | 44eb26c16fb66908f75d395e63a16c343c28e00d (diff) | |
download | mpd-78c5d884d2c687034d18e4cb77c7c116e1c97b84.tar.gz mpd-78c5d884d2c687034d18e4cb77c7c116e1c97b84.tar.xz mpd-78c5d884d2c687034d18e4cb77c7c116e1c97b84.zip |
new command "devices", prints devices and their states
git-svn-id: https://svn.musicpd.org/mpd/trunk@2486 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/command.c')
-rw-r--r-- | src/command.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/command.c b/src/command.c index a98c1cf1f..d7d644cd0 100644 --- a/src/command.c +++ b/src/command.c @@ -82,8 +82,9 @@ #define COMMAND_URL_HANDLERS "urlhandlers" #define COMMAND_PLCHANGES "plchanges" #define COMMAND_CURRENTSONG "currentsong" -#define COMMAND_ENABLE_DEV "enable_device" -#define COMMAND_DISABLE_DEV "disable_device" +#define COMMAND_ENABLE_DEV "enabledevice" +#define COMMAND_DISABLE_DEV "disabledevice" +#define COMMAND_DEVICES "devices" #define COMMAND_STATUS_VOLUME "volume" #define COMMAND_STATUS_STATE "state" @@ -790,6 +791,14 @@ int handleDisableDevice(FILE * fp, unsigned int * permission, return disableAudioDevice(fp, device); } +int handleDevices(FILE * fp, unsigned int * permission, int argArrayLength, + char ** argArray) +{ + printAudioDevices(fp); + + return 0; +} + void initCommands() { commandList = makeList(free); @@ -840,6 +849,7 @@ void initCommands() { addCommand(COMMAND_PLCHANGES ,PERMISSION_READ, 1, 1,handlePlaylistChanges,NULL); addCommand(COMMAND_ENABLE_DEV ,PERMISSION_ADMIN, 1, 1,handleEnableDevice,NULL); addCommand(COMMAND_DISABLE_DEV ,PERMISSION_ADMIN, 1, 1,handleDisableDevice,NULL); + addCommand(COMMAND_DEVICES ,PERMISSION_ADMIN, 0, 0,handleDevices,NULL); sortList(commandList); } |