diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k202CController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k202CController.cs
index 0f9fa19d..59d05bf4 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k202CController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k202CController.cs
@@ -186,7 +186,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 (Hdmi1VideoSyncFeedback != null)
{
@@ -200,64 +200,65 @@ namespace PepperDash.Essentials.DM
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);
-
- if (type == eRoutingSignalType.Video)
- {
- switch (input)
- {
- case 0:
+ public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
+ {
+ Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
+
+ switch (type)
+ {
+ case eRoutingSignalType.Video:
+ switch (input)
+ {
+ case 0:
{
ExecuteSwitch(eVst.Auto, null, type);
break;
}
- case 1:
+ case 1:
{
ExecuteSwitch(HdmiIn1.Selector, null, type);
break;
}
- case 2:
+ case 2:
{
ExecuteSwitch(HdmiIn2.Selector, null, type);
break;
}
- case 3:
+ case 3:
{
ExecuteSwitch(eVst.AllDisabled, null, type);
break;
}
- }
- }
- else if (type == eRoutingSignalType.Audio)
- {
- switch (input)
- {
- case 0:
+ }
+ break;
+ case eRoutingSignalType.Audio:
+ switch (input)
+ {
+ case 0:
{
ExecuteSwitch(eAst.Auto, null, type);
break;
}
- case 1:
+ case 1:
{
ExecuteSwitch(eAst.Hdmi1, null, type);
break;
}
- case 2:
+ case 2:
{
ExecuteSwitch(eAst.Hdmi2, null, type);
break;
}
- case 3:
+ case 3:
{
ExecuteSwitch(eAst.AllDisabled, null, type);
break;
}
- }
- }
- }
-
+ }
+ break;
+ }
+ }
+
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
{
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
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 7d787051..4e0c7fec 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k302CController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx4k302CController.cs
@@ -105,44 +105,24 @@ namespace PepperDash.Essentials.DM
() => ActualActiveVideoInput.ToString());
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
- Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
+ Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
+ Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
Tx.BaseEvent += Tx_BaseEvent;
- VideoSourceNumericFeedback = new IntFeedback(() =>
- {
- return (int)Tx.VideoSourceFeedback;
- });
- AudioSourceNumericFeedback = new IntFeedback(() =>
- {
- return (int)Tx.AudioSourceFeedback;
- });
+ VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
+ AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
- HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () =>
- {
- return (int)tx.HdmiInputs[1].HdcpCapabilityFeedback;
- });
+ HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
- HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () =>
- {
- return (int)tx.HdmiInputs[2].HdcpCapabilityFeedback;
- });
+ HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
- Hdmi1VideoSyncFeedback = new BoolFeedback(() =>
- {
- return (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue;
- });
+ Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
- Hdmi2VideoSyncFeedback = new BoolFeedback(() =>
- {
- return (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue;
- });
+ Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].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);
@@ -164,9 +144,7 @@ namespace PepperDash.Essentials.DM
{
if (ActualActiveVideoInput == eVst.Hdmi1)
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
- if (ActualActiveVideoInput == eVst.Hdmi2)
- return tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString();
- return "";
+ return ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : "";
},
VideoResolutionFeedbackFunc = () =>
@@ -175,9 +153,7 @@ namespace PepperDash.Essentials.DM
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == eVst.Hdmi2)
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
- if (ActualActiveVideoInput == eVst.Vga)
- return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
- return "";
+ return ActualActiveVideoInput == eVst.Vga ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
},
VideoSyncFeedbackFunc = () =>
(ActualActiveVideoInput == eVst.Hdmi1
@@ -209,20 +185,34 @@ namespace PepperDash.Essentials.DM
HdmiIn2.Port = Tx.HdmiInputs[2];
HdmiLoopOut.Port = Tx.HdmiOutput;
DmOut.Port = Tx.DmOutput;
- }
+ }
+
+ void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
+ {
+ switch (args.EventId)
+ {
+ case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
+ FreeRunEnabledFeedback.FireUpdate();
+ break;
+ case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
+ VgaVideoSyncFeedback.FireUpdate();
+ break;
+ }
+ }
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();
+ switch (id)
+ {
+ case VideoControlsEventIds.BrightnessFeedbackEventId:
+ VgaBrightnessFeedback.FireUpdate();
+ break;
+ case VideoControlsEventIds.ContrastFeedbackEventId:
+ VgaContrastFeedback.FireUpdate();
+ break;
}
}
@@ -246,7 +236,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 (Hdmi1VideoSyncFeedback != null)
{
@@ -268,18 +258,11 @@ namespace PepperDash.Essentials.DM
/// Enables or disables free run
///
///
- public void SetFreeRunEnabled(bool enable)
- {
- if (enable)
- {
- Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
- }
- else
- {
- Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
- }
- }
-
+ public void SetFreeRunEnabled(bool enable)
+ {
+ Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
+ }
+
///
/// Sets the VGA brightness level
///
@@ -300,74 +283,75 @@ namespace PepperDash.Essentials.DM
- public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
- {
- Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
-
- if (type == eRoutingSignalType.Video)
- {
- switch (input)
- {
- case 0:
+ public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
+ {
+ Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
+
+ switch (type)
+ {
+ case eRoutingSignalType.Video:
+ switch (input)
+ {
+ case 0:
{
ExecuteSwitch(eVst.Auto, null, type);
break;
}
- case 1:
+ case 1:
{
ExecuteSwitch(HdmiIn1.Selector, null, type);
break;
}
- case 2:
+ case 2:
{
ExecuteSwitch(HdmiIn2.Selector, null, type);
break;
}
- case 3:
+ case 3:
{
ExecuteSwitch(VgaIn.Selector, null, type);
break;
}
- case 4:
+ case 4:
{
ExecuteSwitch(eVst.AllDisabled, null, type);
break;
}
- }
- }
- else if (type == eRoutingSignalType.Audio)
- {
- switch (input)
- {
- case 0:
+ }
+ break;
+ case eRoutingSignalType.Audio:
+ switch (input)
+ {
+ case 0:
{
ExecuteSwitch(eAst.Auto, null, type);
break;
}
- case 1:
+ case 1:
{
ExecuteSwitch(eAst.Hdmi1, null, type);
break;
}
- case 2:
+ case 2:
{
ExecuteSwitch(eAst.Hdmi2, null, type);
break;
}
- case 3:
+ case 3:
{
ExecuteSwitch(eAst.AudioIn, null, type);
break;
}
- case 4:
+ case 4:
{
ExecuteSwitch(eAst.AllDisabled, null, type);
break;
}
- }
- }
- }
-
+ }
+ break;
+ }
+ }
+
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
{
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
@@ -376,54 +360,52 @@ namespace PepperDash.Essentials.DM
Tx.AudioSource = (eAst)inputSelector;
}
- void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
- {
- Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
-
- if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId)
- {
- if (inputStream == Tx.HdmiInputs[1])
- HdmiIn1HdcpCapabilityFeedback.FireUpdate();
- else if (inputStream == Tx.HdmiInputs[2])
- HdmiIn2HdcpCapabilityFeedback.FireUpdate();
- }
- else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId)
- {
- if (inputStream == Tx.HdmiInputs[1])
- HdmiIn1HdcpCapabilityFeedback.FireUpdate();
- else if (inputStream == Tx.HdmiInputs[2])
- HdmiIn2HdcpCapabilityFeedback.FireUpdate();
- }
- }
-
- void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
- {
- var id = 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();
- }
- }
-
- ///
+ void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
+ {
+ Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
+
+ switch (args.EventId)
+ {
+ case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
+ if (inputStream == Tx.HdmiInputs[1])
+ HdmiIn1HdcpCapabilityFeedback.FireUpdate();
+ else if (inputStream == Tx.HdmiInputs[2])
+ HdmiIn2HdcpCapabilityFeedback.FireUpdate();
+ break;
+ case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
+ if (inputStream == Tx.HdmiInputs[1])
+ HdmiIn1HdcpCapabilityFeedback.FireUpdate();
+ else if (inputStream == Tx.HdmiInputs[2])
+ HdmiIn2HdcpCapabilityFeedback.FireUpdate();
+ break;
+ }
+ }
+
+ void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
+ {
+ var id = args.EventId;
+ switch (id)
+ {
+ case EndpointTransmitterBase.VideoSourceFeedbackEventId:
+ Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
+ VideoSourceNumericFeedback.FireUpdate();
+ ActiveVideoInputFeedback.FireUpdate();
+ break;
+ case EndpointTransmitterBase.AudioSourceFeedbackEventId:
+ Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
+ AudioSourceNumericFeedback.FireUpdate();
+ break;
+ }
+ }
+
+ ///
/// Relays the input stream change to the appropriate RoutingInputPort.
///
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();
}
///