Merge pull request #204 from PepperDash/hotfix/dm-tx-bridging

Hotfix/dm tx bridging
This commit is contained in:
Andrew Welker
2020-05-20 14:24:54 -06:00
committed by GitHub
9 changed files with 632 additions and 722 deletions

View File

@@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
@@ -12,7 +8,6 @@ using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.DM.Config;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
@@ -21,7 +16,8 @@ namespace PepperDash.Essentials.DM
/// <summary> /// <summary>
/// Controller class for all DM-TX-201C/S/F transmitters /// Controller class for all DM-TX-201C/S/F transmitters
/// </summary> /// </summary>
public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls [Description("Wrapper class for DM-TX-200-C Endpoint")]
public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx200C2G Tx { get; private set; } public DmTx200C2G Tx { get; private set; }
@@ -52,15 +48,10 @@ namespace PepperDash.Essentials.DM
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Analog || Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Analog ||
Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Disable) Tx.VideoSourceFeedback == DmTx200Base.eSourceSelection.Disable)
return Tx.VideoSourceFeedback; return Tx.VideoSourceFeedback;
else // auto
{
if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue) if (Tx.HdmiInput.SyncDetectedFeedback.BoolValue)
return DmTx200Base.eSourceSelection.Digital; return DmTx200Base.eSourceSelection.Digital;
else if (Tx.VgaInput.SyncDetectedFeedback.BoolValue)
return DmTx200Base.eSourceSelection.Analog; return Tx.VgaInput.SyncDetectedFeedback.BoolValue ? DmTx200Base.eSourceSelection.Analog : DmTx200Base.eSourceSelection.Disable;
else
return DmTx200Base.eSourceSelection.Disable;
}
} }
} }
@@ -106,45 +97,28 @@ namespace PepperDash.Essentials.DM
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput", ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
() => ActualActiveVideoInput.ToString()); () => ActualActiveVideoInput.ToString());
Tx.HdmiInput.InputStreamChange += new EndpointInputStreamChangeEventHandler(InputStreamChangeEvent); Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange); Tx.OnlineStatusChange += Tx_OnlineStatusChange;
VideoSourceNumericFeedback = new IntFeedback(() => VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
{ AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
return (int)Tx.VideoSourceFeedback;
});
AudioSourceNumericFeedback = new IntFeedback(() =>
{
return (int)Tx.AudioSourceFeedback;
});
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0);
{
if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
return 1;
else
return 0;
});
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport; HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
HdmiVideoSyncFeedback = new BoolFeedback(() => HdmiVideoSyncFeedback = new BoolFeedback(() => tx.HdmiInput.SyncDetectedFeedback.BoolValue);
{
return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
});
VgaVideoSyncFeedback = new BoolFeedback(() => VgaVideoSyncFeedback = new BoolFeedback(() => tx.VgaInput.SyncDetectedFeedback.BoolValue);
{
return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
});
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled); FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue); VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue); VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange); tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
var combinedFuncs = new VideoStatusFuncsWrapper var combinedFuncs = new VideoStatusFuncsWrapper
@@ -153,20 +127,13 @@ namespace PepperDash.Essentials.DM
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue), && tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
HdcpStateFeedbackFunc = () => HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ? tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
{
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
return "";
},
VideoResolutionFeedbackFunc = () => VideoResolutionFeedbackFunc = () =>
{ {
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital) if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString(); return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog) return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
return "";
}, },
VideoSyncFeedbackFunc = () => VideoSyncFeedbackFunc = () =>
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
@@ -181,7 +148,8 @@ namespace PepperDash.Essentials.DM
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn, AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs); eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, null, this); DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.DmCat, null, this);
AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback, AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback, AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
@@ -195,18 +163,32 @@ namespace PepperDash.Essentials.DM
DmOutput.Port = Tx.DmOutput; DmOutput.Port = Tx.DmOutput;
} }
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args) private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{
switch (args.EventId)
{
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
FreeRunEnabledFeedback.FireUpdate();
break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
VgaVideoSyncFeedback.FireUpdate();
break;
}
}
void VideoControls_ControlChange(object sender, GenericEventArgs args)
{ {
var id = args.EventId; var id = args.EventId;
Debug.Console(2, this, "EventId {0}", args.EventId); Debug.Console(2, this, "EventId {0}", args.EventId);
if (id == VideoControlsEventIds.BrightnessFeedbackEventId) switch (id)
{ {
case VideoControlsEventIds.BrightnessFeedbackEventId:
VgaBrightnessFeedback.FireUpdate(); VgaBrightnessFeedback.FireUpdate();
} break;
else if (id == VideoControlsEventIds.ContrastFeedbackEventId) case VideoControlsEventIds.ContrastFeedbackEventId:
{
VgaContrastFeedback.FireUpdate(); VgaContrastFeedback.FireUpdate();
break;
} }
} }
@@ -233,7 +215,7 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{ {
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey); var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
if (HdmiVideoSyncFeedback != null) if (HdmiVideoSyncFeedback != null)
{ {
@@ -253,14 +235,7 @@ namespace PepperDash.Essentials.DM
/// <param name="enable"></param> /// <param name="enable"></param>
public void SetFreeRunEnabled(bool enable) public void SetFreeRunEnabled(bool enable)
{ {
if (enable) Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
}
else
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
}
} }
/// <summary> /// <summary>
@@ -323,32 +298,35 @@ namespace PepperDash.Essentials.DM
var id = args.EventId; var id = args.EventId;
Debug.Console(2, this, "EventId {0}", args.EventId); Debug.Console(2, this, "EventId {0}", args.EventId);
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId) switch (id)
{ {
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback); Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
} break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
// ------------------------------ incomplete -----------------------------------------
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
{
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
break;
} }
} }
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}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId) switch (args.EventId)
{ {
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
HdmiInHdcpCapabilityFeedback.FireUpdate(); HdmiInHdcpCapabilityFeedback.FireUpdate();
} break;
else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId) case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
{
HdmiInHdcpCapabilityFeedback.FireUpdate(); HdmiInHdcpCapabilityFeedback.FireUpdate();
break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
HdmiVideoSyncFeedback.FireUpdate();
break;
} }
} }
@@ -357,12 +335,13 @@ 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)
{ {
return;
}
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate(); inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
} }
}
/// <summary> /// <summary>
/// Relays the VideoAttributes change to a RoutingInputPort /// Relays the VideoAttributes change to a RoutingInputPort

