diff --git a/src/NvxEpi/Abstractions/INvx36XDeviceWithHardware.cs b/src/NvxEpi/Abstractions/INvx36XDeviceWithHardware.cs index 6311c51..777b1e4 100644 --- a/src/NvxEpi/Abstractions/INvx36XDeviceWithHardware.cs +++ b/src/NvxEpi/Abstractions/INvx36XDeviceWithHardware.cs @@ -2,8 +2,10 @@ namespace NvxEpi.Abstractions { + /* public interface INvx36XDeviceWithHardware : INvxDeviceWithHardware, INvx36XHardware { } + */ } \ No newline at end of file diff --git a/src/NvxEpi/Application/Entities/NvxApplicationVideoTransmitter.cs b/src/NvxEpi/Application/Entities/NvxApplicationVideoTransmitter.cs index 3672317..2da842b 100644 --- a/src/NvxEpi/Application/Entities/NvxApplicationVideoTransmitter.cs +++ b/src/NvxEpi/Application/Entities/NvxApplicationVideoTransmitter.cs @@ -59,8 +59,16 @@ public NvxApplicationVideoTransmitter(string key, NvxApplicationDeviceVideoConfi AddPostActivationAction(() => { - LinkRoutingInputPort(config.NvxRoutingPort); - LinkInputValues(config.NvxRoutingPort); + try + { + + LinkRoutingInputPort(config.NvxRoutingPort); + LinkInputValues(config.NvxRoutingPort); + } + catch (Exception ex) + { + Debug.Console(0, this, "Caught an exception:{0}", ex); + } }); } diff --git a/src/NvxEpi/Devices/Nvx36X.cs b/src/NvxEpi/Devices/Nvx36X.cs index bd6f479..18dc23e 100644 --- a/src/NvxEpi/Devices/Nvx36X.cs +++ b/src/NvxEpi/Devices/Nvx36X.cs @@ -91,7 +91,6 @@ public void MakeUsbRoute(IUsbStreamWithHardware hardware) usbStream.MakeUsbRoute(hardware); } - public CrestronCollection ComPorts { get { return Hardware.ComPorts; } diff --git a/src/NvxEpi/Extensions/HdmiInputExtensions.cs b/src/NvxEpi/Extensions/HdmiInputExtensions.cs index 163b68f..3454402 100644 --- a/src/NvxEpi/Extensions/HdmiInputExtensions.cs +++ b/src/NvxEpi/Extensions/HdmiInputExtensions.cs @@ -1,5 +1,7 @@ using System; using Crestron.SimplSharpPro.DM; +using Crestron.SimplSharpPro.DM.Endpoints; +using Crestron.SimplSharpPro.DM.Streaming; using NvxEpi.Abstractions.HdmiInput; using PepperDash.Core; @@ -11,12 +13,25 @@ public static void SetHdmi1HdcpCapability(this IHdmiInput device, ushort capabil { try { - if (device.Hardware.HdmiIn[1] == null) - throw new NotSupportedException("hdmi1"); + eHdcpCapabilityType capabilityToSet; - var capabilityToSet = (eHdcpCapabilityType) capability; - Debug.Console(1, device, "Setting Hdmi1 Capability to '{0}'", capabilityToSet.ToString()); - device.Hardware.HdmiIn[1].HdcpCapability = capabilityToSet; + if (device.Hardware is DmNvxE760x) + { + capabilityToSet = (eHdcpCapabilityType)capability; + Debug.Console(1, device, "Setting Hdmi1 Capability to '{0}'", capabilityToSet.ToString()); + var hardware = device.Hardware as DmNvxE760x; + hardware.DmIn.HdcpCapability = capabilityToSet; + } + else if (device.Hardware.HdmiIn != null && device.Hardware.HdmiIn[1] != null) + { + capabilityToSet = (eHdcpCapabilityType) capability; + Debug.Console(1, device, "Setting Hdmi1 Capability to '{0}'", capabilityToSet.ToString()); + device.Hardware.HdmiIn[1].HdcpCapability = capabilityToSet; + } + else + { + throw new NotSupportedException("hdmi1"); + } } catch (ArgumentOutOfRangeException ex) { diff --git a/src/NvxEpi/Services/Feedback/DmHdcpCapabilityValueFeedback.cs b/src/NvxEpi/Services/Feedback/DmHdcpCapabilityValueFeedback.cs index 0e21f35..f642b24 100644 --- a/src/NvxEpi/Services/Feedback/DmHdcpCapabilityValueFeedback.cs +++ b/src/NvxEpi/Services/Feedback/DmHdcpCapabilityValueFeedback.cs @@ -12,7 +12,24 @@ public static IntFeedback GetFeedback(DmNvxBaseClass device) return new IntFeedback(() => 0); var feedback = new IntFeedback(Hdmi1HdcpCapabilityValueFeedback.Key, - () => (int)device.DmIn.HdcpCapabilityFeedback); + () => (int)device.DmIn.HdcpCapability); + + device.DmIn.InputStreamChange += (stream, args) => feedback.FireUpdate(); + device.DmIn.VideoAttributes.AttributeChange += (stream, args) => feedback.FireUpdate(); + return feedback; + } + } + + public class DmHdcpCapabilityStateFeedback + { + public static IntFeedback GetFeedback(DmNvxBaseClass device) + { + var dmDevice = device as DmNvxE760x; + if (dmDevice == null) + return new IntFeedback(() => 0); + + var feedback = new IntFeedback(Hdmi1HdcpCapabilityValueFeedback.Key, + () => (int)device.DmIn.VideoAttributes.HdcpStateFeedback); device.DmIn.InputStreamChange += (stream, args) => feedback.FireUpdate(); device.DmIn.VideoAttributes.AttributeChange += (stream, args) => feedback.FireUpdate(); diff --git a/src/NvxEpi/Services/Feedback/Hdmi1HdcpCapabilityFeedback.cs b/src/NvxEpi/Services/Feedback/Hdmi1HdcpCapabilityFeedback.cs index 2c58cc8..48ded6a 100644 --- a/src/NvxEpi/Services/Feedback/Hdmi1HdcpCapabilityFeedback.cs +++ b/src/NvxEpi/Services/Feedback/Hdmi1HdcpCapabilityFeedback.cs @@ -20,4 +20,21 @@ public static StringFeedback GetFeedback(DmNvxBaseClass device) return feedback; } } + + public class Hdmi1HdcpStateFeedback + { + public const string Key = "Hdmi1HdcpState"; + + public static IntFeedback GetFeedback(DmNvxBaseClass device) + { + if (device.HdmiIn == null || device.HdmiIn[1] == null) + return new IntFeedback(() => 0); + + var feedback = new IntFeedback(Key, + () => (int)device.HdmiIn[1].VideoAttributes.HdcpStateFeedback); + + device.HdmiIn[1].StreamChange += (stream, args) => feedback.FireUpdate(); + return feedback; + } + } } \ No newline at end of file