Skip to content

Commit

Permalink
Merge pull request #114 from PepperDash/temp-to-dev
Browse files Browse the repository at this point in the history
Temp to dev
  • Loading branch information
andrew-welker authored Mar 19, 2024
2 parents 9c1e631 + 6c96bf9 commit 4b9ef9b
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/NvxEpi/Abstractions/INvx36XDeviceWithHardware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

namespace NvxEpi.Abstractions
{
/*
public interface INvx36XDeviceWithHardware : INvxDeviceWithHardware, INvx36XHardware
{
}
*/
}
12 changes: 10 additions & 2 deletions src/NvxEpi/Application/Entities/NvxApplicationVideoTransmitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}

Expand Down
1 change: 0 additions & 1 deletion src/NvxEpi/Devices/Nvx36X.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public void MakeUsbRoute(IUsbStreamWithHardware hardware)
usbStream.MakeUsbRoute(hardware);
}


public CrestronCollection<ComPort> ComPorts
{
get { return Hardware.ComPorts; }
Expand Down
25 changes: 20 additions & 5 deletions src/NvxEpi/Extensions/HdmiInputExtensions.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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)
{
Expand Down
19 changes: 18 additions & 1 deletion src/NvxEpi/Services/Feedback/DmHdcpCapabilityValueFeedback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
17 changes: 17 additions & 0 deletions src/NvxEpi/Services/Feedback/Hdmi1HdcpCapabilityFeedback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

0 comments on commit 4b9ef9b

Please sign in to comment.