View File

@@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
@@ -12,18 +8,16 @@ using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.DM.Config;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
// using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
/// <summary> /// <summary>
/// Controller class for all DM-TX-201C/S/F transmitters /// Controller class for all DM-TX-201C/S/F transmitters
/// </summary> /// </summary>
public class DmTx201CController : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls [Description("Wrapper class for DM-TX-201-C Endpoint")]
public class DmTx201CController : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx201C Tx { get; private set; } // uses the 201S class as it is the base class for the 201C public DmTx201C Tx { get; private set; }
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; } public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; } public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
@@ -107,43 +101,29 @@ namespace PepperDash.Essentials.DM
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput", ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
() => ActualActiveVideoInput.ToString()); () => ActualActiveVideoInput.ToString());
Tx.HdmiInput.InputStreamChange += new EndpointInputStreamChangeEventHandler(InputStreamChangeEvent); Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange); Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
VideoSourceNumericFeedback = new IntFeedback(() => VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
{
return (int)Tx.VideoSourceFeedback; AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
});
AudioSourceNumericFeedback = new IntFeedback(() =>
{
return (int)Tx.AudioSourceFeedback;
});
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
{ (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0));
if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
return 1;
else
return 0;
});
HdmiVideoSyncFeedback = new BoolFeedback(() => HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
{
return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
});
VgaVideoSyncFeedback = new BoolFeedback(() => VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
{
return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
});
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled); FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue); VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue); VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange); tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport; HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
@@ -153,21 +133,17 @@ namespace PepperDash.Essentials.DM
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue), && tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
HdcpStateFeedbackFunc = () => HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ?
{ tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
return "";
},
VideoResolutionFeedbackFunc = () => VideoResolutionFeedbackFunc = () =>
{ {
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital) if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString(); return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog) return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ?
return tx.VgaInput.VideoAttributes.GetVideoResolutionString(); tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
return "";
}, },
VideoSyncFeedbackFunc = () => VideoSyncFeedbackFunc = () =>
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue) && tx.HdmiInput.SyncDetectedFeedback.BoolValue)
@@ -203,13 +179,14 @@ namespace PepperDash.Essentials.DM
var id = args.EventId; var id = args.EventId;
Debug.Console(2, this, "EventId {0}", args.EventId); Debug.Console(2, this, "EventId {0}", args.EventId);
if (id == VideoControlsEventIds.BrightnessFeedbackEventId) switch (id)
{ {
case VideoControlsEventIds.BrightnessFeedbackEventId:
VgaBrightnessFeedback.FireUpdate(); VgaBrightnessFeedback.FireUpdate();
} break;
else if (id == VideoControlsEventIds.ContrastFeedbackEventId) case VideoControlsEventIds.ContrastFeedbackEventId:
{
VgaContrastFeedback.FireUpdate(); VgaContrastFeedback.FireUpdate();
break;
} }
} }
@@ -221,6 +198,19 @@ namespace PepperDash.Essentials.DM
} }
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{
switch (args.EventId)
{
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
FreeRunEnabledFeedback.FireUpdate();
break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
VgaVideoSyncFeedback.FireUpdate();
break;
}
}
public override bool CustomActivate() public override bool CustomActivate()
{ {
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId); Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
@@ -235,7 +225,7 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{ {
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey); var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
if (HdmiVideoSyncFeedback != null) if (HdmiVideoSyncFeedback != null)
{ {
@@ -255,14 +245,7 @@ namespace PepperDash.Essentials.DM
/// <param name="enable"></param> /// <param name="enable"></param>
public void SetFreeRunEnabled(bool enable) public void SetFreeRunEnabled(bool enable)
{ {
if (enable) Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
}
else
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
}
} }
/// <summary> /// <summary>
@@ -331,38 +314,38 @@ namespace PepperDash.Essentials.DM
var id = args.EventId; var id = args.EventId;
Debug.Console(2, this, "EventId {0}", args.EventId); Debug.Console(2, this, "EventId {0}", args.EventId);
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId) switch (id)
{ {
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback); Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
} break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
// ------------------------------ incomplete -----------------------------------------
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
{
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
break;
} }
} }
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}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId) switch (args.EventId)
{ {
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
HdmiInHdcpCapabilityFeedback.FireUpdate(); HdmiInHdcpCapabilityFeedback.FireUpdate();
} break;
else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId) case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
{
HdmiInHdcpCapabilityFeedback.FireUpdate(); HdmiInHdcpCapabilityFeedback.FireUpdate();
break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
HdmiVideoSyncFeedback.FireUpdate();
break;
} }
else if (args.EventId == EndpointInputStreamEventIds.FreeRunFeedbackEventId)
{
FreeRunEnabledFeedback.FireUpdate();
}
} }
/// <summary> /// <summary>
@@ -370,12 +353,13 @@ 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)
{ {
return;
}
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate(); inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
} }
}
/// <summary> /// <summary>
/// Relays the VideoAttributes change to a RoutingInputPort /// Relays the VideoAttributes change to a RoutingInputPort

