Update to support Cisco Codec External Sources using Essentials Room logic.

Adds new interface for Codecs IHasExternalSourceSwitching
Adds ability to set and clear External Sources in Cisco Spark device class
Adds ability to send sources from the source list to the Cisco Spark in the "EssentialsHuddleVtc1Room" room
[ ] still needs parsing when source is selected on the Cisco touch 10
This commit is contained in:
Jason Alborough
2020-08-14 15:51:37 -04:00
parent 22ff61d7f3
commit aea6942a1f
8 changed files with 533 additions and 388 deletions

View File

@@ -51,7 +51,19 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// The config name of the source list
/// </summary>
public string SourceListKey { get; set; }
///
protected string _SourceListKey;
public virtual string SourceListKey {
get
{
return _SourceListKey;
}
set
{
_SourceListKey = value;
}
}
/// <summary>
/// Timer used for informing the UIs of a shutdown

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public interface IHasExternalSourceSwitching
{
bool ExternalSourceListEnabled { get; }
void AddExternalSource(string connectorId, string name);
void ClearExternalSources();
Action<string, string> RunRouteAction { set;}
}
}

View File

@@ -112,6 +112,7 @@
<Compile Include="Codec\eCodecCallStatus.cs" />
<Compile Include="Codec\eMeetingPrivacy.cs" />
<Compile Include="Codec\iCodecAudio.cs" />
<Compile Include="Codec\IHasExternalSourceSwitching.cs" />
<Compile Include="ImageProcessors\TVOneCorio.cs" />
<Compile Include="ImageProcessors\TVOneCorioPropertiesConfig.cs" />
<Compile Include="Power Controllers\Digitallogger.cs" />

View File

@@ -15,16 +15,16 @@ using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
using PepperDash.Essentials.Devices.Common.Cameras;
using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common.VideoCodec;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
enum eCommandType { SessionStart, SessionEnd, Command, GetStatus, GetConfiguration };
public enum eExternalSourceType {camera, desktop, document_camera, mediaplayer, PC, whiteboard, other}
public class CiscoSparkCodec : VideoCodecBase, IHasCallHistory, IHasCallFavorites, IHasDirectory,
IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfView,
ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets
ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets, IHasExternalSourceSwitching
{
public event EventHandler<DirectoryEventArgs> DirectoryResultReturned;
@@ -348,6 +348,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
CallHistory = new CodecCallHistory();
if (props.Favorites != null)
{
CallFavorites = new CodecCallFavorites();
@@ -398,6 +399,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SetUpCameras();
CreateOsdSource();
if (props.ExternalSourceListEnabled != null)
{
ExternalSourceListEnabled = props.ExternalSourceListEnabled;
}
}
/// <summary>
@@ -472,7 +478,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
prefix + "/Bookings" + Delimiter +
prefix + "/Event/CallDisconnect" + Delimiter +
prefix + "/Event/Bookings" + Delimiter +
prefix + "/Event/CameraPresetListUpdated" + Delimiter;
prefix + "/Event/CameraPresetListUpdated" + Delimiter +
prefix + "/Event/UserInterface/Presentation/ExternalSource/Selected/SourceIdentifier" + Delimiter;
return base.CustomActivate();
}
@@ -629,6 +636,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
}
}
}
//TODO JTA FInish Parsing for External Sources
if (args.Text == "ExternalSource")
{
RunRouteAction("", "");
}
}
@@ -1802,9 +1814,57 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SendText(string.Format("xCommand Call FarEndControl RoomPreset Activate CallId: {0} PresetId: {1}", GetCallId(), preset));
}
}
/// <summary>
#region IHasExternalSourceSwitching Members
/// <summary>
///
/// </summary>
public bool ExternalSourceListEnabled
{
get;
private set;
}
public void AddExternalSource(string connectorId, string name)
{
int id = 2;
if (connectorId.ToLower() == "hdmiin3")
{
id = 3;
}
SendText(string.Format("xCommand UserInterface Presentation ExternalSource Add ConnectorId: {0} SourceIdentifier: \"{1}\" Name: \"{2}\" Type: desktop", id, name, name));
Debug.Console(2, this, "Adding ExternalSource {0} {1}", connectorId, name);
}
/// <summary>
///
/// </summary>
public void ClearExternalSources()
{
SendText("xCommand UserInterface Presentation ExternalSource RemoveAll");
}
public Action<string, string> RunRouteAction { private get; set; }
#endregion
#region ExternalDevices
#endregion
}
/// <summary>
/// Represents a codec command that might need to have a friendly label applied for UI feedback purposes
/// </summary>
public class CodecCommandWithLabel

View File

@@ -1,47 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using Newtonsoft.Json;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public class CiscoSparkCodecPropertiesConfig
{
[JsonProperty("communicationMonitorProperties")]
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
[JsonProperty("favorites")]
public List<CodecActiveCallItem> Favorites { get; set; }
/// <summary>
/// Valid values: "Local" or "Corporate"
/// </summary>
[JsonProperty("phonebookMode")]
public string PhonebookMode { get; set; }
[JsonProperty("showSelfViewByDefault")]
public bool ShowSelfViewByDefault { get; set; }
[JsonProperty("sharing")]
public SharingProperties Sharing { get; set; }
/// <summary>
/// Optionsal property to set the limit of any phonebook queries for directory or searching
/// </summary>
[JsonProperty("phonebookResultsLimit")]
public uint PhonebookResultsLimit { get; set; }
}
public class SharingProperties
{
[JsonProperty("autoShareContentWhileInCall")]
public bool AutoShareContentWhileInCall { get; set; }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using Newtonsoft.Json;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public class CiscoSparkCodecPropertiesConfig
{
[JsonProperty("communicationMonitorProperties")]
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
[JsonProperty("favorites")]
public List<CodecActiveCallItem> Favorites { get; set; }
/// <summary>
/// Valid values: "Local" or "Corporate"
/// </summary>
[JsonProperty("phonebookMode")]
public string PhonebookMode { get; set; }
[JsonProperty("showSelfViewByDefault")]
public bool ShowSelfViewByDefault { get; set; }
[JsonProperty("sharing")]
public SharingProperties Sharing { get; set; }
[JsonProperty("externalSourceListEnabled")]
public bool ExternalSourceListEnabled { get; set; }
/// <summary>
/// Optionsal property to set the limit of any phonebook queries for directory or searching
/// </summary>
[JsonProperty("phonebookResultsLimit")]
public uint PhonebookResultsLimit { get; set; }
}
public class SharingProperties
{
[JsonProperty("autoShareContentWhileInCall")]
public bool AutoShareContentWhileInCall { get; set; }
}
}