diff --git a/PepperDashEssentials/Bridges/BridgeBase.cs b/PepperDashEssentials/Bridges/BridgeBase.cs
index aa3ed15f..68ca0751 100644
--- a/PepperDashEssentials/Bridges/BridgeBase.cs
+++ b/PepperDashEssentials/Bridges/BridgeBase.cs
@@ -102,7 +102,11 @@ namespace PepperDash.Essentials.Bridges
(device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
continue;
}
-
+ else if (device is DmpsRoutingController)
+ {
+ (device as DmpsRoutingController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
+ continue;
+ }
else if (device is DmTxControllerBase)
{
(device as DmTxControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
@@ -127,7 +131,7 @@ namespace PepperDash.Essentials.Bridges
{
(device as AppleTV).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
continue;
- }
+ }
else if (device is IBridge)
{
(device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
@@ -217,16 +221,26 @@ namespace PepperDash.Essentials.Bridges
///
void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
{
- if (Debug.Level >= 1)
- Debug.Console(1, this, "EiscApi change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
- var uo = args.Sig.UserObject;
- Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
- if (uo is Action)
- (uo as Action)(args.Sig.BoolValue);
- else if (uo is Action)
- (uo as Action)(args.Sig.UShortValue);
- else if (uo is Action)
- (uo as Action)(args.Sig.StringValue);
+ try
+ {
+ if (Debug.Level >= 1)
+ Debug.Console(1, this, "EiscApi change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
+ var uo = args.Sig.UserObject;
+ if (uo != null)
+ {
+ Debug.Console(1, this, "Executing Action: {0}", uo.ToString());
+ if (uo is Action)
+ (uo as Action)(args.Sig.BoolValue);
+ else if (uo is Action)
+ (uo as Action)(args.Sig.UShortValue);
+ else if (uo is Action)
+ (uo as Action)(args.Sig.StringValue);
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e);
+ }
}
}
diff --git a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs
index 807c733c..85558645 100644
--- a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs
+++ b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.DM;
using PepperDash.Core;
using PepperDash.Essentials.Core;
@@ -27,7 +28,7 @@ namespace PepperDash.Essentials.Bridges
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
// Link up outputs
- for (uint i = 1; i <= dmChassis.Chassis.NumberOfOutputs - 1; i++)
+ for (uint i = 1; i <= dmChassis.Chassis.NumberOfOutputs; i++)
{
var ioSlot = i;
@@ -39,8 +40,16 @@ namespace PepperDash.Essentials.Bridges
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
var TxKey = dmChassis.TxDictionary[ioSlot];
var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
- dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
- //TxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
+ if (dmChassis.Chassis is DmMd8x8Cpu3 || dmChassis.Chassis is DmMd8x8Cpu3rps
+ || dmChassis.Chassis is DmMd16x16Cpu3 || dmChassis.Chassis is DmMd16x16Cpu3rps
+ || dmChassis.Chassis is DmMd32x32Cpu3 || dmChassis.Chassis is DmMd32x32Cpu3rps)
+ {
+ dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
+ }
+ else
+ {
+ TxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
+ }
// TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
// trilist.SetUShortSigAction((ApiMap.HdcpSupport[ioSlot]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
// TxDevice.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap. + ioSlot]);
@@ -55,9 +64,16 @@ namespace PepperDash.Essentials.Bridges
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
var RxKey = dmChassis.RxDictionary[ioSlot];
var RxDevice = DeviceManager.GetDeviceForKey(RxKey) as DmRmcControllerBase;
- dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
-
- //RxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
+ if (dmChassis.Chassis is DmMd8x8Cpu3 || dmChassis.Chassis is DmMd8x8Cpu3rps
+ || dmChassis.Chassis is DmMd16x16Cpu3 || dmChassis.Chassis is DmMd16x16Cpu3rps
+ || dmChassis.Chassis is DmMd32x32Cpu3 || dmChassis.Chassis is DmMd32x32Cpu3rps)
+ {
+ dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
+ }
+ else
+ {
+ RxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
+ }
}
// Feedback
dmChassis.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
@@ -69,8 +85,6 @@ namespace PepperDash.Essentials.Bridges
dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
dmChassis.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
- // dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
- // dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
}
}
diff --git a/PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs b/PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
new file mode 100644
index 00000000..1f61b1b6
--- /dev/null
+++ b/PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
@@ -0,0 +1,177 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.DM;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.DM;
+
+namespace PepperDash.Essentials.Bridges
+{
+ public static class DmpsRoutingControllerApiExtentions
+ {
+ public static void LinkToApi(this DmpsRoutingController dmpsRouter, BasicTriList trilist, uint joinStart, string joinMapKey)
+ {
+ var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmpsRoutingControllerJoinMap;
+
+ if (joinMap == null)
+ joinMap = new DmpsRoutingControllerJoinMap();
+
+ joinMap.OffsetJoinNumbers(joinStart);
+
+ Debug.Console(1, dmpsRouter, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ // Link up outputs
+ for (uint i = 1; i <= dmpsRouter.Dmps.NumberOfSwitcherInputs; i++)
+ {
+ Debug.Console(2, dmpsRouter, "Linking Input Card {0}", i);
+
+ var ioSlot = i;
+
+ //if (dmpsRouter.TxDictionary.ContainsKey(ioSlot))
+ //{
+ // Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
+ // var TxKey = dmpsRouter.TxDictionary[ioSlot];
+ // var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
+ // //TxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
+ // // TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
+ // // trilist.SetUShortSigAction((ApiMap.HdcpSupport[ioSlot]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
+ // // TxDevice.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap. + ioSlot]);
+ // // trilist.UShortInput[ApiMap.HdcpSupportCapability[ioSlot]].UShortValue = TxDevice.HdcpSupportCapability;
+ //}
+ //else
+ //{
+ // // dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[ApiMap.TxVideoSyncStatus[ioSlot]]);
+ //}
+
+ if(dmpsRouter.VideoInputSyncFeedbacks[ioSlot] != null)
+ dmpsRouter.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
+
+ if (dmpsRouter.InputNameFeedbacks[ioSlot] != null)
+ dmpsRouter.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
+
+ trilist.SetStringSigAction(joinMap.InputNames + ioSlot, new Action(s =>
+ {
+ var inputCard = dmpsRouter.Dmps.SwitcherInputs[ioSlot] as DMInput;
+
+ if (inputCard != null)
+ {
+ if (inputCard.NameFeedback != null && !string.IsNullOrEmpty(inputCard.NameFeedback.StringValue) && inputCard.NameFeedback.StringValue != s)
+ if(inputCard.Name != null)
+ inputCard.Name.StringValue = s;
+ }
+ }));
+
+
+ if(dmpsRouter.InputEndpointOnlineFeedbacks[ioSlot] != null)
+ dmpsRouter.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
+ }
+
+ for (uint i = 1; i <= dmpsRouter.Dmps.NumberOfSwitcherOutputs; i++)
+ {
+ Debug.Console(2, dmpsRouter, "Linking Output Card {0}", i);
+
+ var ioSlot = i;
+ // Control
+ trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action(o => dmpsRouter.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)));
+ trilist.SetUShortSigAction(joinMap.OutputAudio + ioSlot, new Action(o => dmpsRouter.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio)));
+
+ trilist.SetStringSigAction(joinMap.OutputNames + ioSlot, new Action(s =>
+ {
+ var outputCard = dmpsRouter.Dmps.SwitcherOutputs[ioSlot] as DMOutput;
+
+ //Debug.Console(2, dmpsRouter, "Output Name String Sig Action for Output Card {0}", ioSlot);
+
+ if (outputCard != null)
+ {
+ //Debug.Console(2, dmpsRouter, "Card Type: {0}", outputCard.CardInputOutputType);
+
+ if (!(outputCard is Crestron.SimplSharpPro.DM.Cards.Card.Dmps3CodecOutput) && outputCard.NameFeedback != null)
+ {
+ if (!string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
+ {
+ //Debug.Console(2, dmpsRouter, "NameFeedabck: {0}", outputCard.NameFeedback.StringValue);
+
+ if (outputCard.NameFeedback.StringValue != s && outputCard.Name != null)
+ {
+ outputCard.Name.StringValue = s;
+ }
+ }
+ }
+ }
+ }));
+
+ // Feedback
+ if(dmpsRouter.VideoOutputFeedbacks[ioSlot] != null)
+ dmpsRouter.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
+ if (dmpsRouter.AudioOutputFeedbacks[ioSlot] != null)
+ dmpsRouter.AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]);
+ if (dmpsRouter.OutputNameFeedbacks[ioSlot] != null)
+ dmpsRouter.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
+ if (dmpsRouter.OutputVideoRouteNameFeedbacks[ioSlot] != null)
+ dmpsRouter.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
+ if (dmpsRouter.OutputAudioRouteNameFeedbacks[ioSlot] != null)
+ dmpsRouter.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
+ if (dmpsRouter.OutputEndpointOnlineFeedbacks[ioSlot] != null)
+ dmpsRouter.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
+ }
+ }
+
+
+ public class DmpsRoutingControllerJoinMap : JoinMapBase
+ {
+ public uint OutputVideo { get; set; }
+ public uint OutputAudio { get; set; }
+ public uint VideoSyncStatus { get; set; }
+ public uint InputNames { get; set; }
+ public uint OutputNames { get; set; }
+ public uint OutputCurrentVideoInputNames { get; set; }
+ public uint OutputCurrentAudioInputNames { get; set; }
+ public uint InputCurrentResolution { get; set; }
+ public uint InputEndpointOnline { get; set; }
+ public uint OutputEndpointOnline { get; set; }
+ //public uint HdcpSupport { get; set; }
+ //public uint HdcpSupportCapability { get; set; }
+
+
+ public DmpsRoutingControllerJoinMap()
+ {;
+ OutputVideo = 100; //101-299
+ OutputAudio = 300; //301-499
+ VideoSyncStatus = 100; //101-299
+ InputNames = 100; //101-299
+ OutputNames = 300; //301-499
+ OutputCurrentVideoInputNames = 2000; //2001-2199
+ OutputCurrentAudioInputNames = 2200; //2201-2399
+ InputCurrentResolution = 2400; // 2401-2599
+ InputEndpointOnline = 500;
+ OutputEndpointOnline = 700;
+ //HdcpSupport = 1000; //1001-1199
+ //HdcpSupportCapability = 1200; //1201-1399
+
+ }
+
+ public override void OffsetJoinNumbers(uint joinStart)
+ {
+ var joinOffset = joinStart - 1;
+
+ OutputVideo = OutputVideo + joinOffset;
+ OutputAudio = OutputAudio + joinOffset;
+ VideoSyncStatus = VideoSyncStatus + joinOffset;
+ InputNames = InputNames + joinOffset;
+ OutputNames = OutputNames + joinOffset;
+ OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
+ OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
+ InputCurrentResolution = InputCurrentResolution + joinOffset;
+ InputEndpointOnline = InputEndpointOnline + joinOffset;
+ OutputEndpointOnline = OutputEndpointOnline + joinOffset;
+ //HdcpSupport = HdcpSupport + joinOffset;
+ //HdcpSupportCapability = HdcpSupportCapability + joinOffset;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs
index 1325ea3e..795a4228 100644
--- a/PepperDashEssentials/ControlSystem.cs
+++ b/PepperDashEssentials/ControlSystem.cs
@@ -356,8 +356,22 @@ namespace PepperDash.Essentials
public void LoadDevices()
{
// Build the processor wrapper class
+
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
+ // Check if the processor is a DMPS model
+ if (this.ControllerPrompt.IndexOf("dmps", StringComparison.OrdinalIgnoreCase) > -1)
+ {
+ Debug.Console(2, "Adding DmpsRoutingController for {0} to Device Manager.", this.ControllerPrompt);
+
+ var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, new DM.Config.DmpsRoutingPropertiesConfig());
+ DeviceManager.AddDevice(dmpsRoutingController);
+ }
+ else
+ {
+ Debug.Console(2, "************Processor is not DMPS type***************");
+ }
+
// Add global System Monitor device
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
@@ -373,7 +387,7 @@ namespace PepperDash.Essentials
if (devConf.Type.ToLower() != Global.ControlSystem.ControllerPrompt.ToLower())
Debug.Console(0,
"WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available",
- devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
+ devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
continue;
}
diff --git a/PepperDashEssentials/PepperDashEssentials.csproj b/PepperDashEssentials/PepperDashEssentials.csproj
index ae31ff6e..bdc25538 100644
--- a/PepperDashEssentials/PepperDashEssentials.csproj
+++ b/PepperDashEssentials/PepperDashEssentials.csproj
@@ -121,6 +121,7 @@
+
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingPort.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingPort.cs
index 47e47501..34e9b573 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingPort.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Routing/RoutingPort.cs
@@ -33,7 +33,7 @@ namespace PepperDash.Essentials.Core
{
Audio = 1,
Video = 2,
- AudioVideo = 3
+ AudioVideo = 4
}
public enum eRoutingPortConnectionType
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
index 4e413749..7d6d3444 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
@@ -21,8 +21,8 @@ namespace PepperDash.Essentials.DM
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
///
///
- public class DmChassisController : CrestronGenericBaseDevice, IRoutingInputsOutputs, IRouting, IHasFeedback//, ICardPortsDevice
- {
+ public class DmChassisController : CrestronGenericBaseDevice, IRoutingInputsOutputs, IRouting, IHasFeedback
+ {
public DmMDMnxn Chassis { get; private set; }
// Feedbacks for EssentialDM
@@ -117,82 +117,6 @@ namespace PepperDash.Essentials.DM
controller.InputNames = properties.InputNames;
controller.OutputNames = properties.OutputNames;
return controller;
-
-
- //DmChassisController controller = null;
-
- //if (type == "dmmd8x8")
- //{
- // controller = new DmChassisController(key, name, new DmMd8x8(ipid, Global.ControlSystem));
-
- // // add the cards and port names
- // foreach (var kvp in properties.InputSlots)
- // controller.AddInputCard(kvp.Value, kvp.Key);
- // foreach (var kvp in properties.OutputSlots)
- // {
- // controller.AddOutputCard(kvp.Value, kvp.Key);
-
- // }
-
- // foreach (var kvp in properties.VolumeControls)
- // {
- // // get the card
- // // check it for an audio-compatible type
- // // make a something-something that will make it work
- // // retire to mountain village
- // var outNum = kvp.Key;
- // var card = controller.Chassis.Outputs[outNum].Card;
- // Audio.Output audio = null;
- // if (card is DmcHdo)
- // audio = (card as DmcHdo).Audio;
- // else if (card is Dmc4kHdo)
- // audio = (card as Dmc4kHdo).Audio;
- // if (audio == null)
- // continue;
- // // wire up the audio to something here...
- // controller.AddVolumeControl(outNum, audio);
- // }
-
- // controller.InputNames = properties.InputNames;
- // controller.OutputNames = properties.OutputNames;
- // return controller;
- //}
- //else if (type == "dmmd16x16")
- //{
- // controller = new DmChassisController(key, name, new DmMd16x16(ipid, Global.ControlSystem));
-
- // // add the cards and port names
- // foreach (var kvp in properties.InputSlots)
- // controller.AddInputCard(kvp.Value, kvp.Key);
- // foreach (var kvp in properties.OutputSlots)
- // {
- // controller.AddOutputCard(kvp.Value, kvp.Key);
-
- // }
-
- // foreach (var kvp in properties.VolumeControls)
- // {
- // // get the card
- // // check it for an audio-compatible type
- // // make a something-something that will make it work
- // // retire to mountain village
- // var outNum = kvp.Key;
- // var card = controller.Chassis.Outputs[outNum].Card;
- // Audio.Output audio = null;
- // if (card is DmcHdo)
- // audio = (card as DmcHdo).Audio;
- // else if (card is Dmc4kHdo)
- // audio = (card as Dmc4kHdo).Audio;
- // if (audio == null)
- // continue;
- // // wire up the audio to something here...
- // controller.AddVolumeControl(outNum, audio);
- // }
-
- // controller.InputNames = properties.InputNames;
- // controller.OutputNames = properties.OutputNames;
- // return controller;
- //}
}
catch (System.Exception e)
{
@@ -218,7 +142,6 @@ namespace PepperDash.Essentials.DM
TxDictionary = new Dictionary();
RxDictionary = new Dictionary();
IsOnline.OutputChange += new EventHandler(IsOnline_OutputChange);
- //IsOnline.OutputChange += new EventHandler(this.IsOnline_OutputChange);
Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
//Chassis.DMSystemChange += new DMSystemEventHandler(Chassis_DMSystemChange);
Chassis.DMOutputChange += new DMOutputEventHandler(Chassis_DMOutputChange);
@@ -249,7 +172,7 @@ namespace PepperDash.Essentials.DM
return Chassis.Inputs[tempX].VideoDetectedFeedback.BoolValue;
});
InputNameFeedbacks[tempX] = new StringFeedback(() => {
- if (Chassis.Inputs[tempX].NameFeedback.StringValue != null)
+ if (Chassis.Inputs[tempX].NameFeedback != null)
{
return Chassis.Inputs[tempX].NameFeedback.StringValue;
}
@@ -259,7 +182,7 @@ namespace PepperDash.Essentials.DM
}
});
OutputNameFeedbacks[tempX] = new StringFeedback(() => {
- if (Chassis.Outputs[tempX].NameFeedback.StringValue != null)
+ if (Chassis.Outputs[tempX].NameFeedback != null)
{
return Chassis.Outputs[tempX].NameFeedback.StringValue;
}
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsInternalVirtualDmTxController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsInternalVirtualDmTxController.cs
new file mode 100644
index 00000000..7e58056d
--- /dev/null
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsInternalVirtualDmTxController.cs
@@ -0,0 +1,451 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DM;
+using Crestron.SimplSharpPro.DM.Cards;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+
+
+namespace PepperDash.Essentials.DM
+{
+ ///
+ ///
+ ///
+ public class DmpsInternalVirtualHdmiVgaInputController : Device, ITxRouting, IHasFeedback
+ {
+ public Card.Dmps3HdmiVgaInput InputCard { get; protected set; }
+
+ public eHdcpCapabilityType HdcpSupportCapability { get; protected set; }
+ public StringFeedback ActiveVideoInputFeedback { get; protected set; }
+
+ public RoutingInputPortWithVideoStatuses HdmiIn { get; protected set; }
+ public RoutingInputPortWithVideoStatuses VgaIn { get; protected set; }
+ public RoutingInputPort AudioIn { get; protected set; }
+ public RoutingInputPortWithVideoStatuses AnyVideoInput { get; protected set; }
+
+ public RoutingOutputPort VirtualDmOut { get; protected set; }
+
+ public IntFeedback VideoSourceNumericFeedback { get; protected set; }
+ public IntFeedback AudioSourceNumericFeedback { get; protected set; }
+ public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
+
+ ///
+ /// Returns a list containing the Outputs that we want to expose.
+ ///
+ public FeedbackCollection Feedbacks { get; private set; }
+
+ public void SetPortHdcpCapability(eHdcpCapabilityType hdcpMode, uint port) { }
+
+ ///
+ /// Helps get the "real" inputs, including when in Auto
+ ///
+ public eDmps3InputVideoSource ActualVideoInput
+ {
+ get
+ {
+ if (InputCard.VideoSourceFeedback != eDmps3InputVideoSource.Auto)
+ return InputCard.VideoSourceFeedback;
+ else // auto
+ {
+ if (InputCard.HdmiInputPort.SyncDetectedFeedback.BoolValue)
+ return eDmps3InputVideoSource.Hdmi;
+ else if (InputCard.VgaInputPort.SyncDetectedFeedback.BoolValue)
+ return eDmps3InputVideoSource.Vga;
+ else
+ return eDmps3InputVideoSource.Bnc;
+ }
+ }
+ }
+
+ public virtual RoutingPortCollection InputPorts
+ {
+ get
+ {
+ return new RoutingPortCollection
+ {
+ HdmiIn,
+ VgaIn,
+ AudioIn,
+ AnyVideoInput
+ };
+ }
+ }
+
+ public RoutingPortCollection OutputPorts
+ {
+ get
+ {
+ return new RoutingPortCollection { VirtualDmOut };
+ }
+ }
+
+ public DmpsInternalVirtualHdmiVgaInputController(string key, string name, DMInput inputCard)
+ : base(key, name)
+ {
+ Feedbacks = new FeedbackCollection();
+
+ if (inputCard is Card.Dmps3HdmiVgaInput)
+ {
+ InputCard = inputCard as Card.Dmps3HdmiVgaInput;
+
+ HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi,
+ eDmps3InputVideoSource.Hdmi, this, VideoStatusHelper.GetHdmiInputStatusFuncs(InputCard.HdmiInputPort));
+ VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
+ eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eDmps3InputVideoSource.Vga, this,
+ VideoStatusHelper.GetVgaInputStatusFuncs(InputCard.VgaInputPort));
+ AudioIn = new RoutingInputPort(DmPortName.AudioIn, eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio,
+ eDmps3InputAudioSource.Analog, this);
+
+ if (InputCard.HdmiInputPort.HdcpSupportedLevelFeedback == eHdcpSupportedLevel.Hdcp2xSupport)
+ HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
+ else if (InputCard.HdmiInputPort.HdcpSupportedLevelFeedback == eHdcpSupportedLevel.Hdcp1xSupport)
+ HdcpSupportCapability = eHdcpCapabilityType.Hdcp1xSupport;
+
+ var combinedFuncs = new VideoStatusFuncsWrapper
+ {
+ HdcpActiveFeedbackFunc = () =>
+ (ActualVideoInput == eDmps3InputVideoSource.Hdmi
+ && InputCard.HdmiInputPort.VideoAttributes.HdcpActiveFeedback.BoolValue),
+
+ HdcpStateFeedbackFunc = () =>
+ {
+ if (ActualVideoInput == eDmps3InputVideoSource.Hdmi)
+ return InputCard.HdmiInputPort.VideoAttributes.HdcpStateFeedback.ToString();
+ return "";
+ },
+
+ VideoResolutionFeedbackFunc = () =>
+ {
+ if (ActualVideoInput == eDmps3InputVideoSource.Hdmi)
+ return InputCard.HdmiInputPort.VideoAttributes.GetVideoResolutionString();
+ if (ActualVideoInput == eDmps3InputVideoSource.Vga)
+ return InputCard.VgaInputPort.VideoAttributes.GetVideoResolutionString();
+ return "";
+ },
+ VideoSyncFeedbackFunc = () =>
+ (ActualVideoInput == eDmps3InputVideoSource.Hdmi
+ && InputCard.HdmiInputPort.SyncDetectedFeedback.BoolValue)
+ || (ActualVideoInput == eDmps3InputVideoSource.Vga
+ && InputCard.VgaInputPort.SyncDetectedFeedback.BoolValue),
+
+ HasVideoStatusFunc = () =>
+ (ActualVideoInput == eDmps3InputVideoSource.Hdmi
+ && HdmiIn.VideoStatus.HasVideoStatusFeedback.BoolValue)
+ || (ActualVideoInput == eDmps3InputVideoSource.Vga
+ && VgaIn.VideoStatus.HasVideoStatusFeedback.BoolValue)
+ };
+
+ AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
+ eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.None, eDmps3InputVideoSource.Auto, this, combinedFuncs);
+
+ ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput", () => ActualVideoInput.ToString());
+
+ VideoSourceNumericFeedback = new IntFeedback(() =>
+ {
+ return (int)InputCard.VideoSourceFeedback;
+ });
+ AudioSourceNumericFeedback = new IntFeedback(() =>
+ {
+ return (int)InputCard.AudioSourceFeedback;
+ });
+
+ HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
+ {
+ if (InputCard.HdmiInputPort.HdcpSupportOnFeedback.BoolValue)
+ return 1;
+ else
+ return 0;
+ });
+
+ // Set Ports for CEC
+ HdmiIn.Port = InputCard.HdmiInputPort;
+
+ VirtualDmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.None, null, this);
+
+ AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
+ AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
+ AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
+ AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback);
+
+ //AddPostActivationAction(() =>
+ //{
+ // Link up all of these damned events to the various RoutingPorts via a helper handler
+ InputCard.HdmiInputPort.InputOutput.BaseDevice.BaseEvent += (o, a) => FowardInputStreamChange(HdmiIn, a.EventId);
+ InputCard.HdmiInputPort.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn, a.EventId);
+
+ InputCard.VgaInputPort.InputOutput.BaseDevice.BaseEvent += (o, a) => FowardInputStreamChange(VgaIn, a.EventId);
+ InputCard.VgaInputPort.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId);
+ //});
+
+ }
+
+ }
+
+ ///
+ /// Relays the input stream change to the appropriate RoutingInputPort.
+ ///
+ protected void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
+ {
+ if (eventId == Crestron.SimplSharpPro.DM.DMInputEventIds.SourceSyncEventId)
+ {
+ inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
+ AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
+ }
+ }
+
+ ///
+ /// Relays the VideoAttributes change to a RoutingInputPort
+ ///
+ protected void ForwardVideoAttributeChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
+ {
+ 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;
+ }
+ }
+
+ ///
+ /// Adds feedback(s) to the list
+ ///
+ ///
+ public void AddToFeedbackList(params Feedback[] newFbs)
+ {
+ foreach (var f in newFbs)
+ {
+ if (f != null)
+ {
+ if (!Feedbacks.Contains(f))
+ {
+ Feedbacks.Add(f);
+ }
+ }
+ }
+ }
+
+ #region ITxRouting Members
+
+
+ public virtual void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
+ {
+ Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
+
+ switch (input)
+ {
+ case 0:
+ {
+ ExecuteSwitch(eDmps3InputVideoSource.Auto, null, type);
+ break;
+ }
+ case 1:
+ {
+ ExecuteSwitch(HdmiIn.Selector, null, type);
+ break;
+ }
+ case 2:
+ {
+ ExecuteSwitch(VgaIn.Selector, null, type);
+ break;
+ }
+ }
+
+ }
+
+ #endregion
+
+ #region IRouting Members
+
+ public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
+ {
+ if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
+ InputCard.VideoSource = (eDmps3InputVideoSource)inputSelector;
+ if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
+ InputCard.AudioSource = (eDmps3InputAudioSource)inputSelector;
+ }
+
+ #endregion
+ }
+
+ ///
+ ///
+ ///
+ public class DmpsInternalVirtualHdmiVgaBncInputController : DmpsInternalVirtualHdmiVgaInputController
+ {
+ public new Card.Dmps3HdmiVgaBncInput InputCard { get; private set; }
+
+ public RoutingInputPortWithVideoStatuses BncIn { get; private set; }
+ public RoutingInputPort SpdifIn { get; private set; }
+
+ public override RoutingPortCollection InputPorts
+ {
+ get
+ {
+ return new RoutingPortCollection
+ {
+ HdmiIn,
+ VgaIn,
+ BncIn,
+ SpdifIn,
+ AnyVideoInput
+ };
+ }
+ }
+
+ public DmpsInternalVirtualHdmiVgaBncInputController(string key, string name, Card.Dmps3HdmiVgaBncInput inputCard)
+ : base(key, name, inputCard)
+ {
+ InputCard = inputCard;
+
+ HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi,
+ eDmps3InputVideoSource.Hdmi, this, VideoStatusHelper.GetHdmiInputStatusFuncs(InputCard.HdmiInputPort));
+ VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
+ eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eDmps3InputVideoSource.Vga, this,
+ VideoStatusHelper.GetVgaInputStatusFuncs(InputCard.VgaInputPort));
+ BncIn = new RoutingInputPortWithVideoStatuses(DmPortName.BncIn, eRoutingSignalType.Video, eRoutingPortConnectionType.Component,
+ eDmps3InputVideoSource.Bnc, this, VideoStatusHelper.GetBncInputStatusFuncs(InputCard.BncInputPort));
+ SpdifIn = new RoutingInputPort(DmPortName.SpdifIn, eRoutingSignalType.Audio, eRoutingPortConnectionType.DigitalAudio,
+ eDmps3InputAudioSource.Spdif, this);
+
+ if (InputCard.HdmiInputPort.HdcpSupportedLevelFeedback == eHdcpSupportedLevel.Hdcp2xSupport)
+ HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
+ else if (InputCard.HdmiInputPort.HdcpSupportedLevelFeedback == eHdcpSupportedLevel.Hdcp1xSupport)
+ HdcpSupportCapability = eHdcpCapabilityType.Hdcp1xSupport;
+
+ var combinedFuncs = new VideoStatusFuncsWrapper
+ {
+ HdcpActiveFeedbackFunc = () =>
+ (ActualVideoInput == eDmps3InputVideoSource.Hdmi
+ && InputCard.HdmiInputPort.VideoAttributes.HdcpActiveFeedback.BoolValue),
+
+ HdcpStateFeedbackFunc = () =>
+ {
+ if (ActualVideoInput == eDmps3InputVideoSource.Hdmi)
+ return InputCard.HdmiInputPort.VideoAttributes.HdcpStateFeedback.ToString();
+ return "";
+ },
+
+ VideoResolutionFeedbackFunc = () =>
+ {
+ if (ActualVideoInput == eDmps3InputVideoSource.Hdmi)
+ return InputCard.HdmiInputPort.VideoAttributes.GetVideoResolutionString();
+ if (ActualVideoInput == eDmps3InputVideoSource.Vga)
+ return InputCard.VgaInputPort.VideoAttributes.GetVideoResolutionString();
+ if (ActualVideoInput == eDmps3InputVideoSource.Bnc)
+ return InputCard.BncInputPort.VideoAttributes.GetVideoResolutionString();
+ return "";
+ },
+ VideoSyncFeedbackFunc = () =>
+ (ActualVideoInput == eDmps3InputVideoSource.Hdmi
+ && InputCard.HdmiInputPort.SyncDetectedFeedback.BoolValue)
+ || (ActualVideoInput == eDmps3InputVideoSource.Vga
+ && InputCard.VgaInputPort.SyncDetectedFeedback.BoolValue)
+ || (ActualVideoInput == eDmps3InputVideoSource.Bnc
+ && InputCard.BncInputPort.VideoDetectedFeedback.BoolValue),
+
+ HasVideoStatusFunc = () =>
+ (ActualVideoInput == eDmps3InputVideoSource.Hdmi
+ && HdmiIn.VideoStatus.HasVideoStatusFeedback.BoolValue)
+ || (ActualVideoInput == eDmps3InputVideoSource.Vga
+ && VgaIn.VideoStatus.HasVideoStatusFeedback.BoolValue)
+ || (ActualVideoInput == eDmps3InputVideoSource.Bnc
+ &&BncIn.VideoStatus.HasVideoStatusFeedback.BoolValue)
+ };
+
+ AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
+ eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
+
+ ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput", () => ActualVideoInput.ToString());
+
+ VideoSourceNumericFeedback = new IntFeedback(() =>
+ {
+ return (int)InputCard.VideoSourceFeedback;
+ });
+ AudioSourceNumericFeedback = new IntFeedback(() =>
+ {
+ return (int)InputCard.AudioSourceFeedback;
+ });
+
+ HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
+ {
+ if (InputCard.HdmiInputPort.HdcpSupportOnFeedback.BoolValue)
+ return 1;
+ else
+ return 0;
+ });
+
+ // Set Ports for CEC
+ HdmiIn.Port = InputCard.HdmiInputPort;
+
+ VirtualDmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.None, null, this);
+
+ AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
+ AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
+ AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
+ AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback);
+
+ //AddPostActivationAction(() =>
+ //{
+ // Link up all of these damned events to the various RoutingPorts via a helper handler
+ InputCard.HdmiInputPort.InputOutput.BaseDevice.BaseEvent += (o, a) => FowardInputStreamChange(HdmiIn, a.EventId);
+ InputCard.HdmiInputPort.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn, a.EventId);
+
+ InputCard.VgaInputPort.InputOutput.BaseDevice.BaseEvent += (o, a) => FowardInputStreamChange(VgaIn, a.EventId);
+ InputCard.VgaInputPort.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId);
+
+ InputCard.BncInputPort.InputOutput.BaseDevice.BaseEvent += (o, a) => FowardInputStreamChange(HdmiIn, a.EventId);
+ InputCard.BncInputPort.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn, a.EventId);
+ //});
+
+ }
+
+ public override void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
+ {
+ Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
+
+ switch (input)
+ {
+ case 0:
+ {
+ ExecuteSwitch(eDmps3InputVideoSource.Auto, null, type);
+ break;
+ }
+ case 1:
+ {
+ ExecuteSwitch(HdmiIn.Selector, null, type);
+ break;
+ }
+ case 2:
+ {
+ ExecuteSwitch(VgaIn.Selector, null, type);
+ break;
+ }
+ case 3:
+ {
+ ExecuteSwitch(BncIn.Selector, null, type);
+ break;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs
new file mode 100644
index 00000000..c02d48b9
--- /dev/null
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs
@@ -0,0 +1,654 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DM;
+using Crestron.SimplSharpPro.DM.Cards;
+using Crestron.SimplSharpPro.DM.Endpoints;
+using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+
+using PepperDash.Essentials.DM.Config;
+
+namespace PepperDash.Essentials.DM
+{
+ public class DmpsRoutingController : Device, IRoutingInputsOutputs, IRouting, IHasFeedback
+ {
+ public CrestronControlSystem Dmps { get; set; }
+ public ISystemControl SystemControl { get; private set; }
+
+ // Feedbacks for EssentialDM
+ public Dictionary VideoOutputFeedbacks { get; private set; }
+ public Dictionary AudioOutputFeedbacks { get; private set; }
+ public Dictionary VideoInputSyncFeedbacks { get; private set; }
+ public Dictionary InputEndpointOnlineFeedbacks { get; private set; }
+ public Dictionary OutputEndpointOnlineFeedbacks { get; private set; }
+ public Dictionary InputNameFeedbacks { get; private set; }
+ public Dictionary OutputNameFeedbacks { get; private set; }
+ public Dictionary OutputVideoRouteNameFeedbacks { get; private set; }
+ public Dictionary OutputAudioRouteNameFeedbacks { get; private set; }
+
+ public FeedbackCollection Feedbacks { get; private set; }
+
+ // Need a couple Lists of generic Backplane ports
+ public RoutingPortCollection InputPorts { get; private set; }
+ public RoutingPortCollection OutputPorts { get; private set; }
+
+ public Dictionary TxDictionary { get; set; }
+ public Dictionary RxDictionary { get; set; }
+
+ public Dictionary InputNames { get; set; }
+ public Dictionary OutputNames { get; set; }
+ public Dictionary VolumeControls { get; private set; }
+
+ public const int RouteOffTime = 500;
+ Dictionary RouteOffTimers = new Dictionary();
+
+ public static DmpsRoutingController GetDmpsRoutingController(string key, string name,
+ DmpsRoutingPropertiesConfig properties)
+ {
+ try
+ {
+ ISystemControl systemControl = null;
+
+ systemControl = Global.ControlSystem.SystemControl as ISystemControl;
+
+ if (systemControl == null)
+ {
+ return null;
+ }
+
+ var controller = new DmpsRoutingController(key, name, systemControl);
+
+ controller.InputNames = properties.InputNames;
+ controller.OutputNames = properties.OutputNames;
+
+ return controller;
+
+ }
+ catch (System.Exception e)
+ {
+ Debug.Console(0, "Error getting DMPS Controller:\r{0}", e);
+ }
+ return null;
+ }
+
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public DmpsRoutingController(string key, string name, ISystemControl systemControl)
+ : base(key, name)
+ {
+ Dmps = Global.ControlSystem;
+ SystemControl = systemControl;
+
+ InputPorts = new RoutingPortCollection();
+ OutputPorts = new RoutingPortCollection();
+ VolumeControls = new Dictionary();
+ TxDictionary = new Dictionary();
+ RxDictionary = new Dictionary();
+
+ VideoOutputFeedbacks = new Dictionary();
+ AudioOutputFeedbacks = new Dictionary();
+ VideoInputSyncFeedbacks = new Dictionary();
+ InputNameFeedbacks = new Dictionary();
+ OutputNameFeedbacks = new Dictionary();
+ OutputVideoRouteNameFeedbacks = new Dictionary();
+ OutputAudioRouteNameFeedbacks = new Dictionary();
+ InputEndpointOnlineFeedbacks = new Dictionary();
+ OutputEndpointOnlineFeedbacks = new Dictionary();
+
+ Debug.Console(1, this, "{0} Switcher Inputs Present.", Dmps.SwitcherInputs.Count);
+ Debug.Console(1, this, "{0} Switcher Outputs Present.", Dmps.SwitcherOutputs.Count);
+
+ SetupOutputCards();
+
+ SetupInputCards();
+ }
+
+ public override bool CustomActivate()
+ {
+
+
+ // Set input and output names from config
+ if (InputNames != null)
+ foreach (var kvp in InputNames)
+ (Dmps.SwitcherInputs[kvp.Key] as DMInput).Name.StringValue = kvp.Value;
+ if (OutputNames != null)
+ foreach (var kvp in OutputNames)
+ (Dmps.SwitcherOutputs[kvp.Key] as Card.Dmps3OutputBase).Name.StringValue = kvp.Value;
+
+ // Subscribe to events
+ Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange);
+ Dmps.DMOutputChange += new DMOutputEventHandler(Dmps_DMOutputChange);
+
+ return base.CustomActivate();
+ }
+
+
+
+ ///
+ /// Iterate the SwitcherOutputs collection to setup feedbacks and add routing ports
+ ///
+ void SetupOutputCards()
+ {
+ foreach (var card in Dmps.SwitcherOutputs)
+ {
+
+ var outputCard = card as DMOutput;
+
+ Debug.Console(1, this, "Adding Output Card Number {0} Type: {1}", outputCard.Number, outputCard.CardInputOutputType.ToString());
+
+ if (outputCard != null)
+ {
+ VideoOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
+ {
+ if (outputCard.VideoOutFeedback != null) { return (ushort)outputCard.VideoOutFeedback.Number; }
+ else { return 0; };
+ });
+ AudioOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
+ {
+ if (outputCard.AudioOutFeedback != null) { return (ushort)outputCard.AudioOutFeedback.Number; }
+ else { return 0; };
+ });
+
+ OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
+ {
+ if (outputCard.NameFeedback != null && !string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
+ {
+ Debug.Console(2, this, "Output Card {0} Name: {1}", outputCard.Number, outputCard.NameFeedback.StringValue);
+ return outputCard.NameFeedback.StringValue;
+ }
+ else
+ {
+ return "";
+ }
+ });
+
+ OutputVideoRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
+ {
+ if (outputCard.VideoOutFeedback != null && outputCard.VideoOutFeedback.NameFeedback != null)
+ {
+ return outputCard.VideoOutFeedback.NameFeedback.StringValue;
+ }
+ else
+ {
+ return "";
+ }
+ });
+ OutputAudioRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
+ {
+ if (outputCard.AudioOutFeedback != null && outputCard.AudioOutFeedback.NameFeedback != null)
+ {
+ return outputCard.AudioOutFeedback.NameFeedback.StringValue;
+ }
+ else
+ {
+ return "";
+
+ }
+ });
+
+ OutputEndpointOnlineFeedbacks[outputCard.Number] = new BoolFeedback(() => { return outputCard.EndpointOnlineFeedback; });
+
+ AddOutputCard(outputCard.Number, outputCard);
+ }
+ }
+ }
+
+ ///
+ /// Iterate the SwitcherInputs collection to setup feedbacks and add routing ports
+ ///
+ void SetupInputCards()
+ {
+ foreach (var card in Dmps.SwitcherInputs)
+ {
+ var inputCard = card as DMInput;
+
+ Debug.Console(1, this, "Adding Input Card Number {0} Type: {1}", inputCard.Number, inputCard.CardInputOutputType.ToString());
+
+ if (inputCard != null)
+ {
+ InputEndpointOnlineFeedbacks[inputCard.Number] = new BoolFeedback(() => { return inputCard.EndpointOnlineFeedback; });
+
+ if (inputCard.VideoDetectedFeedback != null)
+ {
+ VideoInputSyncFeedbacks[inputCard.Number] = new BoolFeedback(() =>
+ {
+ return inputCard.VideoDetectedFeedback.BoolValue;
+ });
+ }
+ InputNameFeedbacks[inputCard.Number] = new StringFeedback(() =>
+ {
+ if (inputCard.NameFeedback != null && !string.IsNullOrEmpty(inputCard.NameFeedback.StringValue))
+ {
+ Debug.Console(2, this, "Input Card {0} Name: {1}", inputCard.Number, inputCard.NameFeedback.StringValue);
+ return inputCard.NameFeedback.StringValue;
+
+ }
+ else
+ {
+ Debug.Console(2, this, "Input Card {0} Name is null", inputCard.Number, inputCard.NameFeedback.StringValue);
+ return "";
+ }
+ });
+ }
+
+ AddInputCard(inputCard.Number, inputCard);
+ }
+ }
+
+ ///
+ /// Builds the appropriate ports aand callst the appropreate add port method
+ ///
+ ///
+ ///
+ public void AddInputCard(uint number, DMInput inputCard)
+ {
+ if (inputCard is Card.Dmps3HdmiInputWithoutAnalogAudio)
+ {
+ var hdmiInputCard = inputCard as Card.Dmps3HdmiInput;
+
+ var cecPort = hdmiInputCard.HdmiInputPort;
+
+ AddInputPortWithDebug(number, string.Format("HdmiIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, cecPort);
+ }
+ else if (inputCard is Card.Dmps3HdmiInput)
+ {
+ var hdmiInputCard = inputCard as Card.Dmps3HdmiInput;
+
+ var cecPort = hdmiInputCard.HdmiInputPort;
+
+ AddInputPortWithDebug(number, string.Format("HdmiIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, cecPort);
+ AddInputPortWithDebug(number, string.Format("HudioIn{1}", number), eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
+ }
+ else if (inputCard is Card.Dmps3HdmiVgaInput)
+ {
+ // TODO: Build a virtual TX device and assign the ports to it
+
+ var hdmiVgaInputCard = inputCard as Card.Dmps3HdmiVgaInput;
+
+ DmpsInternalVirtualHdmiVgaInputController inputCardController = new DmpsInternalVirtualHdmiVgaInputController(Key +
+ string.Format("-HdmiVgaIn{0}", number), string.Format("InternalInputController-{0}", number), hdmiVgaInputCard);
+
+ DeviceManager.AddDevice(inputCardController);
+
+ AddInputPortWithDebug(number, string.Format("HdmiVgaIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.BackplaneOnly);
+ }
+ else if (inputCard is Card.Dmps3HdmiVgaBncInput)
+ {
+ // TODO: Build a virtual TX device and assign the ports to it
+
+ var hdmiVgaBncInputCard = inputCard as Card.Dmps3HdmiVgaBncInput;
+
+ DmpsInternalVirtualHdmiVgaBncInputController inputCardController = new DmpsInternalVirtualHdmiVgaBncInputController(Key +
+ string.Format("-HdmiVgaBncIn{0}", number), string.Format("InternalInputController-{0}", number), hdmiVgaBncInputCard);
+
+ DeviceManager.AddDevice(inputCardController);
+
+ AddInputPortWithDebug(number, string.Format("HdmiVgaBncIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.BackplaneOnly);
+
+ }
+ else if (inputCard is Card.Dmps3DmInput)
+ {
+ var hdmiInputCard = inputCard as Card.Dmps3DmInput;
+
+ var cecPort = hdmiInputCard.DmInputPort;
+
+ AddInputPortWithDebug(number, string.Format("DmIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmCat, cecPort);
+ }
+ else if (inputCard is Card.Dmps3AirMediaInput)
+ {
+ var airMediaInputCard = inputCard as Card.Dmps3AirMediaInput;
+
+ AddInputPortWithDebug(number, string.Format("AirMediaIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Streaming);
+ }
+ }
+
+
+ ///
+ /// Adds InputPort
+ ///
+ void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType)
+ {
+ var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
+ Debug.Console(2, this, "Adding input port '{0}'", portKey);
+ var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
+
+ InputPorts.Add(inputPort);
+ }
+
+ ///
+ /// Adds InputPort and sets Port as ICec object
+ ///
+ void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, ICec cecPort)
+ {
+ var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);
+ Debug.Console(2, this, "Adding input port '{0}'", portKey);
+ var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);
+
+ if (cecPort != null)
+ inputPort.Port = cecPort;
+
+ InputPorts.Add(inputPort);
+ }
+
+ ///
+ /// Builds the appropriate ports and calls the appropriate add port method
+ ///
+ ///
+ ///
+ public void AddOutputCard(uint number, DMOutput outputCard)
+ {
+ if (outputCard is Card.Dmps3HdmiOutput)
+ {
+ var hdmiOutputCard = outputCard as Card.Dmps3HdmiOutput;
+
+ var cecPort = hdmiOutputCard.HdmiOutputPort;
+
+ AddHdmiOutputPort(number, cecPort);
+
+ return;
+ }
+ else if (outputCard is Card.Dmps3DmOutput)
+ {
+ var dmOutputCard = outputCard as Card.Dmps3DmOutput;
+
+ var cecPort = dmOutputCard.DmOutputPort;
+
+ AddDmOutputPort(number);
+ return;
+ }
+ else if (outputCard is Card.Dmps3ProgramOutput)
+ {
+ AddAudioOnlyOutputPort(number, "Program");
+ return;
+ }
+ else if (outputCard is Card.Dmps3AuxOutput)
+ {
+ if(outputCard.CardInputOutputType == eCardInputOutputType.Dmps3Aux1Output)
+ AddAudioOnlyOutputPort(number, "Aux1");
+ else if(outputCard.CardInputOutputType == eCardInputOutputType.Dmps3Aux2Output)
+ AddAudioOnlyOutputPort(number, "Aux2");
+ return;
+ }
+ else if (outputCard is Card.Dmps3CodecOutput)
+ {
+ if (number == (uint)CrestronControlSystem.eDmps300cOutputs.Codec1
+ || number == (uint)CrestronControlSystem.eDmps3200cOutputs.Codec1
+ || number == (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec1
+ || number == (uint)CrestronControlSystem.eDmps34K250COutputs.Codec1
+ || number == (uint)CrestronControlSystem.eDmps34K350COutputs.Codec1)
+ AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec1.ToString());
+ else if (number == (uint)CrestronControlSystem.eDmps300cOutputs.Codec2
+ || number == (uint)CrestronControlSystem.eDmps3200cOutputs.Codec2
+ || number == (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec2
+ || number == (uint)CrestronControlSystem.eDmps34K250COutputs.Codec2
+ || number == (uint)CrestronControlSystem.eDmps34K350COutputs.Codec2)
+ AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec2.ToString());
+ return;
+ }
+ else if (outputCard is Card.Dmps3DialerOutput)
+ {
+ AddAudioOnlyOutputPort(number, "Dialer");
+ return;
+ }
+ else if (outputCard is Card.Dmps3DigitalMixOutput)
+ {
+ if (number == (uint)CrestronControlSystem.eDmps34K250COutputs.Mix1
+ || number == (uint)CrestronControlSystem.eDmps34K300COutputs.Mix1
+ || number == (uint)CrestronControlSystem.eDmps34K350COutputs.Mix1)
+ AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps34K250COutputs.Mix1.ToString());
+ if (number == (uint)CrestronControlSystem.eDmps34K250COutputs.Mix2
+ || number == (uint)CrestronControlSystem.eDmps34K300COutputs.Mix2
+ || number == (uint)CrestronControlSystem.eDmps34K350COutputs.Mix2)
+ AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps34K250COutputs.Mix2.ToString());
+ return;
+ }
+ else if (outputCard is Card.Dmps3AecOutput)
+ {
+ AddAudioOnlyOutputPort(number, "Aec");
+ return;
+ }
+ else
+ {
+ Debug.Console(1, this, "Output Card is of a type not currently handled:", outputCard.CardInputOutputType.ToString());
+ }
+ }
+
+ ///
+ /// Adds an Audio only output port
+ ///
+ ///
+ void AddAudioOnlyOutputPort(uint number, string portName)
+ {
+ AddOutputPortWithDebug(number, portName, eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio, number);
+ }
+
+ ///
+ /// Adds an HDMI output port
+ ///
+ ///
+ ///
+ void AddHdmiOutputPort(uint number, ICec cecPort)
+ {
+ AddOutputPortWithDebug(number, string.Format("hdmiOut{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, number, cecPort);
+ }
+
+ ///
+ /// Adds a DM output port
+ ///
+ ///
+ void AddDmOutputPort(uint number)
+ {
+ AddOutputPortWithDebug(number, string.Format("dmOut{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmCat, number);
+ }
+
+ ///
+ /// Adds OutputPort
+ ///
+ void AddOutputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector)
+ {
+ var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
+ Debug.Console(2, this, "Adding output port '{0}'", portKey);
+ OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
+ }
+
+ ///
+ /// Adds OutputPort and sets Port as ICec object
+ ///
+ void AddOutputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector, ICec cecPort)
+ {
+ var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
+ Debug.Console(2, this, "Adding output port '{0}'", portKey);
+ var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);
+
+ if (cecPort != null)
+ outputPort.Port = cecPort;
+
+ OutputPorts.Add(outputPort);
+ }
+
+ ///
+ ///
+ ///
+ void AddVolumeControl(uint number, Audio.Output audio)
+ {
+ VolumeControls.Add(number, new DmCardAudioOutputController(audio));
+ }
+
+ void Dmps_DMInputChange(Switch device, DMInputEventArgs args)
+ {
+ //Debug.Console(2, this, "DMSwitch:{0} Input:{1} Event:{2}'", this.Name, args.Number, args.EventId.ToString());
+
+ switch (args.EventId)
+ {
+ case (DMInputEventIds.OnlineFeedbackEventId):
+ {
+ Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
+ InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
+ break;
+ }
+ case (DMInputEventIds.VideoDetectedEventId):
+ {
+ Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
+ VideoInputSyncFeedbacks[args.Number].FireUpdate();
+ break;
+ }
+ case (DMInputEventIds.InputNameEventId):
+ {
+ Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
+ InputNameFeedbacks[args.Number].FireUpdate();
+ break;
+ }
+ }
+ }
+ ///
+ ///
+ void Dmps_DMOutputChange(Switch device, DMOutputEventArgs args)
+ {
+ Debug.Console(2, this, "DMOutputChange Output: {0} EventId: {1}", args.Number, args.EventId.ToString());
+
+ var output = args.Number;
+
+ DMOutput outputCard = Dmps.SwitcherOutputs[output] as DMOutput;
+
+ if (args.EventId == DMOutputEventIds.VolumeEventId &&
+ VolumeControls.ContainsKey(output))
+ {
+ VolumeControls[args.Number].VolumeEventFromChassis();
+ }
+ else if (args.EventId == DMOutputEventIds.OnlineFeedbackEventId
+ && OutputEndpointOnlineFeedbacks.ContainsKey(output))
+ {
+ OutputEndpointOnlineFeedbacks[output].FireUpdate();
+ }
+ else if (args.EventId == DMOutputEventIds.VideoOutEventId)
+ {
+ if (outputCard != null && outputCard.VideoOutFeedback != null)
+ {
+ Debug.Console(2, this, "DMSwitchVideo:{0} Routed Input:{1} Output:{2}'", this.Name, outputCard.VideoOutFeedback.Number, output);
+ }
+ if (VideoOutputFeedbacks.ContainsKey(output))
+ {
+ VideoOutputFeedbacks[output].FireUpdate();
+ }
+ if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
+ {
+ OutputVideoRouteNameFeedbacks[output].FireUpdate();
+ }
+ }
+ else if (args.EventId == DMOutputEventIds.AudioOutEventId)
+ {
+ if (outputCard != null && outputCard.AudioOutFeedback != null)
+ {
+ Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, outputCard.AudioOutFeedback.Number, output);
+ }
+ if (AudioOutputFeedbacks.ContainsKey(output))
+ {
+ AudioOutputFeedbacks[output].FireUpdate();
+ }
+ }
+ else if (args.EventId == DMOutputEventIds.OutputNameEventId
+ && OutputNameFeedbacks.ContainsKey(output))
+ {
+ Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
+ OutputNameFeedbacks[output].FireUpdate();
+ }
+
+ }
+
+ ///
+ ///
+ ///
+ ///
+ void StartOffTimer(PortNumberType pnt)
+ {
+ if (RouteOffTimers.ContainsKey(pnt))
+ return;
+ RouteOffTimers[pnt] = new CTimer(o =>
+ {
+ ExecuteSwitch(0, pnt.Number, pnt.Type);
+ }, RouteOffTime);
+ }
+
+ #region IRouting Members
+
+ public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType sigType)
+ {
+ try
+ {
+
+ Debug.Console(2, this, "Attempting a DM route from input {0} to output {1} {2}", inputSelector, outputSelector, sigType);
+
+ var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail
+ var output = Convert.ToUInt32(outputSelector);
+
+ if (input <= Dmps.NumberOfSwitcherInputs && output <= Dmps.NumberOfSwitcherOutputs)
+ {
+ // Check to see if there's an off timer waiting on this and if so, cancel
+ var key = new PortNumberType(output, sigType);
+ if (input == 0)
+ {
+ StartOffTimer(key);
+ }
+ else if (key.Number > 0)
+ {
+ if (RouteOffTimers.ContainsKey(key))
+ {
+ Debug.Console(2, this, "{0} cancelling route off due to new source", output);
+ RouteOffTimers[key].Stop();
+ RouteOffTimers.Remove(key);
+ }
+ }
+
+ DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
+
+
+ if (inCard != null)
+ {
+ // NOTE THAT THESE ARE NOTS - TO CATCH THE AudioVideo TYPE
+ if (sigType != eRoutingSignalType.Audio)
+ {
+ var outputCard = Dmps.SwitcherOutputs[output] as Card.Dmps3OutputBase;
+
+ //SystemControl.VideoEnter.BoolValue = true;
+ if (outputCard != null && outputCard.VideoOut != null)
+ outputCard.VideoOut = inCard;
+ }
+
+ if (sigType != eRoutingSignalType.Video)
+ {
+ var outputCard = Dmps.SwitcherOutputs[output] as Card.Dmps3OutputBase;
+ if (outputCard != null && outputCard.AudioOut != null)
+ outputCard.AudioOut = inCard;
+ }
+ }
+ else
+ {
+ Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector);
+ }
+
+ }
+ else
+ {
+ Debug.Console(1, this, "Unable to execute route from input {0} to output {1}", inputSelector, outputSelector);
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "Error executing switch: {0}", e);
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Config/DmpsRoutingConfig.cs b/essentials-framework/Essentials DM/Essentials_DM/Config/DmpsRoutingConfig.cs
new file mode 100644
index 00000000..57dd4a72
--- /dev/null
+++ b/essentials-framework/Essentials DM/Essentials_DM/Config/DmpsRoutingConfig.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using Crestron.SimplSharpPro.DM;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.DM.Cards;
+
+namespace PepperDash.Essentials.DM.Config
+{
+ ///
+ /// Represents the "properties" property of a DM device config
+ ///
+ public class DmpsRoutingPropertiesConfig
+ {
+ [JsonProperty("inputNames")]
+ public Dictionary InputNames { get; set; }
+
+ [JsonProperty("outputNames")]
+ public Dictionary OutputNames { get; set; }
+
+ public DmpsRoutingPropertiesConfig()
+ {
+ InputNames = new Dictionary();
+ OutputNames = new Dictionary();
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials DM/Essentials_DM/DmPortName.cs b/essentials-framework/Essentials DM/Essentials_DM/DmPortName.cs
index c862f1ed..2c65b3f8 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/DmPortName.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/DmPortName.cs
@@ -14,10 +14,12 @@ namespace PepperDash.Essentials.DM
public const string AirBoardIn = "AirBoardIn";
public const string AirMediaIn = "AirMediaIn";
public const string AnyVideoIn = "AnyVideoIn";
+ public const string AudioIn = "AudioIn";
public const string AudioLoopOut = "AudioLoopOut";
public const string BalancedAudioOut = "BalancedAudioOut";
public const string BalancedAudioOut1 = "BalancedAudioOut1";
public const string BalancedAudioOut2 = "BalancedAudioOut2";
+ public const string BncIn = "BncIn";
public const string CompositeIn = "CompositeIn";
public const string DisplayPortIn = "DisplayPortIn";
public const string DmIn = "DmIn";
@@ -32,6 +34,7 @@ namespace PepperDash.Essentials.DM
public const string HdmiLoopOut = "HdmiLoopOut";
public const string HdmiOut = "HdmiOut";
public const string Osd = "Osd";
+ public const string SpdifIn = "SpdifIn";
public const string VgaIn = "VgaIn";
}
}
\ No newline at end of file
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 eb5c10fc..50b5acb7 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Transmitters/DmTx401CController.cs
@@ -168,11 +168,9 @@ namespace PepperDash.Essentials.DM
&& tx.CvbsInput.SyncDetectedFeedback.BoolValue)
};
- AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
- eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
- DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.AudioVideo,
- eRoutingPortConnectionType.DmCat, null, this);
+ DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.AudioVideo,
+ eRoutingPortConnectionType.DmCat, null, this);
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj b/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj
index 3e4283e5..f266c842 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj
+++ b/essentials-framework/Essentials DM/Essentials_DM/Essentials_DM.csproj
@@ -97,7 +97,10 @@
+
+
+
diff --git a/essentials-framework/Essentials DM/Essentials_DM/VideoStatusHelpers.cs b/essentials-framework/Essentials DM/Essentials_DM/VideoStatusHelpers.cs
index 096b1e36..50107c37 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/VideoStatusHelpers.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/VideoStatusHelpers.cs
@@ -48,6 +48,26 @@ namespace PepperDash.Essentials.DM
};
}
+ public static VideoStatusFuncsWrapper GetVgaInputStatusFuncs(VgaDviInputPort port)
+ {
+ return new VideoStatusFuncsWrapper
+ {
+ HdcpActiveFeedbackFunc = () => port.VideoAttributes.HdcpActiveFeedback.BoolValue,
+ HdcpStateFeedbackFunc = () => port.VideoAttributes.HdcpStateFeedback.ToString(),
+ VideoResolutionFeedbackFunc = () => port.VideoAttributes.GetVideoResolutionString(),
+ VideoSyncFeedbackFunc = () => port.SyncDetectedFeedback.BoolValue
+ };
+ }
+
+ public static VideoStatusFuncsWrapper GetBncInputStatusFuncs(Component port)
+ {
+ return new VideoStatusFuncsWrapper
+ {
+ VideoResolutionFeedbackFunc = () => port.VideoAttributes.GetVideoResolutionString(),
+ VideoSyncFeedbackFunc = () => port.VideoDetectedFeedback.BoolValue
+ };
+ }
+
public static VideoStatusFuncsWrapper GetDmInputStatusFuncs(DMInputPort port)
{
return new VideoStatusFuncsWrapper