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.
This commit is contained in:
Andrew Welker
2021-09-20 16:12:39 -06:00
parent fa6cabe246
commit cad45c04cb

View File

@@ -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();
};
}
/// <summary>
///
/// </summary>
@@ -883,6 +907,8 @@ namespace PepperDash.Essentials.DM
{
FeedbackMatchObject = Chassis.Inputs[cardNum]
};
RegisterForInputResolutionFeedback(videoAttributesBasic, cardNum, inputPort as RoutingInputPortWithVideoStatuses);
}
else
{