From a1e9d35a69e1a6ddefe65365e5c080fd4c9a96f2 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 24 Feb 2020 12:21:52 -0700 Subject: [PATCH 1/2] Implements IHasFreeRun and IHasVgaBrightnessContrastControls on DMTx200Controller --- .../Transmitters/DmTx200Controller.cs | 65 ++++++++++++++++++- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx200Controller.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx200Controller.cs index 3b48a0f5..42ecf5c6 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx200Controller.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx200Controller.cs @@ -19,7 +19,7 @@ namespace PepperDash.Essentials.DM /// /// Controller class for all DM-TX-201C/S/F transmitters /// - public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFeedback + public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls { public DmTx200C2G Tx { get; private set; } @@ -32,8 +32,10 @@ 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; } + + public IntFeedback VgaBrightnessFeedback { get; protected set; } + public IntFeedback VgaContrastFeedback { get; protected set; } /// /// Helps get the "real" inputs, including when in Auto @@ -123,6 +125,14 @@ namespace PepperDash.Essentials.DM HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport; + FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled); + + VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue); + VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue); + + tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange); + + var combinedFuncs = new VideoStatusFuncsWrapper { HdcpActiveFeedbackFunc = () => @@ -170,6 +180,21 @@ namespace PepperDash.Essentials.DM DmOutput.Port = Tx.DmOutput; } + void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args) + { + var id = args.EventId; + Debug.Console(2, this, "EventId {0}", args.EventId); + + if (id == VideoControlsEventIds.BrightnessFeedbackEventId) + { + VgaBrightnessFeedback.FireUpdate(); + } + else if (id == VideoControlsEventIds.ContrastFeedbackEventId) + { + VgaContrastFeedback.FireUpdate(); + } + } + void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args) { ActiveVideoInputFeedback.FireUpdate(); @@ -191,6 +216,40 @@ 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; + } + } + + /// + /// Sets the VGA brightness level + /// + /// + public void SetVgaBrightness(ushort level) + { + Tx.VgaInput.VideoControls.Brightness.UShortValue = level; + } + + /// + /// Sets the VGA contrast level + /// + /// + public void SetVgaContrast(ushort level) + { + Tx.VgaInput.VideoControls.Contrast.UShortValue = level; + } + public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type) { Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input); From d80602d3c6e1c22abcad9b57c3c221e1c3eb5666 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 24 Feb 2020 14:11:18 -0700 Subject: [PATCH 2/2] Adds IHasFreeRun and IVgaBrightnessContrastControls to 401 and 302 Tx controller classes --- .../Transmitters/DmTx401CController.cs | 63 +++++++++++++++++- .../Transmitters/DmTx4k302CController.cs | 66 ++++++++++++++++++- 2 files changed, 125 insertions(+), 4 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs index 86003aae..18e91fbe 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs @@ -17,7 +17,7 @@ namespace PepperDash.Essentials.DM { using eVst = DmTx401C.eSourceSelection; - public class DmTx401CController : DmTxControllerBase, ITxRouting, IHasFeedback, IIROutputPorts, IComPorts + public class DmTx401CController : DmTxControllerBase, ITxRouting, IHasFeedback, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls { public DmTx401C Tx { get; private set; } @@ -34,6 +34,11 @@ namespace PepperDash.Essentials.DM public IntFeedback AudioSourceNumericFeedback { get; protected set; } public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; } + public BoolFeedback FreeRunEnabledFeedback { get; protected set; } + + public IntFeedback VgaBrightnessFeedback { get; protected set; } + public IntFeedback VgaContrastFeedback { get; protected set; } + /// /// Helps get the "real" inputs, including when in Auto /// @@ -130,6 +135,13 @@ namespace PepperDash.Essentials.DM HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport; + FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled); + + VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue); + VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue); + + tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange); + var combinedFuncs = new VideoStatusFuncsWrapper { HdcpActiveFeedbackFunc = () => @@ -269,6 +281,55 @@ namespace PepperDash.Essentials.DM } } + void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args) + { + var id = args.EventId; + Debug.Console(2, this, "EventId {0}", args.EventId); + + if (id == VideoControlsEventIds.BrightnessFeedbackEventId) + { + VgaBrightnessFeedback.FireUpdate(); + } + else if (id == VideoControlsEventIds.ContrastFeedbackEventId) + { + VgaContrastFeedback.FireUpdate(); + } + } + + /// + /// Enables or disables free run + /// + /// + public void SetFreeRunEnabled(bool enable) + { + if (enable) + { + Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled; + } + else + { + Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled; + } + } + + /// + /// Sets the VGA brightness level + /// + /// + public void SetVgaBrightness(ushort level) + { + Tx.VgaInput.VideoControls.Brightness.UShortValue = level; + } + + /// + /// Sets the VGA contrast level + /// + /// + public void SetVgaContrast(ushort level) + { + Tx.VgaInput.VideoControls.Contrast.UShortValue = level; + } + /// /// Relays the input stream change to the appropriate RoutingInputPort. /// diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k302CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k302CController.cs index cb91f857..baaac013 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k302CController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k302CController.cs @@ -19,7 +19,7 @@ namespace PepperDash.Essentials.DM using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType; public class DmTx4k302CController : DmTxControllerBase, ITxRouting, IHasFeedback, - IIROutputPorts, IComPorts + IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls { public DmTx4k302C Tx { get; private set; } @@ -35,8 +35,10 @@ namespace PepperDash.Essentials.DM public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; } public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; } - //public override IntFeedback HdcpSupportAllFeedback { get; protected set; } - //public override ushort HdcpSupportCapability { get; protected set; } + public BoolFeedback FreeRunEnabledFeedback { get; protected set; } + + public IntFeedback VgaBrightnessFeedback { get; protected set; } + public IntFeedback VgaContrastFeedback { get; protected set; } /// /// Helps get the "real" inputs, including when in Auto @@ -122,6 +124,13 @@ namespace PepperDash.Essentials.DM HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support; + FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled); + + VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue); + VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue); + + tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange); + var combinedFuncs = new VideoStatusFuncsWrapper { @@ -181,6 +190,21 @@ namespace PepperDash.Essentials.DM DmOut.Port = Tx.DmOutput; } + void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args) + { + var id = args.EventId; + Debug.Console(2, this, "EventId {0}", args.EventId); + + if (id == VideoControlsEventIds.BrightnessFeedbackEventId) + { + VgaBrightnessFeedback.FireUpdate(); + } + else if (id == VideoControlsEventIds.ContrastFeedbackEventId) + { + VgaContrastFeedback.FireUpdate(); + } + } + public override bool CustomActivate() @@ -199,6 +223,42 @@ 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; + } + } + + /// + /// Sets the VGA brightness level + /// + /// + public void SetVgaBrightness(ushort level) + { + Tx.VgaInput.VideoControls.Brightness.UShortValue = level; + } + + /// + /// Sets the VGA contrast level + /// + /// + public void SetVgaContrast(ushort level) + { + Tx.VgaInput.VideoControls.Contrast.UShortValue = level; + } + + + public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type) { Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);