fix(wip): updates stream cec implementation to handle switchers with multiple outputs

This commit is contained in:
Jason DeVito
2023-09-12 10:09:37 -05:00
parent 4e33743f50
commit 27bac4e83d

View File

@@ -15,7 +15,7 @@ using PepperDash_Essentials_DM.Config;
namespace PepperDash_Essentials_DM.Chassis namespace PepperDash_Essentials_DM.Chassis
{ {
[Description("Wrapper class for all HdPsXxx switchers")] [Description("Wrapper class for all HdPsXxx switchers")]
public class HdPsXxxController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback, ICec, IHasHdmiInHdcp, IHasFeedback public class HdPsXxxController : CrestronGenericBridgeableBaseDevice, IRoutingNumericWithFeedback
{ {
private readonly HdPsXxx _chassis; private readonly HdPsXxx _chassis;
@@ -79,8 +79,6 @@ namespace PepperDash_Essentials_DM.Chassis
OutputNames = props.Outputs; OutputNames = props.Outputs;
SetupOutputs(OutputNames); SetupOutputs(OutputNames);
//AddPostActivationAction();
} }
// input setup // input setup
@@ -109,7 +107,7 @@ namespace PepperDash_Essentials_DM.Chassis
{ {
FeedbackMatchObject = input FeedbackMatchObject = input
}; };
Debug.Console(1, this, "Adding HDMI Input port: {0}", port.Key); Debug.Console(1, this, "Adding Input port: {0}", port.Key);
InputPorts.Add(port); InputPorts.Add(port);
InputHdcpEnableFeedback.Add(new BoolFeedback(name, () => input.InputPort.HdcpSupportOnFeedback.BoolValue)); InputHdcpEnableFeedback.Add(new BoolFeedback(name, () => input.InputPort.HdcpSupportOnFeedback.BoolValue));
@@ -127,11 +125,11 @@ namespace PepperDash_Essentials_DM.Chassis
InputNameFeedbacks.Add(new StringFeedback(name, () => InputNames[index])); InputNameFeedbacks.Add(new StringFeedback(name, () => InputNames[index]));
var port = new RoutingInputPort(name, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, input, this) var port = new RoutingInputPort(key, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, input, this)
{ {
FeedbackMatchObject = input FeedbackMatchObject = input
}; };
Debug.Console(0, this, "Adding DM Input port: {0}",port.Key); Debug.Console(0, this, "Adding Input port: {0}", port.Key);
InputPorts.Add(port); InputPorts.Add(port);
InputHdcpEnableFeedback.Add(new BoolFeedback(name, () => input.InputPort.HdcpSupportOnFeedback.BoolValue)); InputHdcpEnableFeedback.Add(new BoolFeedback(name, () => input.InputPort.HdcpSupportOnFeedback.BoolValue));
@@ -169,13 +167,33 @@ namespace PepperDash_Essentials_DM.Chassis
// set port for CEC // set port for CEC
Port = output Port = output
}; };
Debug.Console(0, this, "Adding HdmiDmLite Output port: {0} {1}", Debug.Console(0, this, "Adding Output port: {0}", port.Key);
port.Key, port.ParentDevice);
OutputPorts.Add(port); OutputPorts.Add(port);
OutputRouteNameFeedback.Add(new StringFeedback(name, () => output.VideoOutFeedback.NameFeedback.StringValue)); OutputRouteNameFeedback.Add(new StringFeedback(name, () => output.VideoOutFeedback.NameFeedback.StringValue));
VideoOutputRouteFeedbacks.Add(new IntFeedback(name, () => output.VideoOutFeedback == null ? 0 : (int)output.VideoOutFeedback.Number)); VideoOutputRouteFeedbacks.Add(new IntFeedback(name, () => output.VideoOutFeedback == null ? 0 : (int)output.VideoOutFeedback.Number));
// TODO [ ] Investigate setting input priorities per output
// {{in1-priority-level}, {in2-priority-level}, .... {in6-priority-level}}
// default priority level input 1-4 ascending
output.OutputPort.InputPriorities(new byte[] { 1, 2, 3, 4 });
if (port.Port == null) continue;
var hdmiOutputStreamCec = output.HdmiOutput.HdmiOutputPort.StreamCec;
if (hdmiOutputStreamCec != null)
{
var streamCec = new StreamCecWrapper(string.Format("{0}-hdmiOut{1}-streamCec", Key, index), hdmiOutputStreamCec);
DeviceManager.AddDevice(streamCec);
}
var dmLiteOutputStreamCec = output.DmLiteOutput.DmLiteOutputPort.StreamCec;
if (dmLiteOutputStreamCec != null)
{
var streamCec = new StreamCecWrapper(string.Format("{0}-dmLiteOut{1}-streamCec", Key, index), dmLiteOutputStreamCec);
DeviceManager.AddDevice(streamCec);
}
} }
_chassis.DMOutputChange += _chassis_OutputChange; _chassis.DMOutputChange += _chassis_OutputChange;
@@ -508,26 +526,18 @@ namespace PepperDash_Essentials_DM.Chassis
#endregion #endregion
}
// TODO [ ] Implement CEC control
// return _chassis.HdmiDmLiteOutputs[0].DmLiteOutput.DmLiteOutputPort.StreamCec; public class StreamCecWrapper : IKeyed, ICec
public Cec StreamCec {
public string Key { get; private set; }
public Cec StreamCec { get; private set; }
public StreamCecWrapper(string key, Cec streamCec)
{ {
get Key = key;
{ StreamCec = streamCec;
return _chassis.NumberOfOutputs == 1
//? _chassis.HdmiDmLiteOutputs[0].DmLiteOutput.DmLiteOutputPort.StreamCec
? _chassis.HdmiDmLiteOutputs[0].HdmiOutput.HdmiOutputPort.StreamCec
: null;
}
} }
public IntFeedback HdmiInHdcpStateFeedback { get; private set; }
public void SetHdmiInHdcpState(eHdcpCapabilityType hdcpState)
{
throw new NotImplementedException();
}
public eHdcpCapabilityType HdmiInHdcpCapability { get; private set; }
} }
} }