mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
Merge pull request #1079 from PepperDash/hotfix/dge-hdcp
Add HDCP & Bridging support for DGE Devices
This commit is contained in:
@@ -17,11 +17,12 @@ using PepperDash.Essentials.Core;
|
|||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using PepperDash.Essentials.Core.DeviceInfo;
|
using PepperDash.Essentials.Core.DeviceInfo;
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||||
{
|
{
|
||||||
[Description("Wrapper class for DGE-100")]
|
[Description("Wrapper class for DGE-100")]
|
||||||
public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec, IDeviceInfoProvider
|
public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec, IDeviceInfoProvider, IBridgeAdvanced
|
||||||
{
|
{
|
||||||
private const int CtpPort = 41795;
|
private const int CtpPort = 41795;
|
||||||
private readonly Dge100 _dge;
|
private readonly Dge100 _dge;
|
||||||
@@ -30,9 +31,12 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||||||
|
|
||||||
public BasicTriListWithSmartObject Panel { get { return _dge; } }
|
public BasicTriListWithSmartObject Panel { get { return _dge; } }
|
||||||
|
|
||||||
private DeviceConfig _dc;
|
private DeviceConfig _dc;
|
||||||
|
|
||||||
|
public VideoStatusOutputs VideoStatusFeedbacks { get; private set; }
|
||||||
|
|
||||||
|
CrestronTouchpanelPropertiesConfig PropertiesConfig;
|
||||||
|
|
||||||
CrestronTouchpanelPropertiesConfig PropertiesConfig;
|
|
||||||
|
|
||||||
public Dge100Controller(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
|
public Dge100Controller(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
|
||||||
:base(key, name, device)
|
:base(key, name, device)
|
||||||
@@ -48,8 +52,20 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||||||
|
|
||||||
_dc = dc;
|
_dc = dc;
|
||||||
|
|
||||||
PropertiesConfig = props;
|
PropertiesConfig = props;
|
||||||
}
|
|
||||||
|
var videoStatusFuncs = new VideoStatusFuncsWrapper
|
||||||
|
{
|
||||||
|
HdcpActiveFeedbackFunc = () => _dge.HdmiIn.HdcpSupportOnFeedback.BoolValue,
|
||||||
|
VideoResolutionFeedbackFunc = () => _dge.HdmiIn.VideoAttributes.GetVideoResolutionString(),
|
||||||
|
VideoSyncFeedbackFunc = () => _dge.HdmiIn.SyncDetectedFeedback.BoolValue,
|
||||||
|
};
|
||||||
|
|
||||||
|
VideoStatusFeedbacks = new VideoStatusOutputs(videoStatusFuncs);
|
||||||
|
|
||||||
|
_dge.HdmiIn.StreamChange += (s,a) => VideoStatusFeedbacks.FireAll();
|
||||||
|
_dge.HdmiIn.VideoAttributes.AttributeChange += (o, a) => VideoStatusFeedbacks.FireAll();
|
||||||
|
}
|
||||||
|
|
||||||
#region IComPorts Members
|
#region IComPorts Members
|
||||||
|
|
||||||
@@ -187,6 +203,63 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||||||
handler(this, new DeviceInfoEventArgs(DeviceInfo));
|
handler(this, new DeviceInfoEventArgs(DeviceInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IBridgeAdvanced Members
|
||||||
|
|
||||||
|
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
{
|
||||||
|
var joinMap = new DgeJoinMap(joinStart);
|
||||||
|
|
||||||
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<DgeJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
|
if (bridge != null)
|
||||||
|
{
|
||||||
|
bridge.AddJoinMap(Key, joinMap);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
|
//Presses
|
||||||
|
trilist.SetSigTrueAction(joinMap.HdmiInHdcpOn.JoinNumber, () => _dge.HdmiIn.HdcpSupportOn());
|
||||||
|
trilist.SetSigTrueAction(joinMap.HdmiInHdcpOff.JoinNumber,() => _dge.HdmiIn.HdcpSupportOff());
|
||||||
|
trilist.SetSigTrueAction(joinMap.HdmiInHdcpToggle.JoinNumber, () => {
|
||||||
|
if(_dge.HdmiIn.HdcpSupportOnFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
_dge.HdmiIn.HdcpSupportOff();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_dge.HdmiIn.HdcpSupportOn();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Feedbacks
|
||||||
|
VideoStatusFeedbacks.HdcpActiveFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiInHdcpOn.JoinNumber]);
|
||||||
|
VideoStatusFeedbacks.HdcpActiveFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.HdmiInHdcpOff.JoinNumber]);
|
||||||
|
|
||||||
|
VideoStatusFeedbacks.VideoResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentInputResolution.JoinNumber]);
|
||||||
|
VideoStatusFeedbacks.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SyncDetected.JoinNumber]);
|
||||||
|
|
||||||
|
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||||
|
|
||||||
|
trilist.OnlineStatusChange += (o, a) =>
|
||||||
|
{
|
||||||
|
if (!a.DeviceOnLine) return;
|
||||||
|
|
||||||
|
VideoStatusFeedbacks.FireAll();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
||||||
|
{
|
||||||
|
public class DgeJoinMap : JoinMapBaseAdvanced
|
||||||
|
{
|
||||||
|
[JoinName("IsOnline")]
|
||||||
|
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DGE Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("CurrentInputResolution")]
|
||||||
|
public JoinDataComplete CurrentInputResolution = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DGE Current Input Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|
||||||
|
[JoinName("SyncDetected")]
|
||||||
|
public JoinDataComplete SyncDetected = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DGE Sync Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("HdmiHdcpOn")]
|
||||||
|
public JoinDataComplete HdmiInHdcpOn = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DGE HDMI HDCP State On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("HdmiHdcpOff")]
|
||||||
|
public JoinDataComplete HdmiInHdcpOff = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DGE HDMI HDCP State Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("HdmiHdcpToggle")]
|
||||||
|
public JoinDataComplete HdmiInHdcpToggle = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DGE HDMI HDCP State Toggle", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
public DgeJoinMap(uint joinStart)
|
||||||
|
: this(joinStart, typeof(DgeJoinMap))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor to use when extending this Join map
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="joinStart">Join this join map will start at</param>
|
||||||
|
/// <param name="type">Type of the child join map</param>
|
||||||
|
protected DgeJoinMap(uint joinStart, Type type) : base(joinStart, type)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -58,37 +58,37 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
|
|||||||
HdmiOut.Port = _dge.HdmiOut; ;
|
HdmiOut.Port = _dge.HdmiOut; ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DmDge200CControllerFactory : EssentialsDeviceFactory<DmDge200CController>
|
|
||||||
{
|
|
||||||
public DmDge200CControllerFactory()
|
|
||||||
{
|
|
||||||
TypeNames = new List<string>() { "dmdge200c" };
|
|
||||||
}
|
|
||||||
|
|
||||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
|
||||||
{
|
|
||||||
var typeName = dc.Type.ToLower();
|
|
||||||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
|
||||||
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(dc.Properties.ToString());
|
|
||||||
|
|
||||||
Debug.Console(1, "Factory Attempting to create new DgeController Device");
|
|
||||||
|
|
||||||
DmDge200C dgeDevice = null;
|
|
||||||
|
|
||||||
if (typeName == "dmdge200c")
|
|
||||||
dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem);
|
|
||||||
|
|
||||||
if (dgeDevice == null)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "Unable to create DGE device");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var dgeController = new DmDge200CController(dc.Key , dc.Name, dgeDevice, dc, props);
|
|
||||||
|
|
||||||
return dgeController;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class DmDge200CControllerFactory : EssentialsDeviceFactory<DmDge200CController>
|
||||||
|
{
|
||||||
|
public DmDge200CControllerFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "dmdge200c" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
var typeName = dc.Type.ToLower();
|
||||||
|
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||||
|
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
Debug.Console(1, "Factory Attempting to create new DgeController Device");
|
||||||
|
|
||||||
|
DmDge200C dgeDevice = null;
|
||||||
|
|
||||||
|
if (typeName == "dmdge200c")
|
||||||
|
dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem);
|
||||||
|
|
||||||
|
if (dgeDevice == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Unable to create DGE device");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var dgeController = new DmDge200CController(dc.Key, dc.Name, dgeDevice, dc, props);
|
||||||
|
|
||||||
|
return dgeController;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -105,6 +105,7 @@
|
|||||||
<Compile Include="Chassis\HdMdNxM4kEBridgeableController.cs" />
|
<Compile Include="Chassis\HdMdNxM4kEBridgeableController.cs" />
|
||||||
<Compile Include="Chassis\HdMdNxM4kEController.cs" />
|
<Compile Include="Chassis\HdMdNxM4kEController.cs" />
|
||||||
<Compile Include="Config\InputPropertiesConfig.cs" />
|
<Compile Include="Config\InputPropertiesConfig.cs" />
|
||||||
|
<Compile Include="Endpoints\DGEs\DgeJoinMap.cs" />
|
||||||
<Compile Include="Endpoints\DGEs\DmDge200CController.cs" />
|
<Compile Include="Endpoints\DGEs\DmDge200CController.cs" />
|
||||||
<Compile Include="Endpoints\Receivers\DmRmc4kZ100CController.cs" />
|
<Compile Include="Endpoints\Receivers\DmRmc4kZ100CController.cs" />
|
||||||
<Compile Include="Endpoints\Receivers\DmRmc4kZScalerCController.cs" />
|
<Compile Include="Endpoints\Receivers\DmRmc4kZScalerCController.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user