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 ed614829..21ef967a 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx201CController.cs
@@ -21,7 +21,7 @@ namespace PepperDash.Essentials.DM
///
/// Controller class for all DM-TX-201C/S/F transmitters
///
- public class DmTx201CController : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls
+ public class DmTx201CController : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
{
public DmTx201C Tx { get; private set; } // uses the 201S class as it is the base class for the 201C
@@ -107,43 +107,29 @@ namespace PepperDash.Essentials.DM
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
() => ActualActiveVideoInput.ToString());
- Tx.HdmiInput.InputStreamChange += new EndpointInputStreamChangeEventHandler(InputStreamChangeEvent);
+ Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
+ Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
Tx.BaseEvent += Tx_BaseEvent;
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
- VideoSourceNumericFeedback = new IntFeedback(() =>
- {
- return (int)Tx.VideoSourceFeedback;
- });
- AudioSourceNumericFeedback = new IntFeedback(() =>
- {
- return (int)Tx.AudioSourceFeedback;
- });
+ VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
- HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
- {
- if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
- return 1;
- else
- return 0;
- });
+ AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
+
+ HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
+ (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0));
- HdmiVideoSyncFeedback = new BoolFeedback(() =>
- {
- return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
- });
+ HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
- VgaVideoSyncFeedback = new BoolFeedback(() =>
- {
- return (bool)tx.VgaInput.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);
- tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
+ tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
@@ -152,22 +138,18 @@ namespace PepperDash.Essentials.DM
HdcpActiveFeedbackFunc = () =>
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
-
- HdcpStateFeedbackFunc = () =>
- {
- if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
- return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
- return "";
- },
+
+ HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ?
+ tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
VideoResolutionFeedbackFunc = () =>
{
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
- if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog)
- return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
- return "";
+ return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ?
+ tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
},
+
VideoSyncFeedbackFunc = () =>
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue)
@@ -201,15 +183,16 @@ 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();
+ Debug.Console(2, this, "EventId {0}", args.EventId);
+
+ switch (id)
+ {
+ case VideoControlsEventIds.BrightnessFeedbackEventId:
+ VgaBrightnessFeedback.FireUpdate();
+ break;
+ case VideoControlsEventIds.ContrastFeedbackEventId:
+ VgaContrastFeedback.FireUpdate();
+ break;
}
}
@@ -219,6 +202,19 @@ namespace PepperDash.Essentials.DM
VideoSourceNumericFeedback.FireUpdate();
AudioSourceNumericFeedback.FireUpdate();
+ }
+
+ private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
+ {
+ switch (args.EventId)
+ {
+ case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
+ FreeRunEnabledFeedback.FireUpdate();
+ break;
+ case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
+ VgaVideoSyncFeedback.FireUpdate();
+ break;
+ }
}
public override bool CustomActivate()
@@ -235,7 +231,7 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
- DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
+ var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
if (HdmiVideoSyncFeedback != null)
{
@@ -254,15 +250,8 @@ namespace PepperDash.Essentials.DM
///
///
public void SetFreeRunEnabled(bool enable)
- {
- if (enable)
- {
- Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
- }
- else
- {
- Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
- }
+ {
+ Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
}
///
@@ -329,40 +318,40 @@ namespace PepperDash.Essentials.DM
void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
{
var id = args.EventId;
- Debug.Console(2, this, "EventId {0}", args.EventId);
-
- if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId)
- {
- Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
- VideoSourceNumericFeedback.FireUpdate();
- ActiveVideoInputFeedback.FireUpdate();
- }
-
- // ------------------------------ incomplete -----------------------------------------
- else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
- {
- Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
- AudioSourceNumericFeedback.FireUpdate();
- }
-
+ Debug.Console(2, this, "EventId {0}", args.EventId);
+
+ switch (id)
+ {
+ case EndpointTransmitterBase.VideoSourceFeedbackEventId:
+ Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
+ ActiveVideoInputFeedback.FireUpdate();
+ VideoSourceNumericFeedback.FireUpdate();
+ ActiveVideoInputFeedback.FireUpdate();
+ break;
+ case EndpointTransmitterBase.AudioSourceFeedbackEventId:
+ Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
+ AudioSourceNumericFeedback.FireUpdate();
+ break;
+ }
}
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{
- Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
+ Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
+
+ switch (args.EventId)
+ {
+ case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
+ HdmiInHdcpCapabilityFeedback.FireUpdate();
+ break;
+ case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
+ HdmiInHdcpCapabilityFeedback.FireUpdate();
+ break;
+ case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
+ VgaVideoSyncFeedback.FireUpdate();
+ break;
+ }
- if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
- {
- HdmiInHdcpCapabilityFeedback.FireUpdate();
- }
- else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
- {
- HdmiInHdcpCapabilityFeedback.FireUpdate();
- }
- else if (args.EventId == EndpointInputStreamEventIds.FreeRunFeedbackEventId)
- {
- FreeRunEnabledFeedback.FireUpdate();
- }
}
///
@@ -370,11 +359,12 @@ namespace PepperDash.Essentials.DM
///
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
{
- if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
- {
- inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
- AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
- }
+ if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
+ {
+ return;
+ }
+ inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
}
///