Updated DmTx4k202CController

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

View File

@@ -100,36 +100,19 @@ namespace PepperDash.Essentials.DM
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent; Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
VideoSourceNumericFeedback = new IntFeedback(() => VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
{
return (int)Tx.VideoSourceFeedback;
});
AudioSourceNumericFeedback = new IntFeedback(() =>
{
return (int)Tx.AudioSourceFeedback;
});
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
{
return (int)tx.HdmiInputs[1].HdcpCapabilityFeedback;
});
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
{
return (int)tx.HdmiInputs[2].HdcpCapabilityFeedback; HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (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
{ {
@@ -287,37 +270,40 @@ namespace PepperDash.Essentials.DM
{ {
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);
VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate();
}
// ------------------------------ incomplete ----------------------------------------- switch (id)
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
{ {
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback); case EndpointTransmitterBase.VideoSourceFeedbackEventId:
AudioSourceNumericFeedback.FireUpdate(); Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate();
break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate();
break;
} }
} }
@@ -326,11 +312,12 @@ namespace PepperDash.Essentials.DM
/// </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>