mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-17 05:35:03 +00:00
Added in source list filtering based on in-call and current mode of UI driver (call or present)
This commit is contained in:
@@ -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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -68,6 +68,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
public string VolumeControlKey { get; set; }
|
public string VolumeControlKey { get; set; }
|
||||||
public eSourceListItemType Type { get; set; }
|
public eSourceListItemType Type { get; set; }
|
||||||
public List<SourceRouteListItem> RouteList { get; set; }
|
public List<SourceRouteListItem> RouteList { get; set; }
|
||||||
|
public bool DisableCodecSharing { get; set; }
|
||||||
|
public bool DisableRoutedSharing { get; set; }
|
||||||
|
|
||||||
public SourceListItem()
|
public SourceListItem()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -103,6 +103,7 @@
|
|||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Config\SourceDevicePropertiesConfigBase.cs" />
|
||||||
<Compile Include="Crestron IO\Inputs\GenericDigitalInputDevice.cs" />
|
<Compile Include="Crestron IO\Inputs\GenericDigitalInputDevice.cs" />
|
||||||
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
|
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
|
||||||
<Compile Include="Crestron IO\Inputs\IDigitalInput.cs" />
|
<Compile Include="Crestron IO\Inputs\IDigitalInput.cs" />
|
||||||
|
|||||||
@@ -35,10 +35,10 @@ namespace PepperDash.Essentials.DM.Chassis
|
|||||||
|
|
||||||
// logical ports
|
// logical ports
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
for (int i = 1; i <= 4; i++)
|
for (uint i = 1; i <= 4; i++)
|
||||||
{
|
{
|
||||||
InputPorts.Add(new RoutingInputPort("hdmiIn" + i, eRoutingSignalType.AudioVideo,
|
InputPorts.Add(new RoutingInputPort("hdmiIn" + i, eRoutingSignalType.AudioVideo,
|
||||||
eRoutingPortConnectionType.Hdmi, 1, this, false));
|
eRoutingPortConnectionType.Hdmi, i, this));
|
||||||
}
|
}
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||||
OutputPorts.Add(new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
|
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)
|
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
|
||||||
{
|
{
|
||||||
Chassis.HdmiOutputs[1].VideoOut = Chassis.HdmiInputs[(uint)inputSelector];
|
Chassis.HdmiOutputs[1].VideoOut = Chassis.HdmiInputs[(uint)inputSelector];
|
||||||
Chassis.VideoEnter.Pulse();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ using PepperDash.Essentials.Devices.Common.Occupancy;
|
|||||||
|
|
||||||
using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
public class DeviceFactory
|
public class DeviceFactory
|
||||||
@@ -28,6 +29,8 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
var name = dc.Name;
|
var name = dc.Name;
|
||||||
var type = dc.Type;
|
var type = dc.Type;
|
||||||
var properties = dc.Properties;
|
var properties = dc.Properties;
|
||||||
|
var propAnon = new {};
|
||||||
|
JsonConvert.DeserializeAnonymousType(dc.Properties.ToString(), propAnon);
|
||||||
|
|
||||||
var typeName = dc.Type.ToLower();
|
var typeName = dc.Type.ToLower();
|
||||||
var groupName = dc.Group.ToLower();
|
var groupName = dc.Group.ToLower();
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using PepperDash.Core;
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
public class SetTopBoxPropertiesConfig
|
public class SetTopBoxPropertiesConfig : PepperDash.Essentials.Core.Config.SourceDevicePropertiesConfigBase
|
||||||
{
|
{
|
||||||
public bool HasPresets { get; set; }
|
public bool HasPresets { get; set; }
|
||||||
public bool HasDvr { get; set; }
|
public bool HasDvr { get; set; }
|
||||||
|
|||||||
@@ -318,8 +318,6 @@ namespace PepperDash.Essentials
|
|||||||
(CurrentRoom.DefaultDisplay as IPower).PowerToggle();
|
(CurrentRoom.DefaultDisplay as IPower).PowerToggle();
|
||||||
});
|
});
|
||||||
|
|
||||||
//TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusButtonPress, ShowActiveCallsList );
|
|
||||||
|
|
||||||
SetupNextMeetingTimer();
|
SetupNextMeetingTimer();
|
||||||
|
|
||||||
base.Show();
|
base.Show();
|
||||||
@@ -906,6 +904,7 @@ namespace PepperDash.Essentials
|
|||||||
_CurrentRoom.OnFeedback.OutputChange += CurrentRoom_OnFeedback_OutputChange;
|
_CurrentRoom.OnFeedback.OutputChange += CurrentRoom_OnFeedback_OutputChange;
|
||||||
_CurrentRoom.IsWarmingUpFeedback.OutputChange -= CurrentRoom_IsWarmingFeedback_OutputChange;
|
_CurrentRoom.IsWarmingUpFeedback.OutputChange -= CurrentRoom_IsWarmingFeedback_OutputChange;
|
||||||
_CurrentRoom.IsCoolingDownFeedback.OutputChange -= CurrentRoom_IsCoolingDownFeedback_OutputChange;
|
_CurrentRoom.IsCoolingDownFeedback.OutputChange -= CurrentRoom_IsCoolingDownFeedback_OutputChange;
|
||||||
|
_CurrentRoom.InCallFeedback.OutputChange -= CurrentRoom_InCallFeedback_OutputChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
_CurrentRoom = room;
|
_CurrentRoom = room;
|
||||||
@@ -913,27 +912,9 @@ namespace PepperDash.Essentials
|
|||||||
if (_CurrentRoom != null)
|
if (_CurrentRoom != null)
|
||||||
{
|
{
|
||||||
// get the source list config and set up the source list
|
// 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
|
SetupSourceList();
|
||||||
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;
|
|
||||||
|
|
||||||
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
|
// Name and logo
|
||||||
TriList.StringInput[UIStringJoin.CurrentRoomName].StringValue = _CurrentRoom.Name;
|
TriList.StringInput[UIStringJoin.CurrentRoomName].StringValue = _CurrentRoom.Name;
|
||||||
ShowLogo();
|
ShowLogo();
|
||||||
@@ -948,6 +929,8 @@ namespace PepperDash.Essentials
|
|||||||
CurrentRoom_SyncOnFeedback();
|
CurrentRoom_SyncOnFeedback();
|
||||||
_CurrentRoom.IsWarmingUpFeedback.OutputChange += CurrentRoom_IsWarmingFeedback_OutputChange;
|
_CurrentRoom.IsWarmingUpFeedback.OutputChange += CurrentRoom_IsWarmingFeedback_OutputChange;
|
||||||
_CurrentRoom.IsCoolingDownFeedback.OutputChange += CurrentRoom_IsCoolingDownFeedback_OutputChange;
|
_CurrentRoom.IsCoolingDownFeedback.OutputChange += CurrentRoom_IsCoolingDownFeedback_OutputChange;
|
||||||
|
_CurrentRoom.InCallFeedback.OutputChange -= CurrentRoom_InCallFeedback_OutputChange;
|
||||||
|
|
||||||
|
|
||||||
_CurrentRoom.CurrentVolumeDeviceChange += CurrentRoom_CurrentAudioDeviceChange;
|
_CurrentRoom.CurrentVolumeDeviceChange += CurrentRoom_CurrentAudioDeviceChange;
|
||||||
RefreshAudioDeviceConnections();
|
RefreshAudioDeviceConnections();
|
||||||
@@ -976,6 +959,60 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If the schedule changes, this event will fire
|
/// If the schedule changes, this event will fire
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user