diff --git a/PepperDashEssentials/Room/Cotija/CotijaSystemController.cs b/PepperDashEssentials/Room/Cotija/CotijaSystemController.cs index 54261370..17805209 100644 --- a/PepperDashEssentials/Room/Cotija/CotijaSystemController.cs +++ b/PepperDashEssentials/Room/Cotija/CotijaSystemController.cs @@ -82,6 +82,8 @@ namespace PepperDash.Essentials CrestronConsole.AddNewConsoleCommand(TestHttpRequest, "mobilehttprequest", "Tests an HTTP get to URL given", ConsoleAccessLevelEnum.AccessOperator); + CrestronConsole.AddNewConsoleCommand(PrintActionDictionaryPaths, "showactionpaths", "Prints the paths in teh Action Dictionary", ConsoleAccessLevelEnum.AccessOperator); + CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler); } @@ -102,6 +104,16 @@ namespace PepperDash.Essentials } } + public void PrintActionDictionaryPaths(object o) + { + Debug.Console(0, this, "ActionDictionary Contents:"); + + foreach (var item in ActionDictionary) + { + Debug.Console(0, this, "{0}", item.Key); + } + } + /// /// Adds an action to the dictionary /// diff --git a/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaDdvc01RoomBridge.cs b/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaDdvc01RoomBridge.cs index 7678fa89..d9d2cda2 100644 --- a/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaDdvc01RoomBridge.cs +++ b/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaDdvc01RoomBridge.cs @@ -261,7 +261,7 @@ namespace PepperDash.Essentials.Room.Cotija foreach (var item in sourceJoinMap) { - Parent.AddAction(prefix + item.Key, new PressAndHoldAction(b => EISC.SetBool(item.Value, b))); + Parent.AddAction(string.Format("{0}{1}", prefix, item.Key), new PressAndHoldAction(b => EISC.SetBool(item.Value, b))); } } @@ -467,23 +467,42 @@ namespace PepperDash.Essentials.Room.Cotija { if (ConfigIsLoaded) { + var count = EISC.UShortOutput[801].UShortValue; + + Debug.Console(1, this, "The Fader Count is : {0}", count); + + // build volumes object, serialize and put in content of method below + + var auxFaders = new List(); + + // Create auxFaders + for (uint i = 2; i <= count; i++) + { + auxFaders.Add( + new Volume(string.Format("level-{0}", i), + EISC.UShortOutput[i].UShortValue, + EISC.BooleanOutput[i].BoolValue, + EISC.StringOutput[800 + i].StringValue, + true, + "someting.png")); + } + + var volumes = new Volumes(); + + volumes.Master = new Volume("master", + EISC.UShortOutput[UshortJoin.MasterVolumeLevel].UShortValue, + EISC.BooleanOutput[BoolJoin.MasterVolumeIsMuted].BoolValue, + EISC.StringOutput[801].StringValue, + true, + "something.png"); + + volumes.AuxFaders = auxFaders; + PostStatusMessage(new { isOn = EISC.BooleanOutput[BoolJoin.RoomIsOn].BoolValue, selectedSourceKey = EISC.StringOutput[StringJoin.SelectedSourceKey].StringValue, - volumes = new - { - master = new - { - level = EISC.UShortOutput[UshortJoin.MasterVolumeLevel].UShortValue, - muted = EISC.BooleanOutput[BoolJoin.MasterVolumeIsMuted].BoolValue, - label = EISC.StringInput[701].StringValue, - hasMute = true, - muteIcon = "something.png" - }, - count = 1 - } - + volumes = volumes }); } else @@ -495,7 +514,45 @@ namespace PepperDash.Essentials.Room.Cotija } } + public class Volumes + { + [JsonProperty("master")] + public Volume Master { get; set; } + [JsonProperty("auxFaders")] + public List AuxFaders { get; set; } + } + + public class Volume + { + [JsonProperty("key")] + public string Key { get; set; } + + [JsonProperty("level")] + public ushort Level { get; set; } + + [JsonProperty("muted")] + public bool Muted { get; set; } + + [JsonProperty("label")] + public string Label { get; set; } + + [JsonProperty("hasMute")] + public bool HasMute { get; set; } + + [JsonProperty("muteIcon")] + public string MuteIcon { get; set; } + + public Volume(string key, ushort level, bool muted, string label, bool hasMute, string muteIcon) + { + Key = key; + Level = level; + Muted = muted; + Label = label; + HasMute = hasMute; + MuteIcon = muteIcon; + } + } /// /// Helper for posting status message diff --git a/PepperDashEssentials/Room/Cotija/RoomBridges/SourceDeviceMapDictionary.cs b/PepperDashEssentials/Room/Cotija/RoomBridges/SourceDeviceMapDictionary.cs index 06d64f94..341f77dd 100644 --- a/PepperDashEssentials/Room/Cotija/RoomBridges/SourceDeviceMapDictionary.cs +++ b/PepperDashEssentials/Room/Cotija/RoomBridges/SourceDeviceMapDictionary.cs @@ -90,11 +90,15 @@ namespace PepperDash.Essentials.Room.Cotija {"prevTrack", 175}, {"nextTrack", 176}, {"powerOn", 177}, - {"powerOff", 178} + {"powerOff", 178}, + {"dot", 179} }; - + foreach (var item in dictionary) + { + this.Add(item.Key, item.Value); + } } } } \ No newline at end of file diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index f008ebe1..2ca1e7da 100644 Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ diff --git a/Release Package/PepperDashEssentials.dll b/Release Package/PepperDashEssentials.dll index 0d625d8d..a818be1b 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