mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
Implements IHasFreeRun and IHasVgaBrightnessContrastControls on DMTx200Controller
This commit is contained in:
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFeedback
|
public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||||
{
|
{
|
||||||
public DmTx200C2G Tx { get; private set; }
|
public DmTx200C2G Tx { get; private set; }
|
||||||
|
|
||||||
@@ -32,8 +32,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||||
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
|
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
|
||||||
|
|
||||||
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||||
//public override ushort HdcpSupportCapability { get; protected set; }
|
|
||||||
|
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||||
|
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helps get the "real" inputs, including when in Auto
|
/// Helps get the "real" inputs, including when in Auto
|
||||||
@@ -123,6 +125,14 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
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
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
{
|
{
|
||||||
HdcpActiveFeedbackFunc = () =>
|
HdcpActiveFeedbackFunc = () =>
|
||||||
@@ -170,6 +180,21 @@ namespace PepperDash.Essentials.DM
|
|||||||
DmOutput.Port = Tx.DmOutput;
|
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)
|
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
ActiveVideoInputFeedback.FireUpdate();
|
ActiveVideoInputFeedback.FireUpdate();
|
||||||
@@ -191,6 +216,40 @@ namespace PepperDash.Essentials.DM
|
|||||||
return base.CustomActivate();
|
return base.CustomActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enables or disables free run
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="enable"></param>
|
||||||
|
public void SetFreeRunEnabled(bool enable)
|
||||||
|
{
|
||||||
|
if (enable)
|
||||||
|
{
|
||||||
|
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the VGA brightness level
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="level"></param>
|
||||||
|
public void SetVgaBrightness(ushort level)
|
||||||
|
{
|
||||||
|
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the VGA contrast level
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="level"></param>
|
||||||
|
public void SetVgaContrast(ushort level)
|
||||||
|
{
|
||||||
|
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||||
|
}
|
||||||
|
|
||||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||||
|
|||||||
Reference in New Issue
Block a user