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 f40da022..1289d1a7 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs
@@ -1,46 +1,46 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
-//using Crestron.SimplSharpPro.DeviceSupport;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Crestron.SimplSharpPro.DM;
-using Crestron.SimplSharpPro.DM.Endpoints;
-using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Bridges;
-using PepperDash.Essentials.DM.Config;
-
-namespace PepperDash.Essentials.DM
-{
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+//using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.DM;
+using Crestron.SimplSharpPro.DM.Endpoints;
+using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.DM.Config;
+
+namespace PepperDash.Essentials.DM
+{
using eVst = DmTx401C.eSourceSelection;
[Description("Wrapper class for DM-TX-401-C")]
- public class DmTx401CController : DmTxControllerBase, ITxRoutingWithFeedback, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
- {
- public DmTx401C Tx { get; private set; }
-
- public RoutingInputPortWithVideoStatuses HdmiIn { get; private set; }
- public RoutingInputPortWithVideoStatuses DisplayPortIn { get; private set; }
- public RoutingInputPortWithVideoStatuses VgaIn { get; private set; }
- public RoutingInputPortWithVideoStatuses CompositeIn { get; private set; }
- public RoutingOutputPort DmOut { get; private set; }
-
- public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
- public IntFeedback VideoSourceNumericFeedback { get; protected set; }
- public IntFeedback AudioSourceNumericFeedback { get; protected set; }
- public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
- public BoolFeedback DisplayPortVideoSyncFeedback { get; protected set; }
- public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
- public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
-
- public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
-
- public IntFeedback VgaBrightnessFeedback { get; protected set; }
+ public class DmTx401CController : DmTxControllerBase, ITxRoutingWithFeedback, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
+ {
+ public DmTx401C Tx { get; private set; }
+
+ public RoutingInputPortWithVideoStatuses HdmiIn { get; private set; }
+ public RoutingInputPortWithVideoStatuses DisplayPortIn { get; private set; }
+ public RoutingInputPortWithVideoStatuses VgaIn { get; private set; }
+ public RoutingInputPortWithVideoStatuses CompositeIn { get; private set; }
+ public RoutingOutputPort DmOut { get; private set; }
+
+ public override StringFeedback ActiveVideoInputFeedback { get; protected set; }
+ public IntFeedback VideoSourceNumericFeedback { get; protected set; }
+ public IntFeedback AudioSourceNumericFeedback { get; protected set; }
+ public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
+ public BoolFeedback DisplayPortVideoSyncFeedback { get; protected set; }
+ public BoolFeedback HdmiVideoSyncFeedback { get; protected set; }
+ public BoolFeedback VgaVideoSyncFeedback { get; protected set; }
+
+ public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
+
+ public IntFeedback VgaBrightnessFeedback { get; protected set; }
public IntFeedback VgaContrastFeedback { get; protected set; }
//IroutingNumericEvent
@@ -54,88 +54,88 @@ namespace PepperDash.Essentials.DM
{
var newEvent = NumericSwitchChange;
if (newEvent != null) newEvent(this, e);
- }
-
-
- ///
- /// Helps get the "real" inputs, including when in Auto
- ///
- public BaseDmTx401.eSourceSelection ActualVideoInput
- {
- get
- {
- if (Tx.VideoSourceFeedback != BaseDmTx401.eSourceSelection.Auto)
- return Tx.VideoSourceFeedback;
- else // auto
- {
- if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
- return BaseDmTx401.eSourceSelection.HDMI;
- else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
- return BaseDmTx401.eSourceSelection.VGA;
- else if (Tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
- return BaseDmTx401.eSourceSelection.DisplayPort;
- else if (Tx.CvbsInput.SyncDetectedFeedback.BoolValue)
- return BaseDmTx401.eSourceSelection.Composite;
- else
- return BaseDmTx401.eSourceSelection.Disabled;
- }
- }
- }
-
- public RoutingPortCollection InputPorts
- {
- get
- {
- return new RoutingPortCollection
- {
- HdmiIn,
- DisplayPortIn,
- VgaIn,
- CompositeIn,
- AnyVideoInput
- };
- }
- }
-
- public RoutingPortCollection OutputPorts
- {
- get
- {
- return new RoutingPortCollection { DmOut };
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public DmTx401CController(string key, string name, DmTx401C tx)
- : base(key, name, tx)
- {
- Tx = tx;
-
- HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
- eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.HDMI, this,
+ }
+
+
+ ///
+ /// Helps get the "real" inputs, including when in Auto
+ ///
+ public BaseDmTx401.eSourceSelection ActualVideoInput
+ {
+ get
+ {
+ if (Tx.VideoSourceFeedback != BaseDmTx401.eSourceSelection.Auto)
+ return Tx.VideoSourceFeedback;
+ else // auto
+ {
+ if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
+ return BaseDmTx401.eSourceSelection.HDMI;
+ else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
+ return BaseDmTx401.eSourceSelection.VGA;
+ else if (Tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
+ return BaseDmTx401.eSourceSelection.DisplayPort;
+ else if (Tx.CvbsInput.SyncDetectedFeedback.BoolValue)
+ return BaseDmTx401.eSourceSelection.Composite;
+ else
+ return BaseDmTx401.eSourceSelection.Disabled;
+ }
+ }
+ }
+
+ public RoutingPortCollection InputPorts
+ {
+ get
+ {
+ return new RoutingPortCollection
+ {
+ HdmiIn,
+ DisplayPortIn,
+ VgaIn,
+ CompositeIn,
+ AnyVideoInput
+ };
+ }
+ }
+
+ public RoutingPortCollection OutputPorts
+ {
+ get
+ {
+ return new RoutingPortCollection { DmOut };
+ }
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public DmTx401CController(string key, string name, DmTx401C tx)
+ : base(key, name, tx)
+ {
+ Tx = tx;
+
+ HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
+ eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.HDMI, this,
VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput))
{
FeedbackMatchObject = eVst.HDMI
- };
- DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.DisplayPortIn,
- eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.DisplayPort, this,
+ };
+ DisplayPortIn = new RoutingInputPortWithVideoStatuses(DmPortName.DisplayPortIn,
+ eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.DisplayPort, this,
VideoStatusHelper.GetDisplayPortInputStatusFuncs(tx.DisplayPortInput))
{
FeedbackMatchObject = eVst.DisplayPort
- };
- VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
- eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.VGA, this,
+ };
+ VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
+ eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.VGA, this,
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
{
FeedbackMatchObject = eVst.VGA
- };
- CompositeIn = new RoutingInputPortWithVideoStatuses(DmPortName.CompositeIn,
- eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, eVst.Composite, this,
+ };
+ CompositeIn = new RoutingInputPortWithVideoStatuses(DmPortName.CompositeIn,
+ eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, eVst.Composite, this,
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput))
{
FeedbackMatchObject = eVst.Composite
@@ -146,185 +146,188 @@ namespace PepperDash.Essentials.DM
Tx.BaseEvent += Tx_BaseEvent;
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
- tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
-
-
- ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
+ tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
+
+
+ ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
() => ActualVideoInput.ToString());
- VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
-
+ VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
+
AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0);
- HdcpStateFeedback = HdmiInHdcpCapabilityFeedback;
-
+ HdcpStateFeedback = HdmiInHdcpCapabilityFeedback;
+
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
DisplayPortVideoSyncFeedback = new BoolFeedback("DisplayPortVideoSync", () => (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue);
HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
- VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
-
- FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
-
- VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
-
- VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
-
-
- var combinedFuncs = new VideoStatusFuncsWrapper
- {
- HdcpActiveFeedbackFunc = () =>
- (ActualVideoInput == eVst.HDMI
- && tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue)
- || (ActualVideoInput == eVst.DisplayPort
- && tx.DisplayPortInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
-
- HdcpStateFeedbackFunc = () =>
- {
- if (ActualVideoInput == eVst.HDMI)
- return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
- if (ActualVideoInput == eVst.DisplayPort)
- return tx.DisplayPortInput.VideoAttributes.HdcpStateFeedback.ToString();
- return "";
- },
-
- VideoResolutionFeedbackFunc = () =>
- {
- if (ActualVideoInput == eVst.HDMI)
- return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
- if (ActualVideoInput == eVst.DisplayPort)
- return tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString();
- if (ActualVideoInput == eVst.VGA)
- return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
- if (ActualVideoInput == eVst.Composite)
- return tx.CvbsInput.VideoAttributes.GetVideoResolutionString();
- return "";
- },
- VideoSyncFeedbackFunc = () =>
- (ActualVideoInput == eVst.HDMI
- && tx.HdmiInput.SyncDetectedFeedback.BoolValue)
- || (ActualVideoInput == eVst.DisplayPort
- && tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
- || (ActualVideoInput == eVst.VGA
- && tx.VgaInput.SyncDetectedFeedback.BoolValue)
- || (ActualVideoInput == eVst.Composite
- && tx.CvbsInput.SyncDetectedFeedback.BoolValue)
- };
-
- AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
- eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
-
- DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.DmCat, null, this);
-
- AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
- AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
- AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
- AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, DisplayPortVideoSyncFeedback,
- HdmiVideoSyncFeedback, VgaVideoSyncFeedback);
-
- // Set Ports for CEC
- DisplayPortIn.Port = Tx.DisplayPortInput;
- HdmiIn.Port = Tx.HdmiInput;
- DmOut.Port = Tx.DmOutput;
- }
-
- public override bool CustomActivate()
- {
- // Link up all of these damned events to the various RoutingPorts via a helper handler
- Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn, a.EventId);
- Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn, a.EventId);
-
- Tx.DisplayPortInput.InputStreamChange += (o, a) => FowardInputStreamChange(DisplayPortIn, a.EventId);
- Tx.DisplayPortInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(DisplayPortIn, a.EventId);
-
- Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaIn, a.EventId);
- Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId);
-
- // Base does register and sets up comm monitoring.
- return base.CustomActivate();
- }
-
- public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
-
- if (HdmiVideoSyncFeedback != null)
- {
- HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
- }
- if (VgaVideoSyncFeedback != null)
+ VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
+
+ FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
+
+ VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
+
+ VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
+
+
+ var combinedFuncs = new VideoStatusFuncsWrapper
+ {
+ HdcpActiveFeedbackFunc = () =>
+ (ActualVideoInput == eVst.HDMI
+ && tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue)
+ || (ActualVideoInput == eVst.DisplayPort
+ && tx.DisplayPortInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
+
+ HdcpStateFeedbackFunc = () =>
+ {
+ if (ActualVideoInput == eVst.HDMI)
+ return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
+ if (ActualVideoInput == eVst.DisplayPort)
+ return tx.DisplayPortInput.VideoAttributes.HdcpStateFeedback.ToString();
+ return "";
+ },
+
+ VideoResolutionFeedbackFunc = () =>
+ {
+ if (ActualVideoInput == eVst.HDMI)
+ return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
+ if (ActualVideoInput == eVst.DisplayPort)
+ return tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString();
+ if (ActualVideoInput == eVst.VGA)
+ return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
+ if (ActualVideoInput == eVst.Composite)
+ return tx.CvbsInput.VideoAttributes.GetVideoResolutionString();
+ return "";
+ },
+ VideoSyncFeedbackFunc = () =>
+ (ActualVideoInput == eVst.HDMI
+ && tx.HdmiInput.SyncDetectedFeedback.BoolValue)
+ || (ActualVideoInput == eVst.DisplayPort
+ && tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
+ || (ActualVideoInput == eVst.VGA
+ && tx.VgaInput.SyncDetectedFeedback.BoolValue)
+ || (ActualVideoInput == eVst.Composite
+ && tx.CvbsInput.SyncDetectedFeedback.BoolValue)
+ };
+
+ AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
+ eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
+
+ DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.DmCat, null, this);
+
+ AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
+ AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
+ AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
+ AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, DisplayPortVideoSyncFeedback,
+ HdmiVideoSyncFeedback, VgaVideoSyncFeedback);
+
+ // Set Ports for CEC
+ DisplayPortIn.Port = Tx.DisplayPortInput;
+ HdmiIn.Port = Tx.HdmiInput;
+ DmOut.Port = Tx.DmOutput;
+ }
+
+ public override bool CustomActivate()
+ {
+ // Link up all of these damned events to the various RoutingPorts via a helper handler
+ Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiIn, a.EventId);
+ Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn, a.EventId);
+
+ Tx.DisplayPortInput.InputStreamChange += (o, a) => FowardInputStreamChange(DisplayPortIn, a.EventId);
+ Tx.DisplayPortInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(DisplayPortIn, a.EventId);
+
+ Tx.VgaInput.InputStreamChange += (o, a) => FowardInputStreamChange(VgaIn, a.EventId);
+ Tx.VgaInput.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId);
+
+ // Base does register and sets up comm monitoring.
+ return base.CustomActivate();
+ }
+
+ public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
+
+ if (HdmiVideoSyncFeedback != null)
{
- VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
- }
-
- LinkDmTxToApi(this, trilist, joinMap, bridge);
- }
-
- public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
- {
- Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
-
- switch (input)
- {
- case 0:
- {
- ExecuteSwitch(eVst.Auto, null, type);
- break;
- }
- case 1:
- {
- ExecuteSwitch(DisplayPortIn.Selector, null, type);
- break;
- }
- case 2:
- {
- ExecuteSwitch(HdmiIn.Selector, null, type);
- break;
- }
- case 3:
- {
- ExecuteSwitch(VgaIn.Selector, null, type);
- break;
- }
- case 4:
- {
- ExecuteSwitch(CompositeIn.Selector, null, type);
- break;
- }
- case 5:
- {
- ExecuteSwitch(eVst.Disabled, null, type);
- break;
- }
- }
-
- }
-
- public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
- {
- if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
- Tx.VideoSource = (eVst)inputSelector;
- if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
- Tx.AudioSource = (eVst)inputSelector;
+ HdmiVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input1VideoSyncStatus.JoinNumber]);
+ }
+ if (VgaVideoSyncFeedback != null)
+ {
+ VgaVideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Input2VideoSyncStatus.JoinNumber]);
+ }
+
+ LinkDmTxToApi(this, trilist, joinMap, bridge);
+ }
+
+ public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
+ {
+ Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
+
+ switch (input)
+ {
+ case 0:
+ {
+ ExecuteSwitch(eVst.Auto, null, type);
+ break;
+ }
+ case 1:
+ {
+ ExecuteSwitch(DisplayPortIn.Selector, null, type);
+ break;
+ }
+ case 2:
+ {
+ ExecuteSwitch(HdmiIn.Selector, null, type);
+ break;
+ }
+ case 3:
+ {
+ ExecuteSwitch(VgaIn.Selector, null, type);
+ break;
+ }
+ case 4:
+ {
+ ExecuteSwitch(CompositeIn.Selector, null, type);
+ break;
+ }
+ case 5:
+ {
+ ExecuteSwitch(eVst.Disabled, null, type);
+ break;
+ }
+ }
+
+ }
+
+ public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
+ {
+ if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
+ Tx.VideoSource = (eVst)inputSelector;
+ if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
+ Tx.AudioSource = (eVst)inputSelector;
}
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
- var localVideoInputPort =
- InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
- var localAudioInputPort =
- InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.AudioSourceFeedback);
+ if (args.DeviceOnLine)
+ {
+ var localVideoInputPort =
+ InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.VideoSourceFeedback);
+ var localAudioInputPort =
+ InputPorts.FirstOrDefault(p => (eVst)p.Selector == Tx.AudioSourceFeedback);
- ActiveVideoInputFeedback.FireUpdate();
- VideoSourceNumericFeedback.FireUpdate();
- AudioSourceNumericFeedback.FireUpdate();
- OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
- OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
+ ActiveVideoInputFeedback.FireUpdate();
+ VideoSourceNumericFeedback.FireUpdate();
+ AudioSourceNumericFeedback.FireUpdate();
+ OnSwitchChange(new RoutingNumericEventArgs(1, VideoSourceNumericFeedback.UShortValue, OutputPorts.First(), localVideoInputPort, eRoutingSignalType.Video));
+ OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localAudioInputPort, eRoutingSignalType.Audio));
+ }
}
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
@@ -348,7 +351,7 @@ namespace PepperDash.Essentials.DM
OnSwitchChange(new RoutingNumericEventArgs(1, AudioSourceNumericFeedback.UShortValue, OutputPorts.First(), localInputAudioPort, eRoutingSignalType.Audio));
break;
}
- }
+ }
void VideoControls_ControlChange(object sender, GenericEventArgs args)
{
@@ -364,7 +367,7 @@ namespace PepperDash.Essentials.DM
VgaContrastFeedback.FireUpdate();
break;
}
- }
+ }
///
/// Enables or disables free run
@@ -391,10 +394,10 @@ namespace PepperDash.Essentials.DM
public void SetVgaContrast(ushort level)
{
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
- }
-
- ///
- /// Relays the input stream change to the appropriate RoutingInputPort.
+ }
+
+ ///
+ /// Relays the input stream change to the appropriate RoutingInputPort.
///
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
{
@@ -404,36 +407,36 @@ namespace PepperDash.Essentials.DM
}
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
- }
-
- ///
- /// Relays the VideoAttributes change to a RoutingInputPort
- ///
- void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
- {
- //// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
- //Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
- // args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
- switch (eventId)
- {
- case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
- inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
- AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
- break;
- case VideoAttributeEventIds.HdcpStateFeedbackEventId:
- inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
- AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
- break;
- case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
- case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
- inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
- AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
- break;
- case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
- inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
- AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
- break;
- }
+ }
+
+ ///
+ /// Relays the VideoAttributes change to a RoutingInputPort
+ ///
+ void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
+ {
+ //// LOCATION: Crestron.SimplSharpPro.DM.VideoAttributeEventIds
+ //Debug.Console(2, this, "VideoAttributes_AttributeChange event id={0} from {1}",
+ // args.EventId, (sender as VideoAttributesEnhanced).Owner.GetType());
+ switch (eventId)
+ {
+ case VideoAttributeEventIds.HdcpActiveFeedbackEventId:
+ inputPort.VideoStatus.HdcpActiveFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.HdcpActiveFeedback.FireUpdate();
+ break;
+ case VideoAttributeEventIds.HdcpStateFeedbackEventId:
+ inputPort.VideoStatus.HdcpStateFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.HdcpStateFeedback.FireUpdate();
+ break;
+ case VideoAttributeEventIds.HorizontalResolutionFeedbackEventId:
+ case VideoAttributeEventIds.VerticalResolutionFeedbackEventId:
+ inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ break;
+ case VideoAttributeEventIds.FramesPerSecondFeedbackEventId:
+ inputPort.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.VideoResolutionFeedback.FireUpdate();
+ break;
+ }
}
void HdmiInputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
@@ -477,18 +480,18 @@ namespace PepperDash.Essentials.DM
VgaVideoSyncFeedback.FireUpdate();
break;
}
- }
-
-
-
- #region IIROutputPorts Members
- public CrestronCollection IROutputPorts { get { return Tx.IROutputPorts; } }
- public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
- #endregion
-
- #region IComPorts Members
- public CrestronCollection ComPorts { get { return Tx.ComPorts; } }
- public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
- #endregion
- }
+ }
+
+
+
+ #region IIROutputPorts Members
+ public CrestronCollection IROutputPorts { get { return Tx.IROutputPorts; } }
+ public int NumberOfIROutputPorts { get { return Tx.NumberOfIROutputPorts; } }
+ #endregion
+
+ #region IComPorts Members
+ public CrestronCollection ComPorts { get { return Tx.ComPorts; } }
+ public int NumberOfComPorts { get { return Tx.NumberOfComPorts; } }
+ #endregion
+ }
}
\ No newline at end of file