mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
Merge pull request #352 from PepperDash/feature/add-dmc-4kz-hdo-support-and-try-catch
Adds support for DMC-4KZ-HDO output card and adds try catch to solve …
This commit is contained in:
@@ -329,56 +329,64 @@ namespace PepperDash.Essentials.DM
|
|||||||
InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { return Chassis.Inputs[tempX].EndpointOnlineFeedback; });
|
InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { return Chassis.Inputs[tempX].EndpointOnlineFeedback; });
|
||||||
|
|
||||||
InputCardHdcpStateFeedbacks[tempX] = new IntFeedback(() => {
|
InputCardHdcpStateFeedbacks[tempX] = new IntFeedback(() => {
|
||||||
var inputCard = Chassis.Inputs[tempX];
|
try
|
||||||
|
|
||||||
if (inputCard.Card is DmcHd)
|
|
||||||
{
|
{
|
||||||
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
|
var inputCard = Chassis.Inputs[tempX];
|
||||||
|
|
||||||
if ((inputCard.Card as DmcHd).HdmiInput.HdcpSupportOnFeedback.BoolValue)
|
if (inputCard.Card is DmcHd)
|
||||||
return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inputCard.Card is DmcHdDsp)
|
|
||||||
{
|
|
||||||
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
|
|
||||||
|
|
||||||
if ((inputCard.Card as DmcHdDsp).HdmiInput.HdcpSupportOnFeedback.BoolValue)
|
|
||||||
return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (inputCard.Card is Dmc4kHdBase)
|
|
||||||
{
|
|
||||||
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
|
|
||||||
return (int)(inputCard.Card as Dmc4kHdBase).HdmiInput.HdcpReceiveCapability;
|
|
||||||
}
|
|
||||||
if (inputCard.Card is Dmc4kCBase)
|
|
||||||
{
|
|
||||||
if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
|
|
||||||
{
|
{
|
||||||
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
|
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
|
||||||
return (int)(inputCard.Card as Dmc4kCBase).DmInput.HdcpReceiveCapability;
|
|
||||||
|
if ((inputCard.Card as DmcHd).HdmiInput.HdcpSupportOnFeedback.BoolValue)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((inputCard.Card as Dmc4kCBase).DmInput.HdcpSupportOnFeedback.BoolValue)
|
if (inputCard.Card is DmcHdDsp)
|
||||||
return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (inputCard.Card is Dmc4kCDspBase)
|
|
||||||
{
|
|
||||||
if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
|
|
||||||
{
|
{
|
||||||
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
|
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
|
||||||
return (int)(inputCard.Card as Dmc4kCDspBase).DmInput.HdcpReceiveCapability;
|
|
||||||
|
if ((inputCard.Card as DmcHdDsp).HdmiInput.HdcpSupportOnFeedback.BoolValue)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (inputCard.Card is Dmc4kHdBase)
|
||||||
|
{
|
||||||
|
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
|
||||||
|
return (int)(inputCard.Card as Dmc4kHdBase).HdmiInput.HdcpReceiveCapability;
|
||||||
|
}
|
||||||
|
if (inputCard.Card is Dmc4kCBase)
|
||||||
|
{
|
||||||
|
if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
|
||||||
|
{
|
||||||
|
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
|
||||||
|
return (int)(inputCard.Card as Dmc4kCBase).DmInput.HdcpReceiveCapability;
|
||||||
|
}
|
||||||
|
|
||||||
if ((inputCard.Card as Dmc4kCDspBase).DmInput.HdcpSupportOnFeedback.BoolValue)
|
if ((inputCard.Card as Dmc4kCBase).DmInput.HdcpSupportOnFeedback.BoolValue)
|
||||||
return 1;
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (inputCard.Card is Dmc4kCDspBase)
|
||||||
|
{
|
||||||
|
if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
|
||||||
|
{
|
||||||
|
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
|
||||||
|
return (int)(inputCard.Card as Dmc4kCDspBase).DmInput.HdcpReceiveCapability;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((inputCard.Card as Dmc4kCDspBase).DmInput.HdcpSupportOnFeedback.BoolValue)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException iopex)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Warning, "The Input Card in slot: {0} supports HDCP 2. Please update the configuration value in the inputCardSupportsHdcp2 object to true. Error: {1}", tempX, iopex);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -614,6 +622,13 @@ namespace PepperDash.Essentials.DM
|
|||||||
var cecPort2 = outputCard.Card2.HdmiOutput;
|
var cecPort2 = outputCard.Card2.HdmiOutput;
|
||||||
AddDmcHdoPorts(number, cecPort1, cecPort2);
|
AddDmcHdoPorts(number, cecPort1, cecPort2);
|
||||||
}
|
}
|
||||||
|
else if (type == "dmc4kzhdo")
|
||||||
|
{
|
||||||
|
var outputCard = new Dmc4kzHdoSingle(number, Chassis);
|
||||||
|
var cecPort1 = outputCard.Card1.HdmiOutput;
|
||||||
|
var cecPort2 = outputCard.Card2.HdmiOutput;
|
||||||
|
AddDmcHdoPorts(number, cecPort1, cecPort2);
|
||||||
|
}
|
||||||
else if (type == "dmchdo")
|
else if (type == "dmchdo")
|
||||||
{
|
{
|
||||||
var outputCard = new DmcHdoSingle(number, Chassis);
|
var outputCard = new DmcHdoSingle(number, Chassis);
|
||||||
@@ -800,56 +815,63 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
|
void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
|
||||||
{
|
{
|
||||||
switch (args.EventId)
|
try
|
||||||
{
|
{
|
||||||
case DMInputEventIds.EndpointOnlineEventId:
|
switch (args.EventId)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
case DMInputEventIds.EndpointOnlineEventId:
|
||||||
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
{
|
||||||
break;
|
Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
||||||
}
|
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
||||||
case DMInputEventIds.OnlineFeedbackEventId:
|
break;
|
||||||
{
|
}
|
||||||
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
case DMInputEventIds.OnlineFeedbackEventId:
|
||||||
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
{
|
||||||
break;
|
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
||||||
}
|
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
||||||
case DMInputEventIds.VideoDetectedEventId:
|
break;
|
||||||
{
|
}
|
||||||
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
|
case DMInputEventIds.VideoDetectedEventId:
|
||||||
VideoInputSyncFeedbacks[args.Number].FireUpdate();
|
{
|
||||||
break;
|
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
|
||||||
}
|
VideoInputSyncFeedbacks[args.Number].FireUpdate();
|
||||||
case DMInputEventIds.InputNameEventId:
|
break;
|
||||||
{
|
}
|
||||||
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
|
case DMInputEventIds.InputNameEventId:
|
||||||
InputNameFeedbacks[args.Number].FireUpdate();
|
{
|
||||||
break;
|
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
|
||||||
}
|
InputNameFeedbacks[args.Number].FireUpdate();
|
||||||
case DMInputEventIds.UsbRoutedToEventId:
|
break;
|
||||||
{
|
}
|
||||||
Debug.Console(2, this, "DM Input {0} UsbRoutedToEventId", args.Number);
|
case DMInputEventIds.UsbRoutedToEventId:
|
||||||
if (UsbInputRoutedToFeebacks[args.Number] != null)
|
{
|
||||||
UsbInputRoutedToFeebacks[args.Number].FireUpdate();
|
Debug.Console(2, this, "DM Input {0} UsbRoutedToEventId", args.Number);
|
||||||
else
|
if (UsbInputRoutedToFeebacks[args.Number] != null)
|
||||||
Debug.Console(1, this, "No index of {0} found in UsbInputRoutedToFeedbacks");
|
UsbInputRoutedToFeebacks[args.Number].FireUpdate();
|
||||||
break;
|
else
|
||||||
}
|
Debug.Console(1, this, "No index of {0} found in UsbInputRoutedToFeedbacks");
|
||||||
case DMInputEventIds.HdcpCapabilityFeedbackEventId:
|
break;
|
||||||
{
|
}
|
||||||
Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number);
|
case DMInputEventIds.HdcpCapabilityFeedbackEventId:
|
||||||
if (InputCardHdcpStateFeedbacks[args.Number] != null)
|
{
|
||||||
InputCardHdcpStateFeedbacks[args.Number].FireUpdate();
|
Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number);
|
||||||
else
|
if (InputCardHdcpStateFeedbacks[args.Number] != null)
|
||||||
Debug.Console(1, this, "No index of {0} found in InputCardHdcpStateFeedbacks");
|
InputCardHdcpStateFeedbacks[args.Number].FireUpdate();
|
||||||
break;
|
else
|
||||||
}
|
Debug.Console(1, this, "No index of {0} found in InputCardHdcpCapabilityFeedbacks");
|
||||||
default:
|
break;
|
||||||
{
|
}
|
||||||
Debug.Console(2, this, "DMInputChange fired for Input {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
default:
|
||||||
break;
|
{
|
||||||
|
Debug.Console(2, this, "DMInputChange fired for Input {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Error in Chassis_DMInputChange: {0}", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user