View File

@@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
@@ -12,18 +8,16 @@ using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.DM.Config;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
// using eVst = Crestron.SimplSharpPro.DeviceSupport.eX02VideoSourceType;
/// <summary> /// <summary>
/// Controller class for all DM-TX-201C/S/F transmitters /// Controller class for all DM-TX-201S/F transmitters
/// </summary> /// </summary>
public class DmTx201SController : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls [Description("Wrapper class for DM-TX-201-S/F Endpoint")]
public class DmTx201SController : DmTxControllerBase, ITxRouting, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx201S Tx { get; private set; } // uses the 201S class as it is the base class for the 201C public DmTx201S Tx { get; private set; }
public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; } public RoutingInputPortWithVideoStatuses HdmiInput { get; private set; }
public RoutingInputPortWithVideoStatuses VgaInput { get; private set; } public RoutingInputPortWithVideoStatuses VgaInput { get; private set; }
@@ -107,43 +101,29 @@ namespace PepperDash.Essentials.DM
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput", ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
() => ActualActiveVideoInput.ToString()); () => ActualActiveVideoInput.ToString());
Tx.HdmiInput.InputStreamChange += new EndpointInputStreamChangeEventHandler(InputStreamChangeEvent); Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange); Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);
VideoSourceNumericFeedback = new IntFeedback(() => VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
{
return (int)Tx.VideoSourceFeedback; AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
});
AudioSourceNumericFeedback = new IntFeedback(() =>
{
return (int)Tx.AudioSourceFeedback;
});
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
{ (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0));
if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
return 1;
else
return 0;
});
HdmiVideoSyncFeedback = new BoolFeedback(() => HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
{
return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
});
VgaVideoSyncFeedback = new BoolFeedback(() => VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
{
return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
});
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled); FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue); VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue); VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange); tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport; HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
@@ -153,21 +133,17 @@ namespace PepperDash.Essentials.DM
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue), && tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
HdcpStateFeedbackFunc = () => HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ?
{ tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
return "";
},
VideoResolutionFeedbackFunc = () => VideoResolutionFeedbackFunc = () =>
{ {
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital) if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString(); return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog) return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ?
return tx.VgaInput.VideoAttributes.GetVideoResolutionString(); tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
return "";
}, },
VideoSyncFeedbackFunc = () => VideoSyncFeedbackFunc = () =>
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
&& tx.HdmiInput.SyncDetectedFeedback.BoolValue) && tx.HdmiInput.SyncDetectedFeedback.BoolValue)
@@ -203,13 +179,14 @@ namespace PepperDash.Essentials.DM
var id = args.EventId; var id = args.EventId;
Debug.Console(2, this, "EventId {0}", args.EventId); Debug.Console(2, this, "EventId {0}", args.EventId);
if (id == VideoControlsEventIds.BrightnessFeedbackEventId) switch (id)
{ {
case VideoControlsEventIds.BrightnessFeedbackEventId:
VgaBrightnessFeedback.FireUpdate(); VgaBrightnessFeedback.FireUpdate();
} break;
else if (id == VideoControlsEventIds.ContrastFeedbackEventId) case VideoControlsEventIds.ContrastFeedbackEventId:
{
VgaContrastFeedback.FireUpdate(); VgaContrastFeedback.FireUpdate();
break;
} }
} }
@@ -221,6 +198,19 @@ namespace PepperDash.Essentials.DM
} }
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{
switch (args.EventId)
{
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
FreeRunEnabledFeedback.FireUpdate();
break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
VgaVideoSyncFeedback.FireUpdate();
break;
}
}
public override bool CustomActivate() public override bool CustomActivate()
{ {
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId); Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
@@ -235,7 +225,7 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{ {
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey); var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
if (HdmiVideoSyncFeedback != null) if (HdmiVideoSyncFeedback != null)
{ {
@@ -255,14 +245,7 @@ namespace PepperDash.Essentials.DM
/// <param name="enable"></param> /// <param name="enable"></param>
public void SetFreeRunEnabled(bool enable) public void SetFreeRunEnabled(bool enable)
{ {
if (enable) Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
}
else
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
}
} }
/// <summary> /// <summary>
@@ -331,38 +314,38 @@ namespace PepperDash.Essentials.DM
var id = args.EventId; var id = args.EventId;
Debug.Console(2, this, "EventId {0}", args.EventId); Debug.Console(2, this, "EventId {0}", args.EventId);
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId) switch (id)
{ {
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback); Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
} break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
// ------------------------------ incomplete -----------------------------------------
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
{
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
break;
} }
} }
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}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId) switch (args.EventId)
{ {
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
HdmiInHdcpCapabilityFeedback.FireUpdate(); HdmiInHdcpCapabilityFeedback.FireUpdate();
} break;
else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId) case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
{
HdmiInHdcpCapabilityFeedback.FireUpdate(); HdmiInHdcpCapabilityFeedback.FireUpdate();
break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
HdmiVideoSyncFeedback.FireUpdate();
break;
} }
else if (args.EventId == EndpointInputStreamEventIds.FreeRunFeedbackEventId)
{
FreeRunEnabledFeedback.FireUpdate();
}
} }
/// <summary> /// <summary>
@@ -370,12 +353,13 @@ 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)
{ {
return;
}
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate(); inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
} }
}
/// <summary> /// <summary>
/// Relays the VideoAttributes change to a RoutingInputPort /// Relays the VideoAttributes change to a RoutingInputPort

View File

@@ -19,12 +19,10 @@ namespace PepperDash.Essentials.DM
{ {
using eVst = DmTx401C.eSourceSelection; using eVst = DmTx401C.eSourceSelection;
public class DmTx401CController : DmTxControllerBase, ITxRouting, IHasFeedback, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls public class DmTx401CController : DmTxControllerBase, ITxRouting, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
{ {
public DmTx401C Tx { get; private set; } public DmTx401C Tx { get; private set; }
public RoutingInputPortWithVideoStatuses HdmiIn { get; private set; } public RoutingInputPortWithVideoStatuses HdmiIn { get; private set; }
public RoutingInputPortWithVideoStatuses DisplayPortIn { get; private set; } public RoutingInputPortWithVideoStatuses DisplayPortIn { get; private set; }
public RoutingInputPortWithVideoStatuses VgaIn { get; private set; } public RoutingInputPortWithVideoStatuses VgaIn { get; private set; }
@@ -116,51 +114,36 @@ namespace PepperDash.Essentials.DM
eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, eVst.Composite, this, eRoutingSignalType.Video, eRoutingPortConnectionType.Composite, eVst.Composite, this,
VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput)); VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
Tx.HdmiInput.InputStreamChange += HdmiInputStreamChangeEvent;
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChangeEvent;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
Tx.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput", ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
() => ActualVideoInput.ToString()); () => ActualVideoInput.ToString());
VideoSourceNumericFeedback = new IntFeedback(() => VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
{
return (int)Tx.VideoSourceFeedback;
});
AudioSourceNumericFeedback = new IntFeedback(() =>
{
return (int)Tx.AudioSourceFeedback;
});
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
{
if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue) HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0);
return 1;
else
return 0;
});
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport; HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
DisplayPortVideoSyncFeedback = new BoolFeedback("DisplayPortVideoSync", () => DisplayPortVideoSyncFeedback = new BoolFeedback("DisplayPortVideoSync", () => (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue);
{
return (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue;
});
HdmiVideoSyncFeedback = new BoolFeedback(() => HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
{
return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
});
VgaVideoSyncFeedback = new BoolFeedback(() => VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
{
return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
});
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled); FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue); VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue); VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
var combinedFuncs = new VideoStatusFuncsWrapper var combinedFuncs = new VideoStatusFuncsWrapper
{ {
@@ -238,7 +221,7 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{ {
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey); var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
if (HdmiVideoSyncFeedback != null) if (HdmiVideoSyncFeedback != null)
{ {
@@ -303,33 +286,35 @@ namespace PepperDash.Essentials.DM
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);
switch (id)
{ {
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback); Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
} break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
// ------------------------------ incomplete -----------------------------------------
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
{
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
break;
} }
} }
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args) void VideoControls_ControlChange(object sender, GenericEventArgs args)
{ {
var id = args.EventId; var id = args.EventId;
Debug.Console(2, this, "EventId {0}", args.EventId); Debug.Console(2, this, "EventId {0}", args.EventId);
if (id == VideoControlsEventIds.BrightnessFeedbackEventId) switch (id)
{ {
case VideoControlsEventIds.BrightnessFeedbackEventId:
VgaBrightnessFeedback.FireUpdate(); VgaBrightnessFeedback.FireUpdate();
} break;
else if (id == VideoControlsEventIds.ContrastFeedbackEventId) case VideoControlsEventIds.ContrastFeedbackEventId:
{
VgaContrastFeedback.FireUpdate(); VgaContrastFeedback.FireUpdate();
break;
} }
} }
@@ -339,14 +324,7 @@ namespace PepperDash.Essentials.DM
/// <param name="enable"></param> /// <param name="enable"></param>
public void SetFreeRunEnabled(bool enable) public void SetFreeRunEnabled(bool enable)
{ {
if (enable) Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
}
else
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
}
} }
/// <summary> /// <summary>
@@ -372,12 +350,13 @@ 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)
{ {
return;
}
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate(); inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
} }
}
/// <summary> /// <summary>
/// Relays the VideoAttributes change to a RoutingInputPort /// Relays the VideoAttributes change to a RoutingInputPort
@@ -409,6 +388,50 @@ namespace PepperDash.Essentials.DM
} }
} }
void HdmiInputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
switch (args.EventId)
{
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
HdmiInHdcpCapabilityFeedback.FireUpdate();
break;
case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
HdmiInHdcpCapabilityFeedback.FireUpdate();
break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
HdmiVideoSyncFeedback.FireUpdate();
break;
}
}
void DisplayPortInputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
switch (args.EventId)
{
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
DisplayPortVideoSyncFeedback.FireUpdate();
break;
}
}
private void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{
switch (args.EventId)
{
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
FreeRunEnabledFeedback.FireUpdate();
break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
VgaVideoSyncFeedback.FireUpdate();
break;
}
}
#region IIROutputPorts Members #region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } } public CrestronCollection<IROutputPort> IROutputPorts { get { return Tx.IROutputPorts; } }

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
{ {
@@ -203,7 +186,7 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{ {
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey); var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
if (Hdmi1VideoSyncFeedback != null) if (Hdmi1VideoSyncFeedback != null)
{ {
@@ -221,8 +204,9 @@ namespace PepperDash.Essentials.DM
{ {
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input); Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
if (type == eRoutingSignalType.Video) switch (type)
{ {
case eRoutingSignalType.Video:
switch (input) switch (input)
{ {
case 0: case 0:
@@ -246,9 +230,8 @@ namespace PepperDash.Essentials.DM
break; break;
} }
} }
} break;
else if (type == eRoutingSignalType.Audio) case eRoutingSignalType.Audio:
{
switch (input) switch (input)
{ {
case 0: case 0:
@@ -272,6 +255,7 @@ namespace PepperDash.Essentials.DM
break; break;
} }
} }
break;
} }
} }
@@ -287,37 +271,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);
switch (id)
{ {
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback); Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
ActiveVideoInputFeedback.FireUpdate();
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
} break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
// ------------------------------ incomplete -----------------------------------------
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
{
Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source : {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
break;
} }
} }
@@ -326,12 +313,13 @@ 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)
{ {
return;
}
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate(); inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
} }
}
/// <summary> /// <summary>
/// Relays the VideoAttributes change to a RoutingInputPort /// Relays the VideoAttributes change to a RoutingInputPort

View File

@@ -106,43 +106,23 @@ 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.VgaInput.InputStreamChange += VgaInputOnInputStreamChange;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
VideoSourceNumericFeedback = new IntFeedback(() => VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
{ 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;
});
VgaVideoSyncFeedback = new BoolFeedback(() => VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);
{
return (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue;
});
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled); FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
@@ -164,9 +144,7 @@ namespace PepperDash.Essentials.DM
{ {
if (ActualActiveVideoInput == eVst.Hdmi1) if (ActualActiveVideoInput == eVst.Hdmi1)
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString(); return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
if (ActualActiveVideoInput == eVst.Hdmi2) return ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : "";
return tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString();
return "";
}, },
VideoResolutionFeedbackFunc = () => VideoResolutionFeedbackFunc = () =>
@@ -175,9 +153,7 @@ namespace PepperDash.Essentials.DM
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString(); return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == eVst.Hdmi2) if (ActualActiveVideoInput == eVst.Hdmi2)
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString(); return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == eVst.Vga) return ActualActiveVideoInput == eVst.Vga ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
return "";
}, },
VideoSyncFeedbackFunc = () => VideoSyncFeedbackFunc = () =>
(ActualActiveVideoInput == eVst.Hdmi1 (ActualActiveVideoInput == eVst.Hdmi1
@@ -211,18 +187,32 @@ namespace PepperDash.Essentials.DM
DmOut.Port = Tx.DmOutput; DmOut.Port = Tx.DmOutput;
} }
void VgaInputOnInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{
switch (args.EventId)
{
case EndpointInputStreamEventIds.FreeRunFeedbackEventId:
FreeRunEnabledFeedback.FireUpdate();
break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
VgaVideoSyncFeedback.FireUpdate();
break;
}
}
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args) void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
{ {
var id = args.EventId; var id = args.EventId;
Debug.Console(2, this, "EventId {0}", args.EventId); Debug.Console(2, this, "EventId {0}", args.EventId);
if (id == VideoControlsEventIds.BrightnessFeedbackEventId) switch (id)
{ {
case VideoControlsEventIds.BrightnessFeedbackEventId:
VgaBrightnessFeedback.FireUpdate(); VgaBrightnessFeedback.FireUpdate();
} break;
else if (id == VideoControlsEventIds.ContrastFeedbackEventId) case VideoControlsEventIds.ContrastFeedbackEventId:
{
VgaContrastFeedback.FireUpdate(); VgaContrastFeedback.FireUpdate();
break;
} }
} }
@@ -246,7 +236,7 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{ {
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey); var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
if (Hdmi1VideoSyncFeedback != null) if (Hdmi1VideoSyncFeedback != null)
{ {
@@ -270,14 +260,7 @@ namespace PepperDash.Essentials.DM
/// <param name="enable"></param> /// <param name="enable"></param>
public void SetFreeRunEnabled(bool enable) public void SetFreeRunEnabled(bool enable)
{ {
if (enable) Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
}
else
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
}
} }
/// <summary> /// <summary>
@@ -304,8 +287,9 @@ namespace PepperDash.Essentials.DM
{ {
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input); Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
if (type == eRoutingSignalType.Video) switch (type)
{ {
case eRoutingSignalType.Video:
switch (input) switch (input)
{ {
case 0: case 0:
@@ -334,9 +318,8 @@ namespace PepperDash.Essentials.DM
break; break;
} }
} }
} break;
else if (type == eRoutingSignalType.Audio) case eRoutingSignalType.Audio:
{
switch (input) switch (input)
{ {
case 0: case 0:
@@ -365,6 +348,7 @@ namespace PepperDash.Essentials.DM
break; break;
} }
} }
break;
} }
} }
@@ -380,37 +364,37 @@ 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) switch (id)
{ {
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback); Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
} break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
// ------------------------------ incomplete -----------------------------------------
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
{
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
break;
} }
} }
@@ -419,12 +403,10 @@ 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) return;
{
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate(); inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
} }
}
/// <summary> /// <summary>
/// Relays the VideoAttributes change to a RoutingInputPort /// Relays the VideoAttributes change to a RoutingInputPort

View File

@@ -93,9 +93,9 @@ namespace PepperDash.Essentials.DM
ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput", ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
() => ActualActiveVideoInput.ToString()); () => ActualActiveVideoInput.ToString());
Tx.HdmiInput.InputStreamChange += new EndpointInputStreamChangeEventHandler(InputStreamChangeEvent); Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange); Tx.OnlineStatusChange += Tx_OnlineStatusChange;
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () => HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
@@ -108,10 +108,7 @@ namespace PepperDash.Essentials.DM
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport; HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
HdmiVideoSyncFeedback = new BoolFeedback(() => HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);
{
return (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue;
});
var combinedFuncs = new VideoStatusFuncsWrapper var combinedFuncs = new VideoStatusFuncsWrapper
@@ -120,20 +117,13 @@ namespace PepperDash.Essentials.DM
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
&& tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue), && tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
HdcpStateFeedbackFunc = () => HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ? tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",
{
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
return tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString();
return "";
},
VideoResolutionFeedbackFunc = () => VideoResolutionFeedbackFunc = () =>
{ {
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital) if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
return tx.HdmiInput.VideoAttributes.GetVideoResolutionString(); return tx.HdmiInput.VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog) return ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ? tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "";
return tx.VgaInput.VideoAttributes.GetVideoResolutionString();
return "";
}, },
VideoSyncFeedbackFunc = () => VideoSyncFeedbackFunc = () =>
(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital
@@ -180,7 +170,7 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{ {
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey); var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
if (HdmiVideoSyncFeedback != null) if (HdmiVideoSyncFeedback != null)
{ {
@@ -196,14 +186,7 @@ namespace PepperDash.Essentials.DM
/// <param name="enable"></param> /// <param name="enable"></param>
public void SetFreeRunEnabled(bool enable) public void SetFreeRunEnabled(bool enable)
{ {
if (enable) Tx.VgaInput.FreeRun = enable ? eDmFreeRunSetting.Enabled : eDmFreeRunSetting.Disabled;
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
}
else
{
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
}
} }
/// <summary> /// <summary>
@@ -230,16 +213,15 @@ namespace PepperDash.Essentials.DM
var id = args.EventId; var id = args.EventId;
Debug.Console(2, this, "EventId {0}", args.EventId); Debug.Console(2, this, "EventId {0}", args.EventId);
if (id == EndpointTransmitterBase.VideoSourceFeedbackEventId) switch (id)
{ {
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback); Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
} break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
// ------------------------------ incomplete -----------------------------------------
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
{
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
break;
} }
} }
@@ -247,13 +229,17 @@ 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)
{ {
case EndpointInputStreamEventIds.HdcpSupportOffFeedbackEventId:
HdmiInHdcpCapabilityFeedback.FireUpdate(); HdmiInHdcpCapabilityFeedback.FireUpdate();
} break;
else if (args.EventId == EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId) case EndpointInputStreamEventIds.HdcpSupportOnFeedbackEventId:
{
HdmiInHdcpCapabilityFeedback.FireUpdate(); HdmiInHdcpCapabilityFeedback.FireUpdate();
break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
HdmiVideoSyncFeedback.FireUpdate();
break;
} }
} }
@@ -262,12 +248,10 @@ 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) return;
{
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate(); inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
} }
}
/// <summary> /// <summary>
/// Relays the VideoAttributes change to a RoutingInputPort /// Relays the VideoAttributes change to a RoutingInputPort

View File

@@ -104,43 +104,23 @@ 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.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChange;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
VideoSourceNumericFeedback = new IntFeedback(() => VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
{ 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;
});
DisplayPortVideoSyncFeedback = new BoolFeedback(() => DisplayPortVideoSyncFeedback = new BoolFeedback(() => (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue);
{
return (bool)tx.DisplayPortInput.SyncDetectedFeedback.BoolValue;
});
var combinedFuncs = new VideoStatusFuncsWrapper var combinedFuncs = new VideoStatusFuncsWrapper
@@ -155,9 +135,7 @@ namespace PepperDash.Essentials.DM
{ {
if (ActualActiveVideoInput == eVst.Hdmi1) if (ActualActiveVideoInput == eVst.Hdmi1)
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString(); return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
if (ActualActiveVideoInput == eVst.Hdmi2) return ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : "";
return tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString();
return "";
}, },
VideoResolutionFeedbackFunc = () => VideoResolutionFeedbackFunc = () =>
@@ -166,9 +144,7 @@ namespace PepperDash.Essentials.DM
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString(); return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == eVst.Hdmi2) if (ActualActiveVideoInput == eVst.Hdmi2)
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString(); return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == eVst.Vga) return ActualActiveVideoInput == eVst.Vga ? tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString() : "";
return tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString();
return "";
}, },
VideoSyncFeedbackFunc = () => VideoSyncFeedbackFunc = () =>
(ActualActiveVideoInput == eVst.Hdmi1 (ActualActiveVideoInput == eVst.Hdmi1
@@ -202,6 +178,18 @@ namespace PepperDash.Essentials.DM
DmOut.Port = Tx.DmOutput; DmOut.Port = Tx.DmOutput;
} }
void DisplayPortInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
switch (args.EventId)
{
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
DisplayPortVideoSyncFeedback.FireUpdate();
break;
}
}
public override bool CustomActivate() public override bool CustomActivate()
@@ -222,7 +210,7 @@ namespace PepperDash.Essentials.DM
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{ {
DmTxControllerJoinMap joinMap = GetDmTxJoinMap(joinStart, joinMapKey); var joinMap = GetDmTxJoinMap(joinStart, joinMapKey);
if (Hdmi1VideoSyncFeedback != null) if (Hdmi1VideoSyncFeedback != null)
{ {
@@ -291,37 +279,37 @@ 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) switch (id)
{ {
case EndpointTransmitterBase.VideoSourceFeedbackEventId:
Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback); Debug.Console(2, this, " Video Source: {0}", Tx.VideoSourceFeedback);
VideoSourceNumericFeedback.FireUpdate(); VideoSourceNumericFeedback.FireUpdate();
ActiveVideoInputFeedback.FireUpdate(); ActiveVideoInputFeedback.FireUpdate();
} break;
case EndpointTransmitterBase.AudioSourceFeedbackEventId:
// ------------------------------ incomplete -----------------------------------------
else if (id == EndpointTransmitterBase.AudioSourceFeedbackEventId)
{
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback); Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
AudioSourceNumericFeedback.FireUpdate(); AudioSourceNumericFeedback.FireUpdate();
break;
} }
} }
@@ -330,12 +318,10 @@ 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) return;
{
inputPort.VideoStatus.VideoSyncFeedback.FireUpdate(); inputPort.VideoStatus.VideoSyncFeedback.FireUpdate();
AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate(); AnyVideoInput.VideoStatus.VideoSyncFeedback.FireUpdate();
} }
}
/// <summary> /// <summary>
/// Relays the VideoAttributes change to a RoutingInputPort /// Relays the VideoAttributes change to a RoutingInputPort

View File

@@ -294,7 +294,7 @@ namespace PepperDash.Essentials.DM
if (txFreeRun != null) if (txFreeRun != null)
{ {
txFreeRun.FreeRunEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FreeRunEnabled.JoinNumber]); txFreeRun.FreeRunEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FreeRunEnabled.JoinNumber]);
trilist.SetBoolSigAction(joinMap.FreeRunEnabled.JoinNumber, new Action<bool>(txFreeRun.SetFreeRunEnabled)); trilist.SetBoolSigAction(joinMap.FreeRunEnabled.JoinNumber, txFreeRun.SetFreeRunEnabled);
} }
var txVga = tx as IVgaBrightnessContrastControls; var txVga = tx as IVgaBrightnessContrastControls;