From cad45c04cbfae8db2053291b3090fc9b7dd1784f Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 20 Sep 2021 16:12:39 -0600 Subject: [PATCH] fix: Add method to register for the correct event for resolution feedback The resolution feedback change events don't appear to bubble up to the main DMInput change event. It appears to require subscribing to an event on the VideoAttributes class that the input contains. --- .../Chassis/DmChassisController.cs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs index de9a088a..51990f07 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs @@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM.Cards; using Crestron.SimplSharpPro.DM.Endpoints; +using Crestron.SimplSharpProInternal; using Newtonsoft.Json; using PepperDash.Core; using PepperDash.Essentials.Core; @@ -482,6 +483,29 @@ namespace PepperDash.Essentials.DM } + private void RegisterForInputResolutionFeedback(IVideoAttributesBasic input, uint number, RoutingInputPortWithVideoStatuses inputPort) + { + if (input == null) + { + return; + } + + input.VideoAttributes.AttributeChange += (sender, args) => + { + var inputAttributes = sender as IVideoAttributesBasic; + + if (inputAttributes == null) + { + return; + } + + Debug.Console(1, this, "Input {0} resolution updated", number); + + Debug.Console(1, this, "Updating resolution feedback for input {0}", number); + inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate(); + }; + } + /// /// /// @@ -883,6 +907,8 @@ namespace PepperDash.Essentials.DM { FeedbackMatchObject = Chassis.Inputs[cardNum] }; + + RegisterForInputResolutionFeedback(videoAttributesBasic, cardNum, inputPort as RoutingInputPortWithVideoStatuses); } else {