Skip to content

Commit

Permalink
Merge pull request #116 from PepperDash/feature/remove-3-series
Browse files Browse the repository at this point in the history
chore!: remove 3-series support
  • Loading branch information
andrew-welker authored May 16, 2024
2 parents f158eb8 + 8590c65 commit 38d7c80
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 404 deletions.
Binary file removed ._packages.config
Binary file not shown.
10 changes: 0 additions & 10 deletions .github/workflows/EssentialsPlugins-builds-caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ jobs:
getVersion:
uses: PepperDash/workflow-templates/.github/workflows/essentialsplugins-getversion.yml@main
secrets: inherit
build-3Series:
uses: PepperDash/workflow-templates/.github/workflows/essentialsplugins-3Series-builds.yml@main
secrets: inherit
needs: getVersion
if: needs.getVersion.outputs.newVersion == 'true'
with:
newVersion: ${{ needs.getVersion.outputs.newVersion }}
version: ${{ needs.getVersion.outputs.version }}
tag: ${{ needs.getVersion.outputs.tag }}
channel: ${{ needs.getVersion.outputs.channel }}
build-4Series:
uses: PepperDash/workflow-templates/.github/workflows/essentialsplugins-4Series-builds.yml@main
secrets: inherit
Expand Down
Empty file removed .gitmodules
Empty file.
20 changes: 0 additions & 20 deletions NvxEpi.3Series.sln

This file was deleted.

26 changes: 0 additions & 26 deletions NvxEpi.nuspec

This file was deleted.

2 changes: 0 additions & 2 deletions getEssentials.BAT

This file was deleted.

3 changes: 0 additions & 3 deletions packages.config

This file was deleted.

19 changes: 4 additions & 15 deletions src/NvxEpi/Application/Entities/NvxApplicationVideoReceiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
using NvxEpi.Services.InputSwitching;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Routing;


#if SERIES4
using MockDisplay = PepperDash.Essentials.Devices.Common.Displays.MockDisplay;
#endif

namespace NvxEpi.Application.Entities
{
Expand Down Expand Up @@ -48,10 +44,7 @@ public NvxApplicationVideoReceiver(string key, NvxApplicationDeviceVideoConfig c

AddPostActivationAction(() =>
{
var port = Device.OutputPorts[SwitcherForHdmiOutput.Key];
if (port == null)
throw new NullReferenceException("hdmi output routing port");
var port = Device.OutputPorts[SwitcherForHdmiOutput.Key] ?? throw new NullReferenceException("hdmi output routing port");
TieLineCollection.Default.Add(new TieLine(port, sink.InputPorts[RoutingPortNames.HdmiIn1]));
});

Expand All @@ -66,9 +59,7 @@ public NvxApplicationVideoReceiver(string key, NvxApplicationDeviceVideoConfig c

AddPostActivationAction(() =>
{
var feedback = Device.Feedbacks[CurrentVideoStream.RouteNameKey] as StringFeedback;
if (feedback == null)
throw new NullReferenceException(CurrentVideoStream.RouteNameKey);
var feedback = Device.Feedbacks[CurrentVideoStream.RouteNameKey] as StringFeedback ?? throw new NullReferenceException(CurrentVideoStream.RouteNameKey);
var currentRouteFb = new IntFeedback(() =>
{
Expand Down Expand Up @@ -107,16 +98,14 @@ public NvxApplicationVideoReceiver(string key, NvxApplicationDeviceVideoConfig c
AspectRatioMode = new IntFeedback(() => 0);
EdidManufacturer = new StringFeedback(() => string.Empty);
var hdmiOut = Device as IHdmiOutput;
if (hdmiOut == null)
if (!(Device is IHdmiOutput hdmiOut))
return;
DisabledByHdcp = hdmiOut.DisabledByHdcp;
HorizontalResolution = hdmiOut.HorizontalResolution;
EdidManufacturer = hdmiOut.EdidManufacturer;
var aspect = Device as IVideowallMode;
if(aspect == null)
if (!(Device is IVideowallMode aspect))
return;
AspectRatioMode = aspect.VideoAspectRatioMode;
Expand Down
11 changes: 1 addition & 10 deletions src/NvxEpi/Application/Services/ApplicationTieLineConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
using PepperDash.Essentials;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Routing;

#if SERIES4
using MockDisplay = PepperDash.Essentials.Devices.Common.Displays.MockDisplay;
#endif

namespace NvxEpi.Application.Services
{
Expand All @@ -25,14 +22,8 @@ public static void AddTieLineForAmp(Amplifier amp, INvxDevice rx)

public static void AddTieLineForMockDisplay(MockDisplay dest, INvxDevice rx)
{
var outputPort = rx.OutputPorts[SwitcherForHdmiOutput.Key];
if (outputPort == null)
throw new ArgumentNullException("outputPort");
#if SERIES4
var outputPort = rx.OutputPorts[SwitcherForHdmiOutput.Key] ?? throw new ArgumentNullException("outputPort");
TieLineCollection.Default.Add(new TieLine(outputPort, dest.InputPorts[RoutingPortNames.HdmiIn1], eRoutingSignalType.AudioVideo));
#else
TieLineCollection.Default.Add(new TieLine(outputPort, dest.HdmiIn1, eRoutingSignalType.AudioVideo));
#endif
}
}
}
10 changes: 3 additions & 7 deletions src/NvxEpi/Devices/Nvx36X.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@

using HdmiInput = NvxEpi.Features.Hdmi.Input.HdmiInput;

#if SERIES4
using NvxEpi.McMessengers;
#endif


namespace NvxEpi.Devices
{
Expand Down Expand Up @@ -93,8 +92,7 @@ public void ClearCurrentUsbRoute()
public void MakeUsbRoute(IUsbStreamWithHardware hardware)
{
Debug.Console(0, this, "Try Make USB Route for mac : {0}", hardware.UsbLocalId.StringValue);
var usbStream = _usbStream as UsbStream;
if (usbStream == null)
if (!(_usbStream is UsbStream usbStream))
{
Debug.Console(0, this, "cannot Make USB Route for url : {0} - UsbStream is null", hardware.UsbLocalId.StringValue);
return;
Expand Down Expand Up @@ -194,9 +192,7 @@ public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingS
{
try
{
var switcher = outputSelector as IHandleInputSwitch;
if (switcher == null)
throw new NullReferenceException("outputSelector");
var switcher = outputSelector as IHandleInputSwitch ?? throw new NullReferenceException("outputSelector");

Debug.Console(1,
this,
Expand Down
7 changes: 0 additions & 7 deletions src/NvxEpi/Devices/NvxBaseDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
using PepperDash.Core;
using NvxEpi.Abstractions.HdmiOutput;


#if SERIES4
using NvxEpi.McMessengers;
#endif


namespace NvxEpi.Devices
{
Expand Down Expand Up @@ -146,7 +141,6 @@ public override bool CustomActivate()

protected void AddMcMessengers()
{
#if SERIES4
var mc = DeviceManager.AllDevices.OfType<IMobileControl>().FirstOrDefault();

if (mc == null)
Expand Down Expand Up @@ -189,7 +183,6 @@ protected void AddMcMessengers()
var hdmiOutputMessenger = new IHdmiOutputMessenger($"{Key}-hdmiOutputMessenger", $"/device/{Key}", hdmiOutputDevice);

mc.AddDeviceMessenger(hdmiOutputMessenger);
#endif
}

public StringFeedback CurrentAudioInput
Expand Down
9 changes: 2 additions & 7 deletions src/NvxEpi/Devices/NvxD3X.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ public NvxD3X(DeviceConfig config, Func<DmNvxBaseClass> getHardware)

public override bool CustomActivate()
{
var hardware = base.Hardware as DmNvxD3x;
if (hardware == null)
throw new Exception("hardware built doesn't match");

var hardware = base.Hardware as DmNvxD3x ?? throw new Exception("hardware built doesn't match");
Hardware = hardware;
_hdmiOutput = new HdmiOutput(this);

Expand Down Expand Up @@ -97,9 +94,7 @@ public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingS
{
try
{
var switcher = outputSelector as IHandleInputSwitch;
if (switcher == null)
throw new NullReferenceException("outputSelector");
var switcher = outputSelector as IHandleInputSwitch ?? throw new NullReferenceException("outputSelector");

Debug.Console(1,
this,
Expand Down
30 changes: 2 additions & 28 deletions src/NvxEpi/Features/Routing/NvxGlobalRouter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@
using PepperDash.Essentials.Core.Routing;
using NvxEpi.Abstractions.SecondaryAudio;
using NvxEpi.Devices;

#if SERIES4
using PepperDash.Essentials.AppServer.Messengers;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
#endif

namespace NvxEpi.Features.Routing
{
#if SERIES4
public class NvxGlobalRouter : EssentialsDevice, IRoutingNumeric, IMatrixRouting
#else
public class NvxGlobalRouter : EssentialsDevice, IRoutingNumeric
#endif

{
private static readonly NvxGlobalRouter _instance = new NvxGlobalRouter();

Expand All @@ -46,15 +40,11 @@ private NvxGlobalRouter()

AddPostActivationAction(BuildTieLines);

#if SERIES4
AddPostActivationAction(BuildMatrixRouting);


InputSlots = new Dictionary<string, IRoutingInputSlot>();
OutputSlots = new Dictionary<string, IRoutingOutputSlot>();

//AddPostActivationAction(BuildMobileControlMessenger);
#endif
OutputSlots = new Dictionary<string, IRoutingOutputSlot>();
}

public static NvxGlobalRouter Instance { get { return _instance; } }
Expand Down Expand Up @@ -109,7 +99,6 @@ public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType
throw new NotImplementedException("Execute Numeric Switch");
}

#if SERIES4
public Dictionary<string, IRoutingInputSlot> InputSlots { get; private set; }

public Dictionary<string, IRoutingOutputSlot> OutputSlots { get; private set; }
Expand Down Expand Up @@ -155,20 +144,6 @@ private void BuildMatrixRouting()
}
}

private void BuildMobileControlMessenger()
{
var mc = DeviceManager.AllDevices.OfType<IMobileControl>().FirstOrDefault();

if(mc == null)
{
Debug.Console(0, this, "Unable to find mobile control device");
return;
}

var routingMessenger = new IMatrixRoutingMessenger($"{Key}-matrixRoutingMessenger", $"/device/{Key}", this);
mc.AddDeviceMessenger(routingMessenger);
}

public void Route(string inputSlotKey, string outputSlotKey, eRoutingSignalType type)
{
if(!InputSlots.TryGetValue(inputSlotKey, out var inputSlot))
Expand Down Expand Up @@ -211,6 +186,5 @@ public void Route(string inputSlotKey, string outputSlotKey, eRoutingSignalType
Routing.SecondaryAudioRouter.Route(inputSlot.SlotNumber, audioOutput);
}
}
#endif
}
}
4 changes: 2 additions & 2 deletions src/NvxEpi/NvxEpi.4Series.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="PepperDash.Essentials.Plugin.MobileControl.Messengers" Version="4.0.0-feature-mc-touchpanel-controller.5" />
<PackageReference Include="PepperDashEssentials" Version="2.0.0-alpha-2461" />
<PackageReference Include="PepperDash.Essentials.Plugin.MobileControl.Messengers" Version="4.0.1" />
<PackageReference Include="PepperDashEssentials" Version="2.0.0-beta-2490" />
</ItemGroup>

</Project>
Loading

0 comments on commit 38d7c80

Please sign in to comment.