Room/DSP things. Pre-testing

This commit is contained in:
Heath Volmer
2017-03-20 15:25:14 -06:00
parent 35a3742479
commit e196ad0419
21 changed files with 117 additions and 46 deletions

View File

@@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Devices.Common.DSP;
using PepperDash.Essentials.DM;
namespace PepperDash.Essentials
{
/// <summary>
///
/// </summary>
public class EssentialsPresentationVolumesConfig
{
public EssentialsVolumeLevelConfig Master { get; set; }
public EssentialsVolumeLevelConfig Program { get; set; }
public EssentialsVolumeLevelConfig AudioCallRx { get; set; }
public EssentialsVolumeLevelConfig AudioCallTx { get; set; }
}
/// <summary>
///
/// </summary>
public class EssentialsVolumeLevelConfig
{
public string DeviceKey { get; set; }
public string Label { get; set; }
public int Level { get; set; }
/// <summary>
/// Helper to get the device associated with key - one timer.
/// </summary>
public IBasicVolumeWithFeedback GetDevice()
{
// DM output card format: deviceKey--output~number, dm8x8-1--output~4
var match = Regex.Match(DeviceKey, @"([-_\w]+)--(\w+)~(\d+)");
if (match.Success)
{
var devKey = match.Groups[1].Value;
var chassis = DeviceManager.GetDeviceForKey(devKey) as DmChassisController;
if (chassis != null)
{
var outputNum = Convert.ToUInt32(match.Groups[3].Value);
if (chassis.VolumeControls.ContainsKey(outputNum)) // should always...
return chassis.VolumeControls[outputNum];
}
// No volume for some reason. We have failed as developers
return null;
}
// DSP format: deviceKey--levelName, biampTesira-1--master
match = Regex.Match(DeviceKey, @"([-_\w]+)--(.+)");
if (match.Success)
{
var devKey = match.Groups[1].Value;
var dsp = DeviceManager.GetDeviceForKey(devKey) as BiampTesiraForteDsp;
if (dsp != null)
{
var levelTag = match.Groups[2].Value;
if (dsp.LevelControlPoints.ContainsKey(levelTag)) // should always...
return dsp.LevelControlPoints[levelTag];
}
// No volume for some reason. We have failed as developers
return null;
}
return null;
}
}
}

View File

@@ -117,6 +117,7 @@
<Reference Include="System.Data" />
</ItemGroup>
<ItemGroup>
<Compile Include="Audio\EssentialsVolumeLevelConfig.cs" />
<Compile Include="Configuration ORIGINAL\Builders\TPConfig.cs" />
<Compile Include="Configuration ORIGINAL\Configuration.cs" />
<Compile Include="Configuration ORIGINAL\ConfigurationHelpers.cs" />

View File

@@ -122,7 +122,7 @@ namespace PepperDash.Essentials
public void RunRouteAction(string routeKey)
{
RunRouteAction(routeKey, null);
}
}
/// <summary>
/// Gets a source from config list SourceListKey and dynamically build and executes the

View File

@@ -192,9 +192,9 @@ namespace PepperDash.Essentials
/// <param name="sourceItem"></param>
public void RouteSourceToAllDestinations(SourceListItem sourceItem)
{
if (Config.Volumes.ContainsKey("master"))
if (Config.Volumes.Master != null)
{
var audioDev = DeviceManager.GetDeviceForKey(Config.Volumes["master"].DeviceKey);
var audioDev = DeviceManager.GetDeviceForKey(Config.Volumes.Master.DeviceKey);
if (audioDev is IBasicVolumeWithFeedback)
{

View File

@@ -44,33 +44,11 @@ namespace PepperDash.Essentials
displaysDict.Add(i++, disp);
}
// Need to assign the volume control point and also audio routing endpoint, if routing
// is required: For DSP, typically no.
IBasicVolumeWithFeedback masterVolumeControlDev = null;
if (props.Volumes.ContainsKey("master"))
{
var audioConfig = props.Volumes["master"];
// need to either get a device or drill down into a device for a card or port
// Check for DM output port format
var match = Regex.Match(audioConfig.DeviceKey, @"([-_\w]+)--(\w+)~(\d+)");
if(match.Success)
{
var devKey = match.Groups[1].Value;
var chassis = DeviceManager.GetDeviceForKey(devKey) as DmChassisController;
if (chassis != null)
{
var outputNum = Convert.ToUInt32(match.Groups[3].Value);
if (chassis.VolumeControls.ContainsKey(outputNum)) // should always...
{
masterVolumeControlDev = chassis.VolumeControls[outputNum];
Debug.Console(2, "Setting '{0}' as master volume control on room", audioConfig.DeviceKey);
}
}
}
}
// Get the master volume control
IBasicVolumeWithFeedback masterVolumeControlDev = props.Volumes.Master.GetDevice();
#warning Will need to define audio routing somewhere as well
var presRoom = new EssentialsPresentationRoom(Key, Name, displaysDict, masterVolumeControlDev, props);
return presRoom;
}
@@ -78,12 +56,18 @@ namespace PepperDash.Essentials
}
}
/// <summary>
///
/// </summary>
public class EssentialsRoomPropertiesConfig
{
public string HelpMessage { get; set; }
public string Description { get; set; }
}
/// <summary>
///
/// </summary>
public class EssentialsHuddleRoomPropertiesConfig : EssentialsRoomPropertiesConfig
{
public string DefaultDisplayKey { get; set; }
@@ -91,6 +75,9 @@ namespace PepperDash.Essentials
public string SourceListKey { get; set; }
}
/// <summary>
///
/// </summary>
public class EssentialsPresentationRoomPropertiesConfig : EssentialsRoomPropertiesConfig
{
public string DefaultAudioBehavior { get; set; }
@@ -98,19 +85,12 @@ namespace PepperDash.Essentials
public string DefaultVideoBehavior { get; set; }
public List<string> DisplayKeys { get; set; }
public string SourceListKey { get; set; }
public Dictionary<string, EssentialsVolumeLevelConfig> Volumes { get; set; }
public bool HasDsp { get; set; }
public EssentialsPresentationVolumesConfig Volumes { get; set; }
public EssentialsPresentationRoomPropertiesConfig()
{
DisplayKeys = new List<string>();
Volumes = new Dictionary<string, EssentialsVolumeLevelConfig>();
}
}
public class EssentialsVolumeLevelConfig
{
public string DeviceKey { get; set; }
public string Label { get; set; }
public int Level { get; set; }
}
}
}

View File

@@ -0,0 +1,3 @@
3/16/2017 12:22:16 PM, Info: Initializing SIMPLSharp Services...
3/16/2017 12:22:16 PM, Info: ProjectInfo successfully initialized.
3/16/2017 12:24:22 PM, Info: Terminating SIMPLSharp Services

View File

@@ -0,0 +1,6 @@
3/16/2017 12:44:48 PM, Info: Initializing SIMPLSharp Services...
3/16/2017 12:44:48 PM, Info: ProjectInfo successfully initialized.
3/16/2017 12:47:38 PM, Info: Saving project information...
3/16/2017 12:47:38 PM, Info: Saving project information...
3/16/2017 12:47:38 PM, Info: Saving project information...
3/17/2017 12:46:21 PM, Info: Terminating SIMPLSharp Services

View File

@@ -0,0 +1,3 @@
3/17/2017 9:00:38 AM, Info: Initializing SIMPLSharp Services...
3/17/2017 9:00:38 AM, Info: ProjectInfo successfully initialized.
3/17/2017 12:46:21 PM, Info: Terminating SIMPLSharp Services

View File

@@ -10,8 +10,8 @@
<ArchiveName />
</RequiredInfo>
<OptionalInfo>
<CompiledOn>3/15/2017 11:45:10 AM</CompiledOn>
<CompilerRev>1.0.0.19353</CompilerRev>
<CompiledOn>3/20/2017 7:54:11 AM</CompiledOn>
<CompilerRev>1.0.0.12423</CompilerRev>
</OptionalInfo>
<Plugin>
<Version>Crestron.SIMPLSharp, Version=2.0.48.0, Culture=neutral, PublicKeyToken=812d080f93e2de10</Version>

View File

@@ -1,4 +1,4 @@
MainAssembly=PepperDashEssentials.dll:bfe94f76112b33e310c0f6e4484463e2
MainAssembly=PepperDashEssentials.dll:36b68cb2a41be892b66878dfa5284633
MainAssemblyMinFirmwareVersion=1.009.0029
MainAssemblyResource=SimplSharpData.dat:820b61c48c8a2cace82957eed4cc377c
ü
@@ -30,9 +30,9 @@ DependencySource=Crestron.SimplSharpPro.UI.dll:089312a0cb0b4537072d4eb234e71e0e
DependencyPath=PepperDashEssentials.cpz:Crestron.SimplSharpPro.UI.dll
DependencyMainAssembly=Crestron.SimplSharpPro.UI.dll:089312a0cb0b4537072d4eb234e71e0e
ü
DependencySource=Essentials Devices Common.dll:22c2d648cf02d3bf28b6c42f461c927f
DependencySource=Essentials Devices Common.dll:8c62479abf8cd36d922665ee540cdd85
DependencyPath=PepperDashEssentials.cpz:Essentials Devices Common.dll
DependencyMainAssembly=Essentials Devices Common.dll:22c2d648cf02d3bf28b6c42f461c927f
DependencyMainAssembly=Essentials Devices Common.dll:8c62479abf8cd36d922665ee540cdd85
ü
DependencySource=EssentialsHttpServer.dll:0666085bdb0856c1d117699c7859bb8c
DependencyPath=PepperDashEssentials.cpz:EssentialsHttpServer.dll
@@ -42,9 +42,9 @@ DependencySource=PepperDashCorePortalSync.dll:815e608cb8a8808dab167837cf89b15a
DependencyPath=PepperDashEssentials.cpz:PepperDashCorePortalSync.dll
DependencyMainAssembly=PepperDashCorePortalSync.dll:815e608cb8a8808dab167837cf89b15a
ü
DependencySource=PepperDash_Core.dll:598033e01568965c3bd67b29e5993374
DependencySource=PepperDash_Core.dll:49fe0d78cb676a902c692056067fef4b
DependencyPath=PepperDashEssentials.cpz:PepperDash_Core.dll
DependencyMainAssembly=PepperDash_Core.dll:598033e01568965c3bd67b29e5993374
DependencyMainAssembly=PepperDash_Core.dll:49fe0d78cb676a902c692056067fef4b
ü
DependencySource=PepperDash_Essentials_Core.dll:a3ae2c4b5d2e1890a5788cf717d1b579
DependencyPath=PepperDashEssentials.cpz:PepperDash_Essentials_Core.dll