summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-04-20 01:26:47 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-04-20 01:26:47 (GMT)
commit68bf38157465311e6e5bb83723c2097d1d11da58 (patch)
tree2c269db7f0f8211a2f0737ea202322d3895dac26
parent5eae78ec8f85d0d329bd289bed169e5fe3bfd340 (diff)
sending fade commands @ selectServer works now
-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) {