mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
Finalized IHasExternalSourceSwitching adding method for setting the ExternalSource State
Adds arguments for External Source type it the AddExternalSource() Adds subscription and parsing for External Source events
This commit is contained in:
@@ -695,6 +695,10 @@ namespace PepperDash.Essentials
|
|||||||
(room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
|
(room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Setup the external sources for the Cisco Touch 10 devices that support IHasExternalSourceSwitch
|
||||||
|
/// </summary>
|
||||||
private void SetCodecExternalSources()
|
private void SetCodecExternalSources()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -707,12 +711,13 @@ namespace PepperDash.Essentials
|
|||||||
foreach (var kvp in srcList)
|
foreach (var kvp in srcList)
|
||||||
{
|
{
|
||||||
var srcConfig = kvp.Value;
|
var srcConfig = kvp.Value;
|
||||||
Debug.Console(1, "**** KEY {0}", kvp.Key);
|
|
||||||
|
|
||||||
if (kvp.Key != "codecOsd" && kvp.Key != "roomOff")
|
if (kvp.Key != "codecOsd" && kvp.Key != "roomOff")
|
||||||
{
|
{
|
||||||
|
|
||||||
(VideoCodec as IHasExternalSourceSwitching).AddExternalSource(codecTieLine, srcConfig.PreferredName);
|
(VideoCodec as IHasExternalSourceSwitching).AddExternalSource(codecTieLine, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop);
|
||||||
|
(VideoCodec as IHasExternalSourceSwitching).SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,15 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common.Codec
|
namespace PepperDash.Essentials.Devices.Common.Codec
|
||||||
{
|
{
|
||||||
public interface IHasExternalSourceSwitching
|
public interface IHasExternalSourceSwitching
|
||||||
{
|
{
|
||||||
bool ExternalSourceListEnabled { get; }
|
bool ExternalSourceListEnabled { get; }
|
||||||
void AddExternalSource(string connectorId, string name);
|
void AddExternalSource(string connectorId, string key, string name, eExternalSourceType type);
|
||||||
|
void SetExternalSourceState(string key, eExternalSourceMode mode);
|
||||||
void ClearExternalSources();
|
void ClearExternalSources();
|
||||||
Action<string, string> RunRouteAction { set;}
|
Action<string, string> RunRouteAction { set;}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
{
|
{
|
||||||
enum eCommandType { SessionStart, SessionEnd, Command, GetStatus, GetConfiguration };
|
enum eCommandType { SessionStart, SessionEnd, Command, GetStatus, GetConfiguration };
|
||||||
public enum eExternalSourceType {camera, desktop, document_camera, mediaplayer, PC, whiteboard, other}
|
public enum eExternalSourceType {camera, desktop, document_camera, mediaplayer, PC, whiteboard, other}
|
||||||
|
public enum eExternalSourceMode {Ready, NotReady, Hiddon, Error}
|
||||||
|
|
||||||
public class CiscoSparkCodec : VideoCodecBase, IHasCallHistory, IHasCallFavorites, IHasDirectory,
|
public class CiscoSparkCodec : VideoCodecBase, IHasCallHistory, IHasCallFavorites, IHasDirectory,
|
||||||
IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfView,
|
IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfView,
|
||||||
@@ -636,11 +637,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO JTA FInish Parsing for External Sources
|
|
||||||
if (args.Text == "ExternalSource")
|
|
||||||
{
|
|
||||||
RunRouteAction("", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -865,6 +862,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
{
|
{
|
||||||
GetBookings(null);
|
GetBookings(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (response.IndexOf("\"UserInterface\":{") > -1 || response.IndexOf("\"UserInterface\": {") > -1) // External Source Trigger
|
||||||
|
{
|
||||||
|
CiscoCodecEvents.RootObject eventReceived = new CiscoCodecEvents.RootObject();
|
||||||
|
JsonConvert.PopulateObject(response, eventReceived);
|
||||||
|
Debug.Console(2, this, "*** Got an External Source Selection {0} {1}", eventReceived, eventReceived.Event.UserInterface, eventReceived.Event.UserInterface.Presentation.ExternalSource.Selected.SourceIdentifier.Value);
|
||||||
|
RunRouteAction(eventReceived.Event.UserInterface.Presentation.ExternalSource.Selected.SourceIdentifier.Value, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (response.IndexOf("\"CommandResponse\":{") > -1 || response.IndexOf("\"CommandResponse\": {") > -1)
|
else if (response.IndexOf("\"CommandResponse\":{") > -1 || response.IndexOf("\"CommandResponse\": {") > -1)
|
||||||
{
|
{
|
||||||
@@ -1818,7 +1823,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
#region IHasExternalSourceSwitching Members
|
#region IHasExternalSourceSwitching Members
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// Weather the Cisco supports External Source Lists or not
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ExternalSourceListEnabled
|
public bool ExternalSourceListEnabled
|
||||||
{
|
{
|
||||||
@@ -1826,20 +1831,37 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddExternalSource(string connectorId, string name)
|
/// <summary>
|
||||||
|
/// Adds an external source to the Cisco
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="connectorId"></param>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
public void AddExternalSource(string connectorId, string key, string name, eExternalSourceType type)
|
||||||
{
|
{
|
||||||
int id = 2;
|
int id = 2;
|
||||||
if (connectorId.ToLower() == "hdmiin3")
|
if (connectorId.ToLower() == "hdmiin3")
|
||||||
{
|
{
|
||||||
id = 3;
|
id = 3;
|
||||||
}
|
}
|
||||||
SendText(string.Format("xCommand UserInterface Presentation ExternalSource Add ConnectorId: {0} SourceIdentifier: \"{1}\" Name: \"{2}\" Type: desktop", id, name, name));
|
SendText(string.Format("xCommand UserInterface Presentation ExternalSource Add ConnectorId: {0} SourceIdentifier: \"{1}\" Name: \"{2}\" Type: {3}", id, key, name, type.ToString()));
|
||||||
|
// SendText(string.Format("xCommand UserInterface Presentation ExternalSource State Set SourceIdentifier: \"{0}\" State: Ready", key));
|
||||||
Debug.Console(2, this, "Adding ExternalSource {0} {1}", connectorId, name);
|
Debug.Console(2, this, "Adding ExternalSource {0} {1}", connectorId, name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// Sets the state of the External Source
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="mode"></param>
|
||||||
|
public void SetExternalSourceState(string key, eExternalSourceMode mode)
|
||||||
|
{
|
||||||
|
SendText(string.Format("xCommand UserInterface Presentation ExternalSource State Set SourceIdentifier: \"{0}\" State: {1}", key, mode.ToString()));
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Clears all external sources on the codec
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ClearExternalSources()
|
public void ClearExternalSources()
|
||||||
{
|
{
|
||||||
@@ -1847,7 +1869,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Action that will run when the External Source is selected.
|
||||||
|
/// </summary>
|
||||||
public Action<string, string> RunRouteAction { private get; set; }
|
public Action<string, string> RunRouteAction { private get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -127,10 +127,35 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
|||||||
public RequestedURI RequestedURI { get; set; }
|
public RequestedURI RequestedURI { get; set; }
|
||||||
public PeopleCountAverage PeopleCountAverage { get; set; }
|
public PeopleCountAverage PeopleCountAverage { get; set; }
|
||||||
}
|
}
|
||||||
|
public class UserInterface
|
||||||
|
{
|
||||||
|
public string id { get; set; }
|
||||||
|
public Presentation Presentation { get; set; }
|
||||||
|
}
|
||||||
|
public class Presentation
|
||||||
|
{
|
||||||
|
public string id { get; set; }
|
||||||
|
public ExternalSource ExternalSource { get; set; }
|
||||||
|
}
|
||||||
|
public class ExternalSource
|
||||||
|
{
|
||||||
|
public string id { get; set; }
|
||||||
|
public Selected Selected { get; set; }
|
||||||
|
}
|
||||||
|
public class Selected
|
||||||
|
{
|
||||||
|
public string id { get; set; }
|
||||||
|
public SourceIdentifier SourceIdentifier { get; set; }
|
||||||
|
}
|
||||||
|
public class SourceIdentifier
|
||||||
|
{
|
||||||
|
public string id { get; set; }
|
||||||
|
public string Value { get; set; }
|
||||||
|
}
|
||||||
public class Event
|
public class Event
|
||||||
{
|
{
|
||||||
public CallDisconnect CallDisconnect { get; set; }
|
public CallDisconnect CallDisconnect { get; set; }
|
||||||
|
public UserInterface UserInterface { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RootObject
|
public class RootObject
|
||||||
|
|||||||
Reference in New Issue
Block a user