From 73ab16ce55c49bd2895fb5f9f0964f9d11a49878 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 18 Feb 2020 20:09:51 -0700 Subject: [PATCH] Adds FreeRun support for DM-TX-201-C. Need to test on NYC hardware and then apply to other TX classes. --- .../Transmitters/DmTx201CController.cs | 34 +++++++++++++++++-- .../Endpoints/Transmitters/IFreeRunEnabled.cs | 20 +++++++++++ .../Essentials_DM/Essentials_DM.csproj | 1 + 3 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/IFreeRunEnabled.cs diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs index ba7a005d..28c5611b 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs @@ -19,7 +19,7 @@ namespace PepperDash.Essentials.DM /// /// Controller class for all DM-TX-201C/S/F transmitters /// - public class DmTx201XController : DmTxControllerBase, ITxRouting, IHasFeedback + public class DmTx201XController : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun { public DmTx201S Tx { get; private set; } // uses the 201S class as it is the base class for the 201C @@ -33,8 +33,7 @@ namespace PepperDash.Essentials.DM public IntFeedback AudioSourceNumericFeedback { get; protected set; } public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; } - //public override IntFeedback HdcpSupportAllFeedback { get; protected set; } - //public override ushort HdcpSupportCapability { get; protected set; } + public BoolFeedback FreeRunEnabledFeedback { get; protected set; } /// /// Helps get the "real" inputs, including when in Auto @@ -122,6 +121,8 @@ namespace PepperDash.Essentials.DM return 0; }); + FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled); + HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport; var combinedFuncs = new VideoStatusFuncsWrapper @@ -195,6 +196,28 @@ namespace PepperDash.Essentials.DM return base.CustomActivate(); } + /// + /// Enables or disables free run + /// + /// + public void SetFreeRunEnabled(bool enable) + { + if (enable) + { + Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled; + } + else + { + Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled; + } + } + + /// + /// Switches the audio/video source based on the integer value (0-Auto, 1-HDMI, 2-VGA, 3-Disable) + /// + /// + /// + /// public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type) { Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input); @@ -250,6 +273,7 @@ namespace PepperDash.Essentials.DM Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback); AudioSourceNumericFeedback.FireUpdate(); } + } void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args) @@ -264,6 +288,10 @@ namespace PepperDash.Essentials.DM { HdmiInHdcpCapabilityFeedback.FireUpdate(); } + else if (args.EventId == EndpointInputStreamEventIds.FreeRunFeedbackEventId) + { + FreeRunEnabledFeedback.FireUpdate(); + } } /// diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/IFreeRunEnabled.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/IFreeRunEnabled.cs new file mode 100644 index 00000000..7410af9c --- /dev/null +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/IFreeRunEnabled.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +using PepperDash.Essentials.Core; + +namespace PepperDash.Essentials.DM +{ + /// + /// Defines a device capable of setting the Free Run state of a VGA input and reporting feedback + /// + public interface IHasFreeRun + { + BoolFeedback FreeRunEnabledFeedback { get; } + + void SetFreeRunEnabled(bool enable); + } +} \ No newline at end of file diff --git a/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj b/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj index 6f31634d..127a9e42 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj +++ b/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj @@ -96,6 +96,7 @@ +