From 9f840fae416ba231c7c10c1c6f894785e381c33b Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 25 Feb 2021 16:53:35 -0700 Subject: [PATCH 01/22] add DestinationListItem --- .../Devices/DestinationListItem.cs | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs new file mode 100644 index 00000000..369e2a95 --- /dev/null +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs @@ -0,0 +1,50 @@ +using Newtonsoft.Json; +using PepperDash.Essentials.Core; + +namespace PepperDash.Essentials.Core +{ + public class DestinationListItem + { + [JsonProperty("sinkKey")] + public string SinkKey { get; set; } + + private EssentialsDevice _sinkDevice; + + [JsonIgnore] + public EssentialsDevice SinkDevice + { + get { return _sinkDevice ?? (_sinkDevice = DeviceManager.GetDeviceForKey(SinkKey) as EssentialsDevice); } + } + + public string PreferredName + { + get + { + if (!string.IsNullOrEmpty(Name)) + { + return Name; + } + + return SinkDevice == null ? "---" : SinkDevice.Name; + } + } + + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("includeInDestinationList")] + public bool IncludeInDestinationList { get; set; } + + [JsonProperty("order")] + public int Order { get; set; } + + [JsonProperty("surfaceLocation")] + public int SurfaceLocation { get; set; } + + [JsonProperty("verticalLocation")] + public int VerticalLocation { get; set; } + + [JsonProperty("horizontalLocation")] + public int HorizontalLocation { get; set; } + } +} \ No newline at end of file From 0649cea367d092b4604f1202be25dfa6d600dac7 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 25 Feb 2021 16:53:51 -0700 Subject: [PATCH 02/22] Add DestinationLists to config --- .../Config/BasicConfig.cs | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs index 7cbaa5a1..ee52e1ef 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; -using Crestron.SimplSharp; using Newtonsoft.Json; -using PepperDash.Core; -using PepperDash.Essentials.Core; using Newtonsoft.Json.Linq; @@ -25,7 +20,10 @@ namespace PepperDash.Essentials.Core.Config [JsonProperty("sourceLists")] public Dictionary> SourceLists { get; set; } - [JsonProperty("tieLines")] + [JsonProperty("destinationLists")] + public Dictionary> DestinationLists { get; set; } + + [JsonProperty("tieLines")] public List TieLines { get; set; } [JsonProperty("joinMaps")] @@ -42,6 +40,16 @@ namespace PepperDash.Essentials.Core.Config return SourceLists[key]; } + public Dictionary GetDestinationListForKey(string key) + { + if (string.IsNullOrEmpty(key) || !DestinationLists.ContainsKey(key)) + { + return null; + } + + return DestinationLists[key]; + } + /// /// Checks Devices for an item with a Key that matches and returns it if found. Otherwise, retunes null /// From 0dcbb652df946c21c2467fed462d69587373d511 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 25 Feb 2021 17:00:57 -0700 Subject: [PATCH 03/22] add properties to SourceListItem add XML Comments --- .../PepperDashEssentialsBase/Config/BasicConfig.cs | 5 +++++ .../Devices/SourceListItem.cs | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs index ee52e1ef..dfab0e09 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs @@ -40,6 +40,11 @@ namespace PepperDash.Essentials.Core.Config return SourceLists[key]; } + /// + /// Retrieves a DestinationListItem based on the key + /// + /// key of the item to retrieve + /// DestinationListItem if the key exists, null otherwise public Dictionary GetDestinationListForKey(string key) { if (string.IsNullOrEmpty(key) || !DestinationLists.ContainsKey(key)) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/SourceListItem.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/SourceListItem.cs index 601d75a7..e302a2a4 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/SourceListItem.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/SourceListItem.cs @@ -130,10 +130,24 @@ namespace PepperDash.Essentials.Core [JsonProperty("sourceListKey")] public string SourceListKey { get; set; } + /// + /// Indicates if the device associated with this source is controllable + /// + [JsonProperty("isControllable")] + public bool IsControllable { get; set; } + + /// + /// Indicates that the device associated with this source has audio available + /// + [JsonProperty("isAudioSource")] + public bool IsAudioSource { get; set; } + public SourceListItem() { Icon = "Blank"; } + + } public class SourceRouteListItem From 7c7ae65d401159c7276e31f6c3642f48364190ca Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 25 Feb 2021 17:01:24 -0700 Subject: [PATCH 04/22] Update PepperDash_Essentials_Core.csproj --- .../PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj index cf5587dd..d9357d9e 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj @@ -189,6 +189,7 @@ + From d2ebc340bd6246aec50d56e1e0df670da4058452 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 1 Mar 2021 15:15:50 -0700 Subject: [PATCH 05/22] add Sink Type property --- .../PepperDashEssentialsBase/Devices/DestinationListItem.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs index 369e2a95..1c7ad835 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs @@ -46,5 +46,8 @@ namespace PepperDash.Essentials.Core [JsonProperty("horizontalLocation")] public int HorizontalLocation { get; set; } + + [JsonProperty("sinkType")] + public eRoutingSignalType SinkType { get; set; } } } \ No newline at end of file From 79fd1f7424b7c563e21262eda5ac7dde3f937d14 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 3 Mar 2021 14:43:42 -0700 Subject: [PATCH 06/22] add destinationListKey property and remove DDVC --- PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs | 2 ++ ...RoomPropertiesConfig.cs => SimplRoomPropertiesConfig.cs} | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) rename PepperDashEssentials/Room/Config/{DDVC01RoomPropertiesConfig.cs => SimplRoomPropertiesConfig.cs} (78%) diff --git a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs b/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs index 201b583c..7c7e4c49 100644 --- a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs +++ b/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs @@ -196,6 +196,8 @@ namespace PepperDash.Essentials.Room.Config public string DefaultAudioKey { get; set; } [JsonProperty("sourceListKey")] public string SourceListKey { get; set; } + [JsonProperty("destinationListKey")] + public string DestinationListKey { get; set; } [JsonProperty("defaultSourceItem")] public string DefaultSourceItem { get; set; } diff --git a/PepperDashEssentials/Room/Config/DDVC01RoomPropertiesConfig.cs b/PepperDashEssentials/Room/Config/SimplRoomPropertiesConfig.cs similarity index 78% rename from PepperDashEssentials/Room/Config/DDVC01RoomPropertiesConfig.cs rename to PepperDashEssentials/Room/Config/SimplRoomPropertiesConfig.cs index be779f3a..f0fea9b9 100644 --- a/PepperDashEssentials/Room/Config/DDVC01RoomPropertiesConfig.cs +++ b/PepperDashEssentials/Room/Config/SimplRoomPropertiesConfig.cs @@ -8,19 +8,19 @@ using Newtonsoft.Json; namespace PepperDash.Essentials.Room.Config { - public class DDVC01RoomPropertiesConfig : EssentialsHuddleVtc1PropertiesConfig + public class SimplRoomPropertiesConfig : EssentialsHuddleVtc1PropertiesConfig { [JsonProperty("roomPhoneNumber")] public string RoomPhoneNumber { get; set; } [JsonProperty("roomURI")] public string RoomURI { get; set; } [JsonProperty("speedDials")] - public List SpeedDials { get; set; } + public List SpeedDials { get; set; } [JsonProperty("volumeSliderNames")] public List VolumeSliderNames { get; set; } } - public class DDVC01SpeedDial + public class SimplSpeedDial { [JsonProperty("name")] public string Name { get; set; } From e23fe06feffe7c881495c4167ff56a3a3aca8bdb Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 5 Mar 2021 15:32:21 -0700 Subject: [PATCH 07/22] update name change in csproj --- PepperDashEssentials/PepperDashEssentials.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PepperDashEssentials/PepperDashEssentials.csproj b/PepperDashEssentials/PepperDashEssentials.csproj index b7df4b0d..7b548dd5 100644 --- a/PepperDashEssentials/PepperDashEssentials.csproj +++ b/PepperDashEssentials/PepperDashEssentials.csproj @@ -137,7 +137,7 @@ - + From 8ba0920cc02464437e06b9fc30de1ebd060fdc34 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 5 Mar 2021 15:41:22 -0700 Subject: [PATCH 08/22] add jsonProperty decorator for PreferredName --- .../PepperDashEssentialsBase/Devices/DestinationListItem.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs index 1c7ad835..49379e44 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DestinationListItem.cs @@ -16,6 +16,7 @@ namespace PepperDash.Essentials.Core get { return _sinkDevice ?? (_sinkDevice = DeviceManager.GetDeviceForKey(SinkKey) as EssentialsDevice); } } + [JsonProperty("preferredName")] public string PreferredName { get From 74231a428d0f8a5214e36992f2fe8481b0b46616 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 5 Mar 2021 17:31:21 -0700 Subject: [PATCH 09/22] removed unnecessary stack trace printing --- .../PepperDashEssentialsBase/Plugins/PluginLoader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Plugins/PluginLoader.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Plugins/PluginLoader.cs index 01da1c54..543729da 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Plugins/PluginLoader.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Plugins/PluginLoader.cs @@ -381,7 +381,7 @@ namespace PepperDash.Essentials catch (Exception e) { Debug.Console(2, "Load Plugin not found. {0}.{2} is not a plugin factory. Exception: {1}", - loadedAssembly.Name, e, type.Name); + loadedAssembly.Name, e.Message, type.Name); continue; } From 4e15d7fe5aba51ac6d9338953f910e3670a8a1b5 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 16 Mar 2021 15:36:14 -0600 Subject: [PATCH 10/22] Adds necessary config properteis --- .../Room/Config/EssentialsRoomConfig.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs b/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs index 7c7e4c49..6a59cc56 100644 --- a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs +++ b/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs @@ -200,7 +200,16 @@ namespace PepperDash.Essentials.Room.Config public string DestinationListKey { get; set; } [JsonProperty("defaultSourceItem")] public string DefaultSourceItem { get; set; } - + /// + /// Indicates if the room supports advanced sharing + /// + [JsonProperty("supportsAdvancedSharing")] + public bool SupportsAdvancedSharing { get; set; } + /// + /// Indicates if non-tech users can change the share mode + /// + [JsonProperty("userCanChangeShareMode")] + public bool UserCanChangeShareMode { get; set; } } public class EssentialsConferenceRoomPropertiesConfig : EssentialsAvRoomPropertiesConfig From 6ab4d4d090448d5f8e2d84165bf1ba0b51d90653 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 17 Mar 2021 10:52:17 -0600 Subject: [PATCH 11/22] #658 Initializes config properties in constructor(s) --- .../PepperDashEssentialsBase/Config/BasicConfig.cs | 10 ++++++++++ .../Config/Essentials/EssentialsConfig.cs | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs index dfab0e09..f44f6000 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/BasicConfig.cs @@ -29,6 +29,16 @@ namespace PepperDash.Essentials.Core.Config [JsonProperty("joinMaps")] public Dictionary JoinMaps { get; set; } + public BasicConfig() + { + Info = new InfoConfig(); + Devices = new List(); + SourceLists = new Dictionary>(); + DestinationLists = new Dictionary>(); + TieLines = new List(); + JoinMaps = new Dictionary(); + } + /// /// Checks SourceLists for a given list and returns it if found. Otherwise, returns null /// diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/EssentialsConfig.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/EssentialsConfig.cs index cc3375e2..1e819414 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/EssentialsConfig.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/EssentialsConfig.cs @@ -51,6 +51,13 @@ namespace PepperDash.Essentials.Core.Config [JsonProperty("rooms")] public List Rooms { get; set; } + + + public EssentialsConfig() + : base() + { + Rooms = new List(); + } } /// From 0f28d46f344474006aecde7205612fad7c993960 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 30 Mar 2021 15:53:10 -0600 Subject: [PATCH 12/22] #671 Calls the private dispose method on program stop --- .../PepperDashEssentialsBase/Queues/GenericQueue.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs index 693c39e5..36f69e0f 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs @@ -155,7 +155,7 @@ namespace PepperDash.Essentials.Core.Queues if (programEvent != eProgramStatusEventType.Stopping) return; - Dispose(); + Dispose(true); }; } @@ -407,7 +407,7 @@ namespace PepperDash_Essentials_Core.Queues if (programEvent != eProgramStatusEventType.Stopping) return; - Dispose(); + Dispose(true); }; } From 33a1b1697a6502d238829d3b1ed7ce056d99e604 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 31 Mar 2021 15:29:55 -0600 Subject: [PATCH 13/22] Removes call to dispose on program stop event. Adds debug statement in Dispose() --- .../Queues/GenericQueue.cs | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs index 36f69e0f..a8b839f4 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs @@ -150,13 +150,13 @@ namespace PepperDash.Essentials.Core.Queues _delayEnabled = pacing > 0; _delayTime = pacing; - CrestronEnvironment.ProgramStatusEventHandler += programEvent => - { - if (programEvent != eProgramStatusEventType.Stopping) - return; + //CrestronEnvironment.ProgramStatusEventHandler += programEvent => + //{ + // if (programEvent != eProgramStatusEventType.Stopping) + // return; - Dispose(true); - }; + // Dispose(true); + //}; } /// @@ -231,6 +231,8 @@ namespace PepperDash.Essentials.Core.Queues if (disposing) { + Debug.Console(2, this, "Disposing..."); + _queue.Clear(); Enqueue(null); _worker.Join(); _waitHandle.Close(); @@ -402,13 +404,13 @@ namespace PepperDash_Essentials_Core.Queues _delayEnabled = pacing > 0; _delayTime = pacing; - CrestronEnvironment.ProgramStatusEventHandler += programEvent => - { - if (programEvent != eProgramStatusEventType.Stopping) - return; + //CrestronEnvironment.ProgramStatusEventHandler += programEvent => + //{ + // if (programEvent != eProgramStatusEventType.Stopping) + // return; - Dispose(true); - }; + // Dispose(true); + //}; } /// @@ -477,6 +479,8 @@ namespace PepperDash_Essentials_Core.Queues if (disposing) { + Debug.Console(2, this, "Disposing..."); + _queue.Clear(); Enqueue(null); _worker.Join(); _waitHandle.Close(); From e327d2d359d40049d1c7388a3abf7e529bcd88e1 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Fri, 2 Apr 2021 16:09:54 -0600 Subject: [PATCH 14/22] passes true when disposing of generic queue in deconstructor --- .../PepperDashEssentialsBase/Queues/GenericQueue.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs index a8b839f4..6759d32b 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs @@ -243,7 +243,7 @@ namespace PepperDash.Essentials.Core.Queues ~GenericQueue() { - Dispose(false); + Dispose(true); } /// @@ -491,7 +491,7 @@ namespace PepperDash_Essentials_Core.Queues ~GenericQueue() { - Dispose(false); + Dispose(true); } /// From 037f8ed043fc66eb8f49b306048365ec842399ae Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Fri, 2 Apr 2021 17:07:06 -0600 Subject: [PATCH 15/22] #671 Updates to GenericQueue to resolve issues when stopping program --- .../Queues/GenericQueue.cs | 58 +++++++++++++------ 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs index 6759d32b..e382d16f 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs @@ -150,13 +150,13 @@ namespace PepperDash.Essentials.Core.Queues _delayEnabled = pacing > 0; _delayTime = pacing; - //CrestronEnvironment.ProgramStatusEventHandler += programEvent => - //{ - // if (programEvent != eProgramStatusEventType.Stopping) - // return; + CrestronEnvironment.ProgramStatusEventHandler += programEvent => + { + if (programEvent != eProgramStatusEventType.Stopping) + return; - // Dispose(true); - //}; + Dispose(true); + }; } /// @@ -232,9 +232,20 @@ namespace PepperDash.Essentials.Core.Queues if (disposing) { Debug.Console(2, this, "Disposing..."); - _queue.Clear(); - Enqueue(null); - _worker.Join(); + if (_queue != null && !_queue.Disposed) + { + _queue.Clear(); + Enqueue(null); + } + //else + //{ + // if (_queue == null) + // Debug.Console(2, this, "_queue is null"); + // else + // Debug.Console(2, this, "_queue disposed: {0}", _queue.Disposed); + //} + //_worker.Join(); + _worker.Abort(); _waitHandle.Close(); } @@ -404,13 +415,13 @@ namespace PepperDash_Essentials_Core.Queues _delayEnabled = pacing > 0; _delayTime = pacing; - //CrestronEnvironment.ProgramStatusEventHandler += programEvent => - //{ - // if (programEvent != eProgramStatusEventType.Stopping) - // return; + CrestronEnvironment.ProgramStatusEventHandler += programEvent => + { + if (programEvent != eProgramStatusEventType.Stopping) + return; - // Dispose(true); - //}; + Dispose(true); + }; } /// @@ -480,9 +491,20 @@ namespace PepperDash_Essentials_Core.Queues if (disposing) { Debug.Console(2, this, "Disposing..."); - _queue.Clear(); - Enqueue(null); - _worker.Join(); + if (_queue != null && !_queue.Disposed) + { + _queue.Clear(); + Enqueue(null); + } + //else + //{ + // if (_queue == null) + // Debug.Console(2, this, "_queue is null"); + // else + // Debug.Console(2, this, "_queue disposed: {0}", _queue.Disposed); + //} + //_worker.Join(); + _worker.Abort(); _waitHandle.Close(); } From 1e755df9bb78a5b9e5a02bb8d6e54a4c569c58d4 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 5 Apr 2021 17:01:34 -0600 Subject: [PATCH 16/22] #675 Adds UserPromptedForCode event and method to show code on CiscoSparkCodec --- .../DeviceTypeInterfaces/IMobileControl.cs | 2 ++ .../VideoCodec/CiscoCodec/CiscoSparkCodec.cs | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs index 2dfa7c41..257d58e1 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs @@ -20,6 +20,8 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces { event EventHandler UserCodeChanged; + event EventHandler UserPromptedForCode; + string UserCode { get; } string QrCodeUrl { get; } diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs index 1cf6ade0..99c47a26 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs @@ -490,11 +490,21 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco Debug.Console(2, this, "Setting QR code URL: {0}", mcBridge.QrCodeUrl); mcBridge.UserCodeChanged += (o, a) => SendMcBrandingUrl(mcBridge); + mcBridge.UserPromptedForCode += (o, a) => DisplayUserCode(mcBridge.UserCode); SendMcBrandingUrl(mcBridge); } } + /// + /// Displays the code for the specified duration + /// + /// Mobile Control user code + private void DisplayUserCode(string code) + { + SendText(string.Format("xcommand userinterface message alert display title:\"Mobile Control User Code:\" text:\"{0}\" duration: 30")); + } + private void SendMcBrandingUrl(IMobileControlRoomBridge mcBridge) { if (mcBridge == null) From ba247ee8d64abf1c8c0438df9709af6872d5aad1 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 6 Apr 2021 10:36:03 -0600 Subject: [PATCH 17/22] removes commented code for clarity --- .../Queues/GenericQueue.cs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs index e382d16f..5b737ad4 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs @@ -237,14 +237,6 @@ namespace PepperDash.Essentials.Core.Queues _queue.Clear(); Enqueue(null); } - //else - //{ - // if (_queue == null) - // Debug.Console(2, this, "_queue is null"); - // else - // Debug.Console(2, this, "_queue disposed: {0}", _queue.Disposed); - //} - //_worker.Join(); _worker.Abort(); _waitHandle.Close(); } @@ -496,14 +488,6 @@ namespace PepperDash_Essentials_Core.Queues _queue.Clear(); Enqueue(null); } - //else - //{ - // if (_queue == null) - // Debug.Console(2, this, "_queue is null"); - // else - // Debug.Console(2, this, "_queue disposed: {0}", _queue.Disposed); - //} - //_worker.Join(); _worker.Abort(); _waitHandle.Close(); } From cf8e6736773126ad7520b90e99d334e9b104b4bf Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 6 Apr 2021 12:25:33 -0600 Subject: [PATCH 18/22] Adds ClientJoined event --- .../DeviceTypeInterfaces/IMobileControl.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs index 257d58e1..c87e7865 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IMobileControl.cs @@ -22,6 +22,8 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces event EventHandler UserPromptedForCode; + event EventHandler ClientJoined; + string UserCode { get; } string QrCodeUrl { get; } From 22e7f004a5149dc1dfd1ab5a0e4b28a8d90c81b0 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 6 Apr 2021 18:06:15 -0600 Subject: [PATCH 19/22] adds missing code parameter --- .../VideoCodec/CiscoCodec/CiscoSparkCodec.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs index 99c47a26..09f3e37f 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs @@ -502,7 +502,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco /// Mobile Control user code private void DisplayUserCode(string code) { - SendText(string.Format("xcommand userinterface message alert display title:\"Mobile Control User Code:\" text:\"{0}\" duration: 30")); + SendText(string.Format("xcommand userinterface message alert display title:\"Mobile Control User Code:\" text:\"{0}\" duration: 30", code)); } private void SendMcBrandingUrl(IMobileControlRoomBridge mcBridge) From 1849d118b407598cf90ac0b750d1be175361db40 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 6 Apr 2021 18:15:37 -0600 Subject: [PATCH 20/22] gets rid of console print when queue items are processed. --- .../PepperDashEssentialsBase/Queues/GenericQueue.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs index 5b737ad4..651aab77 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Queues/GenericQueue.cs @@ -180,7 +180,7 @@ namespace PepperDash.Essentials.Core.Queues { try { - Debug.Console(2, this, "Processing queue item: '{0}'", item.ToString()); + //Debug.Console(2, this, "Processing queue item: '{0}'", item.ToString()); item.Dispatch(); if (_delayEnabled) From 6c2abc7abd4c11ceac4bf32800ec20770257edd6 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 6 Apr 2021 19:54:01 -0600 Subject: [PATCH 21/22] Adds missing space in video mute command --- .../VideoCodec/CiscoCodec/CiscoSparkCodec.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs index 09f3e37f..d354eebc 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs @@ -2021,7 +2021,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco /// public void CameraMuteOn() { - SendText("xCommand Video InputMainVideo Mute"); + SendText("xCommand Video Input MainVideo Mute"); } /// @@ -2029,7 +2029,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco /// public void CameraMuteOff() { - SendText("xCommand Video InputMainVideo Unmute"); + SendText("xCommand Video Input MainVideo Unmute"); } /// From 7640b9570129ea7fb6ed52952fcbdb89a0282b82 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Tue, 6 Apr 2021 20:08:59 -0600 Subject: [PATCH 22/22] Clears camera mute mode when turning camera auto mode off --- .../VideoCodec/CiscoCodec/CiscoSparkCodec.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs index d354eebc..a0d4fb74 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs @@ -571,6 +571,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco prefix + "/Status/Standby" + Delimiter + prefix + "/Status/Video/Selfview" + Delimiter + prefix + "/Status/Video/Layout" + Delimiter + + prefix + "/Status/Video/Input/MainVideoMute" + Delimiter + prefix + "/Bookings" + Delimiter + prefix + "/Event/CallDisconnect" + Delimiter + prefix + "/Event/Bookings" + Delimiter + @@ -1660,12 +1661,21 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco public void CameraAutoModeOn() { + if (CameraIsOffFeedback.BoolValue) + { + CameraMuteOff(); + } + SendText("xCommand Cameras SpeakerTrack Activate"); - CameraMuteOff(); } public void CameraAutoModeOff() { + if (CameraIsOffFeedback.BoolValue) + { + CameraMuteOff(); + } + SendText("xCommand Cameras SpeakerTrack Deactivate"); }