diff --git a/Essentials Core/PepperDashEssentialsBase/Config/SourceDevicePropertiesConfigBase.cs b/Essentials Core/PepperDashEssentialsBase/Config/SourceDevicePropertiesConfigBase.cs new file mode 100644 index 00000000..e6d13339 --- /dev/null +++ b/Essentials Core/PepperDashEssentialsBase/Config/SourceDevicePropertiesConfigBase.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +namespace PepperDash.Essentials.Core.Config +{ + public class SourceDevicePropertiesConfigBase + { + public bool DisableSharing { get; set; } + } +} \ No newline at end of file diff --git a/Essentials Core/PepperDashEssentialsBase/Devices/SourceListItem.cs b/Essentials Core/PepperDashEssentialsBase/Devices/SourceListItem.cs index 54436bf1..2e8cdaf9 100644 --- a/Essentials Core/PepperDashEssentialsBase/Devices/SourceListItem.cs +++ b/Essentials Core/PepperDashEssentialsBase/Devices/SourceListItem.cs @@ -68,6 +68,8 @@ namespace PepperDash.Essentials.Core public string VolumeControlKey { get; set; } public eSourceListItemType Type { get; set; } public List RouteList { get; set; } + public bool DisableCodecSharing { get; set; } + public bool DisableRoutedSharing { get; set; } public SourceListItem() { diff --git a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj index 98022ced..2f6ec383 100644 --- a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj +++ b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj @@ -103,6 +103,7 @@ + diff --git a/Essentials DM/Essentials_DM/Chassis/HdMdNxM4kEController.cs b/Essentials DM/Essentials_DM/Chassis/HdMdNxM4kEController.cs index 5a9c3026..4c9092ae 100644 --- a/Essentials DM/Essentials_DM/Chassis/HdMdNxM4kEController.cs +++ b/Essentials DM/Essentials_DM/Chassis/HdMdNxM4kEController.cs @@ -35,10 +35,10 @@ namespace PepperDash.Essentials.DM.Chassis // logical ports InputPorts = new RoutingPortCollection(); - for (int i = 1; i <= 4; i++) + for (uint i = 1; i <= 4; i++) { InputPorts.Add(new RoutingInputPort("hdmiIn" + i, eRoutingSignalType.AudioVideo, - eRoutingPortConnectionType.Hdmi, 1, this, false)); + eRoutingPortConnectionType.Hdmi, i, this)); } OutputPorts = new RoutingPortCollection(); OutputPorts.Add(new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo, @@ -80,7 +80,6 @@ namespace PepperDash.Essentials.DM.Chassis public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType) { Chassis.HdmiOutputs[1].VideoOut = Chassis.HdmiInputs[(uint)inputSelector]; - Chassis.VideoEnter.Pulse(); } #endregion diff --git a/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs b/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs index d88f6dd0..caa16372 100644 --- a/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs +++ b/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs @@ -18,6 +18,7 @@ using PepperDash.Essentials.Devices.Common.Occupancy; using PepperDash.Essentials.Devices.Common; + namespace PepperDash.Essentials.Devices.Common { public class DeviceFactory @@ -28,6 +29,8 @@ namespace PepperDash.Essentials.Devices.Common var name = dc.Name; var type = dc.Type; var properties = dc.Properties; + var propAnon = new {}; + JsonConvert.DeserializeAnonymousType(dc.Properties.ToString(), propAnon); var typeName = dc.Type.ToLower(); var groupName = dc.Group.ToLower(); diff --git a/Essentials Devices Common/Essentials Devices Common/SetTopBox/SetTopBoxPropertiesConfig.cs b/Essentials Devices Common/Essentials Devices Common/SetTopBox/SetTopBoxPropertiesConfig.cs index 63f9581f..ae9a6709 100644 --- a/Essentials Devices Common/Essentials Devices Common/SetTopBox/SetTopBoxPropertiesConfig.cs +++ b/Essentials Devices Common/Essentials Devices Common/SetTopBox/SetTopBoxPropertiesConfig.cs @@ -8,7 +8,7 @@ using PepperDash.Core; namespace PepperDash.Essentials.Devices.Common { - public class SetTopBoxPropertiesConfig + public class SetTopBoxPropertiesConfig : PepperDash.Essentials.Core.Config.SourceDevicePropertiesConfigBase { public bool HasPresets { get; set; } public bool HasDvr { get; set; } diff --git a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs index 044ad2c8..d0246928 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs @@ -318,8 +318,6 @@ namespace PepperDash.Essentials (CurrentRoom.DefaultDisplay as IPower).PowerToggle(); }); - //TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusButtonPress, ShowActiveCallsList ); - SetupNextMeetingTimer(); base.Show(); @@ -906,6 +904,7 @@ namespace PepperDash.Essentials _CurrentRoom.OnFeedback.OutputChange += CurrentRoom_OnFeedback_OutputChange; _CurrentRoom.IsWarmingUpFeedback.OutputChange -= CurrentRoom_IsWarmingFeedback_OutputChange; _CurrentRoom.IsCoolingDownFeedback.OutputChange -= CurrentRoom_IsCoolingDownFeedback_OutputChange; + _CurrentRoom.InCallFeedback.OutputChange -= CurrentRoom_InCallFeedback_OutputChange; } _CurrentRoom = room; @@ -913,27 +912,9 @@ namespace PepperDash.Essentials if (_CurrentRoom != null) { // get the source list config and set up the source list - var config = ConfigReader.ConfigObject.SourceLists; - if (config.ContainsKey(_CurrentRoom.SourceListKey)) - { - var srcList = config[_CurrentRoom.SourceListKey].OrderBy(kv => kv.Value.Order); - // Setup sources list - uint i = 1; // counter for UI list - foreach (var kvp in srcList) - { - var srcConfig = kvp.Value; - if (!srcConfig.IncludeInSourceList) // Skip sources marked this way - continue; + SetupSourceList(); - var routeKey = kvp.Key; - var item = new SubpageReferenceListSourceItem(i++, SourceStagingSrl, srcConfig, - b => { if (!b) UiSelectSource(routeKey); }); - SourceStagingSrl.AddItem(item); // add to the SRL - item.RegisterForSourceChange(_CurrentRoom); - } - SourceStagingSrl.Count = (ushort)(i - 1); - } // Name and logo TriList.StringInput[UIStringJoin.CurrentRoomName].StringValue = _CurrentRoom.Name; ShowLogo(); @@ -948,6 +929,8 @@ namespace PepperDash.Essentials CurrentRoom_SyncOnFeedback(); _CurrentRoom.IsWarmingUpFeedback.OutputChange += CurrentRoom_IsWarmingFeedback_OutputChange; _CurrentRoom.IsCoolingDownFeedback.OutputChange += CurrentRoom_IsCoolingDownFeedback_OutputChange; + _CurrentRoom.InCallFeedback.OutputChange -= CurrentRoom_InCallFeedback_OutputChange; + _CurrentRoom.CurrentVolumeDeviceChange += CurrentRoom_CurrentAudioDeviceChange; RefreshAudioDeviceConnections(); @@ -976,6 +959,60 @@ namespace PepperDash.Essentials } } + /// + /// + /// + /// + /// + void CurrentRoom_InCallFeedback_OutputChange(object sender, EventArgs e) + { + var inCall = CurrentRoom.InCallFeedback.BoolValue; + if (inCall) + { + // Check if transitioning to in call - and non-sharable source is in use + if (CurrentRoom.CurrentSourceInfo.DisableCodecSharing) + { + Debug.Console(1, CurrentRoom, "Transitioning to in-call, cancelling non-sharable source"); + CurrentRoom.RunRouteAction("none"); + } + } + + SetupSourceList(); + } + + /// + /// + /// + void SetupSourceList() + { + var inCall = CurrentRoom.VideoCodec.IsInCall; + var config = ConfigReader.ConfigObject.SourceLists; + if (config.ContainsKey(_CurrentRoom.SourceListKey)) + { + var srcList = config[_CurrentRoom.SourceListKey].OrderBy(kv => kv.Value.Order); + + // Setup sources list + uint i = 1; // counter for UI list + foreach (var kvp in srcList) + { + var srcConfig = kvp.Value; + // Skip sources marked as not included, and filter list of non-sharable sources when in call + // or on share screen + if (!srcConfig.IncludeInSourceList || (inCall && srcConfig.DisableCodecSharing) + || this.CurrentMode == UiDisplayMode.Call) + continue; + + var routeKey = kvp.Key; + var item = new SubpageReferenceListSourceItem(i++, SourceStagingSrl, srcConfig, + b => { if (!b) UiSelectSource(routeKey); }); + SourceStagingSrl.AddItem(item); // add to the SRL + item.RegisterForSourceChange(_CurrentRoom); + } + SourceStagingSrl.Count = (ushort)(i - 1); + } + + } + /// /// If the schedule changes, this event will fire /// diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index 1ba077bf..6a3e3eff 100644 Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