diff --git a/epi-sony-bravia.4Series/SonyBraviaDevice.cs b/epi-sony-bravia.4Series/SonyBraviaDevice.cs index d09896d..de475ea 100644 --- a/epi-sony-bravia.4Series/SonyBraviaDevice.cs +++ b/epi-sony-bravia.4Series/SonyBraviaDevice.cs @@ -14,15 +14,14 @@ using PepperDash.Essentials.Core.Queues; using PepperDash.Essentials.Core.Routing; using PepperDash.Essentials.Devices.Displays; +using static Crestron.SimplSharpPro.DM.Audio; namespace SonyBraviaEpi { public class SonyBraviaDevice : TwoWayDisplayBase, ICommunicationMonitor, IBridgeAdvanced, IInputHdmi1, IInputHdmi2, IInputHdmi3, IInputHdmi4, IInputVga1, IOnline - #if SERIES4 ,IHasInputs -#endif { private readonly IBasicCommunication _coms; private readonly bool _comsIsRs232; @@ -100,9 +99,8 @@ public SonyBraviaDevice(DeviceConfig config, IBasicCommunication comms) BuildInputRoutingPorts(); -#if SERIES4 SetupInputs(); -#endif + var worker = _comsIsRs232 ? new Thread(ProcessRs232Response, null) @@ -377,7 +375,6 @@ public void BuildInputRoutingPorts() new Action(InputComponent3), this), 12); } -#if SERIES4 private void SetupInputs() { Inputs = new SonyBraviaInputs @@ -447,7 +444,6 @@ private void SetupInputs() } }; } -#endif /// /// Select HDMI 1 input @@ -756,8 +752,20 @@ private object ProcessRs232Response(object _) { _currentInput = input; CurrentInputFeedback.FireUpdate(); + + if(Inputs.Items.ContainsKey(input)) + { + foreach (var item in Inputs.Items) + { + item.Value.IsSelected = item.Key.Equals(input); + } + } + + Inputs.CurrentItem = input; } + + buffer = buffer.NumberOfHeaders() > 1 ? buffer.CleanOutFirstMessage() : new byte[0]; Debug.Console(DebugLevels.DebugLevel, this, seperator); @@ -867,6 +875,18 @@ private object ProcessSimpleIpResponse(object _) } } + + // No idea if this will work with _currentInput. It's not clear how the input is determined for IP communication + if (Inputs.Items.ContainsKey(_currentInput)) + { + foreach (var item in Inputs.Items) + { + item.Value.IsSelected = item.Key.Equals(_currentInput); + } + } + + Inputs.CurrentItem = _currentInput; + Debug.Console(DebugLevels.ErrorLevel, this, "ProcessSimpleIpResponse: _currentInput == '{0}'", _currentInput); break;