Fixed volume control device definition in room for simple systems

This commit is contained in:
Heath Volmer
2017-03-15 11:54:44 -06:00
parent f14ced0d16
commit 35a3742479
17 changed files with 78 additions and 15 deletions

View File

@@ -110,6 +110,7 @@ namespace PepperDash.Essentials
DefaultVolumeControls = defaultAudio as IBasicVolumeControls;
else if (defaultAudio is IHasVolumeDevice)
DefaultVolumeControls = (defaultAudio as IHasVolumeDevice).VolumeDevice;
CurrentVolumeControls = DefaultVolumeControls;
OnFeedback = new BoolFeedback(() =>
{ return CurrentSourceInfo != null

View File

@@ -158,16 +158,20 @@ namespace PepperDash.Essentials
/// <param name="name"></param>
public EssentialsPresentationRoom(string key, string name,
Dictionary<uint, IRoutingSinkNoSwitching> displays,
IRoutingSinkNoSwitching defaultAudio, EssentialsPresentationRoomPropertiesConfig config)
IBasicVolumeWithFeedback defaultVolume, EssentialsPresentationRoomPropertiesConfig config)
: base(key, name)
{
Config = config;
Displays = displays;
DefaultAudioDevice = defaultAudio;
if (defaultAudio is IBasicVolumeControls)
DefaultVolumeControls = defaultAudio as IBasicVolumeControls;
else if (defaultAudio is IHasVolumeDevice)
DefaultVolumeControls = (defaultAudio as IHasVolumeDevice).VolumeDevice;
DefaultVolumeControls = defaultVolume;
CurrentVolumeControls = defaultVolume;
//DefaultAudioDevice = defaultAudio;
//if (defaultAudio is IBasicVolumeControls)
// DefaultVolumeControls = defaultAudio as IBasicVolumeControls;
//else if (defaultAudio is IHasVolumeDevice)
// DefaultVolumeControls = (defaultAudio as IHasVolumeDevice).VolumeDevice;
OnFeedback = new BoolFeedback(() =>
{ return (CurrentSingleSourceInfo != null

View File

@@ -2,12 +2,14 @@
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.DM;
namespace PepperDash.Essentials
{
@@ -43,15 +45,33 @@ namespace PepperDash.Essentials
}
// Need to assign the volume control point and also audio routing endpoint, if routing
// is required: For DSP, typically no.
IRoutingSinkNoSwitching masterAudioDev = null;
// is required: For DSP, typically no.
IBasicVolumeWithFeedback masterVolumeControlDev = null;
if (props.Volumes.ContainsKey("master"))
{
var audioKey = props.Volumes["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);
}
}
}
}
var presRoom = new EssentialsPresentationRoom(Key, Name, displaysDict, masterAudioDev, props);
var presRoom = new EssentialsPresentationRoom(Key, Name, displaysDict, masterVolumeControlDev, props);
return presRoom;
}
return null;

View File

@@ -0,0 +1,27 @@
3/13/2017 9:02:52 AM, Info: Initializing SIMPLSharp Services...
3/13/2017 9:02:53 AM, Info: ProjectInfo successfully initialized.
3/13/2017 9:03:08 AM, Info: Validating assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll...
3/13/2017 9:03:09 AM, Info: Verifying assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll
3/13/2017 9:03:09 AM, Info: Creating Archive C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.cpz...
3/13/2017 9:03:11 AM, Info: Saving project information...
3/13/2017 10:06:33 AM, Info: Validating assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll...
3/13/2017 10:06:34 AM, Info: Verifying assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll
3/13/2017 10:06:34 AM, Info: Creating Archive C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.cpz...
3/13/2017 10:06:35 AM, Info: Saving project information...
3/13/2017 10:07:24 AM, Info: Validating assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll...
3/13/2017 10:07:25 AM, Info: Verifying assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll
3/13/2017 10:07:25 AM, Info: Creating Archive C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.cpz...
3/13/2017 10:07:26 AM, Info: Saving project information...
3/13/2017 10:18:49 AM, Info: Validating assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll...
3/13/2017 10:18:49 AM, Info: Verifying assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll
3/13/2017 10:18:50 AM, Info: Creating Archive C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.cpz...
3/13/2017 10:18:51 AM, Info: Saving project information...
3/13/2017 10:40:42 AM, Info: Validating assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll...
3/13/2017 10:40:43 AM, Info: Verifying assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll
3/13/2017 10:40:43 AM, Info: Creating Archive C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.cpz...
3/13/2017 10:40:45 AM, Info: Saving project information...
3/13/2017 10:50:46 AM, Info: Validating assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll...
3/13/2017 10:50:47 AM, Info: Verifying assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll
3/13/2017 10:50:47 AM, Info: Creating Archive C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.cpz...
3/13/2017 10:50:48 AM, Info: Saving project information...
3/13/2017 5:02:05 PM, Info: Terminating SIMPLSharp Services

View File

@@ -0,0 +1,11 @@
3/14/2017 3:40:49 PM, Info: Initializing SIMPLSharp Services...
3/14/2017 3:40:50 PM, Info: ProjectInfo successfully initialized.
3/14/2017 4:14:10 PM, Info: Validating assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll...
3/14/2017 4:14:11 PM, Info: Verifying assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll
3/14/2017 4:14:12 PM, Info: Creating Archive C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.cpz...
3/14/2017 4:14:13 PM, Info: Saving project information...
3/14/2017 4:16:12 PM, Info: Validating assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll...
3/14/2017 4:16:12 PM, Info: Verifying assembly C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.dll
3/14/2017 4:16:12 PM, Info: Creating Archive C:\Users\hvolmer\Desktop\working\essentials\PepperDashEssentials\PepperDashEssentials\bin\PepperDashEssentials.cpz...
3/14/2017 4:16:14 PM, Info: Saving project information...
3/14/2017 4:54:52 PM, Info: Terminating SIMPLSharp Services

View File

@@ -10,8 +10,8 @@
<ArchiveName />
</RequiredInfo>
<OptionalInfo>
<CompiledOn>3/13/2017 10:50:47 AM</CompiledOn>
<CompilerRev>1.0.0.17722</CompilerRev>
<CompiledOn>3/15/2017 11:45:10 AM</CompiledOn>
<CompilerRev>1.0.0.19353</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:ac3af5e6028ddf61e481b2335937c5c9
MainAssembly=PepperDashEssentials.dll:bfe94f76112b33e310c0f6e4484463e2
MainAssemblyMinFirmwareVersion=1.009.0029
MainAssemblyResource=SimplSharpData.dat:820b61c48c8a2cace82957eed4cc377c
ü
@@ -54,9 +54,9 @@ DependencySource=PepperDash_Essentials_Displays.dll:3135ef6b8f66b5b1bc5223aad3ef
DependencyPath=PepperDashEssentials.cpz:PepperDash_Essentials_Displays.dll
DependencyMainAssembly=PepperDash_Essentials_Displays.dll:3135ef6b8f66b5b1bc5223aad3ef66e0
ü
DependencySource=PepperDash_Essentials_DM.dll:6ac51b82e3f70b4b9b30032ccbb9cdc8
DependencySource=PepperDash_Essentials_DM.dll:a8999dad9e695a649c6f8bdb2d4779d2
DependencyPath=PepperDashEssentials.cpz:PepperDash_Essentials_DM.dll
DependencyMainAssembly=PepperDash_Essentials_DM.dll:6ac51b82e3f70b4b9b30032ccbb9cdc8
DependencyMainAssembly=PepperDash_Essentials_DM.dll:a8999dad9e695a649c6f8bdb2d4779d2
ü
DependencySource=SimplSharpCryptographyInterface.dll:dd4791a86d6f67ddc309c4ab1e24c663
DependencyPath=PepperDashEssentials.cpz:SimplSharpCryptographyInterface.dll