Updated DmTx4k202CController

#200
This commit is contained in:
Trevor Payne
2020-05-20 13:55:37 -05:00
parent 102535cd04
commit 76abd05830

View File

@@ -98,38 +98,21 @@ namespace PepperDash.Essentials.DM
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent; Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent; Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
VideoSourceNumericFeedback = new IntFeedback(() => AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
{
return (int)Tx.VideoSourceFeedback;
});
AudioSourceNumericFeedback = new IntFeedback(() =>
{
return (int)Tx.AudioSourceFeedback;
});
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
{
return (int)tx.HdmiInputs[1].HdcpCapabilityFeedback;
});
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
{
return (int)tx.HdmiInputs[2].HdcpCapabilityFeedback;
});
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support; HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
Hdmi1VideoSyncFeedback = new BoolFeedback(() => Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
{
return (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue;
});
Hdmi2VideoSyncFeedback = new BoolFeedback(() => Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
{
return (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue;
});
var combinedFuncs = new VideoStatusFuncsWrapper var combinedFuncs = new VideoStatusFuncsWrapper
{ {
@@ -285,52 +268,56 @@ namespace PepperDash.Essentials.DM
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args) void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{ {
Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString()); Debug.Console(2, "{0} event {1} stream {2}", this.Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId) switch (args.EventId)
{ {
if (inputStream == Tx.HdmiInputs[1]) case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
HdmiIn1HdcpCapabilityFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
else if (inputStream == Tx.HdmiInputs[2]) if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
HdmiIn2HdcpCapabilityFeedback.FireUpdate(); break;
} case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId) if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
{ if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
if (inputStream == Tx.HdmiInputs[1]) break;
HdmiIn1HdcpCapabilityFeedback.FireUpdate(); case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
else if (inputStream == Tx.HdmiInputs[2]) if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate();
HdmiIn2HdcpCapabilityFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate();
break;
} }
} }
void Tx_BaseEvent(GenericBase device, BaseEventArgs args) void Tx_BaseEvent(GenericBase device, BaseEventArgs args)
{ {
var id = args.EventId; var id = args.EventId;
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId) Debug.Console(2, this, "EventId {0}", args.EventId);
{
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback); switch (id)
VideoSourceNumericFeedback.FireUpdate(); {
ActiveVideoInputFeedback.FireUpdate(); case EndpointTransmitterBase.VideoSourceFeedbackEventId:
} Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
ActiveVideoInputFeedback.FireUpdate();
// ------------------------------ incomplete ----------------------------------------- VideoSourceNumericFeedback.FireUpdate();
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId) ActiveVideoInputFeedback.FireUpdate();
{ break;
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback); case EndpointTransmitterBase.AudioSourceFeedbackEventId:
AudioSourceNumericFeedback.FireUpdate(); Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
} AudioSourceNumericFeedback.FireUpdate();
break;
}
} }
/// <summary> /// <summary>
/// Relays the input stream change to the appropriate RoutingInputPort. /// Relays the input stream change to the appropriate RoutingInputPort.
/// </summary> /// </summary>
void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId) void FowardInputStreamChange(RoutingInputPortWithVideoStatuses inputPort, int eventId)
{ {
if (eventId == EndpointInputStreamEventIds.SyncDetectedFeedbackEventId) if (eventId != EndpointInputStreamEventIds.SyncDetectedFeedbackEventId)
{ {
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate(); return;
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate(); }
} inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
} }
/// <summary> /// <summary>