mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
Routing tested and working with EfS bridge
This commit is contained in:
@@ -102,7 +102,11 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
(device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else if (device is DmpsRoutingController)
|
||||||
|
{
|
||||||
|
(device as DmpsRoutingController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
else if (device is DmTxControllerBase)
|
else if (device is DmTxControllerBase)
|
||||||
{
|
{
|
||||||
(device as DmTxControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(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);
|
(device as AppleTV).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (device is IBridge)
|
else if (device is IBridge)
|
||||||
{
|
{
|
||||||
(device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as IBridge).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
@@ -27,7 +28,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
|
|
||||||
// Link up outputs
|
// 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;
|
var ioSlot = i;
|
||||||
|
|
||||||
@@ -39,7 +40,16 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
||||||
var TxKey = dmChassis.TxDictionary[ioSlot];
|
var TxKey = dmChassis.TxDictionary[ioSlot];
|
||||||
var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
|
var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
|
||||||
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]);
|
// TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||||
// trilist.SetUShortSigAction((ApiMap.HdcpSupport[ioSlot]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
|
// trilist.SetUShortSigAction((ApiMap.HdcpSupport[ioSlot]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
|
||||||
// TxDevice.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap. + ioSlot]);
|
// TxDevice.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap. + ioSlot]);
|
||||||
@@ -54,7 +64,16 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
||||||
var RxKey = dmChassis.RxDictionary[ioSlot];
|
var RxKey = dmChassis.RxDictionary[ioSlot];
|
||||||
var RxDevice = DeviceManager.GetDeviceForKey(RxKey) as DmRmcControllerBase;
|
var RxDevice = DeviceManager.GetDeviceForKey(RxKey) as DmRmcControllerBase;
|
||||||
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
|
// Feedback
|
||||||
dmChassis.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
|
dmChassis.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
|
||||||
@@ -66,8 +85,6 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
|
dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
|
||||||
dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
|
dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
|
||||||
dmChassis.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + 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]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
132
PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
Normal file
132
PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
|
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++)
|
||||||
|
{
|
||||||
|
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]]);
|
||||||
|
//}
|
||||||
|
|
||||||
|
dmpsRouter.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||||
|
|
||||||
|
dmpsRouter.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
|
||||||
|
dmpsRouter.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint i = 1; i <= dmpsRouter.Dmps.NumberOfSwitcherOutputs; i++)
|
||||||
|
{
|
||||||
|
var ioSlot = i;
|
||||||
|
// Control
|
||||||
|
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action<ushort>(o => dmpsRouter.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)));
|
||||||
|
trilist.SetUShortSigAction(joinMap.OutputAudio + ioSlot, new Action<ushort>(o => dmpsRouter.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio)));
|
||||||
|
|
||||||
|
//if (dmpsRouter.RxDictionary.ContainsKey(ioSlot))
|
||||||
|
//{
|
||||||
|
// Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
||||||
|
// var RxKey = dmpsRouter.RxDictionary[ioSlot];
|
||||||
|
// var RxDevice = DeviceManager.GetDeviceForKey(RxKey) as DmRmcControllerBase;
|
||||||
|
// //RxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||||
|
//}
|
||||||
|
|
||||||
|
// Feedback
|
||||||
|
dmpsRouter.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
|
||||||
|
dmpsRouter.AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]);
|
||||||
|
dmpsRouter.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
|
||||||
|
dmpsRouter.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
|
||||||
|
dmpsRouter.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -121,6 +121,7 @@
|
|||||||
<Compile Include="Bridges\BridgeFactory.cs" />
|
<Compile Include="Bridges\BridgeFactory.cs" />
|
||||||
<Compile Include="Bridges\CameraControllerBridge.cs" />
|
<Compile Include="Bridges\CameraControllerBridge.cs" />
|
||||||
<Compile Include="Bridges\AirMediaControllerBridge.cs" />
|
<Compile Include="Bridges\AirMediaControllerBridge.cs" />
|
||||||
|
<Compile Include="Bridges\DmpsRoutingControllerBridge.cs" />
|
||||||
<Compile Include="Bridges\DisplayControllerBridge.cs" />
|
<Compile Include="Bridges\DisplayControllerBridge.cs" />
|
||||||
<Compile Include="Bridges\DigitalLoggerBridge.cs" />
|
<Compile Include="Bridges\DigitalLoggerBridge.cs" />
|
||||||
<Compile Include="Bridges\DmChassisControllerBridge.cs" />
|
<Compile Include="Bridges\DmChassisControllerBridge.cs" />
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ namespace PepperDash.Essentials.DM
|
|||||||
TxDictionary = new Dictionary<uint, string>();
|
TxDictionary = new Dictionary<uint, string>();
|
||||||
RxDictionary = new Dictionary<uint, string>();
|
RxDictionary = new Dictionary<uint, string>();
|
||||||
IsOnline.OutputChange += new EventHandler<FeedbackEventArgs>(IsOnline_OutputChange);
|
IsOnline.OutputChange += new EventHandler<FeedbackEventArgs>(IsOnline_OutputChange);
|
||||||
//IsOnline.OutputChange += new EventHandler<EventArgs>(this.IsOnline_OutputChange);
|
|
||||||
Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
|
Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
|
||||||
//Chassis.DMSystemChange += new DMSystemEventHandler(Chassis_DMSystemChange);
|
//Chassis.DMSystemChange += new DMSystemEventHandler(Chassis_DMSystemChange);
|
||||||
Chassis.DMOutputChange += new DMOutputEventHandler(Chassis_DMOutputChange);
|
Chassis.DMOutputChange += new DMOutputEventHandler(Chassis_DMOutputChange);
|
||||||
|
|||||||
@@ -86,20 +86,25 @@ namespace PepperDash.Essentials.DM
|
|||||||
public DmpsInternalVirtualHdmiVgaInputController(string key, string name, DMInput inputCard)
|
public DmpsInternalVirtualHdmiVgaInputController(string key, string name, DMInput inputCard)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
var hdmiVgaInputCard = inputCard as Card.Dmps3HdmiVgaInput;
|
Feedbacks = new FeedbackCollection<Feedback>();
|
||||||
|
|
||||||
if(hdmiVgaInputCard != null)
|
if (inputCard is Card.Dmps3HdmiVgaInput)
|
||||||
{
|
{
|
||||||
InputCard = inputCard as Card.Dmps3HdmiVgaInput;
|
InputCard = inputCard as Card.Dmps3HdmiVgaInput;
|
||||||
|
|
||||||
HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi,
|
HdmiIn = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi,
|
||||||
eDmps3InputVideoSource.Hdmi, this, VideoStatusHelper.GetHdmiInputStatusFuncs(hdmiVgaInputCard.HdmiInputPort));
|
eDmps3InputVideoSource.Hdmi, this, VideoStatusHelper.GetHdmiInputStatusFuncs(InputCard.HdmiInputPort));
|
||||||
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
|
||||||
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eDmps3InputVideoSource.Vga, this,
|
eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eDmps3InputVideoSource.Vga, this,
|
||||||
VideoStatusHelper.GetVgaInputStatusFuncs(InputCard.VgaInputPort));
|
VideoStatusHelper.GetVgaInputStatusFuncs(InputCard.VgaInputPort));
|
||||||
AudioIn = new RoutingInputPort(DmPortName.AudioIn, eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio,
|
AudioIn = new RoutingInputPort(DmPortName.AudioIn, eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio,
|
||||||
eDmps3InputAudioSource.Analog, this);
|
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
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
{
|
{
|
||||||
HdcpActiveFeedbackFunc = () =>
|
HdcpActiveFeedbackFunc = () =>
|
||||||
@@ -125,61 +130,60 @@ namespace PepperDash.Essentials.DM
|
|||||||
(ActualVideoInput == eDmps3InputVideoSource.Hdmi
|
(ActualVideoInput == eDmps3InputVideoSource.Hdmi
|
||||||
&& InputCard.HdmiInputPort.SyncDetectedFeedback.BoolValue)
|
&& InputCard.HdmiInputPort.SyncDetectedFeedback.BoolValue)
|
||||||
|| (ActualVideoInput == eDmps3InputVideoSource.Vga
|
|| (ActualVideoInput == eDmps3InputVideoSource.Vga
|
||||||
&& InputCard.VgaInputPort.SyncDetectedFeedback.BoolValue)
|
&& InputCard.VgaInputPort.SyncDetectedFeedback.BoolValue),
|
||||||
|
|
||||||
|
HasVideoStatusFunc = () =>
|
||||||
|
(ActualVideoInput == eDmps3InputVideoSource.Hdmi
|
||||||
|
&& HdmiIn.VideoStatus.HasVideoStatusFeedback.BoolValue)
|
||||||
|
|| (ActualVideoInput == eDmps3InputVideoSource.Vga
|
||||||
|
&& VgaIn.VideoStatus.HasVideoStatusFeedback.BoolValue)
|
||||||
};
|
};
|
||||||
|
|
||||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||||
eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
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);
|
||||||
|
//});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (InputCard.HdmiInputPort.HdcpSupportedLevelFeedback == eHdcpSupportedLevel.Hdcp2xSupport)
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
|
||||||
else if (InputCard.HdmiInputPort.HdcpSupportedLevelFeedback == eHdcpSupportedLevel.Hdcp1xSupport)
|
|
||||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp1xSupport;
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
// Set Ports for CEC
|
|
||||||
HdmiIn.Port = InputCard.HdmiInputPort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CustomActivate()
|
|
||||||
{
|
|
||||||
// Link up all of these damned events to the various RoutingPorts via a helper handler
|
|
||||||
InputCard.HdmiInputPort.Card.BaseEvent += (o, a) => FowardInputStreamChange(HdmiIn, a.EventId);
|
|
||||||
InputCard.HdmiInputPort.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn, a.EventId);
|
|
||||||
|
|
||||||
InputCard.VgaInputPort.Card.BaseEvent += (o, a) => FowardInputStreamChange(VgaIn, a.EventId);
|
|
||||||
InputCard.VgaInputPort.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(VgaIn, a.EventId);
|
|
||||||
|
|
||||||
// Base does register and sets up comm monitoring.
|
|
||||||
return base.CustomActivate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -322,6 +326,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
SpdifIn = new RoutingInputPort(DmPortName.SpdifIn, eRoutingSignalType.Audio, eRoutingPortConnectionType.DigitalAudio,
|
SpdifIn = new RoutingInputPort(DmPortName.SpdifIn, eRoutingSignalType.Audio, eRoutingPortConnectionType.DigitalAudio,
|
||||||
eDmps3InputAudioSource.Spdif, this);
|
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
|
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||||
{
|
{
|
||||||
HdcpActiveFeedbackFunc = () =>
|
HdcpActiveFeedbackFunc = () =>
|
||||||
@@ -351,21 +360,63 @@ namespace PepperDash.Essentials.DM
|
|||||||
|| (ActualVideoInput == eDmps3InputVideoSource.Vga
|
|| (ActualVideoInput == eDmps3InputVideoSource.Vga
|
||||||
&& InputCard.VgaInputPort.SyncDetectedFeedback.BoolValue)
|
&& InputCard.VgaInputPort.SyncDetectedFeedback.BoolValue)
|
||||||
|| (ActualVideoInput == eDmps3InputVideoSource.Bnc
|
|| (ActualVideoInput == eDmps3InputVideoSource.Bnc
|
||||||
&& InputCard.BncInputPort.VideoDetectedFeedback.BoolValue)
|
&& 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,
|
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||||
eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CustomActivate()
|
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput", () => ActualVideoInput.ToString());
|
||||||
{
|
|
||||||
// Link up all of these damned events to the various RoutingPorts via a helper handler
|
VideoSourceNumericFeedback = new IntFeedback(() =>
|
||||||
InputCard.BncInputPort.Card.BaseEvent += (o, a) => FowardInputStreamChange(HdmiIn, a.EventId);
|
{
|
||||||
InputCard.BncInputPort.VideoAttributes.AttributeChange += (o, a) => ForwardVideoAttributeChange(HdmiIn, a.EventId);
|
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);
|
||||||
|
//});
|
||||||
|
|
||||||
// Base does remaining inputs
|
|
||||||
return base.CustomActivate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
public override void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||||
|
|||||||
@@ -106,43 +106,73 @@ namespace PepperDash.Essentials.DM
|
|||||||
InputEndpointOnlineFeedbacks = new Dictionary<uint, BoolFeedback>();
|
InputEndpointOnlineFeedbacks = new Dictionary<uint, BoolFeedback>();
|
||||||
OutputEndpointOnlineFeedbacks = new Dictionary<uint, BoolFeedback>();
|
OutputEndpointOnlineFeedbacks = new Dictionary<uint, BoolFeedback>();
|
||||||
|
|
||||||
Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange);
|
|
||||||
Dmps.DMOutputChange +=new DMOutputEventHandler(Dmps_DMOutputChange);
|
|
||||||
|
|
||||||
// Default to EnableAudioBreakaway
|
// Default to EnableAudioBreakaway
|
||||||
//SystemControl.EnableAudioBreakaway. = true;
|
//if (SystemControl.EnableAudioBreakawayFeedback != null && !SystemControl.EnableAudioBreakawayFeedback.BoolValue)
|
||||||
|
//{
|
||||||
|
// Debug.Console(1, this, "Enabling Audio Breakaway");
|
||||||
|
// SystemControl.EnableAudioBreakaway.BoolValue = true;
|
||||||
|
//}
|
||||||
|
//if(!SystemControl.VideoEnter.BoolValue)
|
||||||
|
// SystemControl.VideoEnter.BoolValue = true;
|
||||||
|
//if(!SystemControl.AudioEnter.BoolValue)
|
||||||
|
// SystemControl.AudioEnter.BoolValue = true;
|
||||||
|
|
||||||
Debug.Console(1, this, "{0} Switcher Inputs Present.", Dmps.NumberOfSwitcherInputs);
|
Debug.Console(1, this, "{0} Switcher Inputs Present.", Dmps.SwitcherInputs.Count);
|
||||||
Debug.Console(1, this, "{0} Switcher Outputs Present.", Dmps.NumberOfSwitcherOutputs);
|
Debug.Console(1, this, "{0} Switcher Outputs Present.", Dmps.SwitcherOutputs.Count);
|
||||||
|
|
||||||
uint tempX = 1;
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Iterate the SwitcherOutputs collection to setup feedbacks and add routing ports
|
||||||
|
/// </summary>
|
||||||
|
void SetupOutputCards()
|
||||||
|
{
|
||||||
foreach (var card in Dmps.SwitcherOutputs)
|
foreach (var card in Dmps.SwitcherOutputs)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Output Card Type: {0}", card.CardInputOutputType.ToString());
|
|
||||||
|
|
||||||
var outputCard = card as DMOutput;
|
var outputCard = card as DMOutput;
|
||||||
//}
|
|
||||||
|
|
||||||
//for (uint x = 1; x <= Dmps.NumberOfSwitcherOutputs; x++)
|
Debug.Console(1, this, "Adding Output Card Number {0} Type: {1}", outputCard.Number, outputCard.CardInputOutputType.ToString());
|
||||||
//{
|
|
||||||
//var tempX = x;
|
|
||||||
|
|
||||||
//Card.Dmps3OutputBase outputCard = Dmps.SwitcherOutputs[tempX] as Card.Dmps3OutputBase;
|
if (outputCard != null)
|
||||||
|
{
|
||||||
if (outputCard != null)
|
VideoOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
|
||||||
{
|
{
|
||||||
VideoOutputFeedbacks[tempX] = new IntFeedback(() => {
|
if (outputCard.VideoOutFeedback != null) { return (ushort)outputCard.VideoOutFeedback.Number; }
|
||||||
if(outputCard.VideoOutFeedback != null) { return (ushort)outputCard.VideoOutFeedback.Number;}
|
|
||||||
else { return 0; };
|
else { return 0; };
|
||||||
});
|
});
|
||||||
AudioOutputFeedbacks[tempX] = new IntFeedback(() =>
|
AudioOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
|
||||||
{
|
{
|
||||||
if (outputCard.AudioOutFeedback != null) { return (ushort)outputCard.AudioOutFeedback.Number; }
|
if (outputCard.AudioOutFeedback != null) { return (ushort)outputCard.AudioOutFeedback.Number; }
|
||||||
else { return 0; };
|
else { return 0; };
|
||||||
});
|
});
|
||||||
|
|
||||||
OutputNameFeedbacks[tempX] = new StringFeedback(() =>
|
OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
|
||||||
{
|
{
|
||||||
if (outputCard.NameFeedback.StringValue != null)
|
if (outputCard.NameFeedback.StringValue != null)
|
||||||
{
|
{
|
||||||
@@ -152,9 +182,9 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
OutputVideoRouteNameFeedbacks[tempX] = new StringFeedback(() =>
|
OutputVideoRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
|
||||||
{
|
{
|
||||||
if (outputCard.VideoOutFeedback != null)
|
if (outputCard.VideoOutFeedback != null)
|
||||||
{
|
{
|
||||||
@@ -165,7 +195,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
OutputAudioRouteNameFeedbacks[tempX] = new StringFeedback(() =>
|
OutputAudioRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
|
||||||
{
|
{
|
||||||
if (outputCard.AudioOutFeedback != null)
|
if (outputCard.AudioOutFeedback != null)
|
||||||
{
|
{
|
||||||
@@ -178,37 +208,33 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { return outputCard.EndpointOnlineFeedback; });
|
OutputEndpointOnlineFeedbacks[outputCard.Number] = new BoolFeedback(() => { return outputCard.EndpointOnlineFeedback; });
|
||||||
|
|
||||||
AddOutputCard(tempX, outputCard);
|
AddOutputCard(outputCard.Number, outputCard);
|
||||||
|
|
||||||
tempX++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tempX = 1;
|
/// <summary>
|
||||||
|
/// Iterate the SwitcherInputs collection to setup feedbacks and add routing ports
|
||||||
|
/// </summary>
|
||||||
|
void SetupInputCards()
|
||||||
|
{
|
||||||
foreach (var card in Dmps.SwitcherInputs)
|
foreach (var card in Dmps.SwitcherInputs)
|
||||||
{
|
{
|
||||||
var inputCard = card as DMInput;
|
var inputCard = card as DMInput;
|
||||||
|
|
||||||
Debug.Console(1, this, "Output Card Type: {0}", card.CardInputOutputType.ToString());
|
Debug.Console(1, this, "Adding Input Card Number {0} Type: {1}", inputCard.Number, inputCard.CardInputOutputType.ToString());
|
||||||
|
|
||||||
//for (uint x = 1; x <= Dmps.NumberOfSwitcherInputs; x++)
|
|
||||||
//{
|
|
||||||
// var tempX = x;
|
|
||||||
|
|
||||||
// DMInput inputCard = Dmps.SwitcherInputs[tempX] as DMInput;
|
|
||||||
|
|
||||||
if (inputCard != null)
|
if (inputCard != null)
|
||||||
{
|
{
|
||||||
InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { return inputCard.EndpointOnlineFeedback; });
|
InputEndpointOnlineFeedbacks[inputCard.Number] = new BoolFeedback(() => { return inputCard.EndpointOnlineFeedback; });
|
||||||
|
|
||||||
VideoInputSyncFeedbacks[tempX] = new BoolFeedback(() =>
|
VideoInputSyncFeedbacks[inputCard.Number] = new BoolFeedback(() =>
|
||||||
{
|
{
|
||||||
return inputCard.VideoDetectedFeedback.BoolValue;
|
return inputCard.VideoDetectedFeedback.BoolValue;
|
||||||
});
|
});
|
||||||
InputNameFeedbacks[tempX] = new StringFeedback(() =>
|
InputNameFeedbacks[inputCard.Number] = new StringFeedback(() =>
|
||||||
{
|
{
|
||||||
if (inputCard.NameFeedback.StringValue != null)
|
if (inputCard.NameFeedback.StringValue != null)
|
||||||
{
|
{
|
||||||
@@ -221,23 +247,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
AddInputCard(tempX, inputCard);
|
AddInputCard(inputCard.Number, inputCard);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CustomActivate()
|
|
||||||
{
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
return base.CustomActivate();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Builds the appropriate ports aand callst the appropreate add port method
|
/// Builds the appropriate ports aand callst the appropreate add port method
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -251,7 +264,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
var cecPort = hdmiInputCard.HdmiInputPort;
|
var cecPort = hdmiInputCard.HdmiInputPort;
|
||||||
|
|
||||||
AddInputPortWithDebug(number, string.Format("hdmiIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, cecPort);
|
AddInputPortWithDebug(number, string.Format("HdmiIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, cecPort);
|
||||||
}
|
}
|
||||||
else if (inputCard is Card.Dmps3HdmiInput)
|
else if (inputCard is Card.Dmps3HdmiInput)
|
||||||
{
|
{
|
||||||
@@ -259,8 +272,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
var cecPort = hdmiInputCard.HdmiInputPort;
|
var cecPort = hdmiInputCard.HdmiInputPort;
|
||||||
|
|
||||||
AddInputPortWithDebug(number, string.Format("hdmiIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, cecPort);
|
AddInputPortWithDebug(number, string.Format("HdmiIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, cecPort);
|
||||||
AddInputPortWithDebug(number, string.Format("audioIn{1}", number), eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
|
AddInputPortWithDebug(number, string.Format("HudioIn{1}", number), eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio);
|
||||||
}
|
}
|
||||||
else if (inputCard is Card.Dmps3HdmiVgaInput)
|
else if (inputCard is Card.Dmps3HdmiVgaInput)
|
||||||
{
|
{
|
||||||
@@ -269,11 +282,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
var hdmiVgaInputCard = inputCard as Card.Dmps3HdmiVgaInput;
|
var hdmiVgaInputCard = inputCard as Card.Dmps3HdmiVgaInput;
|
||||||
|
|
||||||
DmpsInternalVirtualHdmiVgaInputController inputCardController = new DmpsInternalVirtualHdmiVgaInputController(Key +
|
DmpsInternalVirtualHdmiVgaInputController inputCardController = new DmpsInternalVirtualHdmiVgaInputController(Key +
|
||||||
string.Format("-input{0}", number), string.Format("InternalInputController-{0}", number), hdmiVgaInputCard);
|
string.Format("-HdmiVgaIn{0}", number), string.Format("InternalInputController-{0}", number), hdmiVgaInputCard);
|
||||||
|
|
||||||
DeviceManager.AddDevice(inputCardController);
|
DeviceManager.AddDevice(inputCardController);
|
||||||
|
|
||||||
AddInputPortWithDebug(number, string.Format("input{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.BackplaneOnly);
|
AddInputPortWithDebug(number, string.Format("HdmiVgaIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.BackplaneOnly);
|
||||||
}
|
}
|
||||||
else if (inputCard is Card.Dmps3HdmiVgaBncInput)
|
else if (inputCard is Card.Dmps3HdmiVgaBncInput)
|
||||||
{
|
{
|
||||||
@@ -282,11 +295,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
var hdmiVgaBncInputCard = inputCard as Card.Dmps3HdmiVgaBncInput;
|
var hdmiVgaBncInputCard = inputCard as Card.Dmps3HdmiVgaBncInput;
|
||||||
|
|
||||||
DmpsInternalVirtualHdmiVgaBncInputController inputCardController = new DmpsInternalVirtualHdmiVgaBncInputController(Key +
|
DmpsInternalVirtualHdmiVgaBncInputController inputCardController = new DmpsInternalVirtualHdmiVgaBncInputController(Key +
|
||||||
string.Format("-input{0}", number), string.Format("InternalInputController-{0}", number), hdmiVgaBncInputCard);
|
string.Format("-HdmiVgaBncIn{0}", number), string.Format("InternalInputController-{0}", number), hdmiVgaBncInputCard);
|
||||||
|
|
||||||
DeviceManager.AddDevice(inputCardController);
|
DeviceManager.AddDevice(inputCardController);
|
||||||
|
|
||||||
AddInputPortWithDebug(number, string.Format("input{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.BackplaneOnly);
|
AddInputPortWithDebug(number, string.Format("HdmiVgaBncIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.BackplaneOnly);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (inputCard is Card.Dmps3DmInput)
|
else if (inputCard is Card.Dmps3DmInput)
|
||||||
@@ -295,13 +308,13 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
var cecPort = hdmiInputCard.DmInputPort;
|
var cecPort = hdmiInputCard.DmInputPort;
|
||||||
|
|
||||||
AddInputPortWithDebug(number, string.Format("dmIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmCat, cecPort);
|
AddInputPortWithDebug(number, string.Format("DmIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.DmCat, cecPort);
|
||||||
}
|
}
|
||||||
else if (inputCard is Card.Dmps3AirMediaInput)
|
else if (inputCard is Card.Dmps3AirMediaInput)
|
||||||
{
|
{
|
||||||
var airMediaInputCard = inputCard as Card.Dmps3AirMediaInput;
|
var airMediaInputCard = inputCard as Card.Dmps3AirMediaInput;
|
||||||
|
|
||||||
AddInputPortWithDebug(number, string.Format("airMediaIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Streaming);
|
AddInputPortWithDebug(number, string.Format("AirMediaIn{0}", number), eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Streaming);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -358,23 +371,57 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
AddDmOutputPort(number);
|
AddDmOutputPort(number);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (outputCard is Card.Dmps3ProgramOutput)
|
else if (outputCard is Card.Dmps3ProgramOutput)
|
||||||
{
|
{
|
||||||
// TODO: Deal with audio output
|
AddAudioOnlyOutputPort(number, "Program");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (outputCard is Card.Dmps3AuxOutput)
|
else if (outputCard is Card.Dmps3AuxOutput)
|
||||||
{
|
{
|
||||||
// TODO: Deal with audio output
|
if(outputCard.CardInputOutputType == eCardInputOutputType.Dmps3Aux1Output)
|
||||||
|
AddAudioOnlyOutputPort(number, "Aux1");
|
||||||
|
else if(outputCard.CardInputOutputType == eCardInputOutputType.Dmps3Aux2Output)
|
||||||
|
AddAudioOnlyOutputPort(number, "Aux2");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (outputCard is Card.Dmps3CodecOutput)
|
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)
|
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
|
else
|
||||||
{
|
{
|
||||||
@@ -382,6 +429,15 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds an Audio only output port
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="number"></param>
|
||||||
|
void AddAudioOnlyOutputPort(uint number, string portName)
|
||||||
|
{
|
||||||
|
AddOutputPortWithDebug(number, portName, eRoutingSignalType.Audio, eRoutingPortConnectionType.LineAudio, number);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds an HDMI output port
|
/// Adds an HDMI output port
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -456,9 +512,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
void Dmps_DMOutputChange(Switch device, DMOutputEventArgs args)
|
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;
|
var output = args.Number;
|
||||||
|
|
||||||
Card.Dmps3OutputBase outputCard = Dmps.SwitcherOutputs[output] as Card.Dmps3OutputBase;
|
DMOutput outputCard = Dmps.SwitcherOutputs[output] as DMOutput;
|
||||||
|
|
||||||
if (args.EventId == DMOutputEventIds.VolumeEventId &&
|
if (args.EventId == DMOutputEventIds.VolumeEventId &&
|
||||||
VolumeControls.ContainsKey(output))
|
VolumeControls.ContainsKey(output))
|
||||||
@@ -543,18 +601,19 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
|
||||||
|
|
||||||
|
|
||||||
// NOTE THAT THESE ARE NOTS - TO CATCH THE AudioVideo TYPE
|
// NOTE THAT THESE ARE NOTS - TO CATCH THE AudioVideo TYPE
|
||||||
if (sigType != eRoutingSignalType.Audio)
|
if (sigType != eRoutingSignalType.Audio)
|
||||||
{
|
{
|
||||||
SystemControl.VideoEnter.BoolValue = true;
|
//SystemControl.VideoEnter.BoolValue = true;
|
||||||
(Dmps.SwitcherOutputs[output] as Card.Dmps3OutputBase).VideoOut = inCard;
|
(Dmps.SwitcherOutputs[output] as Card.Dmps3OutputBase).VideoOut = inCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sigType != eRoutingSignalType.Video)
|
if (sigType != eRoutingSignalType.Video)
|
||||||
{
|
{
|
||||||
SystemControl.AudioEnter.BoolValue = true;
|
//SystemControl.AudioEnter.BoolValue = true;
|
||||||
(Dmps.SwitcherOutputs[output] as Card.Dmps3OutputBase).AudioOut = inCard;
|
(Dmps.SwitcherOutputs[output] as Card.Dmps3OutputBase).AudioOut = inCard;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user