Skip to content

Commit

Permalink
consolidated the application to a single solution and added logic for…
Browse files Browse the repository at this point in the history
… audio follows video that modified tie lines
  • Loading branch information
ngenovese11 committed Oct 12, 2020
1 parent aa8490b commit 23f6ac1
Show file tree
Hide file tree
Showing 21 changed files with 695 additions and 512 deletions.
6 changes: 0 additions & 6 deletions NvxEpi.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NvxEpi", "src\NvxEpi\NvxEpi.csproj", "{C6706558-3482-422B-936D-0AB38A3D239D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NvxEpi.Application", "src\NvxEpi.Application\NvxEpi.Application.csproj", "{6934CD39-0DAA-41F8-8D51-FB9E7B2C8E44}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,10 +13,6 @@ Global
{C6706558-3482-422B-936D-0AB38A3D239D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6706558-3482-422B-936D-0AB38A3D239D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C6706558-3482-422B-936D-0AB38A3D239D}.Release|Any CPU.Build.0 = Release|Any CPU
{6934CD39-0DAA-41F8-8D51-FB9E7B2C8E44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6934CD39-0DAA-41F8-8D51-FB9E7B2C8E44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6934CD39-0DAA-41F8-8D51-FB9E7B2C8E44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6934CD39-0DAA-41F8-8D51-FB9E7B2C8E44}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
127 changes: 0 additions & 127 deletions src/NvxEpi.Application/JoinMap/NvxApplicationJoinMap.cs

This file was deleted.

111 changes: 0 additions & 111 deletions src/NvxEpi.Application/NvxEpi.Application.csproj

This file was deleted.

8 changes: 0 additions & 8 deletions src/NvxEpi.Application/Properties/AssemblyInfo.cs

This file was deleted.

Empty file.
23 changes: 16 additions & 7 deletions src/NvxEpi/Aggregates/Nvx35x.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Streaming;
using NvxEpi.Abstractions;
using NvxEpi.Abstractions.Hardware;
using NvxEpi.Abstractions.HdmiInput;
using NvxEpi.Abstractions.HdmiOutput;
Expand All @@ -15,13 +14,13 @@
using NvxEpi.Abstractions.Usb;
using NvxEpi.Entities.Config;
using NvxEpi.Entities.Hardware;
using NvxEpi.Entities.Routing;
using NvxEpi.Entities.Streams;
using NvxEpi.Services.Bridge;
using NvxEpi.Services.Feedback;
using NvxEpi.Services.InputPorts;
using NvxEpi.Services.InputSwitching;
using NvxEpi.Services.Utilities;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
Expand All @@ -36,7 +35,6 @@ public class Nvx35X : CrestronGenericBridgeableBaseDevice, IComPorts, IIROutputP
private readonly ICurrentStream _currentVideoStream;
private readonly ICurrentSecondaryAudioStream _currentSecondaryAudioStream;
private readonly IUsbStream _usbStream;
private readonly IRouting _router;

private readonly Dictionary<uint, IntFeedback> _hdcpCapability =
new Dictionary<uint, IntFeedback>();
Expand All @@ -53,10 +51,9 @@ public Nvx35X(DeviceConfig config, DmNvx35x hardware)
_device = new Nvx35xHardware(config, hardware, Feedbacks, IsOnline);
_currentVideoStream = new CurrentVideoStream(new VideoStream(_device));
_currentSecondaryAudioStream = new CurrentSecondaryAudioStream(new SecondaryAudioStream(_device));
_router = new NvxDeviceRouter(_device);

RegisterForOnlineFeedback(hardware, props);
SetupFeedbacks(props);
SetupFeedbacks();
AddRoutingPorts();
}

Expand All @@ -76,7 +73,7 @@ private void RegisterForOnlineFeedback(GenericBase hardware, NvxDeviceProperties
};
}

private void SetupFeedbacks(NvxDeviceProperties props)
private void SetupFeedbacks()
{
_hdcpCapability.Add(1, Hdmi1HdcpCapabilityValueFeedback.GetFeedback(Hardware));
_hdcpCapability.Add(2, Hdmi2HdcpCapabilityValueFeedback.GetFeedback(Hardware));
Expand Down Expand Up @@ -136,7 +133,19 @@ private void AddRoutingPorts()

public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
{
_router.ExecuteSwitch(inputSelector, outputSelector, signalType);
try
{
var switcher = outputSelector as IHandleInputSwitch;
if (switcher == null)
throw new NullReferenceException("input selector");

Debug.Console(1, this, "Executing switch : '{0}' | '{1}' | '{2}'", inputSelector.ToString(), outputSelector.ToString(), signalType.ToString());
switcher.HandleSwitch(inputSelector, signalType);
}
catch (Exception ex)
{
Debug.Console(1, this, "Error executing switch! : {0}", ex.Message);
}
}

public IntFeedback DeviceMode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using System.Collections.Generic;
using PepperDash.Core;
using PepperDash.Essentials;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Routing;

namespace NvxEpi.Application.Builder
{
public interface IDynNvxBuilder : IKeyed
public interface INvxApplicationBuilder : IKeyed
{
Dictionary<int, string> Transmitters { get; }
Dictionary<int, string> Receivers { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace NvxEpi.Application.Builder
{
public class DynNvxDeviceBuilder : IDynNvxBuilder
public class NvxApplicationApplicationBuilder : INvxApplicationBuilder
{
public string Key { get; private set; }
public Dictionary<int, string> Transmitters { get; private set; }
Expand All @@ -21,10 +21,10 @@ public EssentialsDevice Build()
return new NvxApplication(this);
}

public DynNvxDeviceBuilder(DeviceConfig config)
public NvxApplicationApplicationBuilder(DeviceConfig config)
{
Key = config.Key;
var props = JsonConvert.DeserializeObject<DynNvxConfig>(config.Properties.ToString());
var props = JsonConvert.DeserializeObject<NvxApplicationConfig>(config.Properties.ToString());

Transmitters = props.Transmitters.ToDictionary(x => Convert.ToInt32(x.Key), x => x.Value);
Receivers = props.Receivers.ToDictionary(x => Convert.ToInt32(x.Key), x => x.Value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace NvxEpi.Application.Config
{
public class DynNvxConfig
public class NvxApplicationConfig
{
[JsonProperty("transmitters")]
public Dictionary<string, string> Transmitters { get; set; }
Expand Down
Loading

0 comments on commit 23f6ac1

Please sign in to comment.