summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rhctl/switch_control.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rhctl/switch_control.go b/src/rhctl/switch_control.go
index 0c91331..8440e61 100644
--- a/src/rhctl/switch_control.go
+++ b/src/rhctl/switch_control.go
@@ -174,7 +174,15 @@ func (ctrl *SwitchControl) getSwitchServerAssignment() (swsrv, swch string, err
}
func (ctrl *SwitchControl) selectServer(server string) {
- // TODO: send out commands to switch
+ newIn := SwitchInputNum(1) // TODO: get input num from server name
+ for idx, in := range ctrl.state.Switch.Audio[0].Inputs {
+ if in && SwitchInputNum(idx+1) != newIn {
+ ctrl.sw.Commands <- &SwitchCommand{SwitchCmdAudioFadeDownInput, []interface{}{SwitchInputNum(idx + 1)}, nil}
+ }
+ }
+ ctrl.sw.Commands <- &SwitchCommand{SwitchCmdAudioFadeUpInput, []interface{}{newIn}, nil}
+ ctrl.settling.Reset(10 * time.Second) // TODO: hardcoded value
+ ctrl.state.Settled = false
}
func (ctrl *SwitchControl) reconcile(requestedServer string) (result bool) {