Merge pull request #1195 from PepperDash/feature/video-wall-mode

Feature/video wall mode
This commit is contained in:
Andrew Welker
2024-07-12 09:20:25 -04:00
committed by GitHub
6 changed files with 105 additions and 17 deletions

View File

@@ -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 });
/// <summary>
/// Constructor to use when instantiating this Join Map without inheriting from it

View File

@@ -87,5 +87,11 @@ namespace PepperDash_Essentials_DM
public interface IHasDisplayPortInHdcp : IHasDisplayPortInHdcpGet, IHasDisplayPortInHdcpSet
{
eHdcpCapabilityType DisplayPortInHdcpCapability { get; }
}
public interface IhasWallMode
{
void SetWallMode(ushort walLMode);
}
}

View File

@@ -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<ushort, EndpointScalerOutput.eWall> WallModes;
/// <summary>
/// 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<RoutingInputPort> { DmIn, HdmiIn };
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { 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<ushort, EndpointScalerOutput.eWall>()
{
{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;
}
}
}
}

View File

@@ -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; }

View File

@@ -51,6 +51,7 @@ namespace PepperDash.Essentials.DM
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
// Set Ports for CEC
HdmiOut.Port = _rmc.HdmiOutput;
}

View File

@@ -59,7 +59,7 @@
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.2.1.30543, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="PepperDash_Core, Version=1.3.3.32940, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
</Reference>