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

@@ -50,6 +50,24 @@ namespace PepperDash.Essentials
//************************
public override string SourceListKey
{
get
{
return _SourceListKey;
}
set
{
_SourceListKey = value;
if(VideoCodec is IHasExternalSourceSwitching)
{
if((VideoCodec as IHasExternalSourceSwitching).ExternalSourceListEnabled)
{
SetCodecExternalSources();
}
}
}
}
protected override Func<bool> OnFeedbackFunc
{
@@ -206,9 +224,14 @@ namespace PepperDash.Essentials
VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
if (VideoCodec == null)
throw new ArgumentNullException("codec cannot be null");
//todo Do the thing here JTA
AudioCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.AudioCodecKey) as
PepperDash.Essentials.Devices.Common.AudioCodec.AudioCodecBase;
if (AudioCodec == null)
@@ -298,6 +321,7 @@ namespace PepperDash.Essentials
VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
VideoCodec.IsReadyChange += (o, a) => this.SetCodecExternalSources();
if (AudioCodec != null)
AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
@@ -346,11 +370,10 @@ namespace PepperDash.Essentials
this.SourceListKey = PropertiesConfig.SourceListKey;
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
return base.CustomActivate();
}
/// <summary>
///
/// </summary>
@@ -672,6 +695,30 @@ namespace PepperDash.Essentials
(room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
}
private void SetCodecExternalSources()
{
string codecTieLine = "";
codecTieLine = ConfigReader.ConfigObject.TieLines.SingleOrDefault(x => x.DestinationKey == VideoCodec.Key).DestinationPort;
(VideoCodec as IHasExternalSourceSwitching).ClearExternalSources();
(VideoCodec as IHasExternalSourceSwitching).RunRouteAction = RunRouteAction;
var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order);;
foreach (var kvp in srcList)
{
var srcConfig = kvp.Value;
Debug.Console(1, "**** KEY {0}", kvp.Key);
if (kvp.Key != "codecOsd" && kvp.Key != "roomOff")
{
(VideoCodec as IHasExternalSourceSwitching).AddExternalSource(codecTieLine, srcConfig.PreferredName);
}
}
}
#region IPrivacy Members