From 68bf38157465311e6e5bb83723c2097d1d11da58 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 20 Apr 2016 03:26:47 +0200 Subject: sending fade commands @ selectServer works now 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) { -- cgit v0.10.2