diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmRmcControllerJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmRmcControllerJoinMap.cs index c0e7141f..8352bb1d 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmRmcControllerJoinMap.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/DmRmcControllerJoinMap.cs @@ -68,7 +68,13 @@ namespace PepperDash.Essentials.Core.Bridges public JoinDataComplete HdcpInputPortCount = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 }, new JoinMetadata { Description = "Number of Input Ports that support HDCP", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog }); + [JoinName("ScalerOutWallMode")] + public JoinDataComplete ScalerOutWallMode = new JoinDataComplete(new JoinData { JoinNumber = 6, JoinSpan = 1 }, + new JoinMetadata { Description = "Set Wall Mode for Scaler video Wall mode", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog }); + [JoinName("ScalerOutWallModeRaw")] + public JoinDataComplete ScalerOutWallModeRaw = new JoinDataComplete(new JoinData { JoinNumber = 7, JoinSpan = 1 }, + new JoinMetadata { Description = "Set Wall Mode for Scaler video Wall mode", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog }); /// /// Constructor to use when instantiating this Join Map without inheriting from it diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/EndpointInterfaces.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/EndpointInterfaces.cs index 085d379b..e7df4547 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/EndpointInterfaces.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/EndpointInterfaces.cs @@ -87,5 +87,11 @@ namespace PepperDash_Essentials_DM public interface IHasDisplayPortInHdcp : IHasDisplayPortInHdcpGet, IHasDisplayPortInHdcpSet { eHdcpCapabilityType DisplayPortInHdcpCapability { get; } + } + + public interface IhasWallMode + { + void SetWallMode(ushort walLMode); } + } \ No newline at end of file diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kZScalerCController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kZScalerCController.cs index fd48a904..afd9aff6 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kZScalerCController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmc4kZScalerCController.cs @@ -10,12 +10,13 @@ using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Bridges; using PepperDash.Core; using PepperDash_Essentials_DM; +using System.Collections.Generic; namespace PepperDash.Essentials.DM { [Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")] public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRoutingWithFeedback, - IIROutputPorts, IComPorts, ICec, IRelayPorts, IHasDmInHdcp, IHasHdmiInHdcp + IIROutputPorts, IComPorts, ICec, IRelayPorts, IHasDmInHdcp, IHasHdmiInHdcp, IhasWallMode { private readonly DmRmc4kzScalerC _rmc; @@ -26,9 +27,10 @@ namespace PepperDash.Essentials.DM public IntFeedback DmInHdcpStateFeedback { get; private set; } public IntFeedback HdmiInHdcpStateFeedback { get; private set; } + public BoolFeedback HdmiVideoSyncFeedback { get; private set; } - + private Dictionary WallModes; /// /// The value of the current video source for the HDMI output on the receiver @@ -87,6 +89,9 @@ namespace PepperDash.Essentials.DM VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString()); + VideoWallModeRawFeedback = new IntFeedback("ScalerVideoWallModeRaw", + () => (int)_rmc.Scaler.WallModeRawFeedback.UShortValue); + InputPorts = new RoutingPortCollection { DmIn, HdmiIn }; OutputPorts = new RoutingPortCollection { HdmiOut }; @@ -94,6 +99,7 @@ namespace PepperDash.Essentials.DM _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange; _rmc.HdmiIn.InputStreamChange += InputStreamChangeEvent; _rmc.DmInput.InputStreamChange += InputStreamChangeEvent; + _rmc.Scaler.OutputChange += Scaler_OutputChange; _rmc.OnlineStatusChange += _rmc_OnlineStatusChange; @@ -101,6 +107,15 @@ namespace PepperDash.Essentials.DM HdmiOut.Port = _rmc.HdmiOutput; AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback)); + + WallModes = new Dictionary() + { + {0, EndpointScalerOutput.eWall.Disabled}, + {2211, EndpointScalerOutput.eWall.Mode11}, + {2212, EndpointScalerOutput.eWall.Mode12}, + {2221, EndpointScalerOutput.eWall.Mode13}, + {2222, EndpointScalerOutput.eWall.Mode14} + }; } void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args) @@ -241,5 +256,47 @@ namespace PepperDash.Essentials.DM _rmc.HdmiIn.HdcpCapability = hdcpState; } + + #region IhasWallMode Members + + public void SetWallMode(ushort wallMode) + { + EndpointScalerOutput.eWall wallValue; + + if (WallModes.TryGetValue(wallMode, out wallValue)) + _rmc.Scaler.WallMode = wallValue; + } + + #endregion + + public void SetWallModeRaw(ushort wallMode) + { + _rmc.Scaler.WallModeRaw.UShortValue = wallMode; + } + + void Scaler_OutputChange(EndpointScalerOutput scalerOutput, ScalerOutputEventArgs args) + { + if (scalerOutput == null) + { + Debug.Console(1, this, "Scaler Output object is null"); + return; + } + if (args == null) + { + Debug.Console(1, this, "Scaler Output Args are null"); + return; + } + Debug.Console(2, this, "Scaler Event ID: {0}", args.EventId); + switch (args.EventId) + { + case ScalerOutputEventIds.WallModeFeedbackEventId: + VideoWallModeRawFeedback.FireUpdate(); + break; + default: + Debug.Console(2, this, "Scaler Default Unhandled Event ID: {0}", args.EventId); + break; + } + } + } } \ No newline at end of file diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs index ee423436..52d8a60e 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcHelper.cs @@ -28,6 +28,9 @@ namespace PepperDash.Essentials.DM public StringFeedback EdidPreferredTimingFeedback { get; protected set; } public StringFeedback EdidSerialNumberFeedback { get; protected set; } + public IntFeedback VideoWallModeFeedback { get; protected set; } + public IntFeedback VideoWallModeRawFeedback { get; protected set; } + protected DmRmcControllerBase(string key, string name, EndpointReceiverBase device) : base(key, name, device) { @@ -59,8 +62,8 @@ namespace PepperDash.Essentials.DM else { Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device."); - } - + } + LinkDmRmcToApi(rmc, trilist, joinMap); } @@ -142,18 +145,18 @@ namespace PepperDash.Essentials.DM trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber].UShortValue = (ushort)hdcpCapability; - trilist.UShortInput[joinMap.HdcpInputPortCount.JoinNumber].UShortValue = (ushort)routing.InputPorts.Count; - - var dmRmcScalerCBasicVideoMuteWithFeedback = rmc as IBasicVideoMuteWithFeedback; - - if (dmRmcScalerCBasicVideoMuteWithFeedback != null) - { - Debug.Console(1, this, "Device is IBasicVideoMuteWithFeedback, linking video mute"); - trilist.SetSigTrueAction(joinMap.VideoMuteToggle.JoinNumber, () => dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteToggle()); - trilist.SetSigTrueAction(joinMap.VideoMuteOn.JoinNumber, () => dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteOn()); - trilist.SetSigTrueAction(joinMap.VideoMuteOff.JoinNumber, () => dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteOff()); - dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteIsOn.LinkInputSig(trilist.BooleanInput[joinMap.VideoMuteOn.JoinNumber]); - dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteIsOn.LinkComplementInputSig(trilist.BooleanInput[joinMap.VideoMuteOff.JoinNumber]); + trilist.UShortInput[joinMap.HdcpInputPortCount.JoinNumber].UShortValue = (ushort)routing.InputPorts.Count; + + var dmRmcScalerCBasicVideoMuteWithFeedback = rmc as IBasicVideoMuteWithFeedback; + + if (dmRmcScalerCBasicVideoMuteWithFeedback != null) + { + Debug.Console(1, this, "Device is IBasicVideoMuteWithFeedback, linking video mute"); + trilist.SetSigTrueAction(joinMap.VideoMuteToggle.JoinNumber, () => dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteToggle()); + trilist.SetSigTrueAction(joinMap.VideoMuteOn.JoinNumber, () => dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteOn()); + trilist.SetSigTrueAction(joinMap.VideoMuteOff.JoinNumber, () => dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteOff()); + dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteIsOn.LinkInputSig(trilist.BooleanInput[joinMap.VideoMuteOn.JoinNumber]); + dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteIsOn.LinkComplementInputSig(trilist.BooleanInput[joinMap.VideoMuteOff.JoinNumber]); } var routingWithFeedback = routing as IRmcRouting; @@ -167,8 +170,23 @@ namespace PepperDash.Essentials.DM trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber, a => routingWithFeedback.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo)); + var dmRmcScalerWithVideowall = rmc as DmRmc4kZScalerCController; + + if (dmRmcScalerWithVideowall != null) + { + trilist.SetUShortSigAction(joinMap.ScalerOutWallMode.JoinNumber, a => dmRmcScalerWithVideowall.SetWallMode(a)); + trilist.SetUShortSigAction(joinMap.ScalerOutWallModeRaw.JoinNumber, a => dmRmcScalerWithVideowall.SetWallModeRaw(a)); + + if (rmc.VideoWallModeFeedback != null) + rmc.VideoWallModeFeedback.LinkInputSig(trilist.UShortInput[joinMap.ScalerOutWallMode.JoinNumber]); + if (rmc.VideoWallModeRawFeedback != null) + rmc.VideoWallModeRawFeedback.LinkInputSig(trilist.UShortInput[joinMap.ScalerOutWallModeRaw.JoinNumber]); + + } + } + #region Implementation of IDeviceInfoProvider public DeviceInfo DeviceInfo { get; private set; } diff --git a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerCController.cs b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerCController.cs index d1f2daa1..169995d8 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerCController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Endpoints/Receivers/DmRmcScalerCController.cs @@ -51,6 +51,7 @@ namespace PepperDash.Essentials.DM InputPorts = new RoutingPortCollection {DmIn}; OutputPorts = new RoutingPortCollection {HdmiOut}; + // Set Ports for CEC HdmiOut.Port = _rmc.HdmiOutput; } diff --git a/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj b/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj index 41136d0d..60bdad85 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj +++ b/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj @@ -59,7 +59,7 @@ ..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll - + False ..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll