summaryrefslogtreecommitdiff
path: root/src/rhctl/audio_switch_command.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-04-02 23:13:25 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-04-02 23:13:25 (GMT)
commit2f34a5e62285a3c5334c270c6111e43fc12e8dbf (patch)
tree8931b4d9fa0262f3ccc61d6b59d28a7ebd2a34dd /src/rhctl/audio_switch_command.go
parentdf49dff4c6f96d1c2e032cc93e7b6bdb57f11833 (diff)
refactoring of server, switch states
Diffstat (limited to 'src/rhctl/audio_switch_command.go')
-rw-r--r--src/rhctl/audio_switch_command.go30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/rhctl/audio_switch_command.go b/src/rhctl/audio_switch_command.go
index d3aef7e..17be8d3 100644
--- a/src/rhctl/audio_switch_command.go
+++ b/src/rhctl/audio_switch_command.go
@@ -124,11 +124,11 @@ func (o *SwitchOCNum) FromString(str string) error {
type SwitchCmdString string
const (
- SwitchCmdStatusAudio SwitchCmdString = "*uSL"
- SwitchCmdStatusGPI SwitchCmdString = "*uSPA"
- SwitchCmdStatusOC SwitchCmdString = "*uSO"
- SwitchCmdStatusRelay SwitchCmdString = "*uSR"
- SwitchCmdStatusSilence SwitchCmdString = "*uSS"
+ SwitchCmdStateAudio SwitchCmdString = "*uSL"
+ SwitchCmdStateGPI SwitchCmdString = "*uSPA"
+ SwitchCmdStateOC SwitchCmdString = "*uSO"
+ SwitchCmdStateRelay SwitchCmdString = "*uSR"
+ SwitchCmdStateSilence SwitchCmdString = "*uSS"
SwitchCmdAudioApplyInput SwitchCmdString = "*uiio"
SwitchCmdAudioApplyInputAll SwitchCmdString = "*uiiA"
@@ -177,24 +177,24 @@ type SwitchCommand struct {
Response chan<- interface{}
}
-func SwitchCommandParseStatus(args []string) (cmdstr SwitchCmdString, cmdargs []interface{}, err error) {
+func SwitchCommandParseState(args []string) (cmdstr SwitchCmdString, cmdargs []interface{}, err error) {
if len(args) == 0 {
- err = fmt.Errorf("missing argument <status-type>")
+ err = fmt.Errorf("missing argument <state-type>")
return
}
switch args[0] {
case "audio":
- cmdstr = SwitchCmdStatusAudio
+ cmdstr = SwitchCmdStateAudio
case "gpi":
- cmdstr = SwitchCmdStatusGPI
+ cmdstr = SwitchCmdStateGPI
case "oc":
- cmdstr = SwitchCmdStatusOC
+ cmdstr = SwitchCmdStateOC
case "relay":
- cmdstr = SwitchCmdStatusRelay
+ cmdstr = SwitchCmdStateRelay
case "silence":
- cmdstr = SwitchCmdStatusSilence
+ cmdstr = SwitchCmdStateSilence
default:
- err = fmt.Errorf("unknown status-type: '%s'", args[0])
+ err = fmt.Errorf("unknown state-type: '%s'", args[0])
return
}
return
@@ -353,8 +353,8 @@ func SwitchCommandParseOC(args []string) (cmdstr SwitchCmdString, cmdargs []inte
func NewSwitchCommandFromStrings(cmd string, args ...string) (c *SwitchCommand, err error) {
c = &SwitchCommand{}
switch cmd {
- case "status":
- c.Cmd, c.Args, err = SwitchCommandParseStatus(args)
+ case "state":
+ c.Cmd, c.Args, err = SwitchCommandParseState(args)
case "out":
c.Cmd, c.Args, err = SwitchCommandParseAudio(args)
case "relay":