diff --git a/PepperDash.Essentials.sln b/PepperDash.Essentials.sln
index 40da3b9b..e2db852a 100644
--- a/PepperDash.Essentials.sln
+++ b/PepperDash.Essentials.sln
@@ -11,18 +11,25 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PepperDash.Essentials.Core"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug 4.7.2|Any CPU = Debug 4.7.2|Any CPU
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {53E204B7-97DD-441D-A96C-721DF014DF82}.Debug 4.7.2|Any CPU.ActiveCfg = Debug 4.7.2|Any CPU
+ {53E204B7-97DD-441D-A96C-721DF014DF82}.Debug 4.7.2|Any CPU.Build.0 = Debug 4.7.2|Any CPU
{53E204B7-97DD-441D-A96C-721DF014DF82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{53E204B7-97DD-441D-A96C-721DF014DF82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53E204B7-97DD-441D-A96C-721DF014DF82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53E204B7-97DD-441D-A96C-721DF014DF82}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CB3B11BA-625C-4D35-B663-FDC5BE9A230E}.Debug 4.7.2|Any CPU.ActiveCfg = Debug 4.7.2|Any CPU
+ {CB3B11BA-625C-4D35-B663-FDC5BE9A230E}.Debug 4.7.2|Any CPU.Build.0 = Debug 4.7.2|Any CPU
{CB3B11BA-625C-4D35-B663-FDC5BE9A230E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB3B11BA-625C-4D35-B663-FDC5BE9A230E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB3B11BA-625C-4D35-B663-FDC5BE9A230E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB3B11BA-625C-4D35-B663-FDC5BE9A230E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3D192FED-8FFC-4CB5-B5F7-BA307ABA254B}.Debug 4.7.2|Any CPU.ActiveCfg = Debug 4.7.2|Any CPU
+ {3D192FED-8FFC-4CB5-B5F7-BA307ABA254B}.Debug 4.7.2|Any CPU.Build.0 = Debug 4.7.2|Any CPU
{3D192FED-8FFC-4CB5-B5F7-BA307ABA254B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3D192FED-8FFC-4CB5-B5F7-BA307ABA254B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D192FED-8FFC-4CB5-B5F7-BA307ABA254B}.Release|Any CPU.ActiveCfg = Release|Any CPU
diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets
index 807679e4..6c49ddc7 100644
--- a/src/Directory.Build.targets
+++ b/src/Directory.Build.targets
@@ -1,28 +1,33 @@
-
+
true
content;
-
+
true
content;
-
+
-
+
-
+
-
+
-
-
-
+
+
+
+
+
+
+
+
-
+
diff --git a/src/PepperDash.Essentials.Core/Comm and IR/GenericHttpClient.cs b/src/PepperDash.Essentials.Core/Comm and IR/GenericHttpClient.cs
index 31342a94..fa6c298a 100644
--- a/src/PepperDash.Essentials.Core/Comm and IR/GenericHttpClient.cs
+++ b/src/PepperDash.Essentials.Core/Comm and IR/GenericHttpClient.cs
@@ -9,6 +9,7 @@ using PepperDash.Core.DebugThings;
namespace PepperDash.Essentials.Core
{
+ [Obsolete("Please use the builtin HttpClient class instead: https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/http/httpclient-guidelines")]
public class GenericHttpClient : Device, IBasicCommunication
{
public HttpClient Client;
diff --git a/src/PepperDash.Essentials.Core/Crestron/CrestronGenericBaseDevice.cs b/src/PepperDash.Essentials.Core/Crestron/CrestronGenericBaseDevice.cs
index d9650e63..9d8ebe3d 100644
--- a/src/PepperDash.Essentials.Core/Crestron/CrestronGenericBaseDevice.cs
+++ b/src/PepperDash.Essentials.Core/Crestron/CrestronGenericBaseDevice.cs
@@ -8,9 +8,6 @@ using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Core
{
- ///
- /// A bridge class to cover the basic features of GenericBase hardware
- ///
public abstract class CrestronGenericBaseDevice : EssentialsDevice, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
{
protected GenericBase Hardware;
diff --git a/src/PepperDash.Essentials.Core/Devices/PC/InRoomPc.cs b/src/PepperDash.Essentials.Core/Devices/PC/InRoomPc.cs
index 03e884f0..12b3f0c8 100644
--- a/src/PepperDash.Essentials.Core/Devices/PC/InRoomPc.cs
+++ b/src/PepperDash.Essentials.Core/Devices/PC/InRoomPc.cs
@@ -10,9 +10,7 @@ using PepperDash.Core;
namespace PepperDash.Essentials.Core.Devices
{
- ///
- /// This DVD class should cover most IR, one-way DVD and Bluray fuctions
- ///
+ [Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")]
public class InRoomPc : EssentialsDevice, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
{
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
@@ -65,6 +63,7 @@ namespace PepperDash.Essentials.Core.Devices
#endregion
}
+ [Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")]
public class InRoomPcFactory : EssentialsDeviceFactory
{
public InRoomPcFactory()
diff --git a/src/PepperDash.Essentials.Core/Devices/PC/Laptop.cs b/src/PepperDash.Essentials.Core/Devices/PC/Laptop.cs
index a2864d77..28069c76 100644
--- a/src/PepperDash.Essentials.Core/Devices/PC/Laptop.cs
+++ b/src/PepperDash.Essentials.Core/Devices/PC/Laptop.cs
@@ -10,10 +10,9 @@ using PepperDash.Core;
namespace PepperDash.Essentials.Core.Devices
{
- ///
- /// This DVD class should cover most IR, one-way DVD and Bluray fuctions
- ///
- public class Laptop : EssentialsDevice, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
+
+ [Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")]
+ public class Laptop : EssentialsDevice, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
{
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
public string IconName { get; set; }
@@ -65,6 +64,7 @@ namespace PepperDash.Essentials.Core.Devices
#endregion
}
+ [Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")]
public class LaptopFactory : EssentialsDeviceFactory
{
public LaptopFactory()
diff --git a/src/PepperDash.Essentials.Core/Display/BasicIrDisplay.cs b/src/PepperDash.Essentials.Core/Display/BasicIrDisplay.cs
index 00124ae7..121a1874 100644
--- a/src/PepperDash.Essentials.Core/Display/BasicIrDisplay.cs
+++ b/src/PepperDash.Essentials.Core/Display/BasicIrDisplay.cs
@@ -14,7 +14,7 @@ using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials.Core
{
- [Description("Wrapper class for a Basic IR Display")]
+ [Obsolete("Please use PepperDash.Essentials.Device.Common, this will be removed in 2.1")]
public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IBridgeAdvanced
{
public IrOutputPortController IrPort { get; private set; }
@@ -203,6 +203,7 @@ namespace PepperDash.Essentials.Core
}
}
+ [Obsolete("Please use PepperDash.Essentials.Device.Common, this will be removed in 2.1")]
public class BasicIrDisplayFactory : EssentialsDeviceFactory
{
public BasicIrDisplayFactory()
diff --git a/src/PepperDash.Essentials.Core/Display/DisplayBase.cs b/src/PepperDash.Essentials.Core/Display/DisplayBase.cs
index 6101d232..aa94f4f4 100644
--- a/src/PepperDash.Essentials.Core/Display/DisplayBase.cs
+++ b/src/PepperDash.Essentials.Core/Display/DisplayBase.cs
@@ -3,13 +3,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
-using Crestron.SimplSharpPro.DM;
-using Crestron.SimplSharpPro.DM.Endpoints;
-using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
using Full.Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
@@ -17,9 +12,7 @@ using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Core
{
- ///
- ///
- ///
+ [Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")]
public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IHasPowerControl, IWarmingCooling, IUsageTracking
{
public event SourceInfoChangeHandler CurrentSourceChange;
@@ -257,9 +250,7 @@ namespace PepperDash.Essentials.Core
}
- ///
- ///
- ///
+ [Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")]
public abstract class TwoWayDisplayBase : DisplayBase, IRoutingFeedback, IHasPowerControlWithFeedback
{
public StringFeedback CurrentInputFeedback { get; private set; }
diff --git a/src/PepperDash.Essentials.Core/Display/MockDisplay.cs b/src/PepperDash.Essentials.Core/Display/MockDisplay.cs
index d7f36f13..db568519 100644
--- a/src/PepperDash.Essentials.Core/Display/MockDisplay.cs
+++ b/src/PepperDash.Essentials.Core/Display/MockDisplay.cs
@@ -16,10 +16,8 @@ using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
- ///
- ///
- ///
- public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced
+ [Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")]
+ public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced
{
public RoutingInputPort HdmiIn1 { get; private set; }
@@ -220,6 +218,8 @@ namespace PepperDash.Essentials.Core
}
}
+
+ [Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")]
public class MockDisplayFactory : EssentialsDeviceFactory
{
public MockDisplayFactory()
diff --git a/src/PepperDash.Essentials.Core/Lighting/LightingBase.cs b/src/PepperDash.Essentials.Core/Lighting/LightingBase.cs
index 5bb677a2..38a74d37 100644
--- a/src/PepperDash.Essentials.Core/Lighting/LightingBase.cs
+++ b/src/PepperDash.Essentials.Core/Lighting/LightingBase.cs
@@ -13,6 +13,7 @@ using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Core.Lighting
{
+ [Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")]
public abstract class LightingBase : EssentialsBridgeableDevice, ILightingScenes
{
#region ILightingScenes Members
diff --git a/src/PepperDash.Essentials.Core/PepperDash.Essentials.Core.csproj b/src/PepperDash.Essentials.Core/PepperDash.Essentials.Core.csproj
index 8ea0cf86..a5360467 100644
--- a/src/PepperDash.Essentials.Core/PepperDash.Essentials.Core.csproj
+++ b/src/PepperDash.Essentials.Core/PepperDash.Essentials.Core.csproj
@@ -1,9 +1,11 @@
ProgramLibrary
+ Debug;Release;Debug 4.7.2
- net472
+ net472;net6
+ true
bin\$(Configuration)\
PepperDash.Essentials.Core
PepperDash.Essentials.Core
@@ -13,6 +15,9 @@
full
+
+ full
+
pdbonly
@@ -22,16 +27,11 @@
-
-
-
-
-
-
+
Full
-
+
diff --git a/src/PepperDash.Essentials.Core/Shades/Shade Interfaces.cs b/src/PepperDash.Essentials.Core/Shades/Shade Interfaces.cs
index 94a88c36..93fcbc52 100644
--- a/src/PepperDash.Essentials.Core/Shades/Shade Interfaces.cs
+++ b/src/PepperDash.Essentials.Core/Shades/Shade Interfaces.cs
@@ -8,7 +8,7 @@ namespace PepperDash.Essentials.Core.Shades
///
public interface IShades
{
- List Shades { get; }
+ List Shades { get; }
}
///
diff --git a/src/PepperDash.Essentials.Core/Shades/ShadeBase.cs b/src/PepperDash.Essentials.Core/Shades/ShadeBase.cs
index 2b92480e..c44abac6 100644
--- a/src/PepperDash.Essentials.Core/Shades/ShadeBase.cs
+++ b/src/PepperDash.Essentials.Core/Shades/ShadeBase.cs
@@ -9,9 +9,8 @@ using PepperDash.Essentials.Core.CrestronIO;
namespace PepperDash.Essentials.Core.Shades
{
- ///
- /// Base class for a shade device
- ///
+
+ [Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")]
public abstract class ShadeBase : EssentialsDevice, IShadesOpenCloseStop
{
public ShadeBase(string key, string name)
diff --git a/src/PepperDash.Essentials.Devices.Common/Codec/iHasCallHistory.cs b/src/PepperDash.Essentials.Devices.Common/Codec/iHasCallHistory.cs
index b0451d7b..07e53b3d 100644
--- a/src/PepperDash.Essentials.Devices.Common/Codec/iHasCallHistory.cs
+++ b/src/PepperDash.Essentials.Devices.Common/Codec/iHasCallHistory.cs
@@ -2,12 +2,6 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Essentials.Devices.Common.VideoCodec;
using Full.Newtonsoft.Json;
diff --git a/src/PepperDash.Essentials.Devices.Common/Factory/DeviceFactory.cs b/src/PepperDash.Essentials.Devices.Common/DeviceFactory.cs
similarity index 69%
rename from src/PepperDash.Essentials.Devices.Common/Factory/DeviceFactory.cs
rename to src/PepperDash.Essentials.Devices.Common/DeviceFactory.cs
index c5ab29b1..b5ee9a89 100644
--- a/src/PepperDash.Essentials.Devices.Common/Factory/DeviceFactory.cs
+++ b/src/PepperDash.Essentials.Devices.Common/DeviceFactory.cs
@@ -2,24 +2,9 @@
using System;
using System.Linq;
-using System.Collections.Generic;
-using Crestron.SimplSharp;
-using Crestron.SimplSharp.CrestronIO;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.GeneralIO;
using Crestron.SimplSharp.Reflection;
-
-using Full.Newtonsoft.Json;
-using Full.Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Core.CrestronIO;
-
-using PepperDash.Essentials.Devices.Common;
-using PepperDash.Essentials.Devices.Common.DSP;
-using PepperDash.Essentials.Devices.Common.VideoCodec;
-using PepperDash.Essentials.Devices.Common.Environment;
namespace PepperDash.Essentials.Devices.Common
{
diff --git a/src/PepperDash.Essentials.Devices.Common/Displays/BasicIrDisplay.cs b/src/PepperDash.Essentials.Devices.Common/Displays/BasicIrDisplay.cs
new file mode 100644
index 00000000..59e67278
--- /dev/null
+++ b/src/PepperDash.Essentials.Devices.Common/Displays/BasicIrDisplay.cs
@@ -0,0 +1,224 @@
+using System;
+using System.Collections.Generic;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.DeviceSupport;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Routing;
+
+namespace PepperDash.Essentials.Devices.Common.Displays
+{
+ public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IBridgeAdvanced
+ {
+ public IrOutputPortController IrPort { get; private set; }
+ public ushort IrPulseTime { get; set; }
+
+ protected Func PowerIsOnFeedbackFunc
+ {
+ get { return () => _PowerIsOn; }
+ }
+ protected override Func IsCoolingDownFeedbackFunc
+ {
+ get { return () => _IsCoolingDown; }
+ }
+ protected override Func IsWarmingUpFeedbackFunc
+ {
+ get { return () => _IsWarmingUp; }
+ }
+
+ bool _PowerIsOn;
+ bool _IsWarmingUp;
+ bool _IsCoolingDown;
+
+ public BasicIrDisplay(string key, string name, IROutputPort port, string irDriverFilepath)
+ : base(key, name)
+ {
+ IrPort = new IrOutputPortController(key + "-ir", port, irDriverFilepath);
+ DeviceManager.AddDevice(IrPort);
+
+ IsWarmingUpFeedback.OutputChange += (o, a) => Debug.Console(2, this, "Warming up={0}", _IsWarmingUp);
+ IsCoolingDownFeedback.OutputChange += (o, a) => Debug.Console(2, this, "Cooling down={0}", _IsCoolingDown);
+
+ InputPorts.AddRange(new RoutingPortCollection
+ {
+ new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, new Action(Hdmi1), this, false),
+ new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, new Action(Hdmi2), this, false),
+ new RoutingInputPort(RoutingPortNames.HdmiIn3, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, new Action(Hdmi3), this, false),
+ new RoutingInputPort(RoutingPortNames.HdmiIn4, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, new Action(Hdmi4), this, false),
+ new RoutingInputPort(RoutingPortNames.ComponentIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, new Action(Component1), this, false),
+ new RoutingInputPort(RoutingPortNames.CompositeIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, new Action(Video1), this, false),
+ new RoutingInputPort(RoutingPortNames.AntennaIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, new Action(Antenna), this, false),
+ });
+ }
+
+ public void Hdmi1()
+ {
+ IrPort.Pulse(IROutputStandardCommands.IROut_HDMI_1, IrPulseTime);
+ }
+
+ public void Hdmi2()
+ {
+ IrPort.Pulse(IROutputStandardCommands.IROut_HDMI_2, IrPulseTime);
+ }
+
+ public void Hdmi3()
+ {
+ IrPort.Pulse(IROutputStandardCommands.IROut_HDMI_3, IrPulseTime);
+ }
+
+ public void Hdmi4()
+ {
+ IrPort.Pulse(IROutputStandardCommands.IROut_HDMI_4, IrPulseTime);
+ }
+
+ public void Component1()
+ {
+ IrPort.Pulse(IROutputStandardCommands.IROut_COMPONENT_1, IrPulseTime);
+ }
+
+ public void Video1()
+ {
+ IrPort.Pulse(IROutputStandardCommands.IROut_VIDEO_1, IrPulseTime);
+ }
+
+ public void Antenna()
+ {
+ IrPort.Pulse(IROutputStandardCommands.IROut_ANTENNA, IrPulseTime);
+ }
+
+ #region IPower Members
+
+ public override void PowerOn()
+ {
+ IrPort.Pulse(IROutputStandardCommands.IROut_POWER_ON, IrPulseTime);
+ _PowerIsOn = true;
+ }
+
+ public override void PowerOff()
+ {
+ _PowerIsOn = false;
+ IrPort.Pulse(IROutputStandardCommands.IROut_POWER_OFF, IrPulseTime);
+ }
+
+ public override void PowerToggle()
+ {
+ _PowerIsOn = false;
+ IrPort.Pulse(IROutputStandardCommands.IROut_POWER, IrPulseTime);
+ }
+
+ #endregion
+
+ #region IBasicVolumeControls Members
+
+ public void VolumeUp(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_VOL_PLUS, pressRelease);
+ }
+
+ public void VolumeDown(bool pressRelease)
+ {
+ IrPort.PressRelease(IROutputStandardCommands.IROut_VOL_MINUS, pressRelease);
+ }
+
+ public void MuteToggle()
+ {
+ IrPort.Pulse(IROutputStandardCommands.IROut_MUTE, 200);
+ }
+
+ #endregion
+
+ void StartWarmingTimer()
+ {
+ _IsWarmingUp = true;
+ IsWarmingUpFeedback.FireUpdate();
+ new CTimer(o => {
+ _IsWarmingUp = false;
+ IsWarmingUpFeedback.FireUpdate();
+ }, 10000);
+ }
+
+ void StartCoolingTimer()
+ {
+ _IsCoolingDown = true;
+ IsCoolingDownFeedback.FireUpdate();
+ new CTimer(o =>
+ {
+ _IsCoolingDown = false;
+ IsCoolingDownFeedback.FireUpdate();
+ }, 7000);
+ }
+
+ #region IRoutingSink Members
+
+ ///
+ /// Typically called by the discovery routing algorithm.
+ ///
+ /// A delegate containing the input selector method to call
+ public override void ExecuteSwitch(object inputSelector)
+ {
+ Debug.Console(2, this, "Switching to input '{0}'", (inputSelector as Action).ToString());
+
+ Action finishSwitch = () =>
+ {
+ var action = inputSelector as Action;
+ if (action != null)
+ action();
+ };
+
+ if (!_PowerIsOn)
+ {
+ PowerOn();
+ EventHandler oneTimer = null;
+ oneTimer = (o, a) =>
+ {
+ if (IsWarmingUpFeedback.BoolValue) return; // Only catch done warming
+ IsWarmingUpFeedback.OutputChange -= oneTimer;
+ finishSwitch();
+ };
+ IsWarmingUpFeedback.OutputChange += oneTimer;
+ }
+ else // Do it!
+ finishSwitch();
+ }
+
+ #endregion
+
+ public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
+ }
+ }
+
+ public class BasicIrDisplayFactory : EssentialsDeviceFactory
+ {
+ public BasicIrDisplayFactory()
+ {
+ TypeNames = new List() { "basicirdisplay" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new BasicIrDisplay Device");
+ var ir = IRPortHelper.GetIrPort(dc.Properties);
+ if (ir != null)
+ {
+ var display = new BasicIrDisplay(dc.Key, dc.Name, ir.Port, ir.FileName);
+ display.IrPulseTime = 200; // Set default pulse time for IR commands.
+ return display;
+ }
+
+ return null;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/Displays/DisplayBase.cs b/src/PepperDash.Essentials.Devices.Common/Displays/DisplayBase.cs
new file mode 100644
index 00000000..d93d57ff
--- /dev/null
+++ b/src/PepperDash.Essentials.Devices.Common/Displays/DisplayBase.cs
@@ -0,0 +1,315 @@
+extern alias Full;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DeviceSupport;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using Feedback = PepperDash.Essentials.Core.Feedback;
+using JsonConvert = Full::Newtonsoft.Json.JsonConvert;
+
+
+namespace PepperDash.Essentials.Devices.Common.Displays
+{
+ public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IHasPowerControl, IWarmingCooling, IUsageTracking
+ {
+ public event SourceInfoChangeHandler CurrentSourceChange;
+
+ public string CurrentSourceInfoKey { get; set; }
+ public SourceListItem CurrentSourceInfo
+ {
+ get
+ {
+ return _CurrentSourceInfo;
+ }
+ set
+ {
+ if (value == _CurrentSourceInfo) return;
+
+ var handler = CurrentSourceChange;
+
+ if (handler != null)
+ handler(_CurrentSourceInfo, ChangeType.WillChange);
+
+ _CurrentSourceInfo = value;
+
+ if (handler != null)
+ handler(_CurrentSourceInfo, ChangeType.DidChange);
+ }
+ }
+ SourceListItem _CurrentSourceInfo;
+
+ public BoolFeedback IsCoolingDownFeedback { get; protected set; }
+ public BoolFeedback IsWarmingUpFeedback { get; private set; }
+
+ public UsageTracking UsageTracker { get; set; }
+
+ public uint WarmupTime { get; set; }
+ public uint CooldownTime { get; set; }
+
+ ///
+ /// Bool Func that will provide a value for the PowerIsOn Output. Must be implemented
+ /// by concrete sub-classes
+ ///
+ abstract protected Func IsCoolingDownFeedbackFunc { get; }
+ abstract protected Func IsWarmingUpFeedbackFunc { get; }
+
+
+ protected CTimer WarmupTimer;
+ protected CTimer CooldownTimer;
+
+ #region IRoutingInputs Members
+
+ public RoutingPortCollection InputPorts { get; private set; }
+
+ #endregion
+
+ protected DisplayBase(string key, string name)
+ : base(key, name)
+ {
+ IsCoolingDownFeedback = new BoolFeedback("IsCoolingDown", IsCoolingDownFeedbackFunc);
+ IsWarmingUpFeedback = new BoolFeedback("IsWarmingUp", IsWarmingUpFeedbackFunc);
+
+ InputPorts = new RoutingPortCollection();
+
+ }
+
+ public abstract void PowerOn();
+ public abstract void PowerOff();
+ public abstract void PowerToggle();
+
+ public virtual FeedbackCollection Feedbacks
+ {
+ get
+ {
+ return new FeedbackCollection
+ {
+ IsCoolingDownFeedback,
+ IsWarmingUpFeedback
+ };
+ }
+ }
+
+ public abstract void ExecuteSwitch(object selector);
+
+ protected void LinkDisplayToApi(DisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey,
+ EiscApiAdvanced bridge)
+ {
+ var joinMap = new DisplayControllerJoinMap(joinStart);
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ if (bridge != null)
+ {
+ bridge.AddJoinMap(Key, joinMap);
+ }
+ else
+ {
+ Debug.Console(0,this,"Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
+ }
+
+ LinkDisplayToApi(displayDevice, trilist, joinMap);
+ }
+
+ protected void LinkDisplayToApi(DisplayBase displayDevice, BasicTriList trilist, DisplayControllerJoinMap joinMap)
+ {
+ Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+ Debug.Console(0, "Linking to Display: {0}", displayDevice.Name);
+
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = displayDevice.Name;
+
+ var commMonitor = displayDevice as ICommunicationMonitor;
+ if (commMonitor != null)
+ {
+ commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+ }
+
+ var inputNumber = 0;
+ var inputKeys = new List();
+
+ var inputNumberFeedback = new IntFeedback(() => inputNumber);
+
+ // Two way feedbacks
+ var twoWayDisplay = displayDevice as TwoWayDisplayBase;
+
+ if (twoWayDisplay != null)
+ {
+ trilist.SetBool(joinMap.IsTwoWayDisplay.JoinNumber, true);
+
+ twoWayDisplay.CurrentInputFeedback.OutputChange += (o, a) => Debug.Console(0, "CurrentInputFeedback_OutputChange {0}", a.StringValue);
+
+
+ inputNumberFeedback.LinkInputSig(trilist.UShortInput[joinMap.InputSelect.JoinNumber]);
+ }
+
+ // Power Off
+ trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () =>
+ {
+ inputNumber = 102;
+ inputNumberFeedback.FireUpdate();
+ displayDevice.PowerOff();
+ });
+
+ var twoWayDisplayDevice = displayDevice as TwoWayDisplayBase;
+ if (twoWayDisplayDevice != null)
+ {
+ twoWayDisplayDevice.PowerIsOnFeedback.OutputChange += (o, a) =>
+ {
+ if (!a.BoolValue)
+ {
+ inputNumber = 102;
+ inputNumberFeedback.FireUpdate();
+
+ }
+ else
+ {
+ inputNumber = 0;
+ inputNumberFeedback.FireUpdate();
+ }
+ };
+
+ twoWayDisplayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
+ twoWayDisplayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
+ }
+
+ // PowerOn
+ trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () =>
+ {
+ inputNumber = 0;
+ inputNumberFeedback.FireUpdate();
+ displayDevice.PowerOn();
+ });
+
+
+
+ for (int i = 0; i < displayDevice.InputPorts.Count; i++)
+ {
+ if (i < joinMap.InputNamesOffset.JoinSpan)
+ {
+ inputKeys.Add(displayDevice.InputPorts[i].Key);
+ var tempKey = inputKeys.ElementAt(i);
+ trilist.SetSigTrueAction((ushort)(joinMap.InputSelectOffset.JoinNumber + i),
+ () => displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector));
+ Debug.Console(2, displayDevice, "Setting Input Select Action on Digital Join {0} to Input: {1}",
+ joinMap.InputSelectOffset.JoinNumber + i, displayDevice.InputPorts[tempKey].Key.ToString());
+ trilist.StringInput[(ushort)(joinMap.InputNamesOffset.JoinNumber + i)].StringValue = displayDevice.InputPorts[i].Key.ToString();
+ }
+ else
+ Debug.Console(0, displayDevice, Debug.ErrorLogLevel.Warning, "Device has {0} inputs. The Join Map allows up to {1} inputs. Discarding inputs {2} - {3} from bridge.",
+ displayDevice.InputPorts.Count, joinMap.InputNamesOffset.JoinSpan, i + 1, displayDevice.InputPorts.Count);
+ }
+
+ Debug.Console(2, displayDevice, "Setting Input Select Action on Analog Join {0}", joinMap.InputSelect);
+ trilist.SetUShortSigAction(joinMap.InputSelect.JoinNumber, (a) =>
+ {
+ if (a == 0)
+ {
+ displayDevice.PowerOff();
+ inputNumber = 0;
+ }
+ else if (a > 0 && a < displayDevice.InputPorts.Count && a != inputNumber)
+ {
+ displayDevice.ExecuteSwitch(displayDevice.InputPorts.ElementAt(a - 1).Selector);
+ inputNumber = a;
+ }
+ else if (a == 102)
+ {
+ displayDevice.PowerToggle();
+
+ }
+ if (twoWayDisplay != null)
+ inputNumberFeedback.FireUpdate();
+ });
+
+
+ var volumeDisplay = displayDevice as IBasicVolumeControls;
+ if (volumeDisplay == null) return;
+
+ trilist.SetBoolSigAction(joinMap.VolumeUp.JoinNumber, volumeDisplay.VolumeUp);
+ trilist.SetBoolSigAction(joinMap.VolumeDown.JoinNumber, volumeDisplay.VolumeDown);
+ trilist.SetSigTrueAction(joinMap.VolumeMute.JoinNumber, volumeDisplay.MuteToggle);
+
+ var volumeDisplayWithFeedback = volumeDisplay as IBasicVolumeWithFeedback;
+
+ if (volumeDisplayWithFeedback == null) return;
+ trilist.SetSigTrueAction(joinMap.VolumeMuteOn.JoinNumber, volumeDisplayWithFeedback.MuteOn);
+ trilist.SetSigTrueAction(joinMap.VolumeMuteOff.JoinNumber, volumeDisplayWithFeedback.MuteOff);
+
+
+ trilist.SetUShortSigAction(joinMap.VolumeLevel.JoinNumber, volumeDisplayWithFeedback.SetVolume);
+ volumeDisplayWithFeedback.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[joinMap.VolumeLevel.JoinNumber]);
+ volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMute.JoinNumber]);
+ volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMuteOn.JoinNumber]);
+ volumeDisplayWithFeedback.MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.VolumeMuteOff.JoinNumber]);
+ }
+
+ }
+
+ public abstract class TwoWayDisplayBase : DisplayBase, IRoutingFeedback, IHasPowerControlWithFeedback
+ {
+ public StringFeedback CurrentInputFeedback { get; private set; }
+
+ abstract protected Func CurrentInputFeedbackFunc { get; }
+
+ public BoolFeedback PowerIsOnFeedback { get; protected set; }
+
+ abstract protected Func PowerIsOnFeedbackFunc { get; }
+
+
+ public static MockDisplay DefaultDisplay
+ {
+ get
+ {
+ if (_DefaultDisplay == null)
+ _DefaultDisplay = new MockDisplay("default", "Default Display");
+ return _DefaultDisplay;
+ }
+ }
+ static MockDisplay _DefaultDisplay;
+
+ public TwoWayDisplayBase(string key, string name)
+ : base(key, name)
+ {
+ CurrentInputFeedback = new StringFeedback(CurrentInputFeedbackFunc);
+
+ WarmupTime = 7000;
+ CooldownTime = 15000;
+
+ PowerIsOnFeedback = new BoolFeedback("PowerOnFeedback", PowerIsOnFeedbackFunc);
+
+ Feedbacks.Add(CurrentInputFeedback);
+ Feedbacks.Add(PowerIsOnFeedback);
+
+ PowerIsOnFeedback.OutputChange += PowerIsOnFeedback_OutputChange;
+
+ }
+
+ void PowerIsOnFeedback_OutputChange(object sender, EventArgs e)
+ {
+ if (UsageTracker != null)
+ {
+ if (PowerIsOnFeedback.BoolValue)
+ UsageTracker.StartDeviceUsage();
+ else
+ UsageTracker.EndDeviceUsage();
+ }
+ }
+
+ public event EventHandler NumericSwitchChange;
+
+ ///
+ /// Raise an event when the status of a switch object changes.
+ ///
+ /// Arguments defined as IKeyName sender, output, input, and eRoutingSignalType
+ protected void OnSwitchChange(RoutingNumericEventArgs e)
+ {
+ var newEvent = NumericSwitchChange;
+ if (newEvent != null) newEvent(this, e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/Display/InputInterfaces.cs b/src/PepperDash.Essentials.Devices.Common/Displays/InputInterfaces.cs
similarity index 100%
rename from src/PepperDash.Essentials.Devices.Common/Display/InputInterfaces.cs
rename to src/PepperDash.Essentials.Devices.Common/Displays/InputInterfaces.cs
diff --git a/src/PepperDash.Essentials.Devices.Common/Displays/MockDisplay.cs b/src/PepperDash.Essentials.Devices.Common/Displays/MockDisplay.cs
new file mode 100644
index 00000000..ffbb00cd
--- /dev/null
+++ b/src/PepperDash.Essentials.Devices.Common/Displays/MockDisplay.cs
@@ -0,0 +1,211 @@
+using System;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DeviceSupport;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.Core.Routing;
+
+namespace PepperDash.Essentials.Devices.Common.Displays
+{
+ public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced
+
+ {
+ public RoutingInputPort HdmiIn1 { get; private set; }
+ public RoutingInputPort HdmiIn2 { get; private set; }
+ public RoutingInputPort HdmiIn3 { get; private set; }
+ public RoutingInputPort ComponentIn1 { get; private set; }
+ public RoutingInputPort VgaIn1 { get; private set; }
+
+ bool _PowerIsOn;
+ bool _IsWarmingUp;
+ bool _IsCoolingDown;
+
+ protected override Func PowerIsOnFeedbackFunc
+ {
+ get
+ {
+ return () =>
+ {
+ Debug.Console(2, this, "*************************************************** Display Power is {0}", _PowerIsOn ? "on" : "off");
+ return _PowerIsOn;
+ };
+ } }
+ protected override Func IsCoolingDownFeedbackFunc
+ {
+ get
+ {
+ return () =>
+ {
+ Debug.Console(2, this, "*************************************************** {0}", _IsCoolingDown ? "Display is cooling down" : "Display has finished cooling down");
+ return _IsCoolingDown;
+ };
+ }
+ }
+ protected override Func IsWarmingUpFeedbackFunc
+ {
+ get
+ {
+ return () =>
+ {
+ Debug.Console(2, this, "*************************************************** {0}", _IsWarmingUp ? "Display is warming up" : "Display has finished warming up");
+ return _IsWarmingUp;
+ };
+ }
+ }
+ protected override Func CurrentInputFeedbackFunc { get { return () => "Not Implemented"; } }
+
+ int VolumeHeldRepeatInterval = 200;
+ ushort VolumeInterval = 655;
+ ushort _FakeVolumeLevel = 31768;
+ bool _IsMuted;
+
+ public MockDisplay(string key, string name)
+ : base(key, name)
+ {
+ HdmiIn1 = new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, null, this);
+ HdmiIn2 = new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, null, this);
+ HdmiIn3 = new RoutingInputPort(RoutingPortNames.HdmiIn3, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Hdmi, null, this);
+ ComponentIn1 = new RoutingInputPort(RoutingPortNames.ComponentIn, eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Component, null, this);
+ VgaIn1 = new RoutingInputPort(RoutingPortNames.VgaIn, eRoutingSignalType.Video,
+ eRoutingPortConnectionType.Composite, null, this);
+ InputPorts.AddRange(new[] { HdmiIn1, HdmiIn2, HdmiIn3, ComponentIn1, VgaIn1 });
+
+ VolumeLevelFeedback = new IntFeedback(() => { return _FakeVolumeLevel; });
+ MuteFeedback = new BoolFeedback("MuteOn", () => _IsMuted);
+
+ WarmupTime = 10000;
+ CooldownTime = 10000;
+ }
+
+ public override void PowerOn()
+ {
+ if (!PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
+ {
+ _IsWarmingUp = true;
+ IsWarmingUpFeedback.InvokeFireUpdate();
+ // Fake power-up cycle
+ WarmupTimer = new CTimer(o =>
+ {
+ _IsWarmingUp = false;
+ _PowerIsOn = true;
+ IsWarmingUpFeedback.InvokeFireUpdate();
+ PowerIsOnFeedback.InvokeFireUpdate();
+ }, WarmupTime);
+ }
+ }
+
+ public override void PowerOff()
+ {
+ // If a display has unreliable-power off feedback, just override this and
+ // remove this check.
+ if (PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
+ {
+ _IsCoolingDown = true;
+ IsCoolingDownFeedback.InvokeFireUpdate();
+ // Fake cool-down cycle
+ CooldownTimer = new CTimer(o =>
+ {
+ Debug.Console(2, this, "Cooldown timer ending");
+ _IsCoolingDown = false;
+ IsCoolingDownFeedback.InvokeFireUpdate();
+ _PowerIsOn = false;
+ PowerIsOnFeedback.InvokeFireUpdate();
+ }, CooldownTime);
+ }
+ }
+
+ public override void PowerToggle()
+ {
+ if (PowerIsOnFeedback.BoolValue && !IsWarmingUpFeedback.BoolValue)
+ PowerOff();
+ else if (!PowerIsOnFeedback.BoolValue && !IsCoolingDownFeedback.BoolValue)
+ PowerOn();
+ }
+
+ public override void ExecuteSwitch(object selector)
+ {
+ Debug.Console(2, this, "ExecuteSwitch: {0}", selector);
+
+ if (!_PowerIsOn)
+ {
+ PowerOn();
+ }
+ }
+
+
+
+ #region IBasicVolumeWithFeedback Members
+
+ public IntFeedback VolumeLevelFeedback { get; private set; }
+
+ public void SetVolume(ushort level)
+ {
+ _FakeVolumeLevel = level;
+ VolumeLevelFeedback.InvokeFireUpdate();
+ }
+
+ public void MuteOn()
+ {
+ _IsMuted = true;
+ MuteFeedback.InvokeFireUpdate();
+ }
+
+ public void MuteOff()
+ {
+ _IsMuted = false;
+ MuteFeedback.InvokeFireUpdate();
+ }
+
+ public BoolFeedback MuteFeedback { get; private set; }
+
+ #endregion
+
+ #region IBasicVolumeControls Members
+
+ public void VolumeUp(bool pressRelease)
+ {
+ //while (pressRelease)
+ //{
+ Debug.Console(2, this, "Volume Down {0}", pressRelease);
+ if (pressRelease)
+ {
+ var newLevel = _FakeVolumeLevel + VolumeInterval;
+ SetVolume((ushort)newLevel);
+ CrestronEnvironment.Sleep(VolumeHeldRepeatInterval);
+ }
+ //}
+ }
+
+ public void VolumeDown(bool pressRelease)
+ {
+ //while (pressRelease)
+ //{
+ Debug.Console(2, this, "Volume Up {0}", pressRelease);
+ if (pressRelease)
+ {
+ var newLevel = _FakeVolumeLevel - VolumeInterval;
+ SetVolume((ushort)newLevel);
+ CrestronEnvironment.Sleep(VolumeHeldRepeatInterval);
+ }
+ //}
+ }
+
+ public void MuteToggle()
+ {
+ _IsMuted = !_IsMuted;
+ MuteFeedback.InvokeFireUpdate();
+ }
+
+ #endregion
+
+ public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
+ {
+ LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/PepperDash.Essentials.Devices.Common.csproj b/src/PepperDash.Essentials.Devices.Common/PepperDash.Essentials.Devices.Common.csproj
index 96ef4e5d..6b0b5972 100644
--- a/src/PepperDash.Essentials.Devices.Common/PepperDash.Essentials.Devices.Common.csproj
+++ b/src/PepperDash.Essentials.Devices.Common/PepperDash.Essentials.Devices.Common.csproj
@@ -1,10 +1,11 @@
ProgramLibrary
+ Debug;Release;Debug 4.7.2
- net472
- false
+ net472;net6
+ true
bin\$(Configuration)\
PepperDash.Essentials.Devices.Common
PepperDash.Essentials.Devices.Common
@@ -15,22 +16,20 @@
full
+
+ full
+
pdbonly
-
-
-
-
-
-
+
Full
-
+
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/Environment/Somfy/RelayControlledShade.cs b/src/PepperDash.Essentials.Devices.Common/Shades/RelayControlledShade.cs
similarity index 92%
rename from src/PepperDash.Essentials.Devices.Common/Environment/Somfy/RelayControlledShade.cs
rename to src/PepperDash.Essentials.Devices.Common/Shades/RelayControlledShade.cs
index 852d554f..a8fc5fd4 100644
--- a/src/PepperDash.Essentials.Devices.Common/Environment/Somfy/RelayControlledShade.cs
+++ b/src/PepperDash.Essentials.Devices.Common/Shades/RelayControlledShade.cs
@@ -1,16 +1,12 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using System.Collections.Generic;
using Crestron.SimplSharp;
-
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.CrestronIO;
using PepperDash.Essentials.Core.Shades;
-namespace PepperDash.Essentials.Devices.Common.Environment.Somfy
+namespace PepperDash.Essentials.Devices.Common.Shades
{
///
/// Controls a single shade using three relays
@@ -122,9 +118,9 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Somfy
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
- var props = Newtonsoft.Json.JsonConvert.DeserializeObject(dc.Properties.ToString());
+ var props = Newtonsoft.Json.JsonConvert.DeserializeObject(dc.Properties.ToString());
- return new Environment.Somfy.RelayControlledShade(dc.Key, dc.Name, props);
+ return new RelayControlledShade(dc.Key, dc.Name, props);
}
}
diff --git a/src/PepperDash.Essentials.Devices.Common/Shades/ShadeBase.cs b/src/PepperDash.Essentials.Devices.Common/Shades/ShadeBase.cs
new file mode 100644
index 00000000..2c506750
--- /dev/null
+++ b/src/PepperDash.Essentials.Devices.Common/Shades/ShadeBase.cs
@@ -0,0 +1,22 @@
+using PepperDash.Essentials.Core.Shades;
+using PepperDash.Essentials.Core;
+
+namespace PepperDash.Essentials.Devices.Common.Shades
+{
+ public abstract class ShadeBase : EssentialsDevice, IShadesOpenCloseStop
+ {
+ public ShadeBase(string key, string name)
+ : base(key, name)
+ {
+
+ }
+
+ #region iShadesOpenClose Members
+
+ public abstract void Open();
+ public abstract void Stop();
+ public abstract void Close();
+
+ #endregion
+ }
+}
diff --git a/src/PepperDash.Essentials.Core/Shades/ShadeController.cs b/src/PepperDash.Essentials.Devices.Common/Shades/ShadeController.cs
similarity index 77%
rename from src/PepperDash.Essentials.Core/Shades/ShadeController.cs
rename to src/PepperDash.Essentials.Devices.Common/Shades/ShadeController.cs
index fc50f631..a229cb6d 100644
--- a/src/PepperDash.Essentials.Core/Shades/ShadeController.cs
+++ b/src/PepperDash.Essentials.Devices.Common/Shades/ShadeController.cs
@@ -1,13 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
+using System.Collections.Generic;
using PepperDash.Core;
+using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Shades;
-namespace PepperDash.Essentials.Core.Shades
+namespace PepperDash.Essentials.Devices.Common.Shades
{
///
/// Class that contains the shades to be controlled in a room
@@ -16,14 +13,14 @@ namespace PepperDash.Essentials.Core.Shades
{
ShadeControllerConfigProperties Config;
- public List Shades { get; private set; }
+ public List Shades { get; private set; }
public ShadeController(string key, string name, ShadeControllerConfigProperties config)
: base(key, name)
{
Config = config;
- Shades = new List();
+ Shades = new List();
}
public override bool CustomActivate()
@@ -40,7 +37,7 @@ namespace PepperDash.Essentials.Core.Shades
return base.CustomActivate();
}
- void AddShade(ShadeBase shade)
+ void AddShade(IShadesOpenCloseStop shade)
{
Shades.Add(shade);
}
@@ -67,9 +64,9 @@ namespace PepperDash.Essentials.Core.Shades
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new ShadeController Device");
- var props = Newtonsoft.Json.JsonConvert.DeserializeObject(dc.Properties.ToString());
+ var props = Newtonsoft.Json.JsonConvert.DeserializeObject(dc.Properties.ToString());
- return new Core.Shades.ShadeController(dc.Key, dc.Name, props);
+ return new ShadeController(dc.Key, dc.Name, props);
}
}
diff --git a/src/PepperDash.Essentials.Devices.Common/SoftCodec/BlueJeansPc.cs b/src/PepperDash.Essentials.Devices.Common/SoftCodec/BlueJeansPc.cs
index 868e7fca..67b205e5 100644
--- a/src/PepperDash.Essentials.Devices.Common/SoftCodec/BlueJeansPc.cs
+++ b/src/PepperDash.Essentials.Devices.Common/SoftCodec/BlueJeansPc.cs
@@ -1,19 +1,17 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Routing;
-using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Routing;
+using PepperDash.Essentials.Devices.Common.Sources;
namespace PepperDash.Essentials.Devices.Common.SoftCodec
{
- public class BlueJeansPc : InRoomPc, IRoutingInputs, IRunRouteAction, IRoutingSink
+ public class BlueJeansPc : InRoomPc, IRunRouteAction, IRoutingSink
{
public RoutingInputPort AnyVideoIn { get; private set; }
diff --git a/src/PepperDash.Essentials.Devices.Common/Sources/InRoomPc.cs b/src/PepperDash.Essentials.Devices.Common/Sources/InRoomPc.cs
new file mode 100644
index 00000000..af5f274f
--- /dev/null
+++ b/src/PepperDash.Essentials.Devices.Common/Sources/InRoomPc.cs
@@ -0,0 +1,76 @@
+using System;
+using System.Collections.Generic;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Routing;
+
+namespace PepperDash.Essentials.Devices.Common.Sources
+{
+ public class InRoomPc : EssentialsDevice, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
+ {
+ public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
+ public string IconName { get; set; }
+ public BoolFeedback HasPowerOnFeedback { get; private set; }
+
+ public RoutingOutputPort AnyVideoOut { get; private set; }
+
+ #region IRoutingOutputs Members
+
+ ///
+ /// Options: hdmi
+ ///
+ public RoutingPortCollection OutputPorts { get; private set; }
+
+ #endregion
+
+ public InRoomPc(string key, string name)
+ : base(key, name)
+ {
+ IconName = "PC";
+ HasPowerOnFeedback = new BoolFeedback("HasPowerFeedback",
+ () => this.GetVideoStatuses() != VideoStatusOutputs.NoStatus);
+ OutputPorts = new RoutingPortCollection();
+ OutputPorts.Add(AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.None, 0, this));
+ }
+
+ #region IHasFeedback Members
+
+ ///
+ /// Passes through the VideoStatuses list
+ ///
+ public FeedbackCollection Feedbacks
+ {
+ get
+ {
+ var newList = new FeedbackCollection();
+ newList.AddRange(this.GetVideoStatuses().ToList());
+ return newList;
+ }
+ }
+
+ #endregion
+
+ #region IUsageTracking Members
+
+ public UsageTracking UsageTracker { get; set; }
+
+ #endregion
+ }
+
+ public class InRoomPcFactory : EssentialsDeviceFactory
+ {
+ public InRoomPcFactory()
+ {
+ TypeNames = new List() { "inroompc" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new InRoomPc Device");
+ return new InRoomPc(dc.Key, dc.Name);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/Sources/Laptop.cs b/src/PepperDash.Essentials.Devices.Common/Sources/Laptop.cs
new file mode 100644
index 00000000..dd1f38c2
--- /dev/null
+++ b/src/PepperDash.Essentials.Devices.Common/Sources/Laptop.cs
@@ -0,0 +1,75 @@
+using System;
+using System.Collections.Generic;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Routing;
+
+namespace PepperDash.Essentials.Devices.Common.Sources
+{
+ public class Laptop : EssentialsDevice, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
+ {
+ public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
+ public string IconName { get; set; }
+ public BoolFeedback HasPowerOnFeedback { get; private set; }
+
+ public RoutingOutputPort AnyVideoOut { get; private set; }
+
+ #region IRoutingOutputs Members
+
+ ///
+ /// Options: hdmi
+ ///
+ public RoutingPortCollection OutputPorts { get; private set; }
+
+ #endregion
+
+ public Laptop(string key, string name)
+ : base(key, name)
+ {
+ IconName = "Laptop";
+ HasPowerOnFeedback = new BoolFeedback("HasPowerFeedback",
+ () => this.GetVideoStatuses() != VideoStatusOutputs.NoStatus);
+ OutputPorts = new RoutingPortCollection();
+ OutputPorts.Add(AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
+ eRoutingPortConnectionType.None, 0, this));
+ }
+
+ #region IHasFeedback Members
+
+ ///
+ /// Passes through the VideoStatuses list
+ ///
+ public FeedbackCollection Feedbacks
+ {
+ get
+ {
+ var newList = new FeedbackCollection();
+ newList.AddRange(this.GetVideoStatuses().ToList());
+ return newList;
+ }
+ }
+
+ #endregion
+
+ #region IUsageTracking Members
+
+ public UsageTracking UsageTracker { get; set; }
+
+ #endregion
+ }
+
+ public class LaptopFactory : EssentialsDeviceFactory
+ {
+ public LaptopFactory()
+ {
+ TypeNames = new List() { "laptop" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create new Laptop Device");
+ return new Laptop(dc.Key, dc.Name);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/BookingsDataClasses.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/BookingsDataClasses.cs
deleted file mode 100644
index 05456ad4..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/BookingsDataClasses.cs
+++ /dev/null
@@ -1,448 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Devices.Common.Codec;
-
-namespace PepperDash.Essentials.Devices.Common.VideoCodec
-{
- public class CiscoCodecBookings
- {
- public class TotalRows
- {
- public string Value { get; set; }
- }
-
- public class ResultInfo
- {
- public TotalRows TotalRows { get; set; }
- }
-
- public class LastUpdated
- {
- string _value;
-
- public DateTime Value {
- get
- {
- DateTime _valueDateTime;
- try
- {
- _valueDateTime = DateTime.Parse(_value);
- return _valueDateTime;
- }
- catch
- {
- return new DateTime();
- }
- }
- set
- {
- _value = value.ToString();
- }
- }
- }
-
- public class Id
- {
- public string Value { get; set; }
- }
-
- public class Title
- {
- public string Value { get; set; }
- }
-
- public class Agenda
- {
- public string Value { get; set; }
- }
-
- public class Privacy
- {
- public string Value { get; set; }
- }
-
- public class FirstName
- {
- public string Value { get; set; }
- }
-
- public class LastName
- {
- public string Value { get; set; }
- }
-
- public class Email
- {
- public string Value { get; set; }
- }
-
- public class Id2
- {
- public string Value { get; set; }
- }
-
- public class Organizer
- {
- public FirstName FirstName { get; set; }
- public LastName LastName { get; set; }
- public Email Email { get; set; }
- public Id2 Id { get; set; }
-
- public Organizer()
- {
- FirstName = new FirstName();
- LastName = new LastName();
- Email = new Email();
- }
- }
-
- public class StartTime
- {
- public DateTime Value { get; set; }
- }
-
- public class StartTimeBuffer
- {
- public string Value { get; set; }
- }
-
- public class EndTime
- {
- public DateTime Value { get; set; }
- }
-
- public class EndTimeBuffer
- {
- public string Value { get; set; }
- }
-
- public class Time
- {
- public StartTime StartTime { get; set; }
- public StartTimeBuffer StartTimeBuffer { get; set; }
- public EndTime EndTime { get; set; }
- public EndTimeBuffer EndTimeBuffer { get; set; }
-
- public Time()
- {
- StartTime = new StartTime();
- EndTime = new EndTime();
- }
- }
-
- public class MaximumMeetingExtension
- {
- public string Value { get; set; }
- }
-
- public class MeetingExtensionAvailability
- {
- public string Value { get; set; }
- }
-
- public class BookingStatus
- {
- public string Value { get; set; }
- }
-
- public class BookingStatusMessage
- {
- public string Value { get; set; }
- }
-
- public class Enabled
- {
- public string Value { get; set; }
- }
-
- public class Url
- {
- public string Value { get; set; }
- }
-
- public class MeetingNumber
- {
- public string Value { get; set; }
- }
-
- public class Password
- {
- public string Value { get; set; }
- }
-
- public class HostKey
- {
- public string Value { get; set; }
- }
-
- public class DialInNumbers
- {
- }
-
- public class Webex
- {
- public Enabled Enabled { get; set; }
- public Url Url { get; set; }
- public MeetingNumber MeetingNumber { get; set; }
- public Password Password { get; set; }
- public HostKey HostKey { get; set; }
- public DialInNumbers DialInNumbers { get; set; }
- }
-
- public class Encryption
- {
- public string Value { get; set; }
- }
-
- public class Role
- {
- public string Value { get; set; }
- }
-
- public class Recording
- {
- public string Value { get; set; }
- }
-
- public class Number
- {
- public string Value { get; set; }
- }
-
- public class Protocol
- {
- public string Value { get; set; }
- }
-
- public class CallRate
- {
- public string Value { get; set; }
- }
-
- public class CallType
- {
- public string Value { get; set; }
- }
-
- public class Call
- {
- public string id { get; set; }
- public Number Number { get; set; }
- public Protocol Protocol { get; set; }
- public CallRate CallRate { get; set; }
- public CallType CallType { get; set; }
- }
-
- public class Calls
- {
- public List Call {get; set;}
- }
-
- public class ConnectMode
- {
- public string Value { get; set; }
- }
-
- public class DialInfo
- {
- public Calls Calls { get; set; }
- public ConnectMode ConnectMode { get; set; }
-
- public DialInfo()
- {
- Calls = new Calls();
- ConnectMode = new ConnectMode();
- }
- }
-
- public class Booking
- {
- public string id { get; set; }
- public Id Id { get; set; }
- public Title Title { get; set; }
- public Agenda Agenda { get; set; }
- public Privacy Privacy { get; set; }
- public Organizer Organizer { get; set; }
- public Time Time { get; set; }
- public MaximumMeetingExtension MaximumMeetingExtension { get; set; }
- public MeetingExtensionAvailability MeetingExtensionAvailability { get; set; }
- public BookingStatus BookingStatus { get; set; }
- public BookingStatusMessage BookingStatusMessage { get; set; }
- public Webex Webex { get; set; }
- public Encryption Encryption { get; set; }
- public Role Role { get; set; }
- public Recording Recording { get; set; }
- public DialInfo DialInfo { get; set; }
-
- public Booking()
- {
- Time = new Time();
- Id = new Id();
- Organizer = new Organizer();
- Title = new Title();
- Agenda = new Agenda();
- Privacy = new Privacy();
- DialInfo = new DialInfo();
- }
- }
-
- public class BookingsListResult
- {
- public string status { get; set; }
- public ResultInfo ResultInfo { get; set; }
- //public LastUpdated LastUpdated { get; set; }
- public List Booking { get; set; }
- }
-
- public class CommandResponse
- {
- public BookingsListResult BookingsListResult { get; set; }
- }
-
- public class RootObject
- {
- public CommandResponse CommandResponse { get; set; }
- }
-
- ///
- /// Extracts the necessary meeting values from the Cisco bookings response ans converts them to the generic class
- ///
- ///
- ///
- public static List GetGenericMeetingsFromBookingResult(List bookings)
- {
- var meetings = new List();
-
- if (Debug.Level > 0)
- {
- Debug.Console(1, "Meetings List:\n");
- }
-
- foreach(Booking b in bookings)
- {
- var meeting = new Meeting();
-
- if(b.Id != null)
- meeting.Id = b.Id.Value;
- if(b.Organizer != null)
- meeting.Organizer = string.Format("{0}, {1}", b.Organizer.LastName.Value, b.Organizer.FirstName.Value);
- if(b.Title != null)
- meeting.Title = b.Title.Value;
- if(b.Agenda != null)
- meeting.Agenda = b.Agenda.Value;
- if(b.Time != null)
- {
- meeting.StartTime = b.Time.StartTime.Value;
- meeting.EndTime = b.Time.EndTime.Value;
- }
- if(b.Privacy != null)
- meeting.Privacy = CodecCallPrivacy.ConvertToDirectionEnum(b.Privacy.Value);
-
-//#warning Update this ConnectMode conversion after testing onsite. Expected value is "OBTP", but in PD NYC Test scenarios, "Manual" is being returned for OBTP meetings
- if (b.DialInfo.ConnectMode != null)
- if (b.DialInfo.ConnectMode.Value.ToLower() == "obtp" || b.DialInfo.ConnectMode.Value.ToLower() == "manual")
- meeting.IsOneButtonToPushMeeting = true;
-
- meeting.Dialable = b.DialInfo.Calls.Call.Count > 0;
-
- if (b.DialInfo.Calls.Call != null)
- {
- foreach (Call c in b.DialInfo.Calls.Call)
- {
- meeting.Calls.Add(new PepperDash.Essentials.Devices.Common.Codec.Call()
- {
- Number = c.Number.Value,
- Protocol = c.Protocol.Value,
- CallRate = c.CallRate.Value,
- CallType = c.CallType.Value
- });
- }
- }
-
-
- meetings.Add(meeting);
-
- if(Debug.Level > 0)
- {
- Debug.Console(1, "Title: {0}, ID: {1}, Organizer: {2}, Agenda: {3}", meeting.Title, meeting.Id, meeting.Organizer, meeting.Agenda);
- Debug.Console(1, " Start Time: {0}, End Time: {1}, Duration: {2}", meeting.StartTime, meeting.EndTime, meeting.Duration);
- Debug.Console(1, " Joinable: {0}\n", meeting.Joinable);
- }
- }
-
- meetings.OrderBy(m => m.StartTime);
-
- return meetings;
- }
-
- public static List GetGenericMeetingsFromBookingResult(List bookings, int joinableCooldownSeconds)
- {
- var meetings = new List();
-
- if (Debug.Level > 0)
- {
- Debug.Console(1, "Meetings List:\n");
- }
-
- foreach (Booking b in bookings)
- {
- var meeting = new Meeting(joinableCooldownSeconds);
-
- if (b.Id != null)
- meeting.Id = b.Id.Value;
- if (b.Organizer != null)
- meeting.Organizer = string.Format("{0}, {1}", b.Organizer.LastName.Value, b.Organizer.FirstName.Value);
- if (b.Title != null)
- meeting.Title = b.Title.Value;
- if (b.Agenda != null)
- meeting.Agenda = b.Agenda.Value;
- if (b.Time != null)
- {
- meeting.StartTime = b.Time.StartTime.Value;
- meeting.EndTime = b.Time.EndTime.Value;
- }
- if (b.Privacy != null)
- meeting.Privacy = CodecCallPrivacy.ConvertToDirectionEnum(b.Privacy.Value);
-
- //#warning Update this ConnectMode conversion after testing onsite. Expected value is "OBTP", but in PD NYC Test scenarios, "Manual" is being returned for OBTP meetings
- if (b.DialInfo.ConnectMode != null)
- if (b.DialInfo.ConnectMode.Value.ToLower() == "obtp" || b.DialInfo.ConnectMode.Value.ToLower() == "manual")
- meeting.IsOneButtonToPushMeeting = true;
-
- if (b.DialInfo.Calls.Call != null)
- {
- foreach (Call c in b.DialInfo.Calls.Call)
- {
- meeting.Calls.Add(new PepperDash.Essentials.Devices.Common.Codec.Call()
- {
- Number = c.Number.Value,
- Protocol = c.Protocol.Value,
- CallRate = c.CallRate.Value,
- CallType = c.CallType.Value
- });
- }
- }
-
-
- meetings.Add(meeting);
-
- if (Debug.Level > 0)
- {
- Debug.Console(1, "Title: {0}, ID: {1}, Organizer: {2}, Agenda: {3}", meeting.Title, meeting.Id, meeting.Organizer, meeting.Agenda);
- Debug.Console(1, " Start Time: {0}, End Time: {1}, Duration: {2}", meeting.StartTime, meeting.EndTime, meeting.Duration);
- Debug.Console(1, " Joinable: {0}\n", meeting.Joinable);
- }
- }
-
- meetings.OrderBy(m => m.StartTime);
-
- return meetings;
- }
-
- }
-}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/CiscoCamera.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/CiscoCamera.cs
deleted file mode 100644
index 9e8b0554..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/CiscoCamera.cs
+++ /dev/null
@@ -1,323 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using PepperDash.Essentials.Core.Bridges;
-using PepperDash.Essentials.Devices.Common.Cameras;
-
-namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
-{
- public class CiscoFarEndCamera : CameraBase, IHasCameraPtzControl, IAmFarEndCamera, IBridgeAdvanced
- {
- protected CiscoSparkCodec ParentCodec { get; private set; }
-
- protected string CallId {
- get
- {
- return (ParentCodec as CiscoSparkCodec).GetCallId();
- }
- }
-
- public CiscoFarEndCamera(string key, string name, CiscoSparkCodec codec)
- : base(key, name)
- {
- Capabilities = eCameraCapabilities.Pan | eCameraCapabilities.Tilt | eCameraCapabilities.Zoom;
-
- ParentCodec = codec;
- }
-
- #region IHasCameraPtzControl Members
-
- public void PositionHome()
- {
- // Not supported on far end camera
- }
-
- #endregion
-
- #region IHasCameraPanControl Members
-
- public void PanLeft()
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Move Value: Left CallId: {0}", CallId));
- }
-
- public void PanRight()
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Move Value: Right CallId: {0}", CallId));
- }
-
- public void PanStop()
- {
- Stop();
- }
-
- #endregion
-
- #region IHasCameraTiltControl Members
-
- public void TiltDown()
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Move Value: Down CallId: {0}", CallId));
- }
-
- public void TiltUp()
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Move Value: Up CallId: {0}", CallId));
- }
-
- public void TiltStop()
- {
- Stop();
- }
-
- #endregion
-
- #region IHasCameraZoomControl Members
-
- public void ZoomIn()
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Move Value: ZoomIn CallId: {0}", CallId));
- }
-
- public void ZoomOut()
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Move Value: ZoomOut CallId: {0}", CallId));
- }
-
- public void ZoomStop()
- {
- Stop();
- }
-
- #endregion
-
-
- void Stop()
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Stop CallId: {0}", CallId));
- }
-
- public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- LinkCameraToApi(this, trilist, joinStart, joinMapKey, bridge);
- }
- }
-
- public class CiscoSparkCamera : CameraBase, IHasCameraPtzControl, IHasCameraFocusControl, IBridgeAdvanced
- {
- ///
- /// The codec this camera belongs to
- ///
- protected CiscoSparkCodec ParentCodec { get; private set; }
-
- ///
- /// The ID of the camera on the codec
- ///
- public uint CameraId { get; private set; }
-
- ///
- /// Valid range 1-15
- ///
- protected uint PanSpeed { get; private set; }
-
- ///
- /// Valid range 1-15
- ///
- protected uint TiltSpeed { get; private set; }
-
- ///
- /// Valid range 1-15
- ///
- protected uint ZoomSpeed { get; private set; }
-
- private bool isPanning;
-
- private bool isTilting;
-
- private bool isZooming;
-
- private bool isFocusing;
-
- private bool isMoving
- {
- get
- {
- return isPanning || isTilting || isZooming || isFocusing;
-
- }
- }
-
- public CiscoSparkCamera(string key, string name, CiscoSparkCodec codec, uint id)
- : base(key, name)
- {
- // Default to all capabilties
- Capabilities = eCameraCapabilities.Pan | eCameraCapabilities.Tilt | eCameraCapabilities.Zoom | eCameraCapabilities.Focus;
-
- ParentCodec = codec;
-
- CameraId = id;
-
- // Set default speeds
- PanSpeed = 7;
- TiltSpeed = 7;
- ZoomSpeed = 7;
- }
-
-
- // Takes a string from the camera capabilities value and converts from "ptzf" to enum bitmask
- public void SetCapabilites(string capabilites)
- {
- var c = capabilites.ToLower();
-
- if (c.Contains("p"))
- Capabilities = Capabilities | eCameraCapabilities.Pan;
-
- if (c.Contains("t"))
- Capabilities = Capabilities | eCameraCapabilities.Tilt;
-
- if (c.Contains("z"))
- Capabilities = Capabilities | eCameraCapabilities.Zoom;
-
- if (c.Contains("f"))
- Capabilities = Capabilities | eCameraCapabilities.Focus;
- }
-
- #region IHasCameraPtzControl Members
-
- public void PositionHome()
- {
- // Not supported on Internal Spark Camera
-
-
- }
-
- #endregion
-
- #region IHasCameraPanControl Members
-
- public void PanLeft()
- {
- if (!isMoving)
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Pan: Left PanSpeed: {1}", CameraId, PanSpeed));
- isPanning = true;
- }
- }
-
- public void PanRight()
- {
- if (!isMoving)
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Pan: Right PanSpeed: {1}", CameraId, PanSpeed));
- isPanning = true;
- }
- }
-
- public void PanStop()
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Pan: Stop", CameraId));
- isPanning = false;
- }
-
- #endregion
-
-
-
- #region IHasCameraTiltControl Members
-
- public void TiltDown()
- {
- if (!isMoving)
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Tilt: Down TiltSpeed: {1}", CameraId, TiltSpeed));
- isTilting = true;
- }
- }
-
- public void TiltUp()
- {
- if (!isMoving)
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Tilt: Up TiltSpeed: {1}", CameraId, TiltSpeed));
- isTilting = true;
- }
- }
-
- public void TiltStop()
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Tilt: Stop", CameraId));
- isTilting = false;
- }
-
- #endregion
-
- #region IHasCameraZoomControl Members
-
- public void ZoomIn()
- {
- if (!isMoving)
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Zoom: In ZoomSpeed: {1}", CameraId, ZoomSpeed));
- isZooming = true;
- }
- }
-
- public void ZoomOut()
- {
- if (!isMoving)
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Zoom: Out ZoomSpeed: {1}", CameraId, ZoomSpeed));
- isZooming = true;
- }
- }
-
- public void ZoomStop()
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Zoom: Stop", CameraId));
- isZooming = false;
- }
-
- #endregion
-
- #region IHasCameraFocusControl Members
-
- public void FocusNear()
- {
- if (!isMoving)
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Focus: Near", CameraId));
- isFocusing = true;
- }
- }
-
- public void FocusFar()
- {
- if (!isMoving)
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Focus: Far", CameraId));
- isFocusing = true;
- }
- }
-
- public void FocusStop()
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Focus: Stop", CameraId));
- isFocusing = false;
- }
-
- public void TriggerAutoFocus()
- {
- ParentCodec.EnqueueCommand(string.Format("xCommand Camera TriggerAutofocus CameraId: {0}", CameraId));
- }
-
- #endregion
-
- public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- LinkCameraToApi(this, trilist, joinStart, joinMapKey, bridge);
- }
- }
-}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/CiscoCodecJoinMap.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/CiscoCodecJoinMap.cs
deleted file mode 100644
index 2396afdc..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/CiscoCodecJoinMap.cs
+++ /dev/null
@@ -1,205 +0,0 @@
-using System;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Bridges.JoinMaps;
-
-
-namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
-{
- public class CiscoCodecJoinMap : VideoCodecControllerJoinMap
- {
- #region Digital
-
- [JoinName("PresentationLocalOnly")]
- public JoinDataComplete PresentationLocalOnly = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 205,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Presentation Local Only Feedback",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("PresentationLocalRemote")]
- public JoinDataComplete PresentationLocalRemote = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 206,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Presentation Local and Remote Feedback",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("ActivateDoNotDisturbMode")]
- public JoinDataComplete ActivateDoNotDisturbMode = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 241,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Activates Do Not Disturb Mode. FB High if active.",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("DeactivateDoNotDisturbMode")]
- public JoinDataComplete DeactivateDoNotDisturbMode = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 242,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Deactivates Do Not Disturb Mode. FB High if deactivated.",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("ToggleDoNotDisturbMode")]
- public JoinDataComplete ToggleDoNotDisturbMode = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 243,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Toggles Do Not Disturb Mode.",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("ActivateStandby")]
- public JoinDataComplete ActivateStandby = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 246,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Activates Standby Mode. FB High if active.",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("DeactivateStandby")]
- public JoinDataComplete DeactivateStandby = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 247,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Deactivates Standby Mode. FB High if deactivated.",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("ActivateHalfWakeMode")]
- public JoinDataComplete ActivateHalfWakeMode = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 248,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Activates Half Wake Mode. FB High if active.",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Digital
- });
-
- [JoinName("EnteringStandbyMode")]
- public JoinDataComplete EnteringStandbyMode = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 249,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "High to indicate that the codec is entering standby mode",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Digital
- });
-
- #endregion
-
-
- #region Analog
-
- [JoinName("RingtoneVolume")]
- public JoinDataComplete RingtoneVolume = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 21,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Ringtone volume set/FB. Valid values are 0 - 100 in increments of 5 (5, 10, 15, 20, etc.)",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Analog
- });
-
- [JoinName("PresentationSource")]
- public JoinDataComplete PresentationSource = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 201,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Presentation set/FB. Valid values are 0 - 6 depending on the codec model.",
- JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
- JoinType = eJoinType.Analog
- });
-
-
- #endregion
-
-
- #region Serials
-
- [JoinName("CommandToDevice")]
- public JoinDataComplete CommandToDevice = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 5,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Sends a serial command to the device. Do not include the delimiter, it will be added automatically.",
- JoinCapabilities = eJoinCapabilities.FromSIMPL,
- JoinType = eJoinType.Serial
- });
-
-
-
- #endregion
-
- public CiscoCodecJoinMap(uint joinStart)
- : base(joinStart, typeof(CiscoCodecJoinMap))
- {
- }
-
- public CiscoCodecJoinMap(uint joinStart, Type type)
- : base(joinStart, type)
- {
- }
- }
-}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs
deleted file mode 100644
index 1eccf076..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs
+++ /dev/null
@@ -1,2615 +0,0 @@
-extern alias Full;
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Text.RegularExpressions;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.CrestronThread;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Full.Newtonsoft.Json;
-using Full.Newtonsoft.Json.Linq;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Bridges;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Core.DeviceTypeInterfaces;
-using PepperDash.Essentials.Core.Routing;
-using PepperDash.Essentials.Devices.Common.Cameras;
-using PepperDash.Essentials.Devices.Common.Codec;
-using PepperDash.Essentials.Devices.Common.VideoCodec;
-using PepperDash.Essentials.Core.Queues;
-
-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 enum eExternalSourceMode {Ready, NotReady, Hidden, Error}
-
- public class CiscoSparkCodec : VideoCodecBase, IHasCallHistory, IHasCallFavorites, IHasDirectory,
- IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfView,
- ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets,
- IHasExternalSourceSwitching, IHasBranding, IHasCameraOff, IHasCameraMute, IHasDoNotDisturbMode,
- IHasHalfWakeMode, IHasCallHold, IJoinCalls
- {
- private CiscoSparkCodecPropertiesConfig _config;
-
- private bool _externalSourceChangeRequested;
-
- public event EventHandler DirectoryResultReturned;
-
- private CTimer _brandingTimer;
-
- public CommunicationGather PortGather { get; private set; }
-
- public StatusMonitorBase CommunicationMonitor { get; private set; }
-
- private GenericQueue _receiveQueue;
-
- public BoolFeedback PresentationViewMaximizedFeedback { get; private set; }
-
- private string _currentPresentationView;
-
- public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
-
- public IntFeedback PeopleCountFeedback { get; private set; }
-
- public BoolFeedback CameraAutoModeIsOnFeedback { get; private set; }
-
- public BoolFeedback SelfviewIsOnFeedback { get; private set; }
-
- public StringFeedback SelfviewPipPositionFeedback { get; private set; }
-
- public StringFeedback LocalLayoutFeedback { get; private set; }
-
- public BoolFeedback LocalLayoutIsProminentFeedback { get; private set; }
-
- public BoolFeedback FarEndIsSharingContentFeedback { get; private set; }
-
- public IntFeedback RingtoneVolumeFeedback { get; private set; }
-
- private CodecCommandWithLabel _currentSelfviewPipPosition;
-
- private CodecCommandWithLabel _currentLocalLayout;
-
- ///
- /// List the available positions for the selfview PIP window
- ///
- public List SelfviewPipPositions = new List()
- {
- new CodecCommandWithLabel("CenterLeft", "Center Left"),
- new CodecCommandWithLabel("CenterRight", "Center Right"),
- new CodecCommandWithLabel("LowerLeft", "Lower Left"),
- new CodecCommandWithLabel("LowerRight", "Lower Right"),
- new CodecCommandWithLabel("UpperCenter", "Upper Center"),
- new CodecCommandWithLabel("UpperLeft", "Upper Left"),
- new CodecCommandWithLabel("UpperRight", "Upper Right"),
- };
-
- ///
- /// Lists the available options for local layout
- ///
- public List LocalLayouts = new List()
- {
- //new CodecCommandWithLabel("auto", "Auto"),
- //new CiscoCodecLocalLayout("custom", "Custom"), // Left out for now
- new CodecCommandWithLabel("equal","Equal"),
- new CodecCommandWithLabel("overlay","Overlay"),
- new CodecCommandWithLabel("prominent","Prominent"),
- new CodecCommandWithLabel("single","Single")
- };
-
- private CiscoCodecConfiguration.RootObject CodecConfiguration = new CiscoCodecConfiguration.RootObject();
-
- private CiscoCodecStatus.RootObject CodecStatus = new CiscoCodecStatus.RootObject();
-
- public CodecCallHistory CallHistory { get; private set; }
-
- public CodecCallFavorites CallFavorites { get; private set; }
-
- ///
- /// The root level of the directory
- ///
- public CodecDirectory DirectoryRoot { get; private set; }
-
- ///
- /// Represents the current state of the directory and is computed on get
- ///
- public CodecDirectory CurrentDirectoryResult
- {
- get
- {
- if (DirectoryBrowseHistory.Count > 0)
- return DirectoryBrowseHistory[DirectoryBrowseHistory.Count - 1];
- else
- return DirectoryRoot;
- }
- }
-
- public BoolFeedback CurrentDirectoryResultIsNotDirectoryRoot { get; private set; }
-
- ///
- /// Tracks the directory browse history when browsing beyond the root directory
- ///
- public List DirectoryBrowseHistory { get; private set; }
-
- public CodecScheduleAwareness CodecSchedule { get; private set; }
-
- ///
- /// Gets and returns the scaled volume of the codec
- ///
- protected override Func VolumeLevelFeedbackFunc
- {
- get
- {
- return () => CrestronEnvironment.ScaleWithLimits(CodecStatus.Status.Audio.Volume.IntValue, 100, 0, 65535, 0);
- }
- }
-
- protected override Func PrivacyModeIsOnFeedbackFunc
- {
- get
- {
- return () => CodecStatus.Status.Audio.Microphones.Mute.BoolValue;
- }
- }
-
- protected override Func StandbyIsOnFeedbackFunc
- {
- get
- {
- return () => CodecStatus.Status.Standby.State.BoolValue;
- }
- }
-
- ///
- /// Gets the value of the currently shared source, or returns null
- ///
- protected override Func SharingSourceFeedbackFunc
- {
- get
- {
- return () => _presentationSourceKey;
- }
- }
-
- protected override Func SharingContentIsOnFeedbackFunc
- {
- get
- {
- return () => CodecStatus.Status.Conference.Presentation.Mode.BoolValue;
- }
- }
-
- protected Func FarEndIsSharingContentFeedbackFunc
- {
- get
- {
- return () => CodecStatus.Status.Conference.Presentation.Mode.Value == "Receiving";
- }
- }
-
- protected override Func MuteFeedbackFunc
- {
- get
- {
- return () => CodecStatus.Status.Audio.VolumeMute.BoolValue;
- }
- }
-
- protected Func RoomIsOccupiedFeedbackFunc
- {
- get
- {
- return () => CodecStatus.Status.RoomAnalytics.PeoplePresence.BoolValue;
- }
- }
-
- protected Func PeopleCountFeedbackFunc
- {
- get
- {
- return () => CodecStatus.Status.RoomAnalytics.PeopleCount.Current.IntValue;
- }
- }
-
- protected Func SpeakerTrackIsOnFeedbackFunc
- {
- get
- {
- return () => CodecStatus.Status.Cameras.SpeakerTrack.Status.BoolValue;
- }
- }
-
- protected Func SelfViewIsOnFeedbackFunc
- {
- get
- {
- return () => CodecStatus.Status.Video.Selfview.Mode.BoolValue;
- }
- }
-
- protected Func SelfviewPipPositionFeedbackFunc
- {
- get
- {
- return () => _currentSelfviewPipPosition.Label;
- }
- }
-
- protected Func LocalLayoutFeedbackFunc
- {
- get
- {
- return () => _currentLocalLayout.Label;
- }
- }
-
- protected Func LocalLayoutIsProminentFeedbackFunc
- {
- get
- {
- return () => _currentLocalLayout.Label == "Prominent";
- }
- }
-
-
- private string _cliFeedbackRegistrationExpression;
-
- private CodecSyncState _syncState;
-
- public CodecPhonebookSyncState PhonebookSyncState { get; private set; }
-
- private StringBuilder _jsonMessage;
-
- private bool _jsonFeedbackMessageIsIncoming;
-
- public bool CommDebuggingIsOn;
-
- string Delimiter = "\r\n";
-
- public IntFeedback PresentationSourceFeedback { get; private set; }
-
- public BoolFeedback PresentationSendingLocalOnlyFeedback { get; private set; }
-
- public BoolFeedback PresentationSendingLocalRemoteFeedback { get; private set; }
-
- ///
- /// Used to track the current connector used for the presentation source
- ///
- private int _presentationSource;
-
- ///
- /// Used to track the connector that is desired to be the current presentation source (until the command is send)
- ///
- private int _desiredPresentationSource;
-
- private string _presentationSourceKey;
-
- private bool _presentationLocalOnly;
-
- private bool _presentationLocalRemote;
-
- private string _phonebookMode = "Local"; // Default to Local
-
- private uint _phonebookResultsLimit = 255; // Could be set later by config.
-
- private CTimer _loginMessageReceivedTimer;
- private CTimer _retryConnectionTimer;
-
- // **___________________________________________________________________**
- // Timers to be moved to the global system timer at a later point....
- private CTimer BookingsRefreshTimer;
- private CTimer PhonebookRefreshTimer;
- // **___________________________________________________________________**
-
- public RoutingInputPort CodecOsdIn { get; private set; }
- public RoutingInputPort HdmiIn2 { get; private set; }
- public RoutingInputPort HdmiIn3 { get; private set; }
- public RoutingOutputPort HdmiOut1 { get; private set; }
- public RoutingOutputPort HdmiOut2 { get; private set; }
-
-
- // Constructor for IBasicCommunication
- public CiscoSparkCodec(DeviceConfig config, IBasicCommunication comm)
- : base(config)
- {
- var props = JsonConvert.DeserializeObject(config.Properties.ToString());
-
- _config = props;
-
- // Use the configured phonebook results limit if present
- if (props.PhonebookResultsLimit > 0)
- {
- _phonebookResultsLimit = props.PhonebookResultsLimit;
- }
-
- // The queue that will collect the repsonses in the order they are received
- _receiveQueue = new GenericQueue(this.Key + "-rxQueue", 25);
-
- RoomIsOccupiedFeedback = new BoolFeedback(RoomIsOccupiedFeedbackFunc);
- PeopleCountFeedback = new IntFeedback(PeopleCountFeedbackFunc);
- CameraAutoModeIsOnFeedback = new BoolFeedback(SpeakerTrackIsOnFeedbackFunc);
- SelfviewIsOnFeedback = new BoolFeedback(SelfViewIsOnFeedbackFunc);
- SelfviewPipPositionFeedback = new StringFeedback(SelfviewPipPositionFeedbackFunc);
- LocalLayoutFeedback = new StringFeedback(LocalLayoutFeedbackFunc);
- LocalLayoutIsProminentFeedback = new BoolFeedback(LocalLayoutIsProminentFeedbackFunc);
- FarEndIsSharingContentFeedback = new BoolFeedback(FarEndIsSharingContentFeedbackFunc);
- CameraIsOffFeedback = new BoolFeedback(() => CodecStatus.Status.Video.Input.MainVideoMute.BoolValue);
- CameraIsMutedFeedback = CameraIsOffFeedback;
- SupportsCameraOff = true;
-
- DoNotDisturbModeIsOnFeedback = new BoolFeedback(() => CodecStatus.Status.Conference.DoNotDisturb.BoolValue);
- HalfWakeModeIsOnFeedback = new BoolFeedback(() => CodecStatus.Status.Standby.State.Value.ToLower() == "halfwake");
- EnteringStandbyModeFeedback = new BoolFeedback(() => CodecStatus.Status.Standby.State.Value.ToLower() == "enteringstandby");
-
- PresentationViewMaximizedFeedback = new BoolFeedback(() => _currentPresentationView == "Maximized");
-
- RingtoneVolumeFeedback = new IntFeedback(() => CodecConfiguration.Configuration.Audio.SoundsAndAlerts.RingVolume.Volume);
-
- PresentationSourceFeedback = new IntFeedback(() => _presentationSource);
- PresentationSendingLocalOnlyFeedback = new BoolFeedback(() => _presentationLocalOnly);
- PresentationSendingLocalRemoteFeedback = new BoolFeedback(() => _presentationLocalRemote);
-
- Communication = comm;
-
- if (props.CommunicationMonitorProperties != null)
- {
- CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
- }
- else
- {
- var command = string.Format("xCommand Peripherals HeartBeat ID: {0}{1}", CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, Delimiter);
- CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, command);
- }
-
- if (props.Sharing != null)
- AutoShareContentWhileInCall = props.Sharing.AutoShareContentWhileInCall;
-
- ShowSelfViewByDefault = props.ShowSelfViewByDefault;
-
- DeviceManager.AddDevice(CommunicationMonitor);
-
- _phonebookMode = props.PhonebookMode;
-
- _syncState = new CodecSyncState(Key + "--Sync", this);
-
- PhonebookSyncState = new CodecPhonebookSyncState(Key + "--PhonebookSync");
-
- _syncState.InitialSyncCompleted += new EventHandler(SyncState_InitialSyncCompleted);
-
- PortGather = new CommunicationGather(Communication, Delimiter);
- PortGather.IncludeDelimiter = true;
- PortGather.LineReceived += this.Port_LineReceived;
-
- CodecInfo = new CiscoCodecInfo(CodecStatus, CodecConfiguration);
-
- CallHistory = new CodecCallHistory();
-
-
- if (props.Favorites != null)
- {
- CallFavorites = new CodecCallFavorites();
- CallFavorites.Favorites = props.Favorites;
- }
-
- DirectoryRoot = new CodecDirectory();
-
- DirectoryBrowseHistory = new List();
-
- CurrentDirectoryResultIsNotDirectoryRoot = new BoolFeedback(() => DirectoryBrowseHistory.Count > 0);
-
- CurrentDirectoryResultIsNotDirectoryRoot.FireUpdate();
-
- CodecSchedule = new CodecScheduleAwareness();
-
- //Set Feedback Actions
- SetFeedbackActions();
-
- CodecOsdIn = new RoutingInputPort(RoutingPortNames.CodecOsd, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, new Action(StopSharing), this);
- HdmiIn2 = new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource1), this);
- HdmiIn3 = new RoutingInputPort(RoutingPortNames.HdmiIn3, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource2), this);
-
- HdmiOut1 = new RoutingOutputPort(RoutingPortNames.HdmiOut1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, null, this);
- HdmiOut2 = new RoutingOutputPort(RoutingPortNames.HdmiOut2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, null, this);
-
- InputPorts.Add(CodecOsdIn);
- InputPorts.Add(HdmiIn2);
- InputPorts.Add(HdmiIn3);
- OutputPorts.Add(HdmiOut1);
- CreateOsdSource();
-
- ExternalSourceListEnabled = props.ExternalSourceListEnabled;
- ExternalSourceInputPort = props.ExternalSourceInputPort;
-
- if (props.UiBranding == null)
- {
- return;
- }
- Debug.Console(2, this, "Setting branding properties enable: {0} _brandingUrl {1}", props.UiBranding.Enable,
- props.UiBranding.BrandingUrl);
-
- BrandingEnabled = props.UiBranding.Enable;
-
- _brandingUrl = props.UiBranding.BrandingUrl;
- }
-
- private void SetFeedbackActions()
- {
- CodecStatus.Status.Audio.Volume.ValueChangedAction = VolumeLevelFeedback.FireUpdate;
- CodecStatus.Status.Audio.VolumeMute.ValueChangedAction = MuteFeedback.FireUpdate;
- CodecStatus.Status.Audio.Microphones.Mute.ValueChangedAction = PrivacyModeIsOnFeedback.FireUpdate;
- CodecStatus.Status.Standby.State.ValueChangedAction = new Action(() =>
- {
- StandbyIsOnFeedback.FireUpdate();
- HalfWakeModeIsOnFeedback.FireUpdate();
- EnteringStandbyModeFeedback.FireUpdate();
- });
- CodecStatus.Status.RoomAnalytics.PeoplePresence.ValueChangedAction = RoomIsOccupiedFeedback.FireUpdate;
- CodecStatus.Status.RoomAnalytics.PeopleCount.Current.ValueChangedAction = PeopleCountFeedback.FireUpdate;
- CodecStatus.Status.Cameras.SpeakerTrack.Status.ValueChangedAction = CameraAutoModeIsOnFeedback.FireUpdate;
- CodecStatus.Status.Cameras.SpeakerTrack.Availability.ValueChangedAction = () => { SupportsCameraAutoMode = CodecStatus.Status.Cameras.SpeakerTrack.Availability.BoolValue; };
- CodecStatus.Status.Video.Selfview.Mode.ValueChangedAction = SelfviewIsOnFeedback.FireUpdate;
- CodecStatus.Status.Video.Selfview.PIPPosition.ValueChangedAction = ComputeSelfviewPipStatus;
- CodecStatus.Status.Video.Layout.LayoutFamily.Local.ValueChangedAction = ComputeLocalLayout;
- CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = () =>
- {
- SharingContentIsOnFeedback.FireUpdate();
- FarEndIsSharingContentFeedback.FireUpdate();
- };
- CodecStatus.Status.Conference.DoNotDisturb.ValueChangedAction = DoNotDisturbModeIsOnFeedback.FireUpdate;
-
- CodecConfiguration.Configuration.Audio.SoundsAndAlerts.RingVolume.ValueChangedAction = RingtoneVolumeFeedback.FireUpdate;
-
- try
- {
- CodecStatus.Status.Video.Input.MainVideoMute.ValueChangedAction = CameraIsOffFeedback.FireUpdate;
- }
- catch (Exception ex)
- {
- Debug.Console(0, this, "Error setting MainVideuMute Action: {0}", ex);
-
- if (ex.InnerException != null)
- {
- Debug.Console(0, this, "Error setting MainVideuMute Action: {0}", ex);
- }
- }
- }
-
- ///
- /// Creates the fake OSD source, and connects it's AudioVideo output to the CodecOsdIn input
- /// to enable routing
- ///
- void CreateOsdSource()
- {
- OsdSource = new DummyRoutingInputsDevice(Key + "[osd]");
- DeviceManager.AddDevice(OsdSource);
- var tl = new TieLine(OsdSource.AudioVideoOutputPort, CodecOsdIn);
- TieLineCollection.Default.Add(tl);
- }
-
- public void InitializeBranding(string roomKey)
- {
- Debug.Console(1, this, "Initializing Branding for room {0}", roomKey);
-
- if (!BrandingEnabled)
- {
- return;
- }
-
- var mcBridgeKey = String.Format("mobileControlBridge-{0}", roomKey);
-
- var mcBridge = DeviceManager.GetDeviceForKey(mcBridgeKey) as IMobileControlRoomBridge;
-
- if (!String.IsNullOrEmpty(_brandingUrl))
- {
- Debug.Console(1, this, "Branding URL found: {0}", _brandingUrl);
- if (_brandingTimer != null)
- {
- _brandingTimer.Stop();
- _brandingTimer.Dispose();
- }
-
- _brandingTimer = new CTimer((o) =>
- {
- if (_sendMcUrl)
- {
- SendMcBrandingUrl(mcBridge);
- _sendMcUrl = false;
- }
- else
- {
- SendBrandingUrl();
- _sendMcUrl = true;
- }
- }, 0, 15000);
- } else if (String.IsNullOrEmpty(_brandingUrl))
- {
- Debug.Console(1, this, "No Branding URL found");
- if (mcBridge == null) return;
-
- Debug.Console(2, this, "Setting QR code URL: {0}", mcBridge.QrCodeUrl);
-
- mcBridge.UserCodeChanged += (o, a) => SendMcBrandingUrl(mcBridge);
- mcBridge.UserPromptedForCode += (o, a) => DisplayUserCode(mcBridge.UserCode);
-
- SendMcBrandingUrl(mcBridge);
- }
- }
-
- ///
- /// Displays the code for the specified duration
- ///
- /// Mobile Control user code
- private void DisplayUserCode(string code)
- {
- EnqueueCommand(string.Format("xcommand userinterface message alert display title:\"Mobile Control User Code:\" text:\"{0}\" duration: 30", code));
- }
-
- private void SendMcBrandingUrl(IMobileControlRoomBridge mcBridge)
- {
- if (mcBridge == null)
- {
- return;
- }
-
- Debug.Console(1, this, "Sending url: {0}", mcBridge.QrCodeUrl);
-
- EnqueueCommand("xconfiguration userinterface custommessage: \"Scan the QR code with a mobile phone to get started\"");
- EnqueueCommand("xconfiguration userinterface osd halfwakemessage: \"Tap the touch panel or scan the QR code with a mobile phone to get started\"");
-
- var checksum = !String.IsNullOrEmpty(mcBridge.QrCodeChecksum)
- ? String.Format("checksum: {0} ", mcBridge.QrCodeChecksum)
- : String.Empty;
-
- EnqueueCommand(String.Format(
- "xcommand userinterface branding fetch {1}type: branding url: {0}",
- mcBridge.QrCodeUrl, checksum));
- EnqueueCommand(String.Format(
- "xcommand userinterface branding fetch {1}type: halfwakebranding url: {0}",
- mcBridge.QrCodeUrl, checksum));
- }
-
- private void SendBrandingUrl()
- {
- Debug.Console(1, this, "Sending url: {0}", _brandingUrl);
-
- EnqueueCommand(String.Format("xcommand userinterface branding fetch type: branding url: {0}",
- _brandingUrl));
- EnqueueCommand(String.Format("xcommand userinterface branding fetch type: halfwakebranding url: {0}",
- _brandingUrl));
- }
- ///
- /// Starts the HTTP feedback server and syncronizes state of codec
- ///
- ///
- public override bool CustomActivate()
- {
- CrestronConsole.AddNewConsoleCommand(SetCommDebug, "SetCodecCommDebug", "0 for Off, 1 for on", ConsoleAccessLevelEnum.AccessOperator);
- CrestronConsole.AddNewConsoleCommand(GetPhonebook, "GetCodecPhonebook", "Triggers a refresh of the codec phonebook", ConsoleAccessLevelEnum.AccessOperator);
- CrestronConsole.AddNewConsoleCommand(GetBookings, "GetCodecBookings", "Triggers a refresh of the booking data for today", ConsoleAccessLevelEnum.AccessOperator);
-
- PhonebookSyncState.InitialSyncCompleted += new EventHandler(PhonebookSyncState_InitialSyncCompleted);
-
- return base.CustomActivate();
- }
-
- void PhonebookSyncState_InitialSyncCompleted(object sender, EventArgs e)
- {
- OnDirectoryResultReturned(DirectoryRoot);
- }
-
- #region Overrides of Device
-
- public override void Initialize()
- {
- var socket = Communication as ISocketStatus;
- if (socket != null)
- {
- socket.ConnectionChange += new EventHandler(socket_ConnectionChange);
- }
-
- Communication.Connect();
-
- CommunicationMonitor.Start();
-
- const string prefix = "xFeedback register ";
-
- _cliFeedbackRegistrationExpression =
- prefix + "/Configuration" + Delimiter +
- prefix + "/Status/Audio" + Delimiter +
- prefix + "/Status/Call" + Delimiter +
- prefix + "/Status/Conference/Presentation" + Delimiter +
- prefix + "/Status/Conference/DoNotDisturb" + Delimiter +
- prefix + "/Status/Cameras/SpeakerTrack" + Delimiter +
- prefix + "/Status/RoomAnalytics" + Delimiter +
- prefix + "/Status/RoomPreset" + Delimiter +
- prefix + "/Status/Standby" + Delimiter +
- prefix + "/Status/Video/Selfview" + Delimiter +
- prefix + "/Status/Video/Layout" + Delimiter +
- prefix + "/Status/Video/Input/MainVideoMute" + Delimiter +
- prefix + "/Bookings" + Delimiter +
- prefix + "/Event/Bookings" + Delimiter +
- prefix + "/Event/CameraPresetListUpdated" + Delimiter +
- prefix + "/Event/UserInterface/Presentation/ExternalSource/Selected/SourceIdentifier" + Delimiter +
- prefix + "/Event/CallDisconnect" + Delimiter; // Keep CallDisconnect last to detect when feedback registration completes correctly
-
- }
-
- #endregion
-
- ///
- /// Fires when initial codec sync is completed. Used to then send commands to get call history, phonebook, bookings, etc.
- ///
- ///
- ///
- void SyncState_InitialSyncCompleted(object sender, EventArgs e)
- {
- // Check for camera config info first
- if (_config.CameraInfo.Count > 0)
- {
- Debug.Console(0, this, "Reading codec cameraInfo from config properties.");
- SetUpCameras(_config.CameraInfo);
- }
- else
- {
- Debug.Console(0, this, "No cameraInfo defined in video codec config. Attempting to get camera info from codec status data");
- try
- {
- var cameraInfo = new List();
-
- Debug.Console(0, this, "Codec reports {0} cameras", CodecStatus.Status.Cameras.Camera.Count);
-
- foreach (var camera in CodecStatus.Status.Cameras.Camera)
- {
- Debug.Console(0, this,
-@"Camera id: {0}
-Name: {1}
-ConnectorID: {2}"
-, camera.id
-, camera.Manufacturer.Value
-, camera.Model.Value);
-
- var id = Convert.ToUInt16(camera.id);
- var info = new CameraInfo() { CameraNumber = id, Name = string.Format("{0} {1}", camera.Manufacturer.Value, camera.Model.Value), SourceId = camera.DetectedConnector.ConnectorId };
- cameraInfo.Add(info);
- }
-
- Debug.Console(0, this, "Successfully got cameraInfo for {0} cameras from codec.", cameraInfo.Count);
-
- SetUpCameras(cameraInfo);
- }
- catch (Exception ex)
- {
- Debug.Console(2, this, "Error generating camera info from codec status data: {0}", ex);
- }
- }
-
- //CommDebuggingIsOn = false;
-
- GetCallHistory();
-
- PhonebookRefreshTimer = new CTimer(CheckCurrentHour, 3600000, 3600000); // check each hour to see if the phonebook should be downloaded
- GetPhonebook(null);
-
- BookingsRefreshTimer = new CTimer(GetBookings, 900000, 900000); // 15 minute timer to check for new booking info
- GetBookings(null);
-
- // Fire the ready event
- SetIsReady();
- }
-
- public void SetCommDebug(string s)
- {
- if (s == "1")
- {
- CommDebuggingIsOn = true;
- Debug.Console(0, this, "Comm Debug Enabled.");
- }
- else
- {
- CommDebuggingIsOn = false;
- Debug.Console(0, this, "Comm Debug Disabled.");
- }
- }
-
- void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
- {
- Debug.Console(1, this, "Socket status change {0}", e.Client.ClientStatus);
- if (e.Client.IsConnected)
- {
- if(!_syncState.LoginMessageWasReceived)
- _loginMessageReceivedTimer = new CTimer(o => DisconnectClientAndReconnect(), 5000);
- }
- else
- {
- _syncState.CodecDisconnected();
- PhonebookSyncState.CodecDisconnected();
-
- if (PhonebookRefreshTimer != null)
- {
- PhonebookRefreshTimer.Stop();
- PhonebookRefreshTimer = null;
- }
-
- if (BookingsRefreshTimer != null)
- {
- BookingsRefreshTimer.Stop();
- BookingsRefreshTimer = null;
- }
- }
- }
-
- void DisconnectClientAndReconnect()
- {
- Debug.Console(1, this, "Retrying connection to codec.");
-
- Communication.Disconnect();
-
- _retryConnectionTimer = new CTimer(o => Communication.Connect(), 2000);
-
- //CrestronEnvironment.Sleep(2000);
-
- //Communication.Connect();
- }
-
- ///
- /// Gathers responses from the codec (including the delimiter. Responses are checked to see if they contain JSON data and if so, the data is collected until a complete JSON
- /// message is received before forwarding the message to be deserialized.
- ///
- ///
- ///
- void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
- {
- if (CommDebuggingIsOn)
- {
- if (!_jsonFeedbackMessageIsIncoming)
- Debug.Console(1, this, "RX: '{0}'", ComTextHelper.GetDebugText(args.Text));
- }
-
- if(args.Text.ToLower().Contains("xcommand"))
- {
- Debug.Console(1, this, "Received command echo response. Ignoring");
- return;
- }
-
- if (args.Text == "{" + Delimiter) // Check for the beginning of a new JSON message
- {
- _jsonFeedbackMessageIsIncoming = true;
-
- if (CommDebuggingIsOn)
- Debug.Console(1, this, "Incoming JSON message...");
-
- _jsonMessage = new StringBuilder();
- }
- else if (args.Text == "}" + Delimiter) // Check for the end of a JSON message
- {
- _jsonFeedbackMessageIsIncoming = false;
-
- _jsonMessage.Append(args.Text);
-
- if (CommDebuggingIsOn)
- Debug.Console(1, this, "Complete JSON Received:\n{0}", _jsonMessage.ToString());
-
- // Enqueue the complete message to be deserialized
-
- _receiveQueue.Enqueue(new ProcessStringMessage(_jsonMessage.ToString(), DeserializeResponse));
-
- return;
- }
-
- if(_jsonFeedbackMessageIsIncoming)
- {
- _jsonMessage.Append(args.Text);
-
- //Debug.Console(1, this, "Building JSON:\n{0}", JsonMessage.ToString());
- return;
- }
-
- if (!_syncState.InitialSyncComplete)
- {
- switch (args.Text.Trim().ToLower()) // remove the whitespace
- {
- case "*r login successful":
- {
- _syncState.LoginMessageReceived();
-
- if(_loginMessageReceivedTimer != null)
- _loginMessageReceivedTimer.Stop();
-
- //SendText("echo off");
- SendText("xPreferences outputmode json");
- break;
- }
- case "xpreferences outputmode json":
- {
- if (_syncState.JsonResponseModeSet)
- return;
-
- _syncState.JsonResponseModeMessageReceived();
-
- if (!_syncState.InitialStatusMessageWasReceived)
- SendText("xStatus");
- break;
- }
- case "xfeedback register /event/calldisconnect":
- {
- _syncState.FeedbackRegistered();
- break;
- }
- }
- }
- }
-
- ///
- /// Enqueues a command to be sent to the codec.
- ///
- ///
- public void EnqueueCommand(string command)
- {
- _syncState.AddCommandToQueue(command);
- }
-
- ///
- /// Appends the delimiter and send the command to the codec.
- /// Should not be used for sending general commands to the codec. Use EnqueueCommand instead.
- /// Should be used to get initial Status and Configuration as well as set up Feedback Registration
- ///
- ///
- public void SendText(string command)
- {
- if (CommDebuggingIsOn)
- Debug.Console(1, this, "Sending: '{0}'", ComTextHelper.GetDebugText(command + Delimiter));
-
- Communication.SendText(command + Delimiter);
- }
-
- void DeserializeResponse(string response)
- {
- try
- {
- //// Serializer settings. We want to ignore null values and missing members
- //JsonSerializerSettings settings = new JsonSerializerSettings();
- //settings.NullValueHandling = NullValueHandling.Ignore;
- //settings.MissingMemberHandling = MissingMemberHandling.Ignore;
- //settings.ObjectCreationHandling = ObjectCreationHandling.Auto;
-
- if (response.IndexOf("\"Status\":{") > -1 || response.IndexOf("\"Status\": {") > -1)
- {
- // Status Message
-
- // Temp object so we can inpsect for call data before simply deserializing
- CiscoCodecStatus.RootObject tempCodecStatus = new CiscoCodecStatus.RootObject();
-
- JsonConvert.PopulateObject(response, tempCodecStatus);
-
- // Check to see if the message contains /Status/Conference/Presentation/LocalInstance and extract source value
- var conference = tempCodecStatus.Status.Conference;
-
- if (conference.Presentation != null && conference.Presentation.LocalInstance == null)
- {
- // Handles an empty presentation object response
- return;
- }
-
- if (conference.Presentation.LocalInstance.Count > 0)
- {
- if (!string.IsNullOrEmpty(conference.Presentation.LocalInstance[0].ghost))
- {
- _presentationSource = 0;
- _presentationLocalOnly = false;
- _presentationLocalRemote = false;
- }
- else if (conference.Presentation.LocalInstance[0].Source != null)
- {
- _presentationSource = conference.Presentation.LocalInstance[0].Source.IntValue;
-
- // Check for any values in the SendingMode property
- if (conference.Presentation.LocalInstance.Any((i) => !string.IsNullOrEmpty(i.SendingMode.Value)))
- {
- _presentationLocalOnly = conference.Presentation.LocalInstance.Any((i) => i.SendingMode.LocalOnly);
- _presentationLocalRemote = conference.Presentation.LocalInstance.Any((i) => i.SendingMode.LocalRemote);
- }
- }
-
- PresentationSourceFeedback.FireUpdate();
- PresentationSendingLocalOnlyFeedback.FireUpdate();
- PresentationSendingLocalRemoteFeedback.FireUpdate();
- }
-
- // Check to see if this is a call status message received after the initial status message
- if (tempCodecStatus.Status.Call.Count > 0)
- {
- // Iterate through the call objects in the response
- foreach (CiscoCodecStatus.Call call in tempCodecStatus.Status.Call)
- {
- var tempActiveCall = ActiveCalls.FirstOrDefault(c => c.Id.Equals(call.id));
-
- if (tempActiveCall != null)
- {
- bool changeDetected = false;
-
- eCodecCallStatus newStatus = eCodecCallStatus.Unknown;
-
- // Update properties of ActiveCallItem
- if(call.Status != null)
- if (!string.IsNullOrEmpty(call.Status.Value))
- {
- tempActiveCall.Status = CodecCallStatus.ConvertToStatusEnum(call.Status.Value);
- tempActiveCall.IsOnHold = tempActiveCall.Status == eCodecCallStatus.OnHold;
-
- if (newStatus == eCodecCallStatus.Connected)
- GetCallHistory();
-
- changeDetected = true;
- }
- if (call.CallType != null)
- if (!string.IsNullOrEmpty(call.CallType.Value))
- {
- tempActiveCall.Type = CodecCallType.ConvertToTypeEnum(call.CallType.Value);
- changeDetected = true;
- }
- if (call.DisplayName != null)
- if (!string.IsNullOrEmpty(call.DisplayName.Value))
- {
- tempActiveCall.Name = call.DisplayName.Value;
- changeDetected = true;
- }
- if (call.Direction != null)
- {
- if (!string.IsNullOrEmpty(call.Direction.Value))
- {
- tempActiveCall.Direction = CodecCallDirection.ConvertToDirectionEnum(call.Direction.Value);
- changeDetected = true;
- }
- }
- if(call.Duration != null)
- {
- if(!string.IsNullOrEmpty(call.Duration.Value))
- {
- tempActiveCall.Duration = call.Duration.DurationValue;
- changeDetected = true;
- }
- }
- if(call.PlacedOnHold != null)
- {
- tempActiveCall.IsOnHold = call.PlacedOnHold.BoolValue;
- changeDetected = true;
- }
-
- if (changeDetected)
- {
- SetSelfViewMode();
- OnCallStatusChange(tempActiveCall);
- ListCalls();
- }
- }
- else if( call.ghost == null ) // if the ghost value is present the call has ended already
- {
- // Create a new call item
- var newCallItem = new CodecActiveCallItem()
- {
- Id = call.id,
- Status = CodecCallStatus.ConvertToStatusEnum(call.Status.Value),
- Name = call.DisplayName.Value,
- Number = call.RemoteNumber.Value,
- Type = CodecCallType.ConvertToTypeEnum(call.CallType.Value),
- Direction = CodecCallDirection.ConvertToDirectionEnum(call.Direction.Value),
- Duration = call.Duration.DurationValue,
- IsOnHold = call.PlacedOnHold.BoolValue,
- };
-
- // Add it to the ActiveCalls List
- ActiveCalls.Add(newCallItem);
-
- ListCalls();
-
- SetSelfViewMode();
- OnCallStatusChange(newCallItem);
- }
-
- }
-
- }
-
- // Check for Room Preset data (comes in partial, so we need to handle these responses differently to prevent appending duplicate items
- var tempPresets = tempCodecStatus.Status.RoomPreset;
-
- if (tempPresets.Count > 0)
- {
- // Create temporary list to store the existing items from the CiscoCodecStatus.RoomPreset collection
- var existingRoomPresets = new List();
- // Add the existing items to the temporary list
- existingRoomPresets.AddRange(CodecStatus.Status.RoomPreset);
- // Populate the CodecStatus object (this will append new values to the RoomPreset collection
- JsonConvert.PopulateObject(response, CodecStatus);
-
- var jResponse = JObject.Parse(response);
-
-
- IList roomPresets = jResponse["Status"]["RoomPreset"].Children().ToList();
- // Iterate the new items in this response agains the temporary list. Overwrite any existing items and add new ones.
- foreach (var camPreset in tempPresets)
- {
- var preset = camPreset as CiscoCodecStatus.RoomPreset;
- if (preset == null) continue;
- // First fine the existing preset that matches the id
- var existingPreset = existingRoomPresets.FirstOrDefault(p => p.id.Equals(preset.id));
- if (existingPreset != null)
- {
- Debug.Console(1, this, "Existing Room Preset with ID: {0} found. Updating.", existingPreset.id);
-
- JToken updatedPreset = null;
-
- // Find the JToken from the response with the matching id
- foreach (var jPreset in roomPresets)
- {
- if (jPreset["id"].Value() == existingPreset.id)
- updatedPreset = jPreset;
- }
-
- if (updatedPreset != null)
- {
- // use PopulateObject to overlay the partial data onto the existing object
- JsonConvert.PopulateObject(updatedPreset.ToString(), existingPreset);
- }
-
- }
- else
- {
- Debug.Console(1, this, "New Room Preset with ID: {0}. Adding.", preset.id);
- existingRoomPresets.Add(preset);
- }
- }
-
- // Replace the list in the CodecStatus object with the processed list
- CodecStatus.Status.RoomPreset = existingRoomPresets;
-
- // Generecise the list
- NearEndPresets = existingRoomPresets.GetGenericPresets();
-
- var handler = CodecRoomPresetsListHasChanged;
- if (handler != null)
- {
- handler(this, new EventArgs());
- }
- }
- else
- {
- JsonConvert.PopulateObject(response, CodecStatus);
- }
-
- if (!_syncState.InitialStatusMessageWasReceived)
- {
- _syncState.InitialStatusMessageReceived();
-
- if (!_syncState.InitialConfigurationMessageWasReceived)
- {
- SendText("xConfiguration");
- }
- }
- }
- else if (response.IndexOf("\"Configuration\":{") > -1 || response.IndexOf("\"Configuration\": {") > -1)
- {
- // Configuration Message
-
- JsonConvert.PopulateObject(response, CodecConfiguration);
-
- if (!_syncState.InitialConfigurationMessageWasReceived)
- {
- _syncState.InitialConfigurationMessageReceived();
- if (!_syncState.FeedbackWasRegistered)
- {
- SendText(_cliFeedbackRegistrationExpression);
- }
- }
-
- }
- else if (response.IndexOf("\"Event\":{") > -1 || response.IndexOf("\"Event\": {") > -1)
- {
- if (response.IndexOf("\"CallDisconnect\":{") > -1 || response.IndexOf("\"CallDisconnect\": {") > -1)
- {
- CiscoCodecEvents.RootObject eventReceived = new CiscoCodecEvents.RootObject();
-
- JsonConvert.PopulateObject(response, eventReceived);
-
- EvalutateDisconnectEvent(eventReceived);
- }
- else if (response.IndexOf("\"Bookings\":{") > -1 || response.IndexOf("\"Bookings\": {") > -1) // The list has changed, reload it
- {
- 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);
-
- if (RunRouteAction != null && !_externalSourceChangeRequested)
- {
- RunRouteAction(eventReceived.Event.UserInterface.Presentation.ExternalSource.Selected.SourceIdentifier.Value, null);
- }
-
- _externalSourceChangeRequested = false;
- }
- }
- else if (response.IndexOf("\"CommandResponse\":{") > -1 || response.IndexOf("\"CommandResponse\": {") > -1)
- {
- // CommandResponse Message
-
- if (response.IndexOf("\"CallHistoryRecentsResult\":{") > -1 || response.IndexOf("\"CallHistoryRecentsResult\": {") > -1)
- {
- var codecCallHistory = new CiscoCallHistory.RootObject();
-
- JsonConvert.PopulateObject(response, codecCallHistory);
-
- CallHistory.ConvertCiscoCallHistoryToGeneric(codecCallHistory.CommandResponse.CallHistoryRecentsResult.Entry);
- }
- else if (response.IndexOf("\"CallHistoryDeleteEntryResult\":{") > -1 || response.IndexOf("\"CallHistoryDeleteEntryResult\": {") > -1)
- {
- GetCallHistory();
- }
- else if (response.IndexOf("\"PhonebookSearchResult\":{") > -1 || response.IndexOf("\"PhonebookSearchResult\": {") > -1)
- {
- var codecPhonebookResponse = new CiscoCodecPhonebook.RootObject();
-
- JsonConvert.PopulateObject(response, codecPhonebookResponse);
-
- if (!PhonebookSyncState.InitialPhonebookFoldersWasReceived)
- {
- // Check if the phonebook has any folders
- PhonebookSyncState.InitialPhonebookFoldersReceived();
-
- PhonebookSyncState.SetPhonebookHasFolders(codecPhonebookResponse.CommandResponse.PhonebookSearchResult.Folder.Count > 0);
-
- if (PhonebookSyncState.PhonebookHasFolders)
- {
- DirectoryRoot.AddFoldersToDirectory(CiscoCodecPhonebook.GetRootFoldersFromSearchResult(codecPhonebookResponse.CommandResponse.PhonebookSearchResult));
- }
-
- // Get the number of contacts in the phonebook
- GetPhonebookContacts();
- }
- else if (!PhonebookSyncState.NumberOfContactsWasReceived)
- {
- // Store the total number of contacts in the phonebook
- PhonebookSyncState.SetNumberOfContacts(Int32.Parse(codecPhonebookResponse.CommandResponse.PhonebookSearchResult.ResultInfo.TotalRows.Value));
-
- DirectoryRoot.AddContactsToDirectory(CiscoCodecPhonebook.GetRootContactsFromSearchResult(codecPhonebookResponse.CommandResponse.PhonebookSearchResult));
-
- PhonebookSyncState.PhonebookRootEntriesReceived();
-
- PrintDirectory(DirectoryRoot);
- }
- else if (PhonebookSyncState.InitialSyncComplete)
- {
- var directoryResults = new CodecDirectory();
-
- if(codecPhonebookResponse.CommandResponse.PhonebookSearchResult.ResultInfo.TotalRows.Value != "0")
- directoryResults = CiscoCodecPhonebook.ConvertCiscoPhonebookToGeneric(codecPhonebookResponse.CommandResponse.PhonebookSearchResult);
-
- PrintDirectory(directoryResults);
-
- DirectoryBrowseHistory.Add(directoryResults);
-
- OnDirectoryResultReturned(directoryResults);
-
- }
- }
- else if (response.IndexOf("\"BookingsListResult\":{") > -1)
- {
- var codecBookings = new CiscoCodecBookings.RootObject();
-
- JsonConvert.PopulateObject(response, codecBookings);
-
- if(codecBookings.CommandResponse.BookingsListResult.ResultInfo.TotalRows.Value != "0")
- CodecSchedule.Meetings = CiscoCodecBookings.GetGenericMeetingsFromBookingResult(codecBookings.CommandResponse.BookingsListResult.Booking);
-
- BookingsRefreshTimer.Reset(900000, 900000);
- }
-
- }
-
- }
- catch (Exception ex)
- {
- Debug.Console(1, this, "Error Deserializing feedback from codec: {0}", ex);
-
- if (ex is Newtonsoft.Json.JsonReaderException)
- {
- Debug.Console(1, this, "Received malformed response from codec.");
-
- //Communication.Disconnect();
-
- //Initialize();
- }
-
- }
- }
-
- ///
- /// Call when directory results are updated
- ///
- ///
- void OnDirectoryResultReturned(CodecDirectory result)
- {
- CurrentDirectoryResultIsNotDirectoryRoot.FireUpdate();
-
- // This will return the latest results to all UIs. Multiple indendent UI Directory browsing will require a different methodology
- var handler = DirectoryResultReturned;
- if (handler != null)
- {
- Debug.Console(2, this, "Directory result returned");
- handler(this, new DirectoryEventArgs()
- {
- Directory = result,
- DirectoryIsOnRoot = !CurrentDirectoryResultIsNotDirectoryRoot.BoolValue
- });
- }
-
- PrintDirectory(result);
- }
-
- ///
- /// Evaluates an event received from the codec
- ///
- ///
- void EvalutateDisconnectEvent(CiscoCodecEvents.RootObject eventReceived)
- {
- if (eventReceived.Event.CallDisconnect != null)
- {
- var tempActiveCall = ActiveCalls.FirstOrDefault(c => c.Id.Equals(eventReceived.Event.CallDisconnect.CallId.Value));
-
- // Remove the call from the Active calls list
- if (tempActiveCall != null)
- {
- ActiveCalls.Remove(tempActiveCall);
-
- ListCalls();
-
- SetSelfViewMode();
- // Notify of the call disconnection
- SetNewCallStatusAndFireCallStatusChange(eCodecCallStatus.Disconnected, tempActiveCall);
-
- GetCallHistory();
- }
- }
- }
-
- ///
- ///
- ///
- ///
- public override void ExecuteSwitch(object selector)
- {
- (selector as Action)();
- _presentationSourceKey = selector.ToString();
- }
-
- ///
- /// This is necessary for devices that are "routers" in the middle of the path, even though it only has one output and
- /// may only have one input.
- ///
- public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
- {
- ExecuteSwitch(inputSelector);
- _presentationSourceKey = inputSelector.ToString();
- }
-
-
- ///
- /// Gets the ID of the last connected call
- ///
- ///
- public string GetCallId()
- {
- string callId = null;
-
- if (ActiveCalls.Count > 1)
- {
- var lastCallIndex = ActiveCalls.Count - 1;
- callId = ActiveCalls[lastCallIndex].Id;
- }
- else if (ActiveCalls.Count == 1)
- callId = ActiveCalls[0].Id;
-
- return callId;
-
- }
-
- public void GetCallHistory()
- {
- EnqueueCommand("xCommand CallHistory Recents Limit: 20 Order: OccurrenceTime");
- }
-
- ///
- /// Required for IHasScheduleAwareness
- ///
- public void GetSchedule()
- {
- GetBookings(null);
- }
-
- ///
- /// Gets the bookings for today
- ///
- ///
- public void GetBookings(object command)
- {
- Debug.Console(1, this, "Retrieving Booking Info from Codec. Current Time: {0}", DateTime.Now.ToLocalTime());
-
- EnqueueCommand("xCommand Bookings List Days: 1 DayOffset: 0");
- }
-
- ///
- /// Checks to see if it is 2am (or within that hour) and triggers a download of the phonebook
- ///
- ///
- public void CheckCurrentHour(object o)
- {
- if (DateTime.Now.Hour == 2)
- {
- Debug.Console(1, this, "Checking hour to see if phonebook should be downloaded. Current hour is {0}", DateTime.Now.Hour);
-
- GetPhonebook(null);
- PhonebookRefreshTimer.Reset(3600000, 3600000);
- }
- }
-
- ///
- /// Triggers a refresh of the codec phonebook
- ///
- /// Just to allow this method to be called from a console command
- public void GetPhonebook(string command)
- {
- PhonebookSyncState.CodecDisconnected();
-
- DirectoryRoot = new CodecDirectory();
-
- GetPhonebookFolders();
- }
-
- private void GetPhonebookFolders()
- {
- // Get Phonebook Folders (determine local/corporate from config, and set results limit)
- EnqueueCommand(string.Format("xCommand Phonebook Search PhonebookType: {0} ContactType: Folder", _phonebookMode));
- }
-
- private void GetPhonebookContacts()
- {
- // Get Phonebook Folders (determine local/corporate from config, and set results limit)
- EnqueueCommand(string.Format("xCommand Phonebook Search PhonebookType: {0} ContactType: Contact Limit: {1}", _phonebookMode, _phonebookResultsLimit));
- }
-
- ///
- /// Searches the codec phonebook for all contacts matching the search string
- ///
- ///
- public void SearchDirectory(string searchString)
- {
- EnqueueCommand(string.Format("xCommand Phonebook Search SearchString: \"{0}\" PhonebookType: {1} ContactType: Contact Limit: {2}", searchString, _phonebookMode, _phonebookResultsLimit));
- }
-
- ///
- /// // Get contents of a specific folder in the phonebook
- ///
- ///
- public void GetDirectoryFolderContents(string folderId)
- {
- EnqueueCommand(string.Format("xCommand Phonebook Search FolderId: {0} PhonebookType: {1} ContactType: Any Limit: {2}", folderId, _phonebookMode, _phonebookResultsLimit));
- }
-
- ///
- /// Sets the parent folder contents or the directory root as teh current directory and fires the event. Used to browse up a level
- ///
- ///
- public void GetDirectoryParentFolderContents()
- {
- var currentDirectory = new CodecDirectory();
-
- if (DirectoryBrowseHistory.Count > 0)
- {
- var lastItemIndex = DirectoryBrowseHistory.Count - 1;
- var parentDirectoryContents = DirectoryBrowseHistory[lastItemIndex];
-
- DirectoryBrowseHistory.Remove(DirectoryBrowseHistory[lastItemIndex]);
-
- currentDirectory = parentDirectoryContents;
-
- }
- else
- {
- currentDirectory = DirectoryRoot;
- }
-
- OnDirectoryResultReturned(currentDirectory);
- }
-
- ///
- /// Clears the session browse history and fires the event with the directory root
- ///
- public void SetCurrentDirectoryToRoot()
- {
- DirectoryBrowseHistory.Clear();
-
- OnDirectoryResultReturned(DirectoryRoot);
- }
-
- ///
- /// Prints the directory to console
- ///
- ///
- void PrintDirectory(CodecDirectory directory)
- {
- if (Debug.Level > 0)
- {
- Debug.Console(1, this, "Directory Results:\n");
-
- foreach (DirectoryItem item in directory.CurrentDirectoryResults)
- {
- if (item is DirectoryFolder)
- {
- Debug.Console(1, this, "[+] {0}", item.Name);
- }
- else if (item is DirectoryContact)
- {
- Debug.Console(1, this, "{0}", item.Name);
- }
- }
- Debug.Console(1, this, "Directory is on Root Level: {0}", !CurrentDirectoryResultIsNotDirectoryRoot.BoolValue);
- }
-
- }
-
- ///
- /// Simple dial method
- ///
- ///
- public override void Dial(string number)
- {
- EnqueueCommand(string.Format("xCommand Dial Number: \"{0}\"", number));
- }
-
- ///
- /// Dials a specific meeting
- ///
- ///
- public override void Dial(Meeting meeting)
- {
- foreach (Call c in meeting.Calls)
- {
- Dial(c.Number, c.Protocol, c.CallRate, c.CallType, meeting.Id);
- }
- }
-
- ///
- /// Detailed dial method
- ///
- ///
- ///
- ///
- ///
- ///
- public void Dial(string number, string protocol, string callRate, string callType, string meetingId)
- {
- EnqueueCommand(string.Format("xCommand Dial Number: \"{0}\" Protocol: {1} CallRate: {2} CallType: {3} BookingId: {4}", number, protocol, callRate, callType, meetingId));
- }
-
-
- public override void EndCall(CodecActiveCallItem activeCall)
- {
- EnqueueCommand(string.Format("xCommand Call Disconnect CallId: {0}", activeCall.Id));
- }
-
- public override void EndAllCalls()
- {
- foreach (CodecActiveCallItem activeCall in ActiveCalls)
- {
- EnqueueCommand(string.Format("xCommand Call Disconnect CallId: {0}", activeCall.Id));
- }
- }
-
- public override void AcceptCall(CodecActiveCallItem item)
- {
- EnqueueCommand("xCommand Call Accept");
- }
-
- public override void RejectCall(CodecActiveCallItem item)
- {
- EnqueueCommand("xCommand Call Reject");
- }
-
- #region IHasCallHold Members
-
- public void HoldCall(CodecActiveCallItem activeCall)
- {
- EnqueueCommand(string.Format("xCommand Call Hold CallId: {0}", activeCall.Id));
- }
-
- public void ResumeCall(CodecActiveCallItem activeCall)
- {
- EnqueueCommand(string.Format("xCommand Call Resume CallId: {0}", activeCall.Id));
- }
-
- #endregion
-
- #region IJoinCalls
-
- public void JoinCall(CodecActiveCallItem activeCall)
- {
- EnqueueCommand(string.Format("xCommand Call Join CallId: {0}", activeCall.Id));
- }
-
- public void JoinAllCalls()
- {
- StringBuilder ids = new StringBuilder();
-
- foreach (var call in ActiveCalls)
- {
- if (call.IsActiveCall)
- {
- ids.Append(string.Format(" CallId: {0}", call.Id));
- }
- }
-
- if (ids.Length > 0)
- {
- EnqueueCommand(string.Format("xCommand Call Join {0}", ids.ToString()));
- }
- }
-
- #endregion
-
- ///
- /// Sends tones to the last connected call
- ///
- ///
- public override void SendDtmf(string s)
- {
- EnqueueCommand(string.Format("xCommand Call DTMFSend CallId: {0} DTMFString: \"{1}\"", GetCallId(), s));
- }
-
- ///
- /// Sends tones to a specific call
- ///
- ///
- ///
- public override void SendDtmf(string s, CodecActiveCallItem activeCall)
- {
- EnqueueCommand(string.Format("xCommand Call DTMFSend CallId: {0} DTMFString: \"{1}\"", activeCall.Id, s));
- }
-
- public void SelectPresentationSource(int source)
- {
- _desiredPresentationSource = source;
-
- StartSharing();
- }
-
- ///
- /// Sets the ringtone volume level
- ///
- /// level from 0 - 100 in increments of 5
- public void SetRingtoneVolume(int volume)
- {
- if (volume < 0 || volume > 100)
- {
- Debug.Console(0, this, "Cannot set ringtone volume to '{0}'. Value must be between 0 - 100", volume);
- return;
- }
-
- if (volume % 5 != 0)
- {
- Debug.Console(0, this, "Cannot set ringtone volume to '{0}'. Value must be between 0 - 100 and a multiple of 5", volume);
- return;
- }
-
- EnqueueCommand(string.Format("xConfiguration Audio SoundsAndAlerts RingVolume: {0}", volume));
- }
-
- ///
- /// Select source 1 as the presetnation source
- ///
- public void SelectPresentationSource1()
- {
- SelectPresentationSource(2);
- }
-
- ///
- /// Select source 2 as the presetnation source
- ///
- public void SelectPresentationSource2()
- {
- SelectPresentationSource(3);
- }
-
-
-
- ///
- /// Starts presentation sharing
- ///
- public override void StartSharing()
- {
- string sendingMode = string.Empty;
-
- if (IsInCall)
- sendingMode = "LocalRemote";
- else
- sendingMode = "LocalOnly";
-
- if (_desiredPresentationSource > 0)
- EnqueueCommand(string.Format("xCommand Presentation Start PresentationSource: {0} SendingMode: {1}", _desiredPresentationSource, sendingMode));
- }
-
- ///
- /// Stops sharing the current presentation
- ///
- public override void StopSharing()
- {
- _desiredPresentationSource = 0;
-
- EnqueueCommand("xCommand Presentation Stop");
- }
-
-
-
- public override void PrivacyModeOn()
- {
- EnqueueCommand("xCommand Audio Microphones Mute");
- }
-
- public override void PrivacyModeOff()
- {
- EnqueueCommand("xCommand Audio Microphones Unmute");
- }
-
- public override void PrivacyModeToggle()
- {
- EnqueueCommand("xCommand Audio Microphones ToggleMute");
- }
-
- public override void MuteOff()
- {
- EnqueueCommand("xCommand Audio Volume Unmute");
- }
-
- public override void MuteOn()
- {
- EnqueueCommand("xCommand Audio Volume Mute");
- }
-
- public override void MuteToggle()
- {
- EnqueueCommand("xCommand Audio Volume ToggleMute");
- }
-
- ///
- /// Increments the voluem
- ///
- ///
- public override void VolumeUp(bool pressRelease)
- {
- EnqueueCommand("xCommand Audio Volume Increase");
- }
-
- ///
- /// Decrements the volume
- ///
- ///
- public override void VolumeDown(bool pressRelease)
- {
- EnqueueCommand("xCommand Audio Volume Decrease");
- }
-
- ///
- /// Scales the level and sets the codec to the specified level within its range
- ///
- /// level from slider (0-65535 range)
- public override void SetVolume(ushort level)
- {
- var scaledLevel = CrestronEnvironment.ScaleWithLimits(level, 65535, 0, 100, 0);
- EnqueueCommand(string.Format("xCommand Audio Volume Set Level: {0}", scaledLevel));
- }
-
- ///
- /// Recalls the default volume on the codec
- ///
- public void VolumeSetToDefault()
- {
- EnqueueCommand("xCommand Audio Volume SetToDefault");
- }
-
- ///
- /// Puts the codec in standby mode
- ///
- public override void StandbyActivate()
- {
- EnqueueCommand("xCommand Standby Activate");
- }
-
- ///
- /// Wakes the codec from standby
- ///
- public override void StandbyDeactivate()
- {
- EnqueueCommand("xCommand Standby Deactivate");
- }
-
- public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
- {
- var joinMap = new CiscoCodecJoinMap(joinStart);
-
- var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey);
-
- if (customJoins != null)
- {
- joinMap.SetCustomJoinData(customJoins);
- }
-
- if (bridge != null)
- {
- bridge.AddJoinMap(Key, joinMap);
- }
-
- LinkVideoCodecToApi(this, trilist, joinStart, joinMapKey, bridge);
-
- LinkCiscoCodecToApi(trilist, joinMap);
- }
-
- public void LinkCiscoCodecToApi(BasicTriList trilist, CiscoCodecJoinMap joinMap)
- {
- // Custom commands to codec
- trilist.SetStringSigAction(joinMap.CommandToDevice.JoinNumber, (s) => this.EnqueueCommand(s));
-
-
- var dndCodec = this as IHasDoNotDisturbMode;
- if (dndCodec != null)
- {
- dndCodec.DoNotDisturbModeIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.ActivateDoNotDisturbMode.JoinNumber]);
- dndCodec.DoNotDisturbModeIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.DeactivateDoNotDisturbMode.JoinNumber]);
-
- trilist.SetSigFalseAction(joinMap.ActivateDoNotDisturbMode.JoinNumber, () => dndCodec.ActivateDoNotDisturbMode());
- trilist.SetSigFalseAction(joinMap.DeactivateDoNotDisturbMode.JoinNumber, () => dndCodec.DeactivateDoNotDisturbMode());
- trilist.SetSigFalseAction(joinMap.ToggleDoNotDisturbMode.JoinNumber, () => dndCodec.ToggleDoNotDisturbMode());
- }
-
- var halfwakeCodec = this as IHasHalfWakeMode;
- if (halfwakeCodec != null)
- {
- halfwakeCodec.StandbyIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.ActivateStandby.JoinNumber]);
- halfwakeCodec.StandbyIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.DeactivateStandby.JoinNumber]);
- halfwakeCodec.HalfWakeModeIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.ActivateHalfWakeMode.JoinNumber]);
- halfwakeCodec.EnteringStandbyModeFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnteringStandbyMode.JoinNumber]);
-
- trilist.SetSigFalseAction(joinMap.ActivateStandby.JoinNumber, () => halfwakeCodec.StandbyActivate());
- trilist.SetSigFalseAction(joinMap.DeactivateStandby.JoinNumber, () => halfwakeCodec.StandbyDeactivate());
- trilist.SetSigFalseAction(joinMap.ActivateHalfWakeMode.JoinNumber, () => halfwakeCodec.HalfwakeActivate());
- }
-
- // Ringtone volume
- trilist.SetUShortSigAction(joinMap.RingtoneVolume.JoinNumber, (u) => SetRingtoneVolume(u));
- RingtoneVolumeFeedback.LinkInputSig(trilist.UShortInput[joinMap.RingtoneVolume.JoinNumber]);
-
- // Presentation Source
- trilist.SetUShortSigAction(joinMap.PresentationSource.JoinNumber, (u) => SelectPresentationSource(u));
- PresentationSourceFeedback.LinkInputSig(trilist.UShortInput[joinMap.PresentationSource.JoinNumber]);
-
- PresentationSendingLocalOnlyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PresentationLocalOnly.JoinNumber]);
- PresentationSendingLocalRemoteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PresentationLocalRemote.JoinNumber]);
- }
-
- ///
- /// Reboots the codec
- ///
- public void Reboot()
- {
- EnqueueCommand("xCommand SystemUnit Boot Action: Restart");
- }
-
- ///
- /// Sets SelfView Mode based on config
- ///
- void SetSelfViewMode()
- {
- if (!IsInCall)
- {
- SelfViewModeOff();
- }
- else
- {
- if (ShowSelfViewByDefault)
- SelfViewModeOn();
- else
- SelfViewModeOff();
- }
- }
-
- ///
- /// Turns on Selfview Mode
- ///
- public void SelfViewModeOn()
- {
- EnqueueCommand("xCommand Video Selfview Set Mode: On");
- }
-
- ///
- /// Turns off Selfview Mode
- ///
- public void SelfViewModeOff()
- {
- EnqueueCommand("xCommand Video Selfview Set Mode: Off");
- }
-
- ///
- /// Toggles Selfview mode on/off
- ///
- public void SelfViewModeToggle()
- {
- string mode = string.Empty;
-
- if (CodecStatus.Status.Video.Selfview.Mode.BoolValue)
- mode = "Off";
- else
- mode = "On";
-
- EnqueueCommand(string.Format("xCommand Video Selfview Set Mode: {0}", mode));
- }
-
- ///
- /// Sets a specified position for the selfview PIP window
- ///
- ///
- public void SelfviewPipPositionSet(CodecCommandWithLabel position)
- {
- EnqueueCommand(string.Format("xCommand Video Selfview Set Mode: On PIPPosition: {0}", position.Command));
- }
-
- ///
- /// Toggles to the next selfview PIP position
- ///
- public void SelfviewPipPositionToggle()
- {
- if (_currentSelfviewPipPosition != null)
- {
- var nextPipPositionIndex = SelfviewPipPositions.IndexOf(_currentSelfviewPipPosition) + 1;
-
- if (nextPipPositionIndex >= SelfviewPipPositions.Count) // Check if we need to loop back to the first item in the list
- nextPipPositionIndex = 0;
-
- SelfviewPipPositionSet(SelfviewPipPositions[nextPipPositionIndex]);
- }
- }
-
- ///
- /// Sets a specific local layout
- ///
- ///
- public void LocalLayoutSet(CodecCommandWithLabel layout)
- {
- EnqueueCommand(string.Format("xCommand Video Layout LayoutFamily Set Target: local LayoutFamily: {0}", layout.Command));
- }
-
- ///
- /// Toggles to the next local layout
- ///
- public void LocalLayoutToggle()
- {
- if(_currentLocalLayout != null)
- {
- var nextLocalLayoutIndex = LocalLayouts.IndexOf(_currentLocalLayout) + 1;
-
- if (nextLocalLayoutIndex >= LocalLayouts.Count) // Check if we need to loop back to the first item in the list
- nextLocalLayoutIndex = 0;
-
- LocalLayoutSet(LocalLayouts[nextLocalLayoutIndex]);
- }
- }
-
- ///
- /// Toggles between single/prominent layouts
- ///
- public void LocalLayoutToggleSingleProminent()
- {
- if (_currentLocalLayout != null)
- {
- if (_currentLocalLayout.Label != "Prominent")
- LocalLayoutSet(LocalLayouts.FirstOrDefault(l => l.Label.Equals("Prominent")));
- else
- LocalLayoutSet(LocalLayouts.FirstOrDefault(l => l.Label.Equals("Single")));
- }
-
- }
-
- ///
- ///
- ///
- public void MinMaxLayoutToggle()
- {
- if (PresentationViewMaximizedFeedback.BoolValue)
- _currentPresentationView = "Minimized";
- else
- _currentPresentationView = "Maximized";
-
- EnqueueCommand(string.Format("xCommand Video PresentationView Set View: {0}", _currentPresentationView));
- PresentationViewMaximizedFeedback.FireUpdate();
- }
-
- ///
- /// Calculates the current selfview PIP position
- ///
- void ComputeSelfviewPipStatus()
- {
- _currentSelfviewPipPosition = SelfviewPipPositions.FirstOrDefault(p => p.Command.ToLower().Equals(CodecStatus.Status.Video.Selfview.PIPPosition.Value.ToLower()));
-
- if(_currentSelfviewPipPosition != null)
- SelfviewIsOnFeedback.FireUpdate();
- }
-
- ///
- /// Calculates the current local Layout
- ///
- void ComputeLocalLayout()
- {
- _currentLocalLayout = LocalLayouts.FirstOrDefault(l => l.Command.ToLower().Equals(CodecStatus.Status.Video.Layout.LayoutFamily.Local.Value.ToLower()));
-
- if (_currentLocalLayout != null)
- LocalLayoutFeedback.FireUpdate();
- }
-
- public void RemoveCallHistoryEntry(CodecCallHistory.CallHistoryEntry entry)
- {
- EnqueueCommand(string.Format("xCommand CallHistory DeleteEntry CallHistoryId: {0} AcknowledgeConsecutiveDuplicates: True", entry.OccurrenceHistoryId));
- }
-
- #region IHasCameraSpeakerTrack
-
- public void CameraAutoModeToggle()
- {
- if (!CameraAutoModeIsOnFeedback.BoolValue)
- {
- EnqueueCommand("xCommand Cameras SpeakerTrack Activate");
- }
- else
- {
- EnqueueCommand("xCommand Cameras SpeakerTrack Deactivate");
- }
- }
-
- public void CameraAutoModeOn()
- {
- if (CameraIsOffFeedback.BoolValue)
- {
- CameraMuteOff();
- }
-
- EnqueueCommand("xCommand Cameras SpeakerTrack Activate");
- }
-
- public void CameraAutoModeOff()
- {
- if (CameraIsOffFeedback.BoolValue)
- {
- CameraMuteOff();
- }
-
- EnqueueCommand("xCommand Cameras SpeakerTrack Deactivate");
- }
-
- #endregion
-
- ///
- /// Builds the cameras List. Could later be modified to build from config data
- ///
- void SetUpCameras(List cameraInfo)
- {
- // Add the internal camera
- Cameras = new List();
-
- var camCount = CodecStatus.Status.Cameras.Camera.Count;
-
- // Deal with the case of 1 or no reported cameras
- if (camCount <= 1)
- {
- var internalCamera = new CiscoSparkCamera(Key + "-camera1", "Near End", this, 1);
-
- if (camCount > 0)
- {
- // Try to get the capabilities from the codec
- if (CodecStatus.Status.Cameras.Camera[0] != null && CodecStatus.Status.Cameras.Camera[0].Capabilities != null)
- {
- internalCamera.SetCapabilites(CodecStatus.Status.Cameras.Camera[0].Capabilities.Options.Value);
- }
- }
-
- Cameras.Add(internalCamera);
- //DeviceManager.AddDevice(internalCamera);
- }
- else
- {
- // Setup all the cameras
- for (int i = 0; i < camCount; i++)
- {
- var cam = CodecStatus.Status.Cameras.Camera[i];
-
- var id = (uint)i;
- var name = string.Format("Camera {0}", id);
-
- // Check for a config object that matches the camera number
- var camInfo = cameraInfo.FirstOrDefault(c => c.CameraNumber == i + 1);
- if (camInfo != null)
- {
- id = (uint)camInfo.SourceId;
- name = camInfo.Name;
- }
-
- var key = string.Format("{0}-camera{1}", Key, id);
- var camera = new CiscoSparkCamera(key, name, this, id);
-
- if (cam.Capabilities != null)
- {
- camera.SetCapabilites(cam.Capabilities.Options.Value);
- }
-
- Cameras.Add(camera);
- }
- }
-
- // Add the far end camera
- var farEndCamera = new CiscoFarEndCamera(Key + "-cameraFar", "Far End", this);
- Cameras.Add(farEndCamera);
-
- SelectedCameraFeedback = new StringFeedback(() => SelectedCamera.Key);
-
- ControllingFarEndCameraFeedback = new BoolFeedback(() => SelectedCamera is IAmFarEndCamera);
-
- NearEndPresets = new List(15);
-
- FarEndRoomPresets = new List(15);
-
- // Add the far end presets
- for (int i = 1; i <= FarEndRoomPresets.Capacity; i++)
- {
- var label = string.Format("Far End Preset {0}", i);
- FarEndRoomPresets.Add(new CodecRoomPreset(i, label, true, false));
- }
-
- SelectedCamera = Cameras[0]; ; // call the method to select the camera and ensure the feedbacks get updated.
-
- }
-
- #region IHasCodecCameras Members
-
- public event EventHandler CameraSelected;
-
- public List Cameras { get; private set; }
-
- public StringFeedback SelectedCameraFeedback { get; private set; }
-
- private CameraBase _selectedCamera;
-
- ///
- /// Returns the selected camera
- ///
- public CameraBase SelectedCamera
- {
- get
- {
- return _selectedCamera;
- }
- private set
- {
- _selectedCamera = value;
- SelectedCameraFeedback.FireUpdate();
- ControllingFarEndCameraFeedback.FireUpdate();
- if (CameraIsOffFeedback.BoolValue)
- CameraMuteOff();
-
- var handler = CameraSelected;
- if (handler != null)
- {
- handler(this, new CameraSelectedEventArgs(SelectedCamera));
- }
- }
- }
-
- public void SelectCamera(string key)
- {
- var camera = Cameras.FirstOrDefault(c => c.Key.IndexOf(key, StringComparison.OrdinalIgnoreCase) > -1);
- if (camera != null)
- {
- Debug.Console(2, this, "Selected Camera with key: '{0}'", camera.Key);
- SelectedCamera = camera;
- }
- else
- Debug.Console(2, this, "Unable to select camera with key: '{0}'", key);
-
- var ciscoCam = camera as CiscoSparkCamera;
- if (ciscoCam != null)
- {
- EnqueueCommand(string.Format("xCommand Video Input SetMainVideoSource SourceId: {0}", ciscoCam.CameraId));
- }
- }
-
- public CameraBase FarEndCamera { get; private set; }
-
- public BoolFeedback ControllingFarEndCameraFeedback { get; private set; }
-
- #endregion
-
- ///
- ///
- ///
- public class CiscoCodecInfo : VideoCodecInfo
- {
- public CiscoCodecStatus.RootObject CodecStatus { get; private set; }
-
- public CiscoCodecConfiguration.RootObject CodecConfiguration { get; private set; }
-
- public override bool MultiSiteOptionIsEnabled
- {
- get
- {
- if (!string.IsNullOrEmpty(CodecStatus.Status.SystemUnit.Software.OptionKeys.MultiSite.Value) && CodecStatus.Status.SystemUnit.Software.OptionKeys.MultiSite.Value.ToLower() == "true")
- return true;
- else
- return false;
- }
-
- }
- public override string IpAddress
- {
- get
- {
- var address = string.Empty;
- if (CodecConfiguration.Configuration.Network.Count > 0)
- {
- if(!string.IsNullOrEmpty(CodecConfiguration.Configuration.Network[0].IPv4.Address.Value))
- address = CodecConfiguration.Configuration.Network[0].IPv4.Address.Value;
- }
-
- if (string.IsNullOrEmpty(address) && CodecStatus.Status.Network.Count > 0)
- {
- if(!string.IsNullOrEmpty(CodecStatus.Status.Network[0].IPv4.Address.Value))
- address = CodecStatus.Status.Network[0].IPv4.Address.Value;
- }
- return address;
- }
- }
- public override string E164Alias
- {
- get
- {
- if (CodecConfiguration.Configuration.H323 != null && CodecConfiguration.Configuration.H323.H323Alias.E164 != null)
- {
- return CodecConfiguration.Configuration.H323.H323Alias.E164.Value;
- }
- else
- {
- return string.Empty;
- }
- }
- }
- public override string H323Id
- {
- get
- {
- if (CodecConfiguration.Configuration.H323 != null && CodecConfiguration.Configuration.H323.H323Alias != null
- && CodecConfiguration.Configuration.H323.H323Alias.ID != null)
- {
- return CodecConfiguration.Configuration.H323.H323Alias.ID.Value;
- }
- else
- {
- return string.Empty;
- }
- }
- }
- public override string SipPhoneNumber
- {
- get
- {
- if (CodecStatus.Status.SIP != null && CodecStatus.Status.SIP.Registration.Count > 0)
- {
- var match = Regex.Match(CodecStatus.Status.SIP.Registration[0].URI.Value, @"(\d+)"); // extract numbers only
- if (match.Success)
- {
- Debug.Console(1, "Extracted phone number as '{0}' from string '{1}'", match.Groups[1].Value, CodecStatus.Status.SIP.Registration[0].URI.Value);
- return match.Groups[1].Value;
- }
- else
- {
- Debug.Console(1, "Unable to extract phone number from string: '{0}'", CodecStatus.Status.SIP.Registration[0].URI.Value);
- return string.Empty;
- }
- }
- else
- {
- Debug.Console(1, "Unable to extract phone number. No SIP Registration items found");
- return string.Empty;
- }
- }
- }
-
- public override string SipUri
- {
- get
- {
- if (CodecStatus.Status.SIP != null && CodecStatus.Status.SIP.AlternateURI.Primary.URI.Value != null)
- {
- return CodecStatus.Status.SIP.AlternateURI.Primary.URI.Value;
- }
- else if (CodecStatus.Status.UserInterface != null &&
- CodecStatus.Status.UserInterface.ContactInfo.ContactMethod[0].Number.Value != null)
- {
- return CodecStatus.Status.UserInterface.ContactInfo.ContactMethod[0].Number.Value;
- }
- else
- return string.Empty;
- }
- }
-
- public override bool AutoAnswerEnabled
- {
- get
- {
- if (CodecConfiguration.Configuration.Conference.AutoAnswer.Mode.Value == null) return false;
- return CodecConfiguration.Configuration.Conference.AutoAnswer.Mode.Value.ToLower() == "on";
- }
- }
-
- public CiscoCodecInfo(CiscoCodecStatus.RootObject status, CiscoCodecConfiguration.RootObject configuration)
- {
- CodecStatus = status;
- CodecConfiguration = configuration;
- }
- }
-
-
- #region IHasCameraPresets Members
-
- public event EventHandler CodecRoomPresetsListHasChanged;
-
- public List NearEndPresets { get; private set; }
-
- public List FarEndRoomPresets { get; private set; }
-
- public void CodecRoomPresetSelect(int preset)
- {
- Debug.Console(1, this, "Selecting Preset: {0}", preset);
- if (SelectedCamera is IAmFarEndCamera)
- SelectFarEndPreset(preset);
- else
- EnqueueCommand(string.Format("xCommand RoomPreset Activate PresetId: {0}", preset));
- }
-
- public void CodecRoomPresetStore(int preset, string description)
- {
- EnqueueCommand(string.Format("xCommand RoomPreset Store PresetId: {0} Description: \"{1}\" Type: All", preset, description));
- }
-
- #endregion
-
- public void SelectFarEndPreset(int preset)
- {
- EnqueueCommand(string.Format("xCommand Call FarEndControl RoomPreset Activate CallId: {0} PresetId: {1}", GetCallId(), preset));
- }
-
-
- #region IHasExternalSourceSwitching Members
-
- ///
- /// Wheather the Cisco supports External Source Lists or not
- ///
- public bool ExternalSourceListEnabled
- {
- get;
- private set;
- }
-
- ///
- /// The name of the RoutingInputPort to which the upstream external switcher is connected
- ///
- public string ExternalSourceInputPort { get; private set; }
-
- public bool BrandingEnabled { get; private set; }
- private string _brandingUrl;
- private bool _sendMcUrl;
-
- ///
- /// Adds an external source to the Cisco
- ///
- ///
- ///
- ///
- public void AddExternalSource(string connectorId, string key, string name, eExternalSourceType type)
- {
- int id = 2;
- if (connectorId.ToLower() == "hdmiin3")
- {
- id = 3;
- }
- EnqueueCommand(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);
-
- }
-
-
- ///
- /// Sets the state of the External Source
- ///
- ///
- ///
- public void SetExternalSourceState(string key, eExternalSourceMode mode)
- {
- EnqueueCommand(string.Format("xCommand UserInterface Presentation ExternalSource State Set SourceIdentifier: \"{0}\" State: {1}", key, mode.ToString()));
- }
- ///
- /// Clears all external sources on the codec
- ///
- public void ClearExternalSources()
- {
- EnqueueCommand("xCommand UserInterface Presentation ExternalSource RemoveAll");
-
- }
-
- ///
- /// Sets the selected source of the available external sources on teh Touch10 UI
- ///
- public void SetSelectedSource(string key)
- {
- EnqueueCommand(string.Format("xCommand UserInterface Presentation ExternalSource Select SourceIdentifier: {0}", key));
- _externalSourceChangeRequested = true;
- }
-
- ///
- /// Action that will run when the External Source is selected.
- ///
- public Action RunRouteAction { private get; set; }
-
-
-
-
-
-
- #endregion
- #region ExternalDevices
-
-
-
- #endregion
-
- #region IHasCameraOff Members
-
- public BoolFeedback CameraIsOffFeedback { get; private set; }
-
- public void CameraOff()
- {
- CameraMuteOn();
- }
-
- #endregion
-
- public BoolFeedback CameraIsMutedFeedback { get; private set; }
-
- ///
- /// Mutes the outgoing camera video
- ///
- public void CameraMuteOn()
- {
- EnqueueCommand("xCommand Video Input MainVideo Mute");
- }
-
- ///
- /// Unmutes the outgoing camera video
- ///
- public void CameraMuteOff()
- {
- EnqueueCommand("xCommand Video Input MainVideo Unmute");
- }
-
- ///
- /// Toggles the camera mute state
- ///
- public void CameraMuteToggle()
- {
- if (CameraIsMutedFeedback.BoolValue)
- CameraMuteOff();
- else
- CameraMuteOn();
- }
-
- #region IHasDoNotDisturbMode Members
-
- public BoolFeedback DoNotDisturbModeIsOnFeedback { get; private set; }
-
- public void ActivateDoNotDisturbMode()
- {
- EnqueueCommand("xCommand Conference DoNotDisturb Activate");
- }
-
- public void DeactivateDoNotDisturbMode()
- {
- EnqueueCommand("xCommand Conference DoNotDisturb Deactivate");
- }
-
- public void ToggleDoNotDisturbMode()
- {
- if (DoNotDisturbModeIsOnFeedback.BoolValue)
- {
- DeactivateDoNotDisturbMode();
- }
- else
- {
- ActivateDoNotDisturbMode();
- }
- }
-
- #endregion
-
- #region IHasHalfWakeMode Members
-
- public BoolFeedback HalfWakeModeIsOnFeedback { get; private set; }
-
- public BoolFeedback EnteringStandbyModeFeedback { get; private set; }
-
- public void HalfwakeActivate()
- {
- EnqueueCommand("xCommand Standby Halfwake");
- }
-
- #endregion
- }
-
-
-
- ///
- /// Tracks the initial sycnronization state of the codec when making a connection
- ///
- public class CodecSyncState : IKeyed
- {
- bool _InitialSyncComplete;
- private readonly CiscoSparkCodec _parent;
-
- public event EventHandler InitialSyncCompleted;
- private readonly CrestronQueue _commandQueue;
-
- public string Key { get; private set; }
-
- public bool InitialSyncComplete
- {
- get { return _InitialSyncComplete; }
- private set
- {
- if (value == true)
- {
- var handler = InitialSyncCompleted;
- if (handler != null)
- handler(this, new EventArgs());
- }
- _InitialSyncComplete = value;
- }
- }
-
- public bool LoginMessageWasReceived { get; private set; }
-
- public bool JsonResponseModeSet { get; private set; }
-
- public bool InitialStatusMessageWasReceived { get; private set; }
-
- public bool InitialConfigurationMessageWasReceived { get; private set; }
-
- public bool FeedbackWasRegistered { get; private set; }
-
- public CodecSyncState(string key, CiscoSparkCodec parent)
- {
- Key = key;
- _parent = parent;
- _commandQueue = new CrestronQueue(50);
- CodecDisconnected();
- }
-
- private void ProcessQueuedCommands()
- {
- while (InitialSyncComplete)
- {
- var query = _commandQueue.Dequeue();
-
- _parent.SendText(query);
- }
- }
-
- public void AddCommandToQueue(string query)
- {
- _commandQueue.Enqueue(query);
- }
-
- public void LoginMessageReceived()
- {
- LoginMessageWasReceived = true;
- Debug.Console(1, this, "Login Message Received.");
- CheckSyncStatus();
- }
-
- public void JsonResponseModeMessageReceived()
- {
- JsonResponseModeSet = true;
- Debug.Console(1, this, "Json Response Mode Message Received.");
- CheckSyncStatus();
- }
-
- public void InitialStatusMessageReceived()
- {
- InitialStatusMessageWasReceived = true;
- Debug.Console(1, this, "Initial Codec Status Message Received.");
- CheckSyncStatus();
- }
-
- public void InitialConfigurationMessageReceived()
- {
- InitialConfigurationMessageWasReceived = true;
- Debug.Console(1, this, "Initial Codec Configuration Message Received.");
- CheckSyncStatus();
- }
-
- public void FeedbackRegistered()
- {
- FeedbackWasRegistered = true;
- Debug.Console(1, this, "Initial Codec Feedback Registration Successful.");
- CheckSyncStatus();
- }
-
- public void CodecDisconnected()
- {
- _commandQueue.Clear();
- LoginMessageWasReceived = false;
- JsonResponseModeSet = false;
- InitialConfigurationMessageWasReceived = false;
- InitialStatusMessageWasReceived = false;
- FeedbackWasRegistered = false;
- InitialSyncComplete = false;
- }
-
- void CheckSyncStatus()
- {
- if (LoginMessageWasReceived && JsonResponseModeSet && InitialConfigurationMessageWasReceived && InitialStatusMessageWasReceived && FeedbackWasRegistered)
- {
- InitialSyncComplete = true;
- Debug.Console(1, this, "Initial Codec Sync Complete!");
- Debug.Console(1, this, "{0} Command queued. Processing now...", _commandQueue.Count);
-
- // Invoke a thread for the queue
- CrestronInvoke.BeginInvoke((o) => {
- ProcessQueuedCommands();
- });
- }
- else
- InitialSyncComplete = false;
- }
- }
-
- public class CiscoSparkCodecFactory : EssentialsDeviceFactory
- {
- public CiscoSparkCodecFactory()
- {
- TypeNames = new List() { "ciscospark", "ciscowebex", "ciscowebexpro", "ciscoroomkit", "ciscosparkpluscodec" };
- }
-
- public override EssentialsDevice BuildDevice(DeviceConfig dc)
- {
- Debug.Console(1, "Factory Attempting to create new Cisco Codec Device");
-
- var comm = CommFactory.CreateCommForDevice(dc);
- return new VideoCodec.Cisco.CiscoSparkCodec(dc, comm);
- }
- }
-
-}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/CiscoSparkCodecPropertiesConfig.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/CiscoSparkCodecPropertiesConfig.cs
deleted file mode 100644
index 38b81654..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/CiscoSparkCodecPropertiesConfig.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-extern alias Full;
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-
-using Full.Newtonsoft.Json;
-
-namespace PepperDash.Essentials.Devices.Common.Codec
-{
- public class CiscoSparkCodecPropertiesConfig
- {
- [JsonProperty("communicationMonitorProperties")]
- public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
-
- [JsonProperty("favorites")]
- public List Favorites { get; set; }
-
- ///
- /// Valid values: "Local" or "Corporate"
- ///
- [JsonProperty("phonebookMode")]
- public string PhonebookMode { get; set; }
-
- [JsonProperty("showSelfViewByDefault")]
- public bool ShowSelfViewByDefault { get; set; }
-
- [JsonProperty("sharing")]
- public SharingProperties Sharing { get; set; }
-
- ///
- /// Enables external source switching capability
- ///
- [JsonProperty("externalSourceListEnabled")]
- public bool ExternalSourceListEnabled { get; set; }
-
- ///
- /// The name of the routing input port on the codec to which the external switch is connected
- ///
- [JsonProperty("externalSourceInputPort")]
- public string ExternalSourceInputPort { get; set; }
-
- ///
- /// Optionsal property to set the limit of any phonebook queries for directory or searching
- ///
- [JsonProperty("phonebookResultsLimit")]
- public uint PhonebookResultsLimit { get; set; }
-
- [JsonProperty("UiBranding")]
- public BrandingLogoProperties UiBranding { get; set; }
-
- [JsonProperty("cameraInfo")]
- public List CameraInfo { get; set; }
-
-
- public CiscoSparkCodecPropertiesConfig()
- {
- CameraInfo = new List();
- }
- }
-
- public class SharingProperties
- {
- [JsonProperty("autoShareContentWhileInCall")]
- public bool AutoShareContentWhileInCall { get; set; }
- }
-
- public class BrandingLogoProperties
- {
- [JsonProperty("enable")]
- public bool Enable { get; set; }
-
- [JsonProperty("brandingUrl")]
- public string BrandingUrl { get; set; }
- }
-
- ///
- /// Describes configuration information for the near end cameras
- ///
- public class CameraInfo
- {
- public int CameraNumber { get; set; }
- public string Name { get; set; }
- public int SourceId { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/HttpApiServer.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/HttpApiServer.cs
deleted file mode 100644
index affe9c2f..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/HttpApiServer.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharp.Net.Http;
-
-using PepperDash.Core;
-
-
-namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
-{
- public class HttpApiServer
- {
- public static Dictionary ExtensionContentTypes;
-
- public event EventHandler ApiRequest;
- public Crestron.SimplSharp.Net.Http.HttpServer HttpServer { get; private set; }
-
- public string HtmlRoot { get; set; }
-
-
- ///
- /// SIMPL+ can only execute the default constructor. If you have variables that require initialization, please
- /// use an Initialize method
- ///
- public HttpApiServer()
- {
- ExtensionContentTypes = new Dictionary
- {
- { ".css", "text/css" },
- { ".htm", "text/html" },
- { ".html", "text/html" },
- { ".jpg", "image/jpeg" },
- { ".jpeg", "image/jpeg" },
- { ".js", "application/javascript" },
- { ".json", "application/json" },
- { ".xml", "text/xml" },
- { ".map", "application/x-navimap" },
- { ".pdf", "application.pdf" },
- { ".png", "image/png" },
- { ".txt", "text/plain" },
- };
- HtmlRoot = @"\HTML";
- }
-
-
- public void Start(int port)
- {
- // TEMP - this should be inserted by configuring class
-
- HttpServer = new Crestron.SimplSharp.Net.Http.HttpServer();
- HttpServer.ServerName = "Cisco API Server";
- HttpServer.KeepAlive = true;
- HttpServer.Port = port;
- HttpServer.OnHttpRequest += Server_Request;
- HttpServer.Open();
-
- CrestronEnvironment.ProgramStatusEventHandler += (a) =>
- {
- if (a == eProgramStatusEventType.Stopping)
- {
- HttpServer.Close();
- Debug.Console(1, "Shutting down HTTP Server on port {0}", HttpServer.Port);
- }
- };
- }
-
- void Server_Request(object sender, OnHttpRequestArgs args)
- {
- if (args.Request.Header.RequestType == "OPTIONS")
- {
- Debug.Console(2, "Asking for OPTIONS");
- args.Response.Header.SetHeaderValue("Access-Control-Allow-Origin", "*");
- args.Response.Header.SetHeaderValue("Access-Control-Allow-Methods", "GET, POST, PATCH, PUT, DELETE, OPTIONS");
- return;
- }
-
- string path = Uri.UnescapeDataString(args.Request.Path);
- var host = args.Request.DataConnection.RemoteEndPointAddress;
- //string authToken;
-
- Debug.Console(2, "HTTP Request: {2}: Path='{0}' ?'{1}'", path, args.Request.QueryString, host);
-
- // ----------------------------------- ADD AUTH HERE
- if (path.StartsWith("/cisco/api"))
- {
- var handler = ApiRequest;
- if (ApiRequest != null)
- ApiRequest(this, args);
- }
- }
-
- public static string GetContentType(string extension)
- {
- string type;
- if (ExtensionContentTypes.ContainsKey(extension))
- type = ExtensionContentTypes[extension];
- else
- type = "text/plain";
- return type;
- }
-
- }
-
-}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/PhonebookDataClasses.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/PhonebookDataClasses.cs
deleted file mode 100644
index c88261f5..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/PhonebookDataClasses.cs
+++ /dev/null
@@ -1,397 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Devices.Common.Codec;
-
-namespace PepperDash.Essentials.Devices.Common.VideoCodec
-{
- public class CiscoCodecPhonebook
- {
- public class Offset
- {
- public string Value { get; set; }
- }
-
- public class Limit
- {
- public string Value { get; set; }
- }
-
- public class TotalRows
- {
- public string Value { get; set; }
- }
-
- public class ResultInfo
- {
- public Offset Offset { get; set; }
- public Limit Limit { get; set; }
- public TotalRows TotalRows { get; set; }
- }
-
- public class LocalId
- {
- public string Value { get; set; }
- }
-
- public class FolderId
- {
- public string Value { get; set; }
- }
-
- public class ParentFolderId
- {
- public string Value { get; set; }
- }
-
- public class Name
- {
- public string Value { get; set; }
- }
-
- public class Folder
- {
- public string id { get; set; }
- public LocalId LocalId { get; set; }
- public FolderId FolderId { get; set; }
- public Name Name { get; set; }
- public ParentFolderId ParentFolderId { get; set; }
- }
-
- public class Name2
- {
- public string Value { get; set; }
- }
-
- public class ContactId
- {
- public string Value { get; set; }
- }
-
- public class FolderId2
- {
- public string Value { get; set; }
- }
-
- public class Title
- {
- public string Value { get; set; }
- }
-
- public class ContactMethodId
- {
- public string Value { get; set; }
- }
-
- public class Number
- {
- public string Value { get; set; }
- }
-
- public class Device
- {
- public string Value { get; set; }
- }
-
- public class CallType
- {
- public string Value { get; set; }
- }
-
- public class ContactMethod
- {
- public string id { get; set; }
- public ContactMethodId ContactMethodId { get; set; }
- public Number Number { get; set; }
- public Device Device { get; set; }
- public CallType CallType { get; set; }
-
- public ContactMethod()
- {
- ContactMethodId = new ContactMethodId();
- Number = new Number();
- Device = new Device();
- CallType = new CallType();
- }
- }
-
- public class Contact
- {
- public string id { get; set; }
- public Name2 Name { get; set; }
- public ContactId ContactId { get; set; }
- public FolderId2 FolderId { get; set; }
- public Title Title { get; set; }
- public List ContactMethod { get; set; }
-
- public Contact()
- {
- Name = new Name2();
- ContactId = new ContactId();
- FolderId = new FolderId2();
- Title = new Title();
- ContactMethod = new List();
- }
- }
-
- public class PhonebookSearchResult
- {
- public string status { get; set; }
- public ResultInfo ResultInfo { get; set; }
- public List Folder { get; set; }
- public List Contact { get; set; }
-
- public PhonebookSearchResult()
- {
- Folder = new List();
- Contact = new List();
- ResultInfo = new ResultInfo();
- }
- }
-
- public class CommandResponse
- {
- public PhonebookSearchResult PhonebookSearchResult { get; set; }
- }
-
- public class RootObject
- {
- public CommandResponse CommandResponse { get; set; }
-
- }
-
-
- ///
- /// Extracts the folders with no ParentFolder and returns them sorted alphabetically
- ///
- ///
- ///
- public static List GetRootFoldersFromSearchResult(PhonebookSearchResult result)
- {
- var rootFolders = new List();
-
- if (result.Folder.Count == 0)
- {
- return null;
- }
- else if (result.Folder.Count > 0)
- {
- if (Debug.Level > 0)
- Debug.Console(1, "Phonebook Folders:\n");
-
- foreach (Folder f in result.Folder)
- {
- var folder = new DirectoryFolder();
-
- folder.Name = f.Name.Value;
- folder.FolderId = f.FolderId.Value;
-
- if (f.ParentFolderId == null)
- rootFolders.Add(folder);
-
- if (Debug.Level > 0)
- Debug.Console(1, "+ {0}", folder.Name);
- }
- }
-
- rootFolders.OrderBy(f => f.Name);
-
- return rootFolders;
- }
-
-
- ///
- /// Extracts the contacts with no FolderId and returns them sorted alphabetically
- ///
- ///
- ///
- public static List GetRootContactsFromSearchResult(PhonebookSearchResult result)
- {
- var rootContacts = new List();
-
- if (result.Contact.Count == 0)
- {
- return null;
- }
- else if (result.Contact.Count > 0)
- {
- if (Debug.Level > 0)
- Debug.Console(1, "Root Contacts:\n");
-
- foreach (Contact c in result.Contact)
- {
- var contact = new DirectoryContact();
-
- if (string.IsNullOrEmpty(c.FolderId.Value))
- {
- contact.Name = c.Name.Value;
- contact.ContactId = c.ContactId.Value;
-
- if(!string.IsNullOrEmpty(c.Title.Value))
- contact.Title = c.Title.Value;
-
- if (Debug.Level > 0)
- Debug.Console(1, "{0}\nContact Methods:", contact.Name);
-
- foreach (ContactMethod m in c.ContactMethod)
- {
-
- var tempContactMethod = new PepperDash.Essentials.Devices.Common.Codec.ContactMethod();
-
- eContactMethodCallType callType = eContactMethodCallType.Unknown;
- if (!string.IsNullOrEmpty(m.CallType.Value))
- {
- if (!string.IsNullOrEmpty(m.CallType.Value))
- {
- if (m.CallType.Value.ToLower() == "audio")
- callType = eContactMethodCallType.Audio;
- else if (m.CallType.Value.ToLower() == "video")
- callType = eContactMethodCallType.Video;
-
- tempContactMethod.CallType = callType;
- }
- }
-
- eContactMethodDevice device = eContactMethodDevice.Unknown;
- if (!string.IsNullOrEmpty(m.Device.Value))
- {
-
- if (m.Device.Value.ToLower() == "mobile")
- device = eContactMethodDevice.Mobile;
- else if (m.Device.Value.ToLower() == "telephone")
- device = eContactMethodDevice.Telephone;
- else if (m.Device.Value.ToLower() == "video")
- device = eContactMethodDevice.Video;
- else if (m.Device.Value.ToLower() == "other")
- device = eContactMethodDevice.Other;
-
- tempContactMethod.Device = device;
- }
-
- if (Debug.Level > 0)
- Debug.Console(1, "Number: {0}", m.Number.Value);
-
- tempContactMethod.Number = m.Number.Value;
- tempContactMethod.ContactMethodId = m.ContactMethodId.Value;
-
- contact.ContactMethods.Add(tempContactMethod);
- }
- rootContacts.Add(contact);
- }
- }
- }
-
- rootContacts.OrderBy(f => f.Name);
-
- return rootContacts;
- }
-
-
- ///
- /// Converts data returned from a cisco codec to the generic Directory format.
- ///
- ///
- ///
- ///
- public static CodecDirectory ConvertCiscoPhonebookToGeneric(PhonebookSearchResult result)
- {
- var directory = new Codec.CodecDirectory();
-
- var folders = new List();
-
- var contacts = new List();
-
- try
- {
- if (result.Folder.Count > 0)
- {
- foreach (Folder f in result.Folder)
- {
- var folder = new DirectoryFolder();
-
- folder.Name = f.Name.Value;
- folder.FolderId = f.FolderId.Value;
-
- if (f.ParentFolderId != null)
- {
- folder.ParentFolderId = f.ParentFolderId.Value;
- }
-
- folders.Add(folder);
- }
-
- folders.OrderBy(f => f.Name);
-
- directory.AddFoldersToDirectory(folders);
- }
-
- if (result.Contact.Count > 0)
- {
- foreach (Contact c in result.Contact)
- {
- var contact = new DirectoryContact();
-
- contact.Name = c.Name.Value;
- contact.ContactId = c.ContactId.Value;
- if (!string.IsNullOrEmpty(c.Title.Value))
- contact.Title = c.Title.Value;
-
- if (c.FolderId != null)
- {
- contact.FolderId = c.FolderId.Value;
- }
-
- foreach (ContactMethod m in c.ContactMethod)
- {
- eContactMethodCallType callType = eContactMethodCallType.Unknown;
- if (!string.IsNullOrEmpty(m.CallType.Value))
- {
- if (m.CallType.Value.ToLower() == "audio")
- callType = eContactMethodCallType.Audio;
- else if (m.CallType.Value.ToLower() == "video")
- callType = eContactMethodCallType.Video;
- }
-
- eContactMethodDevice device = eContactMethodDevice.Unknown;
-
- if (!string.IsNullOrEmpty(m.Device.Value))
- {
- if (m.Device.Value.ToLower() == "mobile")
- device = eContactMethodDevice.Mobile;
- else if (m.Device.Value.ToLower() == "telephone")
- device = eContactMethodDevice.Telephone;
- else if (m.Device.Value.ToLower() == "video")
- device = eContactMethodDevice.Video;
- else if (m.Device.Value.ToLower() == "other")
- device = eContactMethodDevice.Other;
- }
-
- contact.ContactMethods.Add(new PepperDash.Essentials.Devices.Common.Codec.ContactMethod()
- {
- Number = m.Number.Value,
- ContactMethodId = m.ContactMethodId.Value,
- CallType = callType,
- Device = device
- });
- }
- contacts.Add(contact);
- }
-
- contacts.OrderBy(c => c.Name);
-
- directory.AddContactsToDirectory(contacts);
- }
- }
- catch (Exception e)
- {
- Debug.Console(1, "Error converting Cisco Phonebook results to generic: {0}", e);
- }
-
- return directory;
- }
- }
-}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/eCommandType.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/eCommandType.cs
new file mode 100644
index 00000000..b68f280d
--- /dev/null
+++ b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/eCommandType.cs
@@ -0,0 +1,4 @@
+namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
+{
+ enum eCommandType { SessionStart, SessionEnd, Command, GetStatus, GetConfiguration };
+}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/eExternalSourceMode.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/eExternalSourceMode.cs
new file mode 100644
index 00000000..1f96f5e1
--- /dev/null
+++ b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/eExternalSourceMode.cs
@@ -0,0 +1,4 @@
+namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
+{
+ public enum eExternalSourceMode {Ready, NotReady, Hidden, Error}
+}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/eExternalSourceType.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/eExternalSourceType.cs
new file mode 100644
index 00000000..66ebe390
--- /dev/null
+++ b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/eExternalSourceType.cs
@@ -0,0 +1,4 @@
+namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
+{
+ public enum eExternalSourceType {camera, desktop, document_camera, mediaplayer, PC, whiteboard, other}
+}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/xConfiguration.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/xConfiguration.cs
deleted file mode 100644
index 7fc983e2..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/xConfiguration.cs
+++ /dev/null
@@ -1,1879 +0,0 @@
-extern alias Full;
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-using Crestron.SimplSharp;
-
-using PepperDash.Core;
-
-using Full.Newtonsoft.Json;
-using Full.Newtonsoft.Json.Linq;
-
-
-namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
-{
- ///
- /// This class exists to capture serialized data sent back by a Cisco codec in JSON output mode
- ///
- public class CiscoCodecConfiguration
- {
- public class DefaultVolume
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Dereverberation
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class NoiseReduction
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class EchoControl
- {
- public Dereverberation Dereverberation { get; set; }
- public Mode Mode { get; set; }
- public NoiseReduction NoiseReduction { get; set; }
- }
-
- public class Level
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Microphone
- {
- public string id { get; set; }
- public EchoControl EchoControl { get; set; }
- public Level Level { get; set; }
- public Mode2 Mode { get; set; }
- }
-
- public class Input
- {
- public List Microphone { get; set; }
- }
-
- public class Enabled
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mute
- {
- public Enabled Enabled { get; set; }
- }
-
- public class Microphones
- {
- public Mute Mute { get; set; }
- }
-
- public class Mode3
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class InternalSpeaker
- {
- public Mode3 Mode { get; set; }
- }
-
- public class Output
- {
- public InternalSpeaker InternalSpeaker { get; set; }
- }
-
- public class RingTone
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class RingVolume : ValueProperty
- {
- public string valueSpaceRef { get; set; }
-
- string _Value;
-
- ///
- /// Sets Value and triggers the action when set
- ///
- public string Value
- {
- get
- {
- return _Value;
- }
- set
- {
- _Value = value;
- OnValueChanged();
- }
- }
-
- public int Volume
- {
- get
- {
- return Int32.Parse(_Value);
- }
- }
- }
-
- public class SoundsAndAlerts
- {
- public RingTone RingTone { get; set; }
- public RingVolume RingVolume { get; set; }
-
- public SoundsAndAlerts()
- {
- RingVolume = new RingVolume();
- }
- }
-
- public class Audio
- {
- public DefaultVolume DefaultVolume { get; set; }
- public Input Input { get; set; }
- public Microphones Microphones { get; set; }
- public Output Output { get; set; }
- public SoundsAndAlerts SoundsAndAlerts { get; set; }
-
-
- public Audio()
- {
- SoundsAndAlerts = new SoundsAndAlerts();
- }
- }
-
- public class DefaultMode
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Backlight
- {
- public DefaultMode DefaultMode { get; set; }
- }
-
- public class DefaultLevel
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode4
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Brightness
- {
- public DefaultLevel DefaultLevel { get; set; }
- public Mode4 Mode { get; set; }
- }
-
- public class Mode5
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Focus
- {
- public Mode5 Mode { get; set; }
- }
-
- public class Level2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode6
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Gamma
- {
- public Level2 Level { get; set; }
- public Mode6 Mode { get; set; }
- }
-
- public class Mirror
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Level3
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode7
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Whitebalance
- {
- public Level3 Level { get; set; }
- public Mode7 Mode { get; set; }
- }
-
- public class Framerate
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Camera
- {
- public string id { get; set; }
- public Framerate Framerate { get; set; }
- public Backlight Backlight { get; set; }
- public Brightness Brightness { get; set; }
- public Focus Focus { get; set; }
- public Gamma Gamma { get; set; }
- public Mirror Mirror { get; set; }
- public Whitebalance Whitebalance { get; set; }
- }
-
- public class Closeup
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode8
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class SpeakerTrack
- {
- public Closeup Closeup { get; set; }
- public Mode8 Mode { get; set; }
- }
-
- public class Cameras
- {
- //[JsonConverter(typeof(CameraConverter)), JsonProperty("Camera")]
- //public List Camera { get; set; }
- //[JsonProperty("SpeakerTrack")]
- public SpeakerTrack SpeakerTrack { get; set; }
-
- public Cameras()
- {
- //Camera = new List();
- SpeakerTrack = new SpeakerTrack();
- }
- }
-
- public class CameraConverter : JsonConverter
- {
- // this is currently not working
- public override bool CanConvert(System.Type objectType)
- {
- return objectType == typeof(Camera) || objectType == typeof(List); // This should not be called but is required for implmentation
- }
-
- public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer)
- {
- try
- {
- if (reader.TokenType == JsonToken.StartArray)
- {
- var l = new List();
- reader.Read();
- while (reader.TokenType != JsonToken.EndArray)
- {
- l.Add(reader.Value as Camera);
- reader.Read();
- }
- Debug.Console(1, "[xConfiguration]: Cameras converted as list");
- return l;
- }
- else
- {
- Debug.Console(1, "[xConfiguration]: Camera converted as single object and added to list");
- return new List { reader.Value as Camera };
- }
- }
- catch (Exception e)
- {
- Debug.Console(1, "[xConfiguration]: Unable to convert JSON for camera objects: {0}", e);
-
- return new List();
- }
- }
-
- public override bool CanWrite
- {
- get
- {
- return false;
- }
- }
-
- public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
- {
- throw new NotImplementedException("Write not implemented");
- }
- }
-
- public class Delay
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode9
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mute2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class AutoAnswer
- {
- public Delay Delay { get; set; }
- public Mode9 Mode { get; set; }
- public Mute2 Mute { get; set; }
-
- public AutoAnswer()
- {
- Mode = new Mode9();
- Delay = new Delay();
- Mute = new Mute2();
- }
- }
-
- public class Protocol
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Rate
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class DefaultCall
- {
- public Protocol Protocol { get; set; }
- public Rate Rate { get; set; }
- }
-
- public class DefaultTimeout
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class DoNotDisturb
- {
- public DefaultTimeout DefaultTimeout { get; set; }
- }
-
- public class Mode10
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Encryption
- {
- public Mode10 Mode { get; set; }
- }
-
- public class Mode11
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class FarEndControl
- {
- public Mode11 Mode { get; set; }
- }
-
- public class MaxReceiveCallRate
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class MaxTotalReceiveCallRate
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class MaxTotalTransmitCallRate
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class MaxTransmitCallRate
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode12
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class MultiStream
- {
- public Mode12 Mode { get; set; }
- }
-
- public class Conference
- {
- public AutoAnswer AutoAnswer { get; set; }
- public DefaultCall DefaultCall { get; set; }
- public DoNotDisturb DoNotDisturb { get; set; }
- public Encryption Encryption { get; set; }
- public FarEndControl FarEndControl { get; set; }
- public MaxReceiveCallRate MaxReceiveCallRate { get; set; }
- public MaxTotalReceiveCallRate MaxTotalReceiveCallRate { get; set; }
- public MaxTotalTransmitCallRate MaxTotalTransmitCallRate { get; set; }
- public MaxTransmitCallRate MaxTransmitCallRate { get; set; }
- public MultiStream MultiStream { get; set; }
-
- public Conference()
- {
- AutoAnswer = new AutoAnswer();
- }
- }
-
- public class LoginName
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode13
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Password
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Authentication
- {
- public LoginName LoginName { get; set; }
- public Mode13 Mode { get; set; }
- public Password Password { get; set; }
- }
-
- public class Mode14
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class CallSetup
- {
- public Mode14 Mode { get; set; }
- }
-
- public class KeySize
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Encryption2
- {
- public KeySize KeySize { get; set; }
- }
-
- public class Address
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Gatekeeper
- {
- public Address Address { get; set; }
- }
-
- public class E164
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class ID
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class H323Alias
- {
- public E164 E164 { get; set; }
- public ID ID { get; set; }
- }
-
- public class Address2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode15
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class NAT
- {
- public Address2 Address { get; set; }
- public Mode15 Mode { get; set; }
- }
-
- public class H323
- {
- public Authentication Authentication { get; set; }
- public CallSetup CallSetup { get; set; }
- public Encryption2 Encryption { get; set; }
- public Gatekeeper Gatekeeper { get; set; }
- public H323Alias H323Alias { get; set; }
- public NAT NAT { get; set; }
- }
-
- public class Name
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Domain
- {
- public Name Name { get; set; }
- }
-
- public class Address3
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Server
- {
- public string id { get; set; }
- public Address3 Address { get; set; }
- }
-
- public class DNS
- {
- public Domain Domain { get; set; }
- public List Server { get; set; }
- }
-
- public class AnonymousIdentity
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Md5
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Peap
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Tls
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Ttls
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Eap
- {
- public Md5 Md5 { get; set; }
- public Peap Peap { get; set; }
- public Tls Tls { get; set; }
- public Ttls Ttls { get; set; }
- }
-
- public class Identity
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode16
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Password2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class TlsVerify
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class UseClientCertificate
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class IEEE8021X
- {
- public AnonymousIdentity AnonymousIdentity { get; set; }
- public Eap Eap { get; set; }
- public Identity Identity { get; set; }
- public Mode16 Mode { get; set; }
- public Password2 Password { get; set; }
- public TlsVerify TlsVerify { get; set; }
- public UseClientCertificate UseClientCertificate { get; set; }
- }
-
- public class IPStack
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Address4
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Assignment
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Gateway
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class SubnetMask
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class IPv4
- {
- public Address4 Address { get; set; }
- public Assignment Assignment { get; set; }
- public Gateway Gateway { get; set; }
- public SubnetMask SubnetMask { get; set; }
-
- public IPv4()
- {
- Address = new Address4();
- }
- }
-
- public class Address5
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Assignment2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class DHCPOptions
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Gateway2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class IPv6
- {
- public Address5 Address { get; set; }
- public Assignment2 Assignment { get; set; }
- public DHCPOptions DHCPOptions { get; set; }
- public Gateway2 Gateway { get; set; }
- }
-
- public class MTU
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Audio2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Data
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class ICMPv6
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class NTP
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Signalling
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Video
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Diffserv
- {
- public Audio2 Audio { get; set; }
- public Data Data { get; set; }
- public ICMPv6 ICMPv6 { get; set; }
- public NTP NTP { get; set; }
- public Signalling Signalling { get; set; }
- public Video Video { get; set; }
- }
-
- public class Mode17
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class QoS
- {
- public Diffserv Diffserv { get; set; }
- public Mode17 Mode { get; set; }
- }
-
- public class Allow
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class RemoteAccess
- {
- public Allow Allow { get; set; }
- }
-
- public class Speed
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode18
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class VlanId
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Voice
- {
- public Mode18 Mode { get; set; }
- public VlanId VlanId { get; set; }
- }
-
- public class VLAN
- {
- public Voice Voice { get; set; }
- }
-
- public class Network
- {
- public string id { get; set; }
- public DNS DNS { get; set; }
- public IEEE8021X IEEE8021X { get; set; }
- public IPStack IPStack { get; set; }
- public IPv4 IPv4 { get; set; }
- public IPv6 IPv6 { get; set; }
- public MTU MTU { get; set; }
- public QoS QoS { get; set; }
- public RemoteAccess RemoteAccess { get; set; }
- public Speed Speed { get; set; }
- public VLAN VLAN { get; set; }
-
- public Network()
- {
- IPv4 = new IPv4();
- }
- }
-
- public class Mode19
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class CDP
- {
- public Mode19 Mode { get; set; }
- }
-
- public class Mode20
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class H3232
- {
- public Mode20 Mode { get; set; }
- }
-
- public class Mode21
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class HTTP
- {
- public Mode21 Mode { get; set; }
- }
-
- public class MinimumTLSVersion
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Server2
- {
- public MinimumTLSVersion MinimumTLSVersion { get; set; }
- }
-
- public class StrictTransportSecurity
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class VerifyClientCertificate
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class VerifyServerCertificate
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class HTTPS
- {
- public Server2 Server { get; set; }
- public StrictTransportSecurity StrictTransportSecurity { get; set; }
- public VerifyClientCertificate VerifyClientCertificate { get; set; }
- public VerifyServerCertificate VerifyServerCertificate { get; set; }
- }
-
- public class Mode22
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Address6
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Server3
- {
- public string id { get; set; }
- public Address6 Address { get; set; }
- }
-
- public class NTP2
- {
- public Mode22 Mode { get; set; }
- public List Server { get; set; }
- }
-
- public class Mode23
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class SIP
- {
- public Mode23 Mode { get; set; }
- }
-
- public class CommunityName
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Address7
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Host
- {
- public string id { get; set; }
- public Address7 Address { get; set; }
- }
-
- public class Mode24
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class SystemContact
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class SystemLocation
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class SNMP
- {
- public CommunityName CommunityName { get; set; }
- public List Host { get; set; }
- public Mode24 Mode { get; set; }
- public SystemContact SystemContact { get; set; }
- public SystemLocation SystemLocation { get; set; }
- }
-
- public class Mode25
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class SSH
- {
- public Mode25 Mode { get; set; }
- }
-
- public class Mode26
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class UPnP
- {
- public Mode26 Mode { get; set; }
- }
-
- public class WelcomeText
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class NetworkServices
- {
- public CDP CDP { get; set; }
- public H3232 H323 { get; set; }
- public HTTP HTTP { get; set; }
- public HTTPS HTTPS { get; set; }
- public NTP2 NTP { get; set; }
- public SIP SIP { get; set; }
- public SNMP SNMP { get; set; }
- public SSH SSH { get; set; }
- public UPnP UPnP { get; set; }
- public WelcomeText WelcomeText { get; set; }
- }
-
- public class Cameras2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class ControlSystems
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class TouchPanels
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Profile
- {
- public Cameras2 Cameras { get; set; }
- public ControlSystems ControlSystems { get; set; }
- public TouchPanels TouchPanels { get; set; }
- }
-
- public class Peripherals
- {
- public Profile Profile { get; set; }
- }
-
- public class ID2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Type
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class URL
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Server4
- {
- public string id { get; set; }
- public ID2 ID { get; set; }
- public Type Type { get; set; }
- public URL URL { get; set; }
- }
-
- public class Phonebook
- {
- public List Server { get; set; }
- }
-
- public class Connectivity
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Address8
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class AlternateAddress
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Domain2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Path
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Protocol2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class ExternalManager
- {
- public Address8 Address { get; set; }
- public AlternateAddress AlternateAddress { get; set; }
- public Domain2 Domain { get; set; }
- public Path Path { get; set; }
- public Protocol2 Protocol { get; set; }
- }
-
- public class HttpMethod
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class LoginName2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode27
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Password3
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Provisioning
- {
- public Connectivity Connectivity { get; set; }
- public ExternalManager ExternalManager { get; set; }
- public HttpMethod HttpMethod { get; set; }
- public LoginName2 LoginName { get; set; }
- public Mode27 Mode { get; set; }
- public Password3 Password { get; set; }
- }
-
- public class Mode28
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class CallControl
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class FromClients
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class ToClients
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class ContentShare
- {
- public FromClients FromClients { get; set; }
- public ToClients ToClients { get; set; }
- }
-
- public class Services
- {
- public CallControl CallControl { get; set; }
- public ContentShare ContentShare { get; set; }
- }
-
- public class Proximity
- {
- public Mode28 Mode { get; set; }
- public Services Services { get; set; }
- }
-
- public class PeopleCountOutOfCall
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class PeoplePresenceDetector
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class RoomAnalytics
- {
- public PeopleCountOutOfCall PeopleCountOutOfCall { get; set; }
- public PeoplePresenceDetector PeoplePresenceDetector { get; set; }
- }
-
- public class Password4
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class UserName
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Authentication2
- {
- public Password4 Password { get; set; }
- public UserName UserName { get; set; }
- }
-
- public class DefaultTransport
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class DisplayName
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class DefaultCandidate
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode29
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Ice
- {
- public DefaultCandidate DefaultCandidate { get; set; }
- public Mode29 Mode { get; set; }
- }
-
- public class ListenPort
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Address9
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Proxy
- {
- public string id { get; set; }
- public Address9 Address { get; set; }
- }
-
- public class Password5
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Server5
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class UserName2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Turn
- {
- public Password5 Password { get; set; }
- public Server5 Server { get; set; }
- public UserName2 UserName { get; set; }
- }
-
- public class URI
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class SIP2
- {
- public Authentication2 Authentication { get; set; }
- public DefaultTransport DefaultTransport { get; set; }
- public DisplayName DisplayName { get; set; }
- public Ice Ice { get; set; }
- public ListenPort ListenPort { get; set; }
- public List Proxy { get; set; }
- public Turn Turn { get; set; }
- public URI URI { get; set; }
- }
-
- public class BaudRate
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class LoginRequired
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode30
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class SerialPort
- {
- public BaudRate BaudRate { get; set; }
- public LoginRequired LoginRequired { get; set; }
- public Mode30 Mode { get; set; }
- }
-
- public class BootAction
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Control
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Delay2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class StandbyAction
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class WakeupAction
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Standby
- {
- public BootAction BootAction { get; set; }
- public Control Control { get; set; }
- public Delay2 Delay { get; set; }
- public StandbyAction StandbyAction { get; set; }
- public WakeupAction WakeupAction { get; set; }
- }
-
- public class Name2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class SystemUnit
- {
- public Name2 Name { get; set; }
- }
-
- public class DateFormat
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class TimeFormat
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Zone
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Time
- {
- public DateFormat DateFormat { get; set; }
- public TimeFormat TimeFormat { get; set; }
- public Zone Zone { get; set; }
- }
-
- public class Type2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class ContactInfo
- {
- public Type2 Type { get; set; }
- }
-
- public class Mode31
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class KeyTones
- {
- public Mode31 Mode { get; set; }
- }
-
- public class Language
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Output2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class OSD
- {
- public Output2 Output { get; set; }
- }
-
- public class UserInterface
- {
- public ContactInfo ContactInfo { get; set; }
- public KeyTones KeyTones { get; set; }
- public Language Language { get; set; }
- public OSD OSD { get; set; }
- }
-
- public class Filter
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Group
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Admin
- {
- public Filter Filter { get; set; }
- public Group Group { get; set; }
- }
-
- public class Attribute
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class BaseDN
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Encryption3
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class MinimumTLSVersion2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode32
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Address10
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Port
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Server6
- {
- public Address10 Address { get; set; }
- public Port Port { get; set; }
- }
-
- public class VerifyServerCertificate2
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class LDAP
- {
- public Admin Admin { get; set; }
- public Attribute Attribute { get; set; }
- public BaseDN BaseDN { get; set; }
- public Encryption3 Encryption { get; set; }
- public MinimumTLSVersion2 MinimumTLSVersion { get; set; }
- public Mode32 Mode { get; set; }
- public Server6 Server { get; set; }
- public VerifyServerCertificate2 VerifyServerCertificate { get; set; }
- }
-
- public class UserManagement
- {
- public LDAP LDAP { get; set; }
- }
-
- public class DefaultMainSource
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class CameraId
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode33
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class CameraControl
- {
- public CameraId CameraId { get; set; }
- public Mode33 Mode { get; set; }
- }
-
- public class InputSourceType
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Name3
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class PreferredResolution
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class PresentationSelection
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Quality
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Visibility
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Connector
- {
- public string id { get; set; }
- public CameraControl CameraControl { get; set; }
- public InputSourceType InputSourceType { get; set; }
- public Name3 Name { get; set; }
- public PreferredResolution PreferredResolution { get; set; }
- public PresentationSelection PresentationSelection { get; set; }
- public Quality Quality { get; set; }
- public Visibility Visibility { get; set; }
- }
-
- public class Input2
- {
- public List Connector { get; set; }
- }
-
- public class Monitors
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode34
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class CEC
- {
- public Mode34 Mode { get; set; }
- }
-
- public class MonitorRole
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Resolution
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Connector2
- {
- public string id { get; set; }
- public CEC CEC { get; set; }
- public MonitorRole MonitorRole { get; set; }
- public Resolution Resolution { get; set; }
- }
-
- public class Output3
- {
- public List Connector { get; set; }
- }
-
- public class DefaultSource
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Presentation
- {
- public DefaultSource DefaultSource { get; set; }
- }
-
- public class FullscreenMode
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode35
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class OnMonitorRole
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class PIPPosition
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Default
- {
- public FullscreenMode FullscreenMode { get; set; }
- public Mode35 Mode { get; set; }
- public OnMonitorRole OnMonitorRole { get; set; }
- public PIPPosition PIPPosition { get; set; }
- }
-
- public class Duration
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class Mode36
- {
- public string valueSpaceRef { get; set; }
- public string Value { get; set; }
- }
-
- public class OnCall
- {
- public Duration Duration { get; set; }
- public Mode36 Mode { get; set; }
- }
-
- public class Selfview
- {
- public Default Default { get; set; }
- public OnCall OnCall { get; set; }
- }
-
- public class Video2
- {
- public DefaultMainSource DefaultMainSource { get; set; }
- public Input2 Input { get; set; }
- public Monitors Monitors { get; set; }
- public Output3 Output { get; set; }
- public Presentation Presentation { get; set; }
- public Selfview Selfview { get; set; }
- }
-
- public class Configuration
- {
- public Audio Audio { get; set; }
- public Cameras Cameras { get; set; }
- public Conference Conference { get; set; }
- public H323 H323 { get; set; }
- public List Network { get; set; }
- public NetworkServices NetworkServices { get; set; }
- public Peripherals Peripherals { get; set; }
- public Phonebook Phonebook { get; set; }
- public Provisioning Provisioning { get; set; }
- public Proximity Proximity { get; set; }
- public RoomAnalytics RoomAnalytics { get; set; }
- public SIP2 SIP { get; set; }
- public SerialPort SerialPort { get; set; }
- public Standby Standby { get; set; }
- public SystemUnit SystemUnit { get; set; }
- public Time Time { get; set; }
- public UserInterface UserInterface { get; set; }
- public UserManagement UserManagement { get; set; }
- public Video2 Video { get; set; }
-
- public Configuration()
- {
- Audio = new Audio();
- Conference = new Conference();
- Network = new List();
- }
- }
-
- public class RootObject
- {
- public Configuration Configuration { get; set; }
-
- public RootObject()
- {
- Configuration = new Configuration();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/xEvent.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/xEvent.cs
deleted file mode 100644
index a797103c..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/xEvent.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
-{
- ///
- /// This class exists to capture serialized data sent back by a Cisco codec in JSON output mode
- ///
- public class CiscoCodecEvents
- {
- public class CauseValue
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class CauseType
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class CauseString
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class OrigCallDirection
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class RemoteURI
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class DisplayName
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class CallId
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class CauseCode
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class CauseOrigin
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class Protocol
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class Duration
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class CallType
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class CallRate
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class Encryption
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class RequestedURI
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class PeopleCountAverage
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class CallDisconnect
- {
- public string id { get; set; }
- public CauseValue CauseValue { get; set; }
- public CauseType CauseType { get; set; }
- public CauseString CauseString { get; set; }
- public OrigCallDirection OrigCallDirection { get; set; }
- public RemoteURI RemoteURI { get; set; }
- public DisplayName DisplayName { get; set; }
- public CallId CallId { get; set; }
- public CauseCode CauseCode { get; set; }
- public CauseOrigin CauseOrigin { get; set; }
- public Protocol Protocol { get; set; }
- public Duration Duration { get; set; }
- public CallType CallType { get; set; }
- public CallRate CallRate { get; set; }
- public Encryption Encryption { get; set; }
- public RequestedURI RequestedURI { 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 CallDisconnect CallDisconnect { get; set; }
- public UserInterface UserInterface { get; set; }
- }
-
- public class RootObject
- {
- public Event Event { get; set; }
- }
- }
-}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/xStatus.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/xStatus.cs
deleted file mode 100644
index 6b7ee2e5..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/xStatus.cs
+++ /dev/null
@@ -1,2281 +0,0 @@
-extern alias Full;
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharp.CrestronXml.Serialization;
-using Full.Newtonsoft.Json;
-using Full.Newtonsoft.Json.Linq;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Devices.Common.VideoCodec.CiscoCodec;
-using PepperDash.Essentials.Core.Presets;
-
-namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
-{
- // Helper Classes for Proerties
- public abstract class ValueProperty
- {
- ///
- /// Triggered when Value is set
- ///
- public Action ValueChangedAction { get; set; }
-
- protected void OnValueChanged()
- {
- var a = ValueChangedAction;
- if (a != null)
- a();
- }
-
- }
-
- ///
- /// This class exists to capture serialized data sent back by a Cisco codec in JSON output mode
- ///
- public class CiscoCodecStatus
- {
-
- public class ConnectionStatus
- {
- public string Value { get; set; }
- }
-
- public class EcReferenceDelay
- {
- public string Value { get; set; }
- }
-
- public class Microphone
- {
- public string id { get; set; }
- public ConnectionStatus ConnectionStatus { get; set; }
- public EcReferenceDelay EcReferenceDelay { get; set; }
- }
-
- public class Connectors
- {
- public List Microphone { get; set; }
- }
-
- public class Input
- {
- public Connectors Connectors { get; set; }
- }
-
- public class Mute : ValueProperty
- {
- public bool BoolValue { get; private set; }
-
- public string Value
- {
- set
- {
- // If the incoming value is "On" it sets the BoolValue true, otherwise sets it false
- BoolValue = value == "On";
- OnValueChanged();
- }
- }
- }
-
- public class Microphones
- {
- public Mute Mute { get; set; }
-
- public Microphones()
- {
- Mute = new Mute();
- }
- }
-
- public class ConnectionStatus2
- {
- public string Value { get; set; }
- }
-
- public class DelayMs
- {
- public string Value { get; set; }
- }
-
- public class Line
- {
- public string id { get; set; }
- public ConnectionStatus2 ConnectionStatus { get; set; }
- public DelayMs DelayMs { get; set; }
- }
-
- public class Connectors2
- {
- public List Line { get; set; }
- }
-
- public class Output
- {
- public Connectors2 Connectors { get; set; }
- }
-
- public class Volume : ValueProperty
- {
- string _Value;
-
- ///
- /// Sets Value and triggers the action when set
- ///
- public string Value
- {
- get
- {
- return _Value;
- }
- set
- {
- _Value = value;
- OnValueChanged();
- }
- }
-
- ///
- /// Converted value of _Value for use as feedback
- ///
- public int IntValue
- {
- get
- {
- if (!string.IsNullOrEmpty(_Value))
- return Convert.ToInt32(_Value);
- else
- return 0;
- }
- }
- }
-
- public class VolumeMute : ValueProperty
- {
- public bool BoolValue { get; private set; }
-
- public string Value
- {
- set
- {
- // If the incoming value is "On" it sets the BoolValue true, otherwise sets it false
- BoolValue = value == "On";
- OnValueChanged();
- }
- }
- }
-
- public class Audio
- {
- public Input Input { get; set; }
- public Microphones Microphones { get; set; } // Can we have this setter fire the update on the CiscoCodec feedback?
- public Output Output { get; set; }
- public Volume Volume { get; set; }
- public VolumeMute VolumeMute { get; set; }
-
- public Audio()
- {
- Volume = new Volume();
- VolumeMute = new VolumeMute();
- Microphones = new Microphones();
- }
- }
-
- public class Id
- {
- public string Value { get; set; }
- }
-
- public class Current
- {
- public Id Id { get; set; }
- }
-
- public class Bookings
- {
- public Current Current { get; set; }
- }
-
- public class Options
- {
- public string Value { get; set; }
- }
-
- public class Capabilities
- {
- public Options Options { get; set; }
- }
-
- public class Connected
- {
- public string Value { get; set; }
- }
-
- public class Framerate
- {
- public string Value { get; set; }
- }
-
- public class Flip
- {
- public string Value { get; set; }
- }
-
- public class HardwareID
- {
- public string Value { get; set; }
- }
-
- public class Manufacturer
- {
- public string Value { get; set; }
- }
-
- public class Model
- {
- public string Value { get; set; }
- }
-
- public class Pan
- {
- public string Value { get; set; }
- }
-
- public class Tilt
- {
- public string Value { get; set; }
- }
-
- public class Zoom
- {
- public string Value { get; set; }
- }
-
- public class Position
- {
- public Pan Pan { get; set; }
- public Tilt Tilt { get; set; }
- public Zoom Zoom { get; set; }
- }
-
- public class SoftwareID
- {
- public string Value { get; set; }
- }
-
- public class DectectedConnector
- {
- public string Value { get; set; }
-
- public int ConnectorId
- {
- get
- {
- if(!string.IsNullOrEmpty(Value))
- {
- return Convert.ToUInt16(Value);
- }
- else
- return -1;
- }
- }
- }
-
- public class Camera
- {
- public string id { get; set; }
- public Capabilities Capabilities { get; set; }
- public Connected Connected { get; set; }
- public DectectedConnector DetectedConnector { get; set; }
- public Flip Flip { get; set; }
- public HardwareID HardwareID { get; set; }
- public MacAddress MacAddress { get; set; }
- public Manufacturer Manufacturer { get; set; }
- public Model Model { get; set; }
- public Position Position { get; set; }
- public SerialNumber SerialNumber { get; set; }
- public SoftwareID SoftwareID { get; set; }
-
- public Camera()
- {
- Manufacturer = new Manufacturer();
- Model = new Model();
- DetectedConnector = new DectectedConnector();
- }
- }
-
- public class Availability : ValueProperty
- {
- string _Value;
- public bool BoolValue { get; private set; }
-
- public string Value
- {
- get
- {
- return _Value;
- }
- set
- {
- // If the incoming value is "Available" it sets the BoolValue true, otherwise sets it false
- _Value = value;
- BoolValue = value == "Available";
- OnValueChanged();
- }
- }
- }
-
- public class CallStatus : ValueProperty
- {
- string _Value;
- public bool BoolValue { get; private set; }
-
-
- public string Value
- {
- get
- {
- return _Value;
- }
- set
- {
- // If the incoming value is "Active" it sets the BoolValue true, otherwise sets it false
- _Value = value;
- BoolValue = value == "Connected";
- OnValueChanged();
- }
- }
- }
-
- public class Status2 : ValueProperty
- {
- string _Value;
- public bool BoolValue { get; private set; }
-
-
- public string Value
- {
- get
- {
- return _Value;
- }
- set
- {
- // If the incoming value is "Active" it sets the BoolValue true, otherwise sets it false
- _Value = value;
- BoolValue = value == "Active";
- OnValueChanged();
- }
- }
- }
-
- public class SpeakerTrack
- {
- public Availability Availability { get; set; }
- public Status2 Status { get; set; }
-
- public SpeakerTrack()
- {
- Status = new Status2();
- Availability = new Availability();
- }
- }
-
- public class Cameras
- {
- // [JsonConverter(typeof(CameraConverter))]
- public List Camera { get; set; }
- public SpeakerTrack SpeakerTrack { get; set; }
-
- public Cameras()
- {
- Camera = new List();
- SpeakerTrack = new SpeakerTrack();
- }
- }
-
- //public class CameraConverter : JsonConverter
- //{
-
- // public override bool CanConvert(System.Type objectType)
- // {
- // return true; // objectType == typeof(Camera) || objectType == typeof(List); // This should not be called but is required for implmentation
- // }
-
- // public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer)
- // {
- // try
- // {
- // if (reader.TokenType == JsonToken.StartArray)
- // {
- // var l = new List();
- // reader.Read();
- // while (reader.TokenType != JsonToken.EndArray)
- // {
- // l.Add(reader.Value as Camera);
- // reader.Read();
- // }
- // Debug.Console(1, "[xStatus]: Cameras converted as list");
- // return l;
- // }
- // else
- // {
- // Debug.Console(1, "[xStatus]: Camera converted as single object and added to list");
- // return new List { reader.Value as Camera };
- // }
- // }
- // catch (Exception e)
- // {
- // Debug.Console(1, "[xStatus]: Unable to convert JSON for camera objects: {0}", e);
-
- // return new List();
- // }
- // }
-
- // public override bool CanWrite
- // {
- // get
- // {
- // return false;
- // }
- // }
-
- // public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
- // {
- // throw new NotImplementedException("Write not implemented");
- // }
- //}
-
-
- public class MaxActiveCalls
- {
- public string Value { get; set; }
- }
-
- public class MaxAudioCalls
- {
- public string Value { get; set; }
- }
-
- public class MaxCalls
- {
- public string Value { get; set; }
- }
-
- public class MaxVideoCalls
- {
- public string Value { get; set; }
- }
-
- public class Conference
- {
- public MaxActiveCalls MaxActiveCalls { get; set; }
- public MaxAudioCalls MaxAudioCalls { get; set; }
- public MaxCalls MaxCalls { get; set; }
- public MaxVideoCalls MaxVideoCalls { get; set; }
- }
-
- public class Capabilities2
- {
- public Conference Conference { get; set; }
- }
-
- public class CallId
- {
- public string Value { get; set; }
- }
-
- public class ActiveSpeaker
- {
- public CallId CallId { get; set; }
- }
-
- public class DoNotDisturb : ValueProperty
- {
- string _Value;
-
- public bool BoolValue { get; private set; }
-
- public string Value
- {
- get
- {
- return _Value;
- }
- set
- {
- _Value = value;
- // If the incoming value is "On" it sets the BoolValue true, otherwise sets it false
- BoolValue = value == "On" || value == "Active";
- OnValueChanged();
- }
- }
- }
-
- public class Mode
- {
- public string Value { get; set; }
- }
-
- public class Multipoint
- {
- public Mode Mode { get; set; }
- }
-
- public class CallId2
- {
- public string Value { get; set; }
- }
-
- public class Mode2 : ValueProperty
- {
- string _Value;
-
- public bool BoolValue { get; private set; }
-
-
-
- public string Value
- {
- get
- {
- return _Value;
- }
- set
- {
- _Value = value;
- // If the incoming value is "Sending" it sets the BoolValue true, otherwise sets it false
- BoolValue = value == "Sending";
- OnValueChanged();
- }
- }
- }
-
- public class Mode3
- {
- public string Value { get; set; }
- }
-
- public class ReleaseFloorAvailability
- {
- public string Value { get; set; }
- }
-
- public class RequestFloorAvailability
- {
- public string Value { get; set; }
- }
-
- public class Whiteboard
- {
- public Mode3 Mode { get; set; }
- public ReleaseFloorAvailability ReleaseFloorAvailability { get; set; }
- public RequestFloorAvailability RequestFloorAvailability { get; set; }
- }
-
- public class Source2 : ValueProperty
- {
- string _Value;
-
- ///
- /// Sets Value and triggers the action when set
- ///
- public string Value
- {
- get
- {
- return _Value;
- }
- set
- {
- _Value = value;
- OnValueChanged();
- }
- }
-
- ///
- /// Converted value of _Value for use as feedback
- ///
- public int IntValue
- {
- get
- {
- if (!string.IsNullOrEmpty(_Value))
- return Convert.ToInt32(_Value);
- else
- return 0;
- }
- }
- }
-
- public class SendingMode : ValueProperty
- {
- string _Value;
-
- ///
- /// Sets Value and triggers the action when set
- ///
- public string Value
- {
- get
- {
- return _Value;
- }
- set
- {
- _Value = value;
- OnValueChanged();
- }
- }
-
- public bool LocalOnly
- {
- get
- {
- if(string.IsNullOrEmpty(_Value))
- return false;
-
- return _Value.ToLower() == "localonly";
- }
- }
-
- public bool LocalRemote
- {
- get
- {
- if(string.IsNullOrEmpty(_Value))
- return false;
-
- return _Value.ToLower() == "localremote";
- }
- }
- }
-
- public class LocalInstance
- {
- public string id { get; set; }
- public string ghost { get; set; }
- public SendingMode SendingMode { get; set; }
- public Source2 Source { get; set; }
-
- public LocalInstance()
- {
- Source = new Source2();
- SendingMode = new SendingMode();
- }
- }
-
- public class Presentation
- {
- public CallId2 CallId { get; set; }
- public Mode2 Mode { get; set; }
- public Whiteboard Whiteboard { get; set; }
- public List LocalInstance { get; set; }
-
- public Presentation()
- {
- Mode = new Mode2();
- LocalInstance = new List();
- }
- }
-
- public class CallId3
- {
- public string Value { get; set; }
- }
-
- public class Mode4
- {
- public string Value { get; set; }
- }
-
- public class SpeakerLock
- {
- public CallId3 CallId { get; set; }
- public Mode4 Mode { get; set; }
- }
-
- public class Conference2
- {
- public ActiveSpeaker ActiveSpeaker { get; set; }
- public DoNotDisturb DoNotDisturb { get; set; }
- public Multipoint Multipoint { get; set; }
- public Presentation Presentation { get; set; }
- public SpeakerLock SpeakerLock { get; set; }
-
- public Conference2()
- {
- Presentation = new Presentation();
- DoNotDisturb = new DoNotDisturb();
- }
- }
-
- public class Description
- {
- public string Value { get; set; }
- }
-
- public class Level
- {
- public string Value { get; set; }
- }
-
- public class References
- {
- public string Value { get; set; }
- }
-
- public class Type
- {
- public string Value { get; set; }
- }
-
- public class Message
- {
- public string id { get; set; }
- public Description Description { get; set; }
- public Level Level { get; set; }
- public References References { get; set; }
- public Type Type { get; set; }
- }
-
- public class Diagnostics
- {
- public List Message { get; set; }
- }
-
- public class Conference3
- {
- }
-
- public class Experimental
- {
- public Conference3 Conference { get; set; }
- }
-
- public class Address
- {
- public string Value { get; set; }
- }
-
- public class Port
- {
- public string Value { get; set; }
- }
-
- public class Reason
- {
- public string Value { get; set; }
- }
-
- public class Status3
- {
- public string Value { get; set; }
- }
-
- public class Gatekeeper
- {
- public Address Address { get; set; }
- public Port Port { get; set; }
- public Reason Reason { get; set; }
- public Status3 Status { get; set; }
- }
-
- public class Reason2
- {
- public string Value { get; set; }
- }
-
- public class Status4
- {
- public string Value { get; set; }
- }
-
- public class Mode5
- {
- public Reason2 Reason { get; set; }
- public Status4 Status { get; set; }
- }
-
- public class H323
- {
- public Gatekeeper Gatekeeper { get; set; }
- public Mode5 Mode { get; set; }
- }
-
- public class Expression
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class Format
- {
- public string Value { get; set; }
- }
-
- public class URL
- {
- public string Value { get; set; }
- }
-
- public class HttpFeedback
- {
- public string id { get; set; }
- public List Expression { get; set; }
- public Format Format { get; set; }
- public URL URL { get; set; }
- }
-
- public class MediaChannels
- {
- }
-
- public class Address2
- {
- public string Value { get; set; }
- }
-
- public class Capabilities3
- {
- public string Value { get; set; }
- }
-
- public class DeviceId
- {
- public string Value { get; set; }
- }
-
- public class Duplex
- {
- public string Value { get; set; }
- }
-
- public class Platform
- {
- public string Value { get; set; }
- }
-
- public class PortID
- {
- public string Value { get; set; }
- }
-
- public class PrimaryMgmtAddress
- {
- public string Value { get; set; }
- }
-
- public class SysName
- {
- public string Value { get; set; }
- }
-
- public class SysObjectID
- {
- public string Value { get; set; }
- }
-
- public class VTPMgmtDomain
- {
- public string Value { get; set; }
- }
-
- public class Version
- {
- public string Value { get; set; }
- }
-
- public class VoIPApplianceVlanID
- {
- public string Value { get; set; }
- }
-
- public class CDP
- {
- public Address2 Address { get; set; }
- public Capabilities3 Capabilities { get; set; }
- public DeviceId DeviceId { get; set; }
- public Duplex Duplex { get; set; }
- public Platform Platform { get; set; }
- public PortID PortID { get; set; }
- public PrimaryMgmtAddress PrimaryMgmtAddress { get; set; }
- public SysName SysName { get; set; }
- public SysObjectID SysObjectID { get; set; }
- public VTPMgmtDomain VTPMgmtDomain { get; set; }
- public Version Version { get; set; }
- public VoIPApplianceVlanID VoIPApplianceVlanID { get; set; }
- }
-
- public class Name
- {
- public string Value { get; set; }
- }
-
- public class Domain
- {
- public Name Name { get; set; }
- }
-
- public class Address3
- {
- public string Value { get; set; }
- }
-
- public class Server
- {
- public string id { get; set; }
- public Address3 Address { get; set; }
- }
-
- public class DNS
- {
- public Domain Domain { get; set; }
- public List Server { get; set; }
- }
-
- public class MacAddress
- {
- public string Value { get; set; }
- }
-
- public class Speed
- {
- public string Value { get; set; }
- }
-
- public class Ethernet
- {
- public MacAddress MacAddress { get; set; }
- public Speed Speed { get; set; }
- }
-
- public class Address4
- {
- public string Value { get; set; }
- }
-
- public class Gateway
- {
- public string Value { get; set; }
- }
-
- public class SubnetMask
- {
- public string Value { get; set; }
- }
-
- public class IPv4
- {
- public Address4 Address { get; set; }
- public Gateway Gateway { get; set; }
- public SubnetMask SubnetMask { get; set; }
-
- public IPv4()
- {
- Address = new Address4();
- }
- }
-
- public class Address5
- {
- public string Value { get; set; }
- }
-
- public class Gateway2
- {
- public string Value { get; set; }
- }
-
- public class IPv6
- {
- public Address5 Address { get; set; }
- public Gateway2 Gateway { get; set; }
- }
-
- public class VlanId
- {
- public string Value { get; set; }
- }
-
- public class Voice
- {
- public VlanId VlanId { get; set; }
- }
-
- public class VLAN
- {
- public Voice Voice { get; set; }
- }
-
- public class Network
- {
- public string id { get; set; }
- public CDP CDP { get; set; }
- public DNS DNS { get; set; }
- public Ethernet Ethernet { get; set; }
- public IPv4 IPv4 { get; set; }
- public IPv6 IPv6 { get; set; }
- public VLAN VLAN { get; set; }
-
- public Network()
- {
- IPv4 = new IPv4();
- }
- }
-
- public class CurrentAddress
- {
- public string Value { get; set; }
- }
-
- public class Address6
- {
- public string Value { get; set; }
- }
-
- public class Server2
- {
- public string id { get; set; }
- public Address6 Address { get; set; }
- }
-
- public class Status5
- {
- public string Value { get; set; }
- }
-
- public class NTP
- {
- public CurrentAddress CurrentAddress { get; set; }
- public List Server { get; set; }
- public Status5 Status { get; set; }
- }
-
- public class NetworkServices
- {
- public NTP NTP { get; set; }
- }
-
- public class HardwareInfo
- {
- public string Value { get; set; }
- }
-
- public class ID2
- {
- public string Value { get; set; }
- }
-
- public class Name2
- {
- public string Value { get; set; }
- }
-
- public class SoftwareInfo
- {
- public string Value { get; set; }
- }
-
- public class Status6
- {
- public string Value { get; set; }
- }
-
- public class Type2
- {
- public string Value { get; set; }
- }
-
- public class UpgradeStatus
- {
- public string Value { get; set; }
- }
-
- public class ConnectedDevice
- {
- public string id { get; set; }
- public HardwareInfo HardwareInfo { get; set; }
- public ID2 ID { get; set; }
- public Name2 Name { get; set; }
- public SoftwareInfo SoftwareInfo { get; set; }
- public Status6 Status { get; set; }
- public Type2 Type { get; set; }
- public UpgradeStatus UpgradeStatus { get; set; }
- }
-
- public class Peripherals
- {
- public List ConnectedDevice { get; set; }
- }
-
- public class Enabled
- {
- public string Value { get; set; }
- }
-
- public class LastLoggedInUserId
- {
- public string Value { get; set; }
- }
-
- public class LoggedIn
- {
- public string Value { get; set; }
- }
-
- public class ExtensionMobility
- {
- public Enabled Enabled { get; set; }
- public LastLoggedInUserId LastLoggedInUserId { get; set; }
- public LoggedIn LoggedIn { get; set; }
- }
-
- public class CUCM
- {
- public ExtensionMobility ExtensionMobility { get; set; }
- }
-
- public class CompletedAt
- {
- public string Value { get; set; }
- }
-
- public class URL2
- {
- public string Value { get; set; }
- }
-
- public class VersionId
- {
- public string Value { get; set; }
- }
-
- public class Current2
- {
- public CompletedAt CompletedAt { get; set; }
- public URL2 URL { get; set; }
- public VersionId VersionId { get; set; }
- }
-
- public class LastChange
- {
- public string Value { get; set; }
- }
-
- public class Message2
- {
- public string Value { get; set; }
- }
-
- public class Phase
- {
- public string Value { get; set; }
- }
-
- public class SessionId
- {
- public string Value { get; set; }
- }
-
- public class Status7
- {
- public string Value { get; set; }
- }
-
- public class URL3
- {
- public string Value { get; set; }
- }
-
- public class VersionId2
- {
- public string Value { get; set; }
- }
-
- public class UpgradeStatus2
- {
- public LastChange LastChange { get; set; }
- public Message2 Message { get; set; }
- public Phase Phase { get; set; }
- public SessionId SessionId { get; set; }
- public Status7 Status { get; set; }
- public URL3 URL { get; set; }
- public VersionId2 VersionId { get; set; }
- }
-
- public class Software
- {
- public Current2 Current { get; set; }
- public UpgradeStatus2 UpgradeStatus { get; set; }
- }
-
- public class Status8
- {
- public string Value { get; set; }
- }
-
- public class Provisioning
- {
- public CUCM CUCM { get; set; }
- public Software Software { get; set; }
- public Status8 Status { get; set; }
- }
-
- public class Availability2
- {
- public string Value { get; set; }
- }
-
- public class Services
- {
- public Availability2 Availability { get; set; }
- }
-
- public class Proximity
- {
- public Services Services { get; set; }
- }
-
- public class Current3 : ValueProperty
- {
- string _Value;
-
- ///
- /// Sets Value and triggers the action when set
- ///
- public string Value
- {
- get
- {
- return _Value;
- }
- set
- {
- _Value = value;
- OnValueChanged();
- }
- }
-
- ///
- /// Converted value of _Value for use as feedback
- ///
- public int IntValue
- {
- get
- {
- if (!string.IsNullOrEmpty(_Value))
- return Convert.ToInt32(_Value);
- else
- return 0;
- }
- }
- }
-
- public class PeopleCount
- {
- public Current3 Current { get; set; }
-
- public PeopleCount()
- {
- Current = new Current3();
- }
- }
-
- public class PeoplePresence : ValueProperty
- {
- public bool BoolValue { get; private set; }
-
- public string Value
- {
- set
- {
- // If the incoming value is "Yes" it sets the BoolValue true, otherwise sets it false
- BoolValue = value == "Yes";
- OnValueChanged();
- }
- }
- }
-
- public class RoomAnalytics
- {
- public PeopleCount PeopleCount { get; set; }
- public PeoplePresence PeoplePresence { get; set; }
-
- public RoomAnalytics()
- {
- PeopleCount = new PeopleCount();
- PeoplePresence = new PeoplePresence();
- }
- }
-
- public class Primary
- {
- public URI URI { get; set; }
-
- public Primary()
- {
- URI = new URI();
- }
- }
-
- public class AlternateURI
- {
- public Primary Primary { get; set; }
-
- public AlternateURI()
- {
- Primary = new Primary();
- }
- }
-
- public class Authentication
- {
- public string Value { get; set; }
- }
-
- public class DisplayName
- {
- public string Value { get; set; }
- }
-
- public class Mode6
- {
- public string Value { get; set; }
- }
-
- public class URI
- {
- public string Value { get; set; }
- }
-
- public class CallForward
- {
- public DisplayName DisplayName { get; set; }
- public Mode6 Mode { get; set; }
- public URI URI { get; set; }
- }
-
- public class MessagesWaiting
- {
- public string Value { get; set; }
- }
-
- public class URI2
- {
- public string Value { get; set; }
- }
-
- public class Mailbox
- {
- public MessagesWaiting MessagesWaiting { get; set; }
- public URI2 URI { get; set; }
- }
-
- public class Address7
- {
- public string Value { get; set; }
- }
-
- public class Status9
- {
- public string Value { get; set; }
- }
-
- public class Proxy
- {
- public string id { get; set; }
- public Address7 Address { get; set; }
- public Status9 Status { get; set; }
- }
-
- public class Reason3
- {
- public string Value { get; set; }
- }
-
- public class Status10
- {
- public string Value { get; set; }
- }
-
- public class URI3
- {
- public string Value { get; set; }
- }
-
- public class Registration
- {
- public string id { get; set; }
- public Reason3 Reason { get; set; }
- public Status10 Status { get; set; }
- public URI3 URI { get; set; }
-
- public Registration()
- {
- URI = new URI3();
- }
- }
-
- public class Secure
- {
- public string Value { get; set; }
- }
-
- public class Verified
- {
- public string Value { get; set; }
- }
-
- public class SIP
- {
- public AlternateURI AlternateURI { get; set; }
- public Authentication Authentication { get; set; }
- public CallForward CallForward { get; set; }
- public Mailbox Mailbox { get; set; }
- public List Proxy { get; set; }
- public List Registration { get; set; }
- public Secure Secure { get; set; }
- public Verified Verified { get; set; }
-
- public SIP()
- {
- AlternateURI = new AlternateURI();
- Registration = new List();
- }
- }
-
- public class Mode7
- {
- public string Value { get; set; }
- }
-
- public class FIPS
- {
- public Mode7 Mode { get; set; }
- }
-
- public class CallHistory
- {
- public string Value { get; set; }
- }
-
- public class Configurations
- {
- public string Value { get; set; }
- }
-
- public class DHCP
- {
- public string Value { get; set; }
- }
-
- public class InternalLogging
- {
- public string Value { get; set; }
- }
-
- public class LocalPhonebook
- {
- public string Value { get; set; }
- }
-
- public class Persistency
- {
- public CallHistory CallHistory { get; set; }
- public Configurations Configurations { get; set; }
- public DHCP DHCP { get; set; }
- public InternalLogging InternalLogging { get; set; }
- public LocalPhonebook LocalPhonebook { get; set; }
- }
-
- public class Security
- {
- public FIPS FIPS { get; set; }
- public Persistency Persistency { get; set; }
- }
-
- public class State : ValueProperty
- {
- string _value;
-
- public bool BoolValue { get; private set; }
-
- public string Value // Valid values are Standby/EnteringStandby/Halfwake/Off
- {
- get { return _value; }
- set
- {
- _value = value;
- // If the incoming value is "On" it sets the BoolValue true, otherwise sets it false
- BoolValue = value == "On" || value == "Standby";
- OnValueChanged();
- }
- }
- }
-
- public class Standby
- {
- public State State { get; set; }
-
- public Standby()
- {
- State = new State();
- }
- }
-
- public class CompatibilityLevel
- {
- public string Value { get; set; }
- }
-
- public class SerialNumber
- {
- public string Value { get; set; }
- }
-
- public class Module
- {
- public CompatibilityLevel CompatibilityLevel { get; set; }
- public SerialNumber SerialNumber { get; set; }
- }
-
- public class Hardware
- {
- public Module Module { get; set; }
- }
-
- public class ProductId
- {
- public string Value { get; set; }
- }
-
- public class ProductPlatform
- {
- public string Value { get; set; }
- }
-
- public class ProductType
- {
- public string Value { get; set; }
- }
-
- public class DisplayName2
- {
- public string Value { get; set; }
- }
-
- public class Name3
- {
- public string Value { get; set; }
- }
-
- public class Encryption
- {
- public string Value { get; set; }
- }
-
- public class MultiSite
- {
- public string Value { get; set; }
- }
-
- public class RemoteMonitoring
- {
- public string Value { get; set; }
- }
-
- public class OptionKeys
- {
- public Encryption Encryption { get; set; }
- public MultiSite MultiSite { get; set; }
- public RemoteMonitoring RemoteMonitoring { get; set; }
-
- public OptionKeys()
- {
- MultiSite = new MultiSite();
- }
- }
-
- public class ReleaseDate
- {
- public string Value { get; set; }
- }
-
- public class Version2
- {
- public string Value { get; set; }
- }
-
- public class Software2
- {
- public DisplayName2 DisplayName { get; set; }
- public Name3 Name { get; set; }
- public OptionKeys OptionKeys { get; set; }
- public ReleaseDate ReleaseDate { get; set; }
- public Version2 Version { get; set; }
-
- public Software2()
- {
- OptionKeys = new OptionKeys();
- }
- }
-
- public class NumberOfActiveCalls
- {
- public string Value { get; set; }
- }
-
- public class NumberOfInProgressCalls
- {
- public string Value { get; set; }
- }
-
- public class NumberOfSuspendedCalls
- {
- public string Value { get; set; }
- }
-
- public class State2
- {
- public NumberOfActiveCalls NumberOfActiveCalls { get; set; }
- public NumberOfInProgressCalls NumberOfInProgressCalls { get; set; }
- public NumberOfSuspendedCalls NumberOfSuspendedCalls { get; set; }
- }
-
- public class Uptime
- {
- public string Value { get; set; }
- }
-
- public class SystemUnit
- {
- public Hardware Hardware { get; set; }
- public ProductId ProductId { get; set; }
- public ProductPlatform ProductPlatform { get; set; }
- public ProductType ProductType { get; set; }
- public Software2 Software { get; set; }
- public State2 State { get; set; }
- public Uptime Uptime { get; set; }
-
- public SystemUnit()
- {
- Software = new Software2();
- }
- }
-
- public class SystemTime
- {
- public DateTime Value { get; set; }
- }
-
- public class Time
- {
- public SystemTime SystemTime { get; set; }
- }
-
- public class Number
- {
- public string Value { get; set; }
- }
-
- public class ContactMethod
- {
- public string id { get; set; }
- public Number Number { get; set; }
- }
-
- public class Name4
- {
- public string Value { get; set; }
- }
-
- public class ContactInfo
- {
- public List ContactMethod { get; set; }
- public Name4 Name { get; set; }
- }
-
- public class UserInterface
- {
- public ContactInfo ContactInfo { get; set; }
- }
-
- public class PIPPosition
- {
- public string Value { get; set; }
- }
-
- public class ActiveSpeaker2
- {
- public PIPPosition PIPPosition { get; set; }
- }
-
- public class Connected2
- {
- public string Value { get; set; }
- }
-
- public class SignalState
- {
- public string Value { get; set; }
- }
-
- public class SourceId
- {
- public string Value { get; set; }
- }
-
- public class Type3
- {
- public string Value { get; set; }
- }
-
- public class Connector
- {
- public string id { get; set; }
- public Connected2 Connected { get; set; }
- public SignalState SignalState { get; set; }
- public SourceId SourceId { get; set; }
- public Type3 Type { get; set; }
- }
-
- public class MainVideoSource
- {
- public string Value { get; set; }
- }
-
- public class MainVideoMute : ValueProperty
- {
- public bool BoolValue { get; private set; }
-
- public string Value
- {
- set
- {
- // If the incoming value is "On" it sets the BoolValue true, otherwise sets it false
- BoolValue = value == "On";
- OnValueChanged();
- }
- }
-
- }
-
- public class ConnectorId
- {
- public string Value { get; set; }
- }
-
- public class FormatStatus
- {
- public string Value { get; set; }
- }
-
- public class FormatType
- {
- public string Value { get; set; }
- }
-
- public class MediaChannelId
- {
- public string Value { get; set; }
- }
-
- public class Height
- {
- public string Value { get; set; }
- }
-
- public class RefreshRate
- {
- public string Value { get; set; }
- }
-
- public class Width
- {
- public string Value { get; set; }
- }
-
- public class Resolution
- {
- public Height Height { get; set; }
- public RefreshRate RefreshRate { get; set; }
- public Width Width { get; set; }
- }
-
- public class Source
- {
- public string id { get; set; }
- public ConnectorId ConnectorId { get; set; }
- public FormatStatus FormatStatus { get; set; }
- public FormatType FormatType { get; set; }
- public MediaChannelId MediaChannelId { get; set; }
- public Resolution Resolution { get; set; }
- }
-
- public class Input2
- {
- public List Connector { get; set; }
- public MainVideoSource MainVideoSource { get; set; }
- public MainVideoMute MainVideoMute { get; set; }
- public List Source { get; set; }
-
- public Input2()
- {
- MainVideoMute = new MainVideoMute();
- }
- }
-
- public class Local : ValueProperty
- {
- string _Value;
-
- public string Value // Valid values are On/Off
- {
- get
- {
- return _Value;
- }
- set
- {
- _Value = value;
- OnValueChanged();
- }
- }
- }
-
- public class LayoutFamily
- {
- public Local Local { get; set; }
-
- public LayoutFamily()
- {
- Local = new Local();
- }
- }
-
- public class Layout
- {
- public LayoutFamily LayoutFamily { get; set; }
-
- public Layout()
- {
- LayoutFamily = new LayoutFamily();
- }
- }
-
- public class Monitors
- {
- public string Value { get; set; }
- }
-
- public class Connected3
- {
- public string Value { get; set; }
- }
-
- public class Name5
- {
- public string Value { get; set; }
- }
-
- public class PreferredFormat
- {
- public string Value { get; set; }
- }
-
- public class ConnectedDevice2
- {
- public Name5 Name { get; set; }
- public PreferredFormat PreferredFormat { get; set; }
- }
-
- public class MonitorRole
- {
- public string Value { get; set; }
- }
-
- public class Height2
- {
- public string Value { get; set; }
- }
-
- public class RefreshRate2
- {
- public string Value { get; set; }
- }
-
- public class Width2
- {
- public string Value { get; set; }
- }
-
- public class Resolution2
- {
- public Height2 Height { get; set; }
- public RefreshRate2 RefreshRate { get; set; }
- public Width2 Width { get; set; }
- }
-
- public class Type4
- {
- public string Value { get; set; }
- }
-
- public class Connector2
- {
- public string id { get; set; }
- public Connected3 Connected { get; set; }
- public ConnectedDevice2 ConnectedDevice { get; set; }
- public MonitorRole MonitorRole { get; set; }
- public Resolution2 Resolution { get; set; }
- public Type4 Type { get; set; }
- }
-
- public class Output2
- {
- public List Connector { get; set; }
- }
-
- public class PIPPosition2
- {
- public string Value { get; set; }
- }
-
- public class Presentation2
- {
- public PIPPosition2 PIPPosition { get; set; }
- }
-
- public class FullscreenMode
- {
- public string Value { get; set; }
- }
-
- public class Mode8 : ValueProperty
- {
- public bool BoolValue { get; private set; }
-
- public string Value // Valid values are On/Off
- {
- set
- {
- // If the incoming value is "On" it sets the BoolValue true, otherwise sets it false
- BoolValue = value == "On";
- OnValueChanged();
- }
- }
- }
-
-
- public class OnMonitorRole
- {
- public string Value { get; set; }
- }
-
- public class PIPPosition3 : ValueProperty
- {
- string _Value;
-
- public string Value
- {
- get
- {
- return _Value;
- }
- set
- {
- _Value = value;
- OnValueChanged();
- }
- }
- }
-
- public class Selfview
- {
- public FullscreenMode FullscreenMode { get; set; }
- public Mode8 Mode { get; set; }
- public OnMonitorRole OnMonitorRole { get; set; }
- public PIPPosition3 PIPPosition { get; set; }
-
- public Selfview()
- {
- Mode = new Mode8();
- PIPPosition = new PIPPosition3();
- }
- }
-
- public class Video
- {
- public ActiveSpeaker2 ActiveSpeaker { get; set; }
- public Input2 Input { get; set; }
- public Layout Layout { get; set; }
- public Monitors Monitors { get; set; }
- public Output2 Output { get; set; }
- public Presentation2 Presentation { get; set; }
- public Selfview Selfview { get; set; }
-
- public Video()
- {
- Selfview = new Selfview();
- Layout = new Layout();
- Input = new Input2();
- }
- }
-
- public class AnswerState
- {
- public string Value { get; set; }
- }
-
- public class CallType
- {
- public string Value { get; set; }
- }
-
- public class CallbackNumber
- {
- public string Value { get; set; }
- }
-
- public class DeviceType
- {
- public string Value { get; set; }
- }
-
- public class Direction
- {
- public string Value { get; set; }
- }
-
- public class Duration : ValueProperty
- {
- private string _Value;
-
- public string Value
- {
- get
- {
- return _Value;
- }
- set
- {
- _Value = value;
- OnValueChanged();
- }
- }
-
- public TimeSpan DurationValue
- {
- get
- {
- return new TimeSpan(0, 0, Int32.Parse(_Value));
- }
- }
- }
-
- public class FacilityServiceId
- {
- public string Value { get; set; }
- }
-
- public class HoldReason
- {
- public string Value { get; set; }
- }
-
- public class PlacedOnHold : ValueProperty
- {
- public bool BoolValue { get; private set; }
-
- public string Value
- {
- set
- {
- // If the incoming value is "True" it sets the BoolValue true, otherwise sets it false
- BoolValue = value == "True";
- OnValueChanged();
- }
- }
- }
-
- public class Protocol
- {
- public string Value { get; set; }
- }
-
- public class ReceiveCallRate
- {
- public string Value { get; set; }
- }
-
- public class RemoteNumber
- {
- public string Value { get; set; }
- }
-
- public class TransmitCallRate
- {
- public string Value { get; set; }
- }
-
- public class Call
- {
- public string id { get; set; }
- public AnswerState AnswerState { get; set; }
- public CallType CallType { get; set; }
- public CallbackNumber CallbackNumber { get; set; }
- public DeviceType DeviceType { get; set; }
- public Direction Direction { get; set; }
- public DisplayName DisplayName { get; set; }
- public Duration Duration { get; set; }
- public Encryption Encryption { get; set; }
- public FacilityServiceId FacilityServiceId { get; set; }
- public string ghost { get; set; }
- public HoldReason HoldReason { get; set; }
- public PlacedOnHold PlacedOnHold { get; set; }
- public Protocol Protocol { get; set; }
- public ReceiveCallRate ReceiveCallRate { get; set; }
- public RemoteNumber RemoteNumber { get; set; }
- public CallStatus Status { get; set; }
- public TransmitCallRate TransmitCallRate { get; set; }
-
- public Call()
- {
- CallType = new CallType();
- Status = new CallStatus();
- Duration = new Duration();
- }
- }
-
- public class Type5
- {
- public string Value { get; set; }
- }
-
- public class Description2 : ValueProperty
- {
- string _Value;
-
- public string Value
- {
- get
- {
- return _Value;
- }
- set
- {
- _Value = value;
- OnValueChanged();
- }
- }
- }
-
- public class Defined : ValueProperty
- {
- public bool BoolValue { get; private set; }
-
- public string Value // Valid values are True/False
- {
- set
- {
- // If the incoming value is "True" it sets the BoolValue true, otherwise sets it false
- BoolValue = value == "True";
- OnValueChanged();
- }
- }
- }
-
- public class RoomPreset : ConvertiblePreset
- {
- public string id { get; set; }
- public Defined Defined { get; set; }
- public Description2 Description { get; set; }
- public Type5 Type { get; set; }
-
- public RoomPreset()
- {
- Defined = new Defined();
- Description = new Description2();
- Type = new Type5();
- }
-
- public override PresetBase ConvertCodecPreset()
- {
- try
- {
- var preset = new CodecRoomPreset(UInt16.Parse(id), Description.Value, Defined.BoolValue, true);
-
- Debug.Console(2, "Preset ID {0} Converted from Cisco Codec Preset to Essentials Preset");
-
- return preset;
- }
- catch (Exception e)
- {
- Debug.Console(2, "Unable to convert preset: {0}. Error: {1}", id, e);
- return null;
- }
- }
-}
-
-
-
- public class Status
- {
- public Audio Audio { get; set; }
- public Bookings Bookings { get; set; }
- public List Call { get; set; }
- public Cameras Cameras { get; set; }
- public Capabilities2 Capabilities { get; set; }
- public Conference2 Conference { get; set; }
- public Diagnostics Diagnostics { get; set; }
- public Experimental Experimental { get; set; }
- public H323 H323 { get; set; }
- public List HttpFeedback { get; set; }
- public MediaChannels MediaChannels { get; set; }
- public List Network { get; set; }
- public NetworkServices NetworkServices { get; set; }
- public Peripherals Peripherals { get; set; }
- public Provisioning Provisioning { get; set; }
- public Proximity Proximity { get; set; }
- public RoomAnalytics RoomAnalytics { get; set; }
-
- public List RoomPreset { get; set; }
-
- public SIP SIP { get; set; }
- public Security Security { get; set; }
- public Standby Standby { get; set; }
- public SystemUnit SystemUnit { get; set; }
- public Time Time { get; set; }
- public UserInterface UserInterface { get; set; }
- public Video Video { get; set; }
-
- public Status()
- {
- Audio = new Audio();
- Call = new List();
- Standby = new Standby();
- Cameras = new Cameras();
- RoomAnalytics = new RoomAnalytics();
- RoomPreset = new List();
- Conference = new Conference2();
- SystemUnit = new SystemUnit();
- Video = new Video();
- Conference = new Conference2();
- Network = new List();
- }
- }
-
- public class RootObject
- {
- public Status Status { get; set; }
-
- public RootObject()
- {
- Status = new Status();
- }
- }
- }
-}
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/xStatusSparkPlus.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/xStatusSparkPlus.cs
deleted file mode 100644
index 9f7bf0b6..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/CiscoCodec/xStatusSparkPlus.cs
+++ /dev/null
@@ -1,1552 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-namespace PepperDash.Essentials.Devices.Common.VideoCodec.CiscoCodec
-{
- public class xStatusSparkPlus
- {
- public class ConnectionStatus
- {
- public string Value { get; set; }
- }
-
- public class EcReferenceDelay
- {
- public string Value { get; set; }
- }
-
- public class Microphone
- {
- public string id { get; set; }
- public ConnectionStatus ConnectionStatus { get; set; }
- public EcReferenceDelay EcReferenceDelay { get; set; }
- }
-
- public class Connectors
- {
- public List Microphone { get; set; }
- }
-
- public class Input
- {
- public Connectors Connectors { get; set; }
- }
-
- public class Mute
- {
- public string Value { get; set; }
- }
-
- public class Microphones
- {
- public Mute Mute { get; set; }
- }
-
- public class ConnectionStatus2
- {
- public string Value { get; set; }
- }
-
- public class DelayMs
- {
- public string Value { get; set; }
- }
-
- public class Line
- {
- public string id { get; set; }
- public ConnectionStatus2 ConnectionStatus { get; set; }
- public DelayMs DelayMs { get; set; }
- }
-
- public class Connectors2
- {
- public List Line { get; set; }
- }
-
- public class Output
- {
- public Connectors2 Connectors { get; set; }
- }
-
- public class Volume
- {
- public string Value { get; set; }
- }
-
- public class VolumeMute
- {
- public string Value { get; set; }
- }
-
- public class Audio
- {
- public Input Input { get; set; }
- public Microphones Microphones { get; set; }
- public Output Output { get; set; }
- public Volume Volume { get; set; }
- public VolumeMute VolumeMute { get; set; }
- }
-
- public class Id
- {
- public string Value { get; set; }
- }
-
- public class Current
- {
- public Id Id { get; set; }
- }
-
- public class Bookings
- {
- public Current Current { get; set; }
- }
-
- public class Options
- {
- public string Value { get; set; }
- }
-
- public class Capabilities
- {
- public Options Options { get; set; }
- }
-
- public class Connected
- {
- public string Value { get; set; }
- }
-
- public class Flip
- {
- public string Value { get; set; }
- }
-
- public class HardwareID
- {
- public string Value { get; set; }
- }
-
- public class MacAddress
- {
- public string Value { get; set; }
- }
-
- public class Manufacturer
- {
- public string Value { get; set; }
- }
-
- public class Model
- {
- public string Value { get; set; }
- }
-
- public class Pan
- {
- public string Value { get; set; }
- }
-
- public class Tilt
- {
- public string Value { get; set; }
- }
-
- public class Zoom
- {
- public string Value { get; set; }
- }
-
- public class Position
- {
- public Pan Pan { get; set; }
- public Tilt Tilt { get; set; }
- public Zoom Zoom { get; set; }
- }
-
- public class SerialNumber
- {
- public string Value { get; set; }
- }
-
- public class SoftwareID
- {
- public string Value { get; set; }
- }
-
- public class Camera
- {
- public string id { get; set; }
- public Capabilities Capabilities { get; set; }
- public Connected Connected { get; set; }
- public Flip Flip { get; set; }
- public HardwareID HardwareID { get; set; }
- public MacAddress MacAddress { get; set; }
- public Manufacturer Manufacturer { get; set; }
- public Model Model { get; set; }
- public Position Position { get; set; }
- public SerialNumber SerialNumber { get; set; }
- public SoftwareID SoftwareID { get; set; }
- }
-
- public class Availability
- {
- public string Value { get; set; }
- }
-
- public class Status2
- {
- public string Value { get; set; }
- }
-
- public class SpeakerTrack
- {
- public Availability Availability { get; set; }
- public Status2 Status { get; set; }
- }
-
- public class Cameras
- {
- public List Camera { get; set; }
- public SpeakerTrack SpeakerTrack { get; set; }
- }
-
- public class MaxActiveCalls
- {
- public string Value { get; set; }
- }
-
- public class MaxAudioCalls
- {
- public string Value { get; set; }
- }
-
- public class MaxCalls
- {
- public string Value { get; set; }
- }
-
- public class MaxVideoCalls
- {
- public string Value { get; set; }
- }
-
- public class Conference
- {
- public MaxActiveCalls MaxActiveCalls { get; set; }
- public MaxAudioCalls MaxAudioCalls { get; set; }
- public MaxCalls MaxCalls { get; set; }
- public MaxVideoCalls MaxVideoCalls { get; set; }
- }
-
- public class Capabilities2
- {
- public Conference Conference { get; set; }
- }
-
- public class CallId
- {
- public string Value { get; set; }
- }
-
- public class ActiveSpeaker
- {
- public CallId CallId { get; set; }
- }
-
- public class DoNotDisturb
- {
- public string Value { get; set; }
- }
-
- public class Mode
- {
- public string Value { get; set; }
- }
-
- public class Line2
- {
- public string id { get; set; }
- public Mode Mode { get; set; }
- }
-
- public class Mode2
- {
- public string Value { get; set; }
- }
-
- public class Multipoint
- {
- public Mode2 Mode { get; set; }
- }
-
- public class CallId2
- {
- public string Value { get; set; }
- }
-
- public class SendingMode
- {
- public string Value { get; set; }
- }
-
- public class Source
- {
- public string Value { get; set; }
- }
-
- public class LocalInstance
- {
- public string id { get; set; }
- public SendingMode SendingMode { get; set; }
- public Source Source { get; set; }
- }
-
- public class Mode3
- {
- public string Value { get; set; }
- }
-
- public class Mode4
- {
- public string Value { get; set; }
- }
-
- public class ReleaseFloorAvailability
- {
- public string Value { get; set; }
- }
-
- public class RequestFloorAvailability
- {
- public string Value { get; set; }
- }
-
- public class Whiteboard
- {
- public Mode4 Mode { get; set; }
- public ReleaseFloorAvailability ReleaseFloorAvailability { get; set; }
- public RequestFloorAvailability RequestFloorAvailability { get; set; }
- }
-
- public class Presentation
- {
- public CallId2 CallId { get; set; }
- public List LocalInstance { get; set; }
- public Mode3 Mode { get; set; }
- public Whiteboard Whiteboard { get; set; }
- }
-
- public class CallId3
- {
- public string Value { get; set; }
- }
-
- public class Mode5
- {
- public string Value { get; set; }
- }
-
- public class SpeakerLock
- {
- public CallId3 CallId { get; set; }
- public Mode5 Mode { get; set; }
- }
-
- public class Conference2
- {
- public ActiveSpeaker ActiveSpeaker { get; set; }
- public DoNotDisturb DoNotDisturb { get; set; }
- public List Line { get; set; }
- public Multipoint Multipoint { get; set; }
- public Presentation Presentation { get; set; }
- public SpeakerLock SpeakerLock { get; set; }
- }
-
- public class Conference3
- {
- }
-
- public class Experimental
- {
- public Conference3 Conference { get; set; }
- }
-
- public class Address
- {
- public string Value { get; set; }
- }
-
- public class Port
- {
- public string Value { get; set; }
- }
-
- public class Reason
- {
- public string Value { get; set; }
- }
-
- public class Status3
- {
- public string Value { get; set; }
- }
-
- public class Gatekeeper
- {
- public Address Address { get; set; }
- public Port Port { get; set; }
- public Reason Reason { get; set; }
- public Status3 Status { get; set; }
- }
-
- public class Reason2
- {
- public string Value { get; set; }
- }
-
- public class Status4
- {
- public string Value { get; set; }
- }
-
- public class Mode6
- {
- public Reason2 Reason { get; set; }
- public Status4 Status { get; set; }
- }
-
- public class H323
- {
- public Gatekeeper Gatekeeper { get; set; }
- public Mode6 Mode { get; set; }
- }
-
- public class Expression
- {
- public string id { get; set; }
- public string Value { get; set; }
- }
-
- public class Format
- {
- public string Value { get; set; }
- }
-
- public class URL
- {
- public string Value { get; set; }
- }
-
- public class HttpFeedback
- {
- public string id { get; set; }
- public List Expression { get; set; }
- public Format Format { get; set; }
- public URL URL { get; set; }
- }
-
- public class MediaChannels
- {
- }
-
- public class Address2
- {
- public string Value { get; set; }
- }
-
- public class Capabilities3
- {
- public string Value { get; set; }
- }
-
- public class DeviceId
- {
- public string Value { get; set; }
- }
-
- public class Duplex
- {
- public string Value { get; set; }
- }
-
- public class Platform
- {
- public string Value { get; set; }
- }
-
- public class PortID
- {
- public string Value { get; set; }
- }
-
- public class PrimaryMgmtAddress
- {
- public string Value { get; set; }
- }
-
- public class SysName
- {
- public string Value { get; set; }
- }
-
- public class SysObjectID
- {
- public string Value { get; set; }
- }
-
- public class VTPMgmtDomain
- {
- public string Value { get; set; }
- }
-
- public class Version
- {
- public string Value { get; set; }
- }
-
- public class VoIPApplianceVlanID
- {
- public string Value { get; set; }
- }
-
- public class CDP
- {
- public Address2 Address { get; set; }
- public Capabilities3 Capabilities { get; set; }
- public DeviceId DeviceId { get; set; }
- public Duplex Duplex { get; set; }
- public Platform Platform { get; set; }
- public PortID PortID { get; set; }
- public PrimaryMgmtAddress PrimaryMgmtAddress { get; set; }
- public SysName SysName { get; set; }
- public SysObjectID SysObjectID { get; set; }
- public VTPMgmtDomain VTPMgmtDomain { get; set; }
- public Version Version { get; set; }
- public VoIPApplianceVlanID VoIPApplianceVlanID { get; set; }
- }
-
- public class Name
- {
- public string Value { get; set; }
- }
-
- public class Domain
- {
- public Name Name { get; set; }
- }
-
- public class Address3
- {
- public string Value { get; set; }
- }
-
- public class Server
- {
- public string id { get; set; }
- public Address3 Address { get; set; }
- }
-
- public class DNS
- {
- public Domain Domain { get; set; }
- public List Server { get; set; }
- }
-
- public class MacAddress2
- {
- public string Value { get; set; }
- }
-
- public class Speed
- {
- public string Value { get; set; }
- }
-
- public class Ethernet
- {
- public MacAddress2 MacAddress { get; set; }
- public Speed Speed { get; set; }
- }
-
- public class Address4
- {
- public string Value { get; set; }
- }
-
- public class Gateway
- {
- public string Value { get; set; }
- }
-
- public class SubnetMask
- {
- public string Value { get; set; }
- }
-
- public class IPv4
- {
- public Address4 Address { get; set; }
- public Gateway Gateway { get; set; }
- public SubnetMask SubnetMask { get; set; }
- }
-
- public class Address5
- {
- public string Value { get; set; }
- }
-
- public class Gateway2
- {
- public string Value { get; set; }
- }
-
- public class IPv6
- {
- public Address5 Address { get; set; }
- public Gateway2 Gateway { get; set; }
- }
-
- public class VlanId
- {
- public string Value { get; set; }
- }
-
- public class Voice
- {
- public VlanId VlanId { get; set; }
- }
-
- public class VLAN
- {
- public Voice Voice { get; set; }
- }
-
- public class Network
- {
- public string id { get; set; }
- public CDP CDP { get; set; }
- public DNS DNS { get; set; }
- public Ethernet Ethernet { get; set; }
- public IPv4 IPv4 { get; set; }
- public IPv6 IPv6 { get; set; }
- public VLAN VLAN { get; set; }
- }
-
- public class CurrentAddress
- {
- public string Value { get; set; }
- }
-
- public class Address6
- {
- public string Value { get; set; }
- }
-
- public class Server2
- {
- public string id { get; set; }
- public Address6 Address { get; set; }
- }
-
- public class Status5
- {
- public string Value { get; set; }
- }
-
- public class NTP
- {
- public CurrentAddress CurrentAddress { get; set; }
- public List Server { get; set; }
- public Status5 Status { get; set; }
- }
-
- public class NetworkServices
- {
- public NTP NTP { get; set; }
- }
-
- public class HardwareInfo
- {
- public string Value { get; set; }
- }
-
- public class ID2
- {
- public string Value { get; set; }
- }
-
- public class Name2
- {
- public string Value { get; set; }
- }
-
- public class SoftwareInfo
- {
- public string Value { get; set; }
- }
-
- public class Status6
- {
- public string Value { get; set; }
- }
-
- public class Type
- {
- public string Value { get; set; }
- }
-
- public class UpgradeStatus
- {
- public string Value { get; set; }
- }
-
- public class ConnectedDevice
- {
- public string id { get; set; }
- public HardwareInfo HardwareInfo { get; set; }
- public ID2 ID { get; set; }
- public Name2 Name { get; set; }
- public SoftwareInfo SoftwareInfo { get; set; }
- public Status6 Status { get; set; }
- public Type Type { get; set; }
- public UpgradeStatus UpgradeStatus { get; set; }
- }
-
- public class Peripherals
- {
- public List ConnectedDevice { get; set; }
- }
-
- public class Enabled
- {
- public string Value { get; set; }
- }
-
- public class LastLoggedInUserId
- {
- public string Value { get; set; }
- }
-
- public class LoggedIn
- {
- public string Value { get; set; }
- }
-
- public class ExtensionMobility
- {
- public Enabled Enabled { get; set; }
- public LastLoggedInUserId LastLoggedInUserId { get; set; }
- public LoggedIn LoggedIn { get; set; }
- }
-
- public class CUCM
- {
- public ExtensionMobility ExtensionMobility { get; set; }
- }
-
- public class CompletedAt
- {
- public string Value { get; set; }
- }
-
- public class URL2
- {
- public string Value { get; set; }
- }
-
- public class VersionId
- {
- public string Value { get; set; }
- }
-
- public class Current2
- {
- public CompletedAt CompletedAt { get; set; }
- public URL2 URL { get; set; }
- public VersionId VersionId { get; set; }
- }
-
- public class LastChange
- {
- public string Value { get; set; }
- }
-
- public class Message
- {
- public string Value { get; set; }
- }
-
- public class Phase
- {
- public string Value { get; set; }
- }
-
- public class SessionId
- {
- public string Value { get; set; }
- }
-
- public class Status7
- {
- public string Value { get; set; }
- }
-
- public class URL3
- {
- public string Value { get; set; }
- }
-
- public class VersionId2
- {
- public string Value { get; set; }
- }
-
- public class UpgradeStatus2
- {
- public LastChange LastChange { get; set; }
- public Message Message { get; set; }
- public Phase Phase { get; set; }
- public SessionId SessionId { get; set; }
- public Status7 Status { get; set; }
- public URL3 URL { get; set; }
- public VersionId2 VersionId { get; set; }
- }
-
- public class Software
- {
- public Current2 Current { get; set; }
- public UpgradeStatus2 UpgradeStatus { get; set; }
- }
-
- public class Status8
- {
- public string Value { get; set; }
- }
-
- public class Provisioning
- {
- public CUCM CUCM { get; set; }
- public Software Software { get; set; }
- public Status8 Status { get; set; }
- }
-
- public class Availability2
- {
- public string Value { get; set; }
- }
-
- public class Services
- {
- public Availability2 Availability { get; set; }
- }
-
- public class Proximity
- {
- public Services Services { get; set; }
- }
-
- public class Current3
- {
- public string Value { get; set; }
- }
-
- public class PeopleCount
- {
- public Current3 Current { get; set; }
- }
-
- public class PeoplePresence
- {
- public string Value { get; set; }
- }
-
- public class RoomAnalytics
- {
- public PeopleCount PeopleCount { get; set; }
- public PeoplePresence PeoplePresence { get; set; }
- }
-
- public class URI
- {
- public string Value { get; set; }
- }
-
- public class Primary
- {
- public URI URI { get; set; }
- }
-
- public class AlternateURI
- {
- public Primary Primary { get; set; }
- }
-
- public class Authentication
- {
- public string Value { get; set; }
- }
-
- public class DisplayName
- {
- public string Value { get; set; }
- }
-
- public class Mode7
- {
- public string Value { get; set; }
- }
-
- public class URI2
- {
- public string Value { get; set; }
- }
-
- public class CallForward
- {
- public DisplayName DisplayName { get; set; }
- public Mode7 Mode { get; set; }
- public URI2 URI { get; set; }
- }
-
- public class MessagesWaiting
- {
- public string Value { get; set; }
- }
-
- public class URI3
- {
- public string Value { get; set; }
- }
-
- public class Mailbox
- {
- public MessagesWaiting MessagesWaiting { get; set; }
- public URI3 URI { get; set; }
- }
-
- public class Address7
- {
- public string Value { get; set; }
- }
-
- public class Status9
- {
- public string Value { get; set; }
- }
-
- public class Proxy
- {
- public string id { get; set; }
- public Address7 Address { get; set; }
- public Status9 Status { get; set; }
- }
-
- public class Reason3
- {
- public string Value { get; set; }
- }
-
- public class Status10
- {
- public string Value { get; set; }
- }
-
- public class URI4
- {
- public string Value { get; set; }
- }
-
- public class Registration
- {
- public string id { get; set; }
- public Reason3 Reason { get; set; }
- public Status10 Status { get; set; }
- public URI4 URI { get; set; }
- }
-
- public class Secure
- {
- public string Value { get; set; }
- }
-
- public class Verified
- {
- public string Value { get; set; }
- }
-
- public class SIP
- {
- public AlternateURI AlternateURI { get; set; }
- public Authentication Authentication { get; set; }
- public CallForward CallForward { get; set; }
- public Mailbox Mailbox { get; set; }
- public List Proxy { get; set; }
- public List Registration { get; set; }
- public Secure Secure { get; set; }
- public Verified Verified { get; set; }
- }
-
- public class Mode8
- {
- public string Value { get; set; }
- }
-
- public class FIPS
- {
- public Mode8 Mode { get; set; }
- }
-
- public class CallHistory
- {
- public string Value { get; set; }
- }
-
- public class Configurations
- {
- public string Value { get; set; }
- }
-
- public class DHCP
- {
- public string Value { get; set; }
- }
-
- public class InternalLogging
- {
- public string Value { get; set; }
- }
-
- public class LocalPhonebook
- {
- public string Value { get; set; }
- }
-
- public class Persistency
- {
- public CallHistory CallHistory { get; set; }
- public Configurations Configurations { get; set; }
- public DHCP DHCP { get; set; }
- public InternalLogging InternalLogging { get; set; }
- public LocalPhonebook LocalPhonebook { get; set; }
- }
-
- public class Security
- {
- public FIPS FIPS { get; set; }
- public Persistency Persistency { get; set; }
- }
-
- public class State
- {
- public string Value { get; set; }
- }
-
- public class Standby
- {
- public State State { get; set; }
- }
-
- public class CompatibilityLevel
- {
- public string Value { get; set; }
- }
-
- public class SerialNumber2
- {
- public string Value { get; set; }
- }
-
- public class Module
- {
- public CompatibilityLevel CompatibilityLevel { get; set; }
- public SerialNumber2 SerialNumber { get; set; }
- }
-
- public class Hardware
- {
- public Module Module { get; set; }
- }
-
- public class ProductId
- {
- public string Value { get; set; }
- }
-
- public class ProductPlatform
- {
- public string Value { get; set; }
- }
-
- public class ProductType
- {
- public string Value { get; set; }
- }
-
- public class DisplayName2
- {
- public string Value { get; set; }
- }
-
- public class Name3
- {
- public string Value { get; set; }
- }
-
- public class Encryption
- {
- public string Value { get; set; }
- }
-
- public class MultiSite
- {
- public string Value { get; set; }
- }
-
- public class RemoteMonitoring
- {
- public string Value { get; set; }
- }
-
- public class OptionKeys
- {
- public Encryption Encryption { get; set; }
- public MultiSite MultiSite { get; set; }
- public RemoteMonitoring RemoteMonitoring { get; set; }
- }
-
- public class ReleaseDate
- {
- public string Value { get; set; }
- }
-
- public class Version2
- {
- public string Value { get; set; }
- }
-
- public class Software2
- {
- public DisplayName2 DisplayName { get; set; }
- public Name3 Name { get; set; }
- public OptionKeys OptionKeys { get; set; }
- public ReleaseDate ReleaseDate { get; set; }
- public Version2 Version { get; set; }
- }
-
- public class NumberOfActiveCalls
- {
- public string Value { get; set; }
- }
-
- public class NumberOfInProgressCalls
- {
- public string Value { get; set; }
- }
-
- public class NumberOfSuspendedCalls
- {
- public string Value { get; set; }
- }
-
- public class State2
- {
- public NumberOfActiveCalls NumberOfActiveCalls { get; set; }
- public NumberOfInProgressCalls NumberOfInProgressCalls { get; set; }
- public NumberOfSuspendedCalls NumberOfSuspendedCalls { get; set; }
- }
-
- public class Uptime
- {
- public string Value { get; set; }
- }
-
- public class SystemUnit
- {
- public Hardware Hardware { get; set; }
- public ProductId ProductId { get; set; }
- public ProductPlatform ProductPlatform { get; set; }
- public ProductType ProductType { get; set; }
- public Software2 Software { get; set; }
- public State2 State { get; set; }
- public Uptime Uptime { get; set; }
- }
-
- public class SystemTime
- {
- public DateTime Value { get; set; }
- }
-
- public class Time
- {
- public SystemTime SystemTime { get; set; }
- }
-
- public class Number
- {
- public string Value { get; set; }
- }
-
- public class ContactMethod
- {
- public string id { get; set; }
- public Number Number { get; set; }
- }
-
- public class Name4
- {
- public string Value { get; set; }
- }
-
- public class ContactInfo
- {
- public List ContactMethod { get; set; }
- public Name4 Name { get; set; }
- }
-
- public class UserInterface
- {
- public ContactInfo ContactInfo { get; set; }
- }
-
- public class PIPPosition
- {
- public string Value { get; set; }
- }
-
- public class ActiveSpeaker2
- {
- public PIPPosition PIPPosition { get; set; }
- }
-
- public class Connected2
- {
- public string Value { get; set; }
- }
-
- public class DeviceType
- {
- public string Value { get; set; }
- }
-
- public class Name5
- {
- public string Value { get; set; }
- }
-
- public class PowerStatus
- {
- public string Value { get; set; }
- }
-
- public class VendorId
- {
- public string Value { get; set; }
- }
-
- public class CEC
- {
- public string id { get; set; }
- public DeviceType DeviceType { get; set; }
- public Name5 Name { get; set; }
- public PowerStatus PowerStatus { get; set; }
- public VendorId VendorId { get; set; }
- }
-
- public class ConnectedDevice2
- {
- public List CEC { get; set; }
- }
-
- public class SignalState
- {
- public string Value { get; set; }
- }
-
- public class SourceId
- {
- public string Value { get; set; }
- }
-
- public class Type2
- {
- public string Value { get; set; }
- }
-
- public class Connector
- {
- public string id { get; set; }
- public Connected2 Connected { get; set; }
- public ConnectedDevice2 ConnectedDevice { get; set; }
- public SignalState SignalState { get; set; }
- public SourceId SourceId { get; set; }
- public Type2 Type { get; set; }
- }
-
- public class MainVideoSource
- {
- public string Value { get; set; }
- }
-
- public class ConnectorId
- {
- public string Value { get; set; }
- }
-
- public class FormatStatus
- {
- public string Value { get; set; }
- }
-
- public class FormatType
- {
- public string Value { get; set; }
- }
-
- public class MediaChannelId
- {
- public string Value { get; set; }
- }
-
- public class Height
- {
- public string Value { get; set; }
- }
-
- public class RefreshRate
- {
- public string Value { get; set; }
- }
-
- public class Width
- {
- public string Value { get; set; }
- }
-
- public class Resolution
- {
- public Height Height { get; set; }
- public RefreshRate RefreshRate { get; set; }
- public Width Width { get; set; }
- }
-
- public class Source2
- {
- public string id { get; set; }
- public ConnectorId ConnectorId { get; set; }
- public FormatStatus FormatStatus { get; set; }
- public FormatType FormatType { get; set; }
- public MediaChannelId MediaChannelId { get; set; }
- public Resolution Resolution { get; set; }
- }
-
- public class Input2
- {
- public List Connector { get; set; }
- public MainVideoSource MainVideoSource { get; set; }
- public List Source { get; set; }
- }
-
- public class Local
- {
- public string Value { get; set; }
- }
-
- public class LayoutFamily
- {
- public Local Local { get; set; }
- }
-
- public class Layout
- {
- public LayoutFamily LayoutFamily { get; set; }
- }
-
- public class Monitors
- {
- public string Value { get; set; }
- }
-
- public class Connected3
- {
- public string Value { get; set; }
- }
-
- public class DeviceType2
- {
- public string Value { get; set; }
- }
-
- public class Name6
- {
- public string Value { get; set; }
- }
-
- public class PowerStatus2
- {
- public string Value { get; set; }
- }
-
- public class VendorId2
- {
- public string Value { get; set; }
- }
-
- public class CEC2
- {
- public string id { get; set; }
- public DeviceType2 DeviceType { get; set; }
- public Name6 Name { get; set; }
- public PowerStatus2 PowerStatus { get; set; }
- public VendorId2 VendorId { get; set; }
- }
-
- public class Name7
- {
- public string Value { get; set; }
- }
-
- public class PreferredFormat
- {
- public string Value { get; set; }
- }
-
- public class ConnectedDevice3
- {
- public List CEC { get; set; }
- public Name7 Name { get; set; }
- public PreferredFormat PreferredFormat { get; set; }
- }
-
- public class MonitorRole
- {
- public string Value { get; set; }
- }
-
- public class Height2
- {
- public string Value { get; set; }
- }
-
- public class RefreshRate2
- {
- public string Value { get; set; }
- }
-
- public class Width2
- {
- public string Value { get; set; }
- }
-
- public class Resolution2
- {
- public Height2 Height { get; set; }
- public RefreshRate2 RefreshRate { get; set; }
- public Width2 Width { get; set; }
- }
-
- public class Type3
- {
- public string Value { get; set; }
- }
-
- public class Connector2
- {
- public string id { get; set; }
- public Connected3 Connected { get; set; }
- public ConnectedDevice3 ConnectedDevice { get; set; }
- public MonitorRole MonitorRole { get; set; }
- public Resolution2 Resolution { get; set; }
- public Type3 Type { get; set; }
- }
-
- public class Output2
- {
- public List Connector { get; set; }
- }
-
- public class PIPPosition2
- {
- public string Value { get; set; }
- }
-
- public class Presentation2
- {
- public PIPPosition2 PIPPosition { get; set; }
- }
-
- public class FullscreenMode
- {
- public string Value { get; set; }
- }
-
- public class Mode9
- {
- public string Value { get; set; }
- }
-
- public class OnMonitorRole
- {
- public string Value { get; set; }
- }
-
- public class PIPPosition3
- {
- public string Value { get; set; }
- }
-
- public class Selfview
- {
- public FullscreenMode FullscreenMode { get; set; }
- public Mode9 Mode { get; set; }
- public OnMonitorRole OnMonitorRole { get; set; }
- public PIPPosition3 PIPPosition { get; set; }
- }
-
- public class Video
- {
- public ActiveSpeaker2 ActiveSpeaker { get; set; }
- public Input2 Input { get; set; }
- public Layout Layout { get; set; }
- public Monitors Monitors { get; set; }
- public Output2 Output { get; set; }
- public Presentation2 Presentation { get; set; }
- public Selfview Selfview { get; set; }
- }
-
- public class Status
- {
- public Audio Audio { get; set; }
- public Bookings Bookings { get; set; }
- public Cameras Cameras { get; set; }
- public Capabilities2 Capabilities { get; set; }
- public Conference2 Conference { get; set; }
- public Experimental Experimental { get; set; }
- public H323 H323 { get; set; }
- public List HttpFeedback { get; set; }
- public MediaChannels MediaChannels { get; set; }
- public List Network { get; set; }
- public NetworkServices NetworkServices { get; set; }
- public Peripherals Peripherals { get; set; }
- public Provisioning Provisioning { get; set; }
- public Proximity Proximity { get; set; }
- public RoomAnalytics RoomAnalytics { get; set; }
- public SIP SIP { get; set; }
- public Security Security { get; set; }
- public Standby Standby { get; set; }
- public SystemUnit SystemUnit { get; set; }
- public Time Time { get; set; }
- public UserInterface UserInterface { get; set; }
- public Video Video { get; set; }
- }
-
- public class RootObject
- {
- public Status Status { get; set; }
- }
- }
-}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/Interfaces/IHasCodecLayouts.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/Interfaces/IHasCodecLayouts.cs
index d2393692..02280fdb 100644
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/Interfaces/IHasCodecLayouts.cs
+++ b/src/PepperDash.Essentials.Devices.Common/VideoCodec/Interfaces/IHasCodecLayouts.cs
@@ -23,44 +23,4 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
void LocalLayoutToggleSingleProminent();
void MinMaxLayoutToggle();
}
-
-
- ///
- /// Defines the requirements for Zoom Room layout control
- ///
- public interface IHasZoomRoomLayouts : IHasCodecLayouts
- {
- event EventHandler LayoutInfoChanged;
-
- BoolFeedback LayoutViewIsOnFirstPageFeedback { get; } // TODO: #697 [*] Consider modifying to report button visibility in func
- BoolFeedback LayoutViewIsOnLastPageFeedback { get; } // TODO: #697 [*] Consider modifying to report button visibility in func
- BoolFeedback CanSwapContentWithThumbnailFeedback { get; }
- BoolFeedback ContentSwappedWithThumbnailFeedback { get; }
-
- ZoomRoom.zConfiguration.eLayoutStyle LastSelectedLayout { get; }
- ZoomRoom.zConfiguration.eLayoutStyle AvailableLayouts { get; }
-
- void GetAvailableLayouts(); // Mot sure this is necessary if we're already subscribed to zStatus Call Layout
- void SetLayout(ZoomRoom.zConfiguration.eLayoutStyle layoutStyle);
- void SwapContentWithThumbnail();
-
- void LayoutTurnNextPage();
- void LayoutTurnPreviousPage();
- }
-
- public class LayoutInfoChangedEventArgs : EventArgs
- {
- [JsonProperty("availableLayouts", NullValueHandling = NullValueHandling.Ignore)]
- public ZoomRoom.zConfiguration.eLayoutStyle AvailableLayouts { get; set; }
- [JsonProperty("currentSelectedLayout", NullValueHandling = NullValueHandling.Ignore)]
- public ZoomRoom.zConfiguration.eLayoutStyle CurrentSelectedLayout { get; set; }
- [JsonProperty("canSwapContentWithThumbnail", NullValueHandling = NullValueHandling.Ignore)]
- public bool CanSwapContentWithThumbnail { get; set; }
- [JsonProperty("contentSwappedWithThumbnail", NullValueHandling = NullValueHandling.Ignore)]
- public bool ContentSwappedWithThumbnail { get; set; }
- [JsonProperty("layoutViewIsOnFirstPage", NullValueHandling = NullValueHandling.Ignore)]
- public bool LayoutViewIsOnFirstPage { get; set; }
- [JsonProperty("layoutViewIsOnLastPage", NullValueHandling = NullValueHandling.Ignore)]
- public bool LayoutViewIsOnLastPage { get; set; }
- }
}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/ZoomRoom/IZoomWirelessShareInstructions.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/ZoomRoom/IZoomWirelessShareInstructions.cs
deleted file mode 100644
index 465e2d2b..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/ZoomRoom/IZoomWirelessShareInstructions.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using PepperDash.Essentials.Core;
-
-using PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom;
-
-namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
-{
- public class ShareInfoEventArgs : EventArgs
- {
- public zStatus.Sharing SharingStatus { get; private set; }
-
- public ShareInfoEventArgs(zStatus.Sharing status)
- {
- SharingStatus = status;
- }
- }
-
- public interface IZoomWirelessShareInstructions
- {
- event EventHandler ShareInfoChanged;
-
- zStatus.Sharing SharingState { get; }
- }
-}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/ZoomRoom/ResponseObjects.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/ZoomRoom/ResponseObjects.cs
deleted file mode 100644
index 0ba684a8..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/ZoomRoom/ResponseObjects.cs
+++ /dev/null
@@ -1,1822 +0,0 @@
-extern alias Full;
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
-using Crestron.SimplSharp;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Devices.Common.Codec;
-
-using Full.Newtonsoft.Json;
-using Full.Newtonsoft.Json.Linq;
-using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
-
-namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
-{
- public enum eZoomRoomResponseType
- {
- zEvent,
- zStatus,
- zConfiguration,
- zCommand
- }
-
- public abstract class NotifiableObject : INotifyPropertyChanged
- {
- #region INotifyPropertyChanged Members
-
- public event PropertyChangedEventHandler PropertyChanged;
-
- protected void NotifyPropertyChanged(string propertyName)
- {
- var handler = PropertyChanged;
- if (handler != null)
- {
- handler(this, new PropertyChangedEventArgs(propertyName));
- }
- else
- {
- Debug.Console(2, "PropertyChanged event is NULL");
- }
- }
-
- #endregion
- }
-
- ///
- /// Used to track the current status of a ZoomRoom
- ///
- public class ZoomRoomStatus
- {
- public zStatus.Login Login { get; set; }
- public zStatus.SystemUnit SystemUnit { get; set; }
- public zStatus.Phonebook Phonebook { get; set; }
- public zStatus.Call Call { get; set; }
- public zStatus.Capabilities Capabilities { get; set; }
- public zStatus.Sharing Sharing { get; set; }
- public zStatus.NumberOfScreens NumberOfScreens { get; set; }
- public zStatus.Layout Layout { get; set; }
- public zStatus.Video Video { get; set; }
- public zStatus.CameraShare CameraShare { get; set; }
- public List AudioInputs { get; set; }
- public List AudioOuputs { get; set; }
- public List Cameras { get; set; }
- public zEvent.PhoneCallStatus PhoneCall { get; set; }
- public zEvent.NeedWaitForHost NeedWaitForHost { get; set; }
-
- public ZoomRoomStatus()
- {
- Login = new zStatus.Login();
- SystemUnit = new zStatus.SystemUnit();
- Phonebook = new zStatus.Phonebook();
- Call = new zStatus.Call();
- Capabilities = new zStatus.Capabilities();
- Sharing = new zStatus.Sharing();
- NumberOfScreens = new zStatus.NumberOfScreens();
- Layout = new zStatus.Layout();
- Video = new zStatus.Video();
- CameraShare = new zStatus.CameraShare();
- AudioInputs = new List();
- AudioOuputs = new List();
- Cameras = new List();
- PhoneCall = new zEvent.PhoneCallStatus();
- NeedWaitForHost = new zEvent.NeedWaitForHost();
- }
- }
-
- ///
- /// Used to track the current configuration of a ZoomRoom
- ///
- public class ZoomRoomConfiguration
- {
- public zConfiguration.Call Call { get; set; }
- public zConfiguration.Audio Audio { get; set; }
- public zConfiguration.Video Video { get; set; }
- public zConfiguration.Client Client { get; set; }
- public zConfiguration.Camera Camera { get; set; }
-
- public ZoomRoomConfiguration()
- {
- Call = new zConfiguration.Call();
- Audio = new zConfiguration.Audio();
- Video = new zConfiguration.Video();
- Client = new zConfiguration.Client();
- Camera = new zConfiguration.Camera();
- }
- }
-
- ///
- /// Represents a response from a ZoomRoom system
- ///
- public class Response
- {
- public Status Status { get; set; }
- public bool Sync { get; set; }
- [JsonProperty("topKey")]
- public string TopKey { get; set; }
- [JsonProperty("type")]
- public string Type { get; set; }
-
- public Response()
- {
- Status = new Status();
- }
- }
-
- public class Status
- {
- [JsonProperty("message")]
- public string Message { get; set; }
- [JsonProperty("state")]
- public string State { get; set; }
- }
-
-
- ///
- /// zStatus class stucture
- ///
- public class zStatus
- {
- public class Login
- {
- [JsonProperty("ZAAPI Release")]
- public string ZAAPIRelease { get; set; }
- [JsonProperty("Zoom Room Release")]
- public string ZoomRoomRelease { get; set; }
- }
-
- public class SystemUnit
- {
- [JsonProperty("email")]
- public string Email { get; set; }
- [JsonProperty("login_type")]
- public string LoginType { get; set; }
- [JsonProperty("meeting_number")]
- public string MeetingNumber { get; set; }
- [JsonProperty("platform")]
- public string Platform { get; set; }
- [JsonProperty("room_info")]
- public RoomInfo RoomInfo { get; set; }
- [JsonProperty("room_version")]
- public string RoomVersion { get; set; }
-
- public SystemUnit()
- {
- RoomInfo = new RoomInfo();
- }
- }
-
- public class RoomInfo
- {
- [JsonProperty("account_email")]
- public string AccountEmail { get; set; }
- [JsonProperty("display_version")]
- public string DisplayVersion { get; set; }
- [JsonProperty("is_auto_answer_enabled")]
- public bool AutoAnswerIsEnabled { get; set; }
- [JsonProperty("is_auto_answer_selected")]
- public bool AutoAnswerIsSelected { get; set; }
- [JsonProperty("room_name")]
- public string RoomName { get; set; }
- }
-
- public class CloudPbxInfo
- {
- [JsonProperty("company_number")]
- public string CompanyNumber { get; set; }
- [JsonProperty("extension")]
- public string Extension { get; set; }
- [JsonProperty("isValid")]
- public bool IsValid { get; set; }
- }
-
- public enum ePresence
- {
- PRESENCE_OFFLINE,
- PRESENCE_ONLINE,
- PRESENCE_AWAY,
- PRESENCE_BUSY,
- PRESENCE_DND
- }
-
- public class Contact
- {
- [JsonProperty("avatarURL")]
- public string AvatarURL { get; set; }
- [JsonProperty("cloud_pbx_info")]
- public CloudPbxInfo CloudPbxInfo { get; set; }
- [JsonProperty("email")]
- public string Email { get; set; }
- [JsonProperty("firstName")]
- public string FirstName { get; set; }
- [JsonProperty("index")]
- public int Index { get; set; }
- [JsonProperty("isLegacy")]
- public bool IsLegacy { get; set; }
- [JsonProperty("isZoomRoom")]
- public bool IsZoomRoom { get; set; }
- [JsonProperty("jid")]
- public string Jid { get; set; }
- [JsonProperty("lastName")]
- public string LastName { get; set; }
- [JsonProperty("onDesktop")]
- public bool OnDesktop { get; set; }
- [JsonProperty("onMobile")]
- public bool OnMobile { get; set; }
- [JsonProperty("phoneNumber")]
- public string PhoneNumber { get; set; }
- [JsonProperty("presence")]
- public ePresence Presence { get; set; }
- [JsonProperty("presence_status")]
- public int PresenceStatus { get; set; }
- [JsonProperty("screenName")]
- public string ScreenName { get; set; }
- [JsonProperty("sip_phone_number")]
- public string SipPhoneNumber { get; set; }
-
-
- public Contact()
- {
- CloudPbxInfo = new CloudPbxInfo();
- }
- }
-
- public class Phonebook
- {
- [JsonProperty("Contacts")]
- public List Contacts { get; set; }
-
- public Phonebook()
- {
- Contacts = new List();
- }
-
- ///
- /// Converts from zStatus.Contact types to generic directory items
- ///
- ///
- public static CodecDirectory ConvertZoomContactsToGeneric(List zoomContacts)
- {
- var directory = new CodecDirectory();
-
- var folders = new List();
-
- var roomFolder = new DirectoryFolder();
-
- var contactFolder = new DirectoryFolder();
-
- var contacts = new List();
-
- // Check if there are any zoom rooms
- var zoomRooms = zoomContacts.FindAll(c => c.IsZoomRoom);
-
- if (zoomRooms.Count > 0)
- {
- // If so, setup a rooms and contacts folder and add them.
-
- directory.ResultsFolderId = "root";
-
- roomFolder.Name = "Rooms";
- roomFolder.ParentFolderId = "root";
- roomFolder.FolderId = "rooms";
-
- contactFolder.Name = "Contacts";
- contactFolder.ParentFolderId = "root";
- contactFolder.FolderId = "contacts";
-
- folders.Add(roomFolder);
- folders.Add(contactFolder);
-
- directory.AddFoldersToDirectory(folders);
- }
-
- try
- {
- if (zoomContacts.Count == 0)
- {
- return directory;
- }
-
- foreach (Contact c in zoomContacts)
- {
- var contact = new InvitableDirectoryContact { Name = c.ScreenName, ContactId = c.Jid };
-
- contact.ContactMethods.Add(new ContactMethod()
- {
- Number = c.Jid,
- Device = eContactMethodDevice.Video,
- CallType = eContactMethodCallType.Video,
- ContactMethodId = c.Jid
- });
-
- if (folders.Count > 0)
- {
- contact.ParentFolderId = c.IsZoomRoom
- ? roomFolder.FolderId // "rooms"
- : contactFolder.FolderId; // "contacts"
- }
-
- contacts.Add(contact);
- }
-
- directory.AddContactsToDirectory(contacts);
- }
- catch (Exception e)
- {
- Debug.Console(1, "Error converting Zoom Phonebook results to generic: {0}", e);
- }
-
- return directory;
- }
- }
-
- public enum eCallStatus
- {
- UNKNOWN,
- NOT_IN_MEETING,
- CONNECTING_MEETING,
- IN_MEETING,
- LOGGED_OUT
- }
-
- public class ClosedCaption
- {
- public bool Available { get; set; }
- }
-
- public class Call : NotifiableObject
- {
- private eCallStatus _status;
- private List _participants;
-
- public bool IsInCall;
-
- public eCallStatus Status
- {
- get
- {
- return _status;
- }
- set
- {
- if (value != _status)
- {
- _status = value;
- IsInCall = _status == eCallStatus.IN_MEETING || _status == eCallStatus.CONNECTING_MEETING;
- NotifyPropertyChanged("Status");
- }
- }
- }
- public ClosedCaption ClosedCaption { get; set; }
- public List Participants
- {
- get
- {
- return _participants;
- }
- set
- {
- _participants = value;
- NotifyPropertyChanged("Participants");
- }
- }
- public zEvent.SharingState Sharing { get; set; }
-
- public CallRecordInfo CallRecordInfo { get; set; }
-
- private zCommand.InfoResult _info;
-
- public zCommand.InfoResult Info
- {
- get
- {
- return _info;
- }
- set
- {
- _info = value;
- NotifyPropertyChanged("Info");
- }
- }
-
- public Call()
- {
- ClosedCaption = new ClosedCaption();
- Participants = new List();
- Sharing = new zEvent.SharingState();
- CallRecordInfo = new CallRecordInfo();
- Info = new zCommand.InfoResult();
- }
- }
-
- public class Capabilities
- {
- public bool aec_Setting_Stored_In_ZR { get; set; }
- public bool can_Dtmf_For_Invite_By_Phone { get; set; }
- public bool can_Mute_On_Entry { get; set; }
- public bool can_Ringing_In_Pstn_Call { get; set; }
- public bool can_Switch_To_Specific_Camera { get; set; }
- public bool is_Airhost_Disabled { get; set; }
- public bool pstn_Call_In_Local_resentation { get; set; }
- public bool support_Claim_Host { get; set; }
- public bool support_Out_Room_Display { get; set; }
- public bool support_Pin_And_Spotlight { get; set; }
- public bool supports_Audio_Checkup { get; set; }
- public bool supports_CheckIn { get; set; }
- public bool supports_Cloud_PBX { get; set; }
- public bool supports_Encrypted_Connection { get; set; }
- public bool supports_Expel_User_Permanently { get; set; }
- public bool supports_H323_DTMF { get; set; }
- public bool supports_Hdmi_Cec_Control { get; set; }
- public bool supports_Highly_Reverberant_Room { get; set; }
- public bool supports_Loading_Contacts_Dynamically { get; set; }
- public bool supports_Loading_Participants_Dynamically { get; set; }
- public bool supports_Mic_Record_Test { get; set; }
- public bool supports_Multi_Share { get; set; }
- public bool supports_ShareCamera { get; set; }
- public bool supports_Share_For_Floating_And_Content_Only { get; set; }
- public bool supports_Sip_Call_out { get; set; }
- public bool supports_Software_Audio_Processing { get; set; }
- public bool supports_Web_Settings_Push { get; set; }
- }
-
- public enum eDisplayState
- {
- None,
- Laptop,
- IOS,
- }
-
- public class Sharing : NotifiableObject
- {
- private eDisplayState _dispState;
- private string _password;
- private bool _isAirHostClientConnected;
- private bool _isSharingBlackMagic;
- private bool _isDirectPresentationConnected;
- private bool _isBlackMagicConnected;
-
-
- public string directPresentationPairingCode { get; set; }
- ///
- /// Laptop client sharing key
- ///
- public string directPresentationSharingKey { get; set; }
- public eDisplayState dispState
- {
- get
- {
- return _dispState;
- }
- set
- {
- if (value != _dispState)
- {
- _dispState = value;
- NotifyPropertyChanged("dispState");
- }
- }
- }
-
- public bool isAirHostClientConnected
- {
- get { return _isAirHostClientConnected; }
- set
- {
- if (value != _isAirHostClientConnected)
- {
- _isAirHostClientConnected = value;
- NotifyPropertyChanged("isAirHostClientConnected");
- }
- }
- }
-
- public bool isBlackMagicConnected
- {
- get { return _isBlackMagicConnected; }
- set
- {
- if (value != _isBlackMagicConnected)
- {
- _isBlackMagicConnected = value;
- NotifyPropertyChanged("isBlackMagicConnected");
- }
- }
- }
- public bool isBlackMagicDataAvailable { get; set; }
-
- public bool isDirectPresentationConnected
- {
- get { return _isDirectPresentationConnected; }
- set
- {
- if (value != _isDirectPresentationConnected)
- {
- _isDirectPresentationConnected = value;
- NotifyPropertyChanged("isDirectPresentationConnected");
- }
- }
- }
-
- public bool isSharingBlackMagic
- {
- get { return _isSharingBlackMagic; }
- set
- {
- if (value != _isSharingBlackMagic)
- {
- _isSharingBlackMagic = value;
- NotifyPropertyChanged("isSharingBlackMagic");
- }
- }
- }
-
- ///
- /// IOS Airplay code
- ///
- public string password
- {
- get
- {
- return _password;
- }
- set
- {
- if (value != _password)
- {
- _password = value;
- NotifyPropertyChanged("password");
- }
- }
- }
- public string serverName { get; set; }
- public string wifiName { get; set; }
- }
-
- public class NumberOfScreens : NotifiableObject
- {
- private int _numOfScreens;
-
- [JsonProperty("NumberOfCECScreens")]
- public int NumOfCECScreens { get; set; }
- [JsonProperty("NumberOfScreens")]
- public int NumOfScreens
- {
- get
- {
- return _numOfScreens;
- }
- set
- {
- if (value != _numOfScreens)
- {
- _numOfScreens = value;
- NotifyPropertyChanged("NumberOfScreens");
- }
- }
- }
- }
-
- ///
- /// AudioInputLine/AudioOutputLine/VideoCameraLine list item
- ///
- public class AudioVideoInputOutputLineItem
- {
- public string Alias { get; set; }
- public string Name { get; set; }
- public bool Selected { get; set; }
- public bool combinedDevice { get; set; }
- public string id { get; set; }
- public bool manuallySelected { get; set; }
- public int numberOfCombinedDevices { get; set; }
- public int ptzComId { get; set; }
- }
-
- public class Video
- {
- public bool Optimizable { get; set; }
- }
-
- public class CameraShare : NotifiableObject
- {
- private bool _canControlCamera;
- private bool _isSharing;
-
- [JsonProperty("can_Control_Camera")]
- public bool CanControlCamera
- {
- get
- {
- return _canControlCamera;
- }
- set
- {
- if (value != _canControlCamera)
- {
- _canControlCamera = value;
- NotifyPropertyChanged("CanControlCamera");
- }
- }
- }
- public string id { get; set; }
- public bool is_Mirrored { get; set; }
- [JsonProperty("is_Sharing")]
- public bool IsSharing
- {
- get
- {
- return _isSharing;
- }
- set
- {
- if (value != _isSharing)
- {
- _isSharing = value;
- NotifyPropertyChanged("IsSharing");
- }
- }
- }
- public int pan_Tilt_Speed { get; set; }
-
- }
-
- public class Layout : NotifiableObject
- {
- // backer variables
- private bool _can_Switch_Speaker_View;
- private bool _can_Switch_Wall_View;
- private bool _can_Switch_Strip_View;
- private bool _can_Switch_Share_On_All_Screens;
- private bool _can_Switch_Floating_Share_Content;
- private bool _is_In_First_Page;
- private bool _is_In_Last_Page;
- private string _video_type;
-
-
- public bool can_Adjust_Floating_Video { get; set; }
-
-
- public bool can_Switch_Floating_Share_Content
- {
- get
- {
- return _can_Switch_Floating_Share_Content;
- }
- set
- {
- if (value != _can_Switch_Floating_Share_Content)
- {
- _can_Switch_Floating_Share_Content = value;
- NotifyPropertyChanged("can_Switch_Floating_Share_Content");
- }
- }
- }
-
-
- ///
- /// [on/off] // Set to On if it is possible to invoke zConfiguration Call Layout Style: ShareAll, to switch to the ShareAll mode, where the content sharing is shown full screen on all monitors.
- ///
- [JsonProperty("can_Switch_Share_On_All_Screens")]
- public bool can_Switch_Share_On_All_Screens
- {
- get
- {
- return _can_Switch_Share_On_All_Screens;
- }
- set
- {
- if (value != _can_Switch_Share_On_All_Screens)
- {
- _can_Switch_Share_On_All_Screens = value;
- NotifyPropertyChanged("can_Switch_Share_On_All_Screens");
- }
- }
- }
-
- ///
- /// [on/off] // Set to On if it is possible to switch to Speaker view by invoking zConfiguration Call Layout Style: Speaker. The active speaker is shown full screen, and other video streams, like self-view, are shown in thumbnails.
- ///
- [JsonProperty("can_Switch_Speaker_View")]
- public bool can_Switch_Speaker_View
- {
- get
- {
- return _can_Switch_Speaker_View;
- }
- set
- {
- if (value != _can_Switch_Speaker_View)
- {
- _can_Switch_Speaker_View = value;
- NotifyPropertyChanged("can_Switch_Speaker_View");
- }
- }
- }
-
- ///
- /// [on/off] On if it is possible to invoke zConfiguration Call Layout Style: Gallery, to switch to the Gallery mode, showing video participants in tiled windows: The Zoom Room shows up to a 5x5 array of tiled windows per page.
- ///
- [JsonProperty("can_Switch_Wall_View")]
- public bool can_Switch_Wall_View
- {
- get
- {
- return _can_Switch_Wall_View;
- }
- set
- {
- if (value != _can_Switch_Wall_View)
- {
- _can_Switch_Wall_View = value;
- NotifyPropertyChanged("can_Switch_Wall_View");
- }
- }
- }
-
- [JsonProperty("can_Switch_Strip_View")]
- public bool can_Switch_Strip_View
- {
- get
- {
- return _can_Switch_Strip_View;
- }
- set
- {
- if (value != _can_Switch_Strip_View)
- {
- _can_Switch_Strip_View = value;
- NotifyPropertyChanged("can_Switch_Strip_View");
- }
- }
- }
-
- [JsonProperty("is_In_First_Page")]
- public bool is_In_First_Page
- {
- get
- {
- return _is_In_First_Page;
- }
- set
- {
- if (value != _is_In_First_Page)
- {
- _is_In_First_Page = value;
- NotifyPropertyChanged("is_In_First_Page");
- }
- }
- }
-
- [JsonProperty("is_In_Last_Page")]
- public bool is_In_Last_Page
- {
- get
- {
- return _is_In_Last_Page;
- }
- set
- {
- if (value != _is_In_Last_Page)
- {
- _is_In_Last_Page = value;
- NotifyPropertyChanged("is_In_Last_Page");
- }
- }
- }
-
- public bool is_supported { get; set; }
- public int video_Count_In_Current_Page { get; set; }
-
- ///
- /// [Gallery | Strip] Indicates which mode applies: Strip or Gallery.
- ///
- [JsonProperty("video_type")]
- public string video_type
- {
- get
- {
- return _video_type;
- }
- set
- {
- if (value != _video_type)
- {
- _video_type = value;
- NotifyPropertyChanged("video_type");
- }
- }
- }
- }
-
- public class CallRecordInfo : NotifiableObject
- {
- private bool _meetingIsBeingRecorded;
- private bool _canRecord;
- private bool _emailRequired;
-
- public bool amIRecording { get; set; }
-
- public bool canRecord
- {
- get
- {
- return _canRecord;
- }
- set
- {
- if (value != _canRecord)
- {
- _canRecord = value;
- NotifyPropertyChanged("canRecord");
- }
- }
- }
-
- public bool emailRequired
- {
- get
- {
- return _emailRequired;
- }
- set
- {
- if (value != _emailRequired)
- {
- _emailRequired = value;
- NotifyPropertyChanged("emailRequired");
- }
- }
- }
-
- public bool meetingIsBeingRecorded
- {
- get
- {
- return _meetingIsBeingRecorded;
- }
- set
- {
- //Debug.Console(2, "************************************setting value of meetingIsBeingRecorded to: {0}", value);
- if (value != _meetingIsBeingRecorded)
- {
- _meetingIsBeingRecorded = value;
- //Debug.Console(2, "********************************set value of meetingIsBeingRecorded to: {0}", _meetingIsBeingRecorded);
- NotifyPropertyChanged("meetingIsBeingRecorded");
- }
- }
- }
-
- ///
- /// Indicates if recording is allowed (when meeting capable and and email is not required to be entered by the user)
- ///
- public bool AllowRecord
- {
- get
- {
- return canRecord && !emailRequired;
- }
- }
-
- public CallRecordInfo()
- {
- Debug.Console(2, Debug.ErrorLogLevel.Notice, "********************************************* CallRecordInfo() ******************************************");
- }
- }
- }
-
- ///
- /// zEvent Class Structure
- ///
- public class zEvent
- {
- public class StartLocalPresentMeeting
- {
- public bool Success { get; set; }
- }
- public class NeedWaitForHost
- {
- public bool Wait { get; set; }
- }
-
- public class IncomingCallIndication
- {
- public string callerJID { get; set; }
- public string calleeJID { get; set; }
- public string meetingID { get; set; }
- public string password { get; set; }
- public string meetingOption { get; set; }
- public long MeetingNumber { get; set; }
- public string callerName { get; set; }
- public string avatarURL { get; set; }
- public int lifeTime { get; set; }
- public bool accepted { get; set; }
- }
-
- public class CallConnectError
- {
- public int error_code { get; set; }
- public string error_message { get; set; }
- }
-
- public class CallDisconnect
- {
- public bool Successful
- {
- get
- {
- return success == "on";
- }
- }
-
- public string success { get; set; }
- }
-
- public class Layout
- {
- public bool Sharethumb { get; set; }
- }
-
- public class Call
- {
- public Layout Layout { get; set; }
- }
-
- public class Client
- {
- public Call Call { get; set; }
- }
-
- public enum eSharingState
- {
- None,
- Connecting,
- Sending,
- Receiving,
- Send_Receiving
- }
-
- public class SharingState : NotifiableObject
- {
- private bool _paused;
- private eSharingState _state;
-
- public bool IsSharing { get; private set; }
-
- [JsonProperty("paused")]
- public bool Paused
- {
- get
- {
- return _paused;
- }
- set
- {
- if (value != _paused)
- {
- _paused = value;
- NotifyPropertyChanged("Paused");
- }
- }
- }
- [JsonProperty("state")]
- public eSharingState State
- {
- get
- {
- return _state;
- }
- set
- {
- if (value != _state)
- {
- _state = value;
- IsSharing = _state == eSharingState.Sending;
- NotifyPropertyChanged("State");
- }
- }
- }
- }
-
- public class PinStatusOfScreenNotification
- {
-
-
- [JsonProperty("can_be_pinned")]
- public bool CanBePinned { get; set; }
- [JsonProperty("can_pin_share")]
- public bool CanPinShare { get; set; }
- [JsonProperty("pinned_share_source_id")]
- public int PinnedShareSourceId { get; set; }
- [JsonProperty("pinned_user_id")]
- public int PinnedUserId { get; set; }
- [JsonProperty("screen_index")]
- public int ScreenIndex { get; set; }
- [JsonProperty("screen_layout")]
- public int ScreenLayout { get; set; }
- [JsonProperty("share_source_type")]
- public int ShareSourceType { get; set; }
- [JsonProperty("why_cannot_pin_share")]
- public string WhyCannotPinShare { get; set; }
- }
-
- public class PhoneCallStatus : NotifiableObject
- {
- private bool _isIncomingCall;
- private string _peerDisplayName;
- private string _peerNumber;
-
- private bool _offHook;
-
- public string CallId { get; set; }
- public bool IsIncomingCall
- {
- get { return _isIncomingCall; }
- set
- {
- if (value == _isIncomingCall) return;
-
- _isIncomingCall = value;
- NotifyPropertyChanged("IsIncomingCall");
- }
- }
-
- public string PeerDisplayName
- {
- get { return _peerDisplayName; }
- set
- {
- if (value == _peerDisplayName) return;
- _peerDisplayName = value;
- NotifyPropertyChanged("PeerDisplayName");
- }
- }
-
- public string PeerNumber
- {
- get { return _peerNumber; }
- set
- {
- if (value == _peerNumber) return;
-
- _peerNumber = value;
- NotifyPropertyChanged("PeerNumber");
- }
- }
-
- public string PeerUri { get; set; }
-
- private ePhoneCallStatus _status;
- public ePhoneCallStatus Status
- {
- get { return _status; }
- set
- {
- _status = value;
- OffHook = _status == ePhoneCallStatus.PhoneCallStatus_Accepted ||
- _status == ePhoneCallStatus.PhoneCallStatus_InCall ||
- _status == ePhoneCallStatus.PhoneCallStatus_Init ||
- _status == ePhoneCallStatus.PhoneCallStatus_Ringing;
- }
- }
-
- public bool OffHook
- {
- get { return _offHook; }
- set
- {
- if (value == _offHook) return;
-
- _offHook = value;
- NotifyPropertyChanged("OffHook");
- }
- }
- }
-
- public enum ePhoneCallStatus
- {
- PhoneCallStatus_Ringing,
- PhoneCallStatus_Terminated,
- PhoneCallStatus_Accepted,
- PhoneCallStatus_InCall,
- PhoneCallStatus_Init,
- }
-
- public class MeetingNeedsPassword
- {
- [JsonProperty("needsPassword")]
- public bool NeedsPassword { get; set; }
-
- [JsonProperty("wrongAndRetry")]
- public bool WrongAndRetry { get; set; }
- }
- }
-
- ///
- /// zConfiguration class structure
- ///
- public class zConfiguration
- {
- public class Sharing
- {
- [JsonProperty("optimize_video_sharing")]
- public bool OptimizeVideoSharing { get; set; }
- }
-
- public class Camera : NotifiableObject
- {
- private bool _mute;
-
- public bool Mute
- {
- get { return _mute; }
- set
- {
- Debug.Console(1, "Camera Mute response received: {0}", value);
-
- if (value == _mute) return;
-
- _mute = value;
- NotifyPropertyChanged("Mute");
- }
- }
- }
-
- public class Microphone : NotifiableObject
- {
- private bool _mute;
-
- public bool Mute
- {
- get
- {
- return _mute;
- }
- set
- {
- if (value != _mute)
- {
- _mute = value;
- NotifyPropertyChanged("Mute");
- }
- }
- }
- }
-
- [Flags]
- public enum eLayoutStyle
- {
- None = 0,
- Gallery = 1,
- Speaker = 2,
- Strip = 4,
- ShareAll = 8,
- }
-
- public enum eLayoutSize
- {
- Off,
- Size1,
- Size2,
- Size3,
- Strip
- }
-
- public enum eLayoutPosition
- {
- Center,
- Up,
- Right,
- UpRight,
- Down,
- DownRight,
- Left,
- UpLeft,
- DownLeft
- }
-
- public class Layout : NotifiableObject
- {
- private bool _shareThumb;
- private eLayoutStyle _style;
- private eLayoutSize _size;
- private eLayoutPosition _position;
-
- public bool ShareThumb
- {
- get { return _shareThumb; }
- set
- {
- if (value != _shareThumb)
- {
- _shareThumb = value;
- NotifyPropertyChanged("ShareThumb");
- }
- }
- }
-
- public eLayoutStyle Style
- {
- get { return _style; }
- set
- {
- if (value != _style)
- {
- _style = value;
- NotifyPropertyChanged("Style");
- }
- }
- }
-
- public eLayoutSize Size
- {
- get { return _size; }
- set
- {
- if (value != _size)
- {
- _size = value;
- NotifyPropertyChanged("Size");
- }
- }
- }
-
- public eLayoutPosition Position
- {
- get { return _position; }
- set
- {
- if (value != _position)
- {
- _position = value;
- NotifyPropertyChanged("Position");
- }
- }
- }
- }
-
- public class Lock : NotifiableObject
- {
- private bool _enable;
-
- public bool Enable
- {
- get
- {
- return _enable;
- }
- set
- {
- if (value != _enable)
- {
- _enable = value;
- NotifyPropertyChanged("Enable");
- }
- }
- }
- }
-
- public class ClosedCaption
- {
- public bool Visible { get; set; }
- public int FontSize { get; set; }
- }
-
- public class MuteUserOnEntry
- {
- public bool Enable { get; set; }
- }
-
- public class Call
- {
- public Sharing Sharing { get; set; }
- public Camera Camera { get; set; }
- public Microphone Microphone { get; set; }
- public Layout Layout { get; set; }
- public Lock Lock { get; set; }
- public MuteUserOnEntry MuteUserOnEntry { get; set; }
- public ClosedCaption ClosedCaption { get; set; }
-
-
- public Call()
- {
- Sharing = new Sharing();
- Camera = new Camera();
- Microphone = new Microphone();
- Layout = new Layout();
- Lock = new Lock();
- MuteUserOnEntry = new MuteUserOnEntry();
- ClosedCaption = new ClosedCaption();
- }
- }
-
- public class Audio
- {
- public Input Input { get; set; }
- public Output Output { get; set; }
-
- public Audio()
- {
- Input = new Input();
- Output = new Output();
- }
- }
-
- public class Input : Output
- {
- [JsonProperty("reduce_reverb")]
- public bool ReduceReverb { get; set; }
- }
-
- public class Output : NotifiableObject
- {
- private int _volume;
-
- [JsonProperty("volume")]
- public int Volume
- {
- get
- {
- return _volume;
- }
- set
- {
- if (value != _volume)
- {
- _volume = value;
- NotifyPropertyChanged("Volume");
- }
- }
- }
- [JsonProperty("selectedId")]
- public string SelectedId { get; set; }
- [JsonProperty("is_sap_disabled")]
- public bool IsSapDisabled { get; set; }
- }
-
- public class Video : NotifiableObject
- {
- private bool _hideConfSelfVideo;
-
- [JsonProperty("hide_conf_self_video")]
- public bool HideConfSelfVideo
- {
- get
- {
- return _hideConfSelfVideo;
- }
- set
- {
- //if (value != _hideConfSelfVideo)
- //{
- _hideConfSelfVideo = value;
- NotifyPropertyChanged("HideConfSelfVideo");
- //}
- }
- }
-
- public VideoCamera Camera { get; set; }
-
- public Video()
- {
- Camera = new VideoCamera();
- }
- }
-
- public class VideoCamera : NotifiableObject
- {
- private string _selectedId;
-
- [JsonProperty("selectedId")]
- public string SelectedId
- {
- get
- {
- return _selectedId;
- }
- set
- {
- if (value != _selectedId)
- {
- _selectedId = value;
- NotifyPropertyChanged("SelectedId");
- }
- }
-
- }
- public bool Mirror { get; set; }
- }
-
- public class Client
- {
- public string appVersion { get; set; }
- public string deviceSystem { get; set; }
-
- // This doesn't belong here, but there's a bug in the object structure of Zoom Room 5.6.3 that puts it here
- public zConfiguration.Call Call { get; set; }
-
- public Client()
- {
- Call = new zConfiguration.Call();
- }
- }
-
- }
-
- ///
- /// zCommand class structure
- ///
- public class zCommand
- {
- public class BookingsListResult
- {
- [JsonProperty("accessRole")]
- public string AccessRole { get; set; }
- [JsonProperty("calendarChangeKey")]
- public string CalendarChangeKey { get; set; }
- [JsonProperty("calendarID")]
- public string CalendarId { get; set; }
- [JsonProperty("checkIn")]
- public bool CheckIn { get; set; }
- [JsonProperty("creatorEmail")]
- public string CreatorEmail { get; set; }
- [JsonProperty("creatorName")]
- public string CreatorName { get; set; }
- [JsonProperty("endTime")]
- public DateTime EndTime { get; set; }
- [JsonProperty("hostName")]
- public string HostName { get; set; }
- [JsonProperty("isInstantMeeting")]
- public bool IsInstantMeeting { get; set; }
- [JsonProperty("isPrivate")]
- public bool IsPrivate { get; set; }
- [JsonProperty("location")]
- public string Location { get; set; }
- [JsonProperty("meetingName")]
- public string MeetingName { get; set; }
- [JsonProperty("meetingNumber")]
- public string MeetingNumber { get; set; }
- [JsonProperty("scheduledFrom")]
- public string ScheduledFrom { get; set; }
- [JsonProperty("startTime")]
- public DateTime StartTime { get; set; }
- [JsonProperty("third_party")]
- public ThirdParty ThirdParty { get; set; }
- }
-
- public static List GetGenericMeetingsFromBookingResult(List bookings,
- int minutesBeforeMeetingStart)
- {
- var rv = GetGenericMeetingsFromBookingResult(bookings);
-
- foreach (var meeting in rv)
- {
- meeting.MinutesBeforeMeeting = minutesBeforeMeetingStart;
- }
-
- return rv;
- }
- ///
- /// Extracts the necessary meeting values from the Zoom bookings response and converts them to the generic class
- ///
- ///
- ///
- public static List GetGenericMeetingsFromBookingResult(List bookings)
- {
- var meetings = new List();
-
- if (Debug.Level > 0)
- {
- Debug.Console(1, "Meetings List:\n");
- }
-
- foreach (var b in bookings)
- {
- var meeting = new Meeting();
-
- if (b.MeetingNumber != null)
- meeting.Id = b.MeetingNumber;
- if (b.CreatorName != null)
- meeting.Organizer = b.CreatorName;
- if (b.MeetingName != null)
- meeting.Title = b.MeetingName;
- //if (b.Agenda != null)
- // meeting.Agenda = b.Agenda.Value;
- if (b.StartTime != null)
- meeting.StartTime = b.StartTime;
- if (b.EndTime != null)
- meeting.EndTime = b.EndTime;
-
- meeting.Privacy = b.IsPrivate ? eMeetingPrivacy.Private : eMeetingPrivacy.Public;
-
- meeting.Dialable = meeting.Id != "0";
-
- // No meeting.Calls data exists for Zoom Rooms. Leaving out for now.
- var now = DateTime.Now;
- if (meeting.StartTime < now && meeting.EndTime < now)
- {
- Debug.Console(1, "Skipping meeting {0}. Meeting is in the past.", meeting.Title);
- continue;
- }
-
- meetings.Add(meeting);
-
- if (Debug.Level > 0)
- {
- Debug.Console(1, "Title: {0}, ID: {1}, Organizer: {2}", meeting.Title, meeting.Id, meeting.Organizer);
- Debug.Console(1, " Start Time: {0}, End Time: {1}, Duration: {2}", meeting.StartTime, meeting.EndTime, meeting.Duration);
- Debug.Console(1, " Joinable: {0}\n", meeting.Joinable);
- }
- }
-
- meetings.OrderBy(m => m.StartTime);
-
- return meetings;
- }
-
- public class HandStatus
- {
- // example return of the "hand_status" object
- // !!!! Note the properties contain ': ' within the property name !!!
- //"hand_status": {
- // "is_raise_hand: ": false,
- // "is_valid: ": "on",
- // "time_stamp: ": "11825083"
- //},
- [JsonProperty("is_raise_hand: ")]
- public bool IsRaiseHand { get; set; }
- [JsonProperty("is_valid: ")]
- public string IsValid { get; set; }
- [JsonProperty("time_stamp: ")]
- public string TimeStamp { get; set; }
- ///
- /// Retuns a boolean value if the participant hand state is raised and is valid (both need to be true)
- ///
- public bool HandIsRaisedAndValid
- {
- get { return IsValid != null && IsValid == "on" && IsRaiseHand; }
- }
- }
- public class ListParticipant
- {
- [JsonProperty("audio_status state")]
- public string AudioStatusState { get; set; }
- [JsonProperty("audio_status type")]
- public string AudioStatusType { get; set; }
- [JsonProperty("avatar_url")]
- public string AvatarUrl { get; set; }
- [JsonProperty("camera_status am_i_controlling")]
- public bool CameraStatusAmIControlling { get; set; }
- [JsonProperty("camera_status can_i_request_control")]
- public bool CameraStatusCanIRequestConrol { get; set; }
- [JsonProperty("camera_status can_move_camera")]
- public bool CameraStatusCanMoveCamera { get; set; }
- [JsonProperty("camera_status can_switch_camera")]
- public bool CameraStatusCanSwitchCamera { get; set; }
- [JsonProperty("camera_status can_zoom_camera")]
- public bool CameraStatusCanZoomCamera { get; set; }
- [JsonProperty("can_edit_closed_caption")]
- public bool CanEditClosedCaption { get; set; }
- [JsonProperty("can_record")]
- public bool CanRecord { get; set; }
- [JsonProperty("event")]
- public string Event { get; set; }
- [JsonProperty("hand_status")]
- public HandStatus HandStatus { get; set; }
- [JsonProperty("isCohost")]
- public bool IsCohost { get; set; }
- [JsonProperty("is_client_support_closed_caption")]
- public bool IsClientSupportClosedCaption { get; set; }
- [JsonProperty("is_client_support_coHost")]
- public bool IsClientSupportCoHost { get; set; }
- [JsonProperty("is_host")]
- public bool IsHost { get; set; }
- [JsonProperty("is_myself")]
- public bool IsMyself { get; set; }
- [JsonProperty("is_recording")]
- public bool IsRecording { get; set; }
- [JsonProperty("is_video_can_mute_byHost")]
- public bool IsVideoCanMuteByHost { get; set; }
- [JsonProperty("is_video_can_unmute_byHost")]
- public bool IsVideoCanUnmuteByHost { get; set; }
- [JsonProperty("local_recording_disabled")]
- public bool LocalRecordingDisabled { get; set; }
- [JsonProperty("user_id")]
- public int UserId { get; set; }
- [JsonProperty("user_name")]
- public string UserName { get; set; }
- [JsonProperty("user_type")]
- public string UserType { get; set; }
- [JsonProperty("video_status has_source")]
- public bool VideoStatusHasSource { get; set; }
- [JsonProperty("video_status is_receiving")]
- public bool VideoStatusIsReceiving { get; set; }
- [JsonProperty("video_status is_sending")]
- public bool VideoStatusIsSending { get; set; }
-
- public ListParticipant()
- {
- HandStatus = new HandStatus();
- }
-
- ///
- /// Converts ZoomRoom pariticpant list response to an Essentials participant list
- ///
- ///
- ///
- public static List GetGenericParticipantListFromParticipantsResult(
- List participants)
- {
- if (participants.Count == 0)
- {
- return new List();
- }
- //return participants.Select(p => new Participant
- // {
- // UserId = p.UserId,
- // Name = p.UserName,
- // IsHost = p.IsHost,
- // CanMuteVideo = p.IsVideoCanMuteByHost,
- // CanUnmuteVideo = p.IsVideoCanUnmuteByHost,
- // AudioMuteFb = p.AudioStatusState == "AUDIO_MUTED",
- // VideoMuteFb = p.VideoStatusIsSending,
- // HandIsRaisedFb = p.HandStatus.HandIsRaisedAndValid,
- // }).ToList();
-
- var sortedParticipants = SortParticipantListByHandStatus(participants);
- return sortedParticipants.Select(p => new Participant
- {
- UserId = p.UserId,
- Name = p.UserName,
- IsHost = p.IsHost,
- IsMyself = p.IsMyself,
- CanMuteVideo = p.IsVideoCanMuteByHost,
- CanUnmuteVideo = p.IsVideoCanUnmuteByHost,
- AudioMuteFb = p.AudioStatusState == "AUDIO_MUTED",
- VideoMuteFb = !p.VideoStatusIsSending,
- HandIsRaisedFb = p.HandStatus.HandIsRaisedAndValid,
- }).ToList();
- }
-
- ///
- /// Will sort by hand-raise status and then alphabetically
- ///
- /// Zoom Room response list of participants
- /// List
- public static List SortParticipantListByHandStatus(List participants)
- {
- if (participants == null)
- {
- //Debug.Console(1, "SortParticiapntListByHandStatu(participants == null)");
- return null;
- }
-
- // debug testing
- //foreach (ListParticipant participant in participants)
- //{
- // Debug.Console(1, "{0} | IsValid: {1} | IsRaiseHand: {2} | HandIsRaisedAndValid: {3}",
- // participant.UserName, participant.HandStatus.IsValid, participant.HandStatus.IsRaiseHand.ToString(), participant.HandStatus.HandIsRaisedAndValid.ToString());
- //}
-
- List handRaisedParticipantsList = participants.Where(p => p.HandStatus.HandIsRaisedAndValid).ToList();
-
- if (handRaisedParticipantsList != null)
- {
- IOrderedEnumerable orderByDescending = handRaisedParticipantsList.OrderByDescending(p => p.HandStatus.TimeStamp);
-
- //foreach (var participant in handRaisedParticipantsList)
- // Debug.Console(1, "handRaisedParticipantList: {0} | {1}", participant.UserName, participant.UserId);
- }
-
- List allOtherParticipantsList = participants.Where(p => !p.HandStatus.HandIsRaisedAndValid).ToList();
-
- if (allOtherParticipantsList != null)
- {
- allOtherParticipantsList.OrderBy(p => p.UserName);
-
- //foreach (var participant in allOtherParticipantsList)
- // Debug.Console(1, "allOtherParticipantsList: {0} | {1}", participant.UserName, participant.UserId);
- }
-
- // merge the lists
- List sortedList = handRaisedParticipantsList.Union(allOtherParticipantsList).ToList();
-
- // return the sorted list
- return sortedList;
- }
-
- }
-
- public class CallinCountryList
- {
- public int code { get; set; }
- public string display_number { get; set; }
- public string id { get; set; }
- public string name { get; set; }
- public string number { get; set; }
- }
-
- public class CalloutCountryList
- {
- public int code { get; set; }
- public string display_number { get; set; }
- public string id { get; set; }
- public string name { get; set; }
- public string number { get; set; }
- }
-
- public class TollFreeCallinList
- {
- public int code { get; set; }
- public string display_number { get; set; }
- public string id { get; set; }
- public string name { get; set; }
- public string number { get; set; }
- }
-
- public class Info
- {
- public List callin_country_list { get; set; }
- public List callout_country_list { get; set; }
- public List toll_free_callin_list { get; set; }
- }
-
- public class ThirdParty
- {
- public string h323_address { get; set; }
- public string meeting_number { get; set; }
- public string service_provider { get; set; }
- public string sip_address { get; set; }
- }
-
- public class MeetingListItem
- {
- public string accessRole { get; set; }
- public string calendarChangeKey { get; set; }
- public string calendarID { get; set; }
- public bool checkIn { get; set; }
- public string creatorEmail { get; set; }
- public string creatorName { get; set; }
- public string endTime { get; set; }
- public string hostName { get; set; }
- public bool isInstantMeeting { get; set; }
- public bool isPrivate { get; set; }
- public string location { get; set; }
- public string meetingName { get; set; }
- public string meetingNumber { get; set; }
- public string scheduledFrom { get; set; }
- public string startTime { get; set; }
- public ThirdParty third_party { get; set; }
-
- public MeetingListItem()
- {
- third_party = new ThirdParty();
- }
- }
-
- public class InfoResult
- {
- public Info Info { get; set; }
- public bool am_i_original_host { get; set; }
- public string default_callin_country { get; set; }
- public string dialIn { get; set; }
- public string international_url { get; set; }
- public string invite_email_content { get; set; }
- public string invite_email_subject { get; set; }
- public bool is_callin_country_list_available { get; set; }
- public bool is_calling_room_system_enabled { get; set; }
- public bool is_toll_free_callin_list_available { get; set; }
- public bool is_view_only { get; set; }
- public bool is_waiting_room { get; set; }
- public bool is_webinar { get; set; }
- public string meeting_id { get; set; }
- public MeetingListItem meeting_list_item { get; set; }
- public string meeting_password { get; set; }
- public string meeting_type { get; set; }
- public int my_userid { get; set; }
- public int participant_id { get; set; }
- public string real_meeting_id { get; set; }
- public string schedule_option { get; set; }
- public string schedule_option2 { get; set; }
- public string support_callout_type { get; set; }
- public string toll_free_number { get; set; }
- public string user_type { get; set; }
-
- public InfoResult()
- {
- Info = new Info();
- meeting_list_item = new MeetingListItem();
- }
- }
-
- public class Phonebook
- {
- public List Contacts { get; set; }
- public int Limit { get; set; }
- public int Offset { get; set; }
- }
- }
-}
\ No newline at end of file
diff --git a/src/PepperDash.Essentials.Devices.Common/VideoCodec/ZoomRoom/ZoomRoom.cs b/src/PepperDash.Essentials.Devices.Common/VideoCodec/ZoomRoom/ZoomRoom.cs
deleted file mode 100644
index a9c6c0f2..00000000
--- a/src/PepperDash.Essentials.Devices.Common/VideoCodec/ZoomRoom/ZoomRoom.cs
+++ /dev/null
@@ -1,3943 +0,0 @@
-extern alias Full;
-
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.CrestronThread;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Full.Newtonsoft.Json;
-using Full.Newtonsoft.Json.Linq;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Bridges;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Core.DeviceTypeInterfaces;
-using PepperDash.Essentials.Core.Routing;
-using PepperDash.Essentials.Core.Queues;
-using PepperDash.Essentials.Devices.Common.Cameras;
-using PepperDash.Essentials.Devices.Common.Codec;
-using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
-using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
-
-namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
-{
- public class ZoomRoom : VideoCodecBase, IHasCodecSelfView, IHasDirectoryHistoryStack, ICommunicationMonitor,
- IRouting,
- IHasScheduleAwareness, IHasCodecCameras, IHasParticipants, IHasCameraOff, IHasCameraMuteWithUnmuteReqeust, IHasCameraAutoMode,
- IHasFarEndContentStatus, IHasSelfviewPosition, IHasPhoneDialing, IHasZoomRoomLayouts, IHasParticipantPinUnpin,
- IHasParticipantAudioMute, IHasSelfviewSize, IPasswordPrompt, IHasStartMeeting, IHasMeetingInfo, IHasPresentationOnlyMeeting,
- IHasMeetingLock, IHasMeetingRecordingWithPrompt, IZoomWirelessShareInstructions
- {
- public event EventHandler VideoUnmuteRequested;
-
- private const long MeetingRefreshTimer = 60000;
- public uint DefaultMeetingDurationMin { get; private set; }
-
- ///
- /// CR LF CR LF Delimits an echoed response to a command
- ///
- private const string EchoDelimiter = "\x0D\x0A\x0D\x0A";
-
- private const string SendDelimiter = "\x0D";
-
- ///
- /// CR LF } CR LF Delimits a JSON response
- ///
- private const string JsonDelimiter = "\x0D\x0A\x7D\x0D\x0A";
-
- private string[] Delimiters = new string[] { EchoDelimiter, JsonDelimiter, "OK\x0D\x0A", "end\x0D\x0A" };
- private readonly GenericQueue _receiveQueue;
-
- private readonly ZoomRoomSyncState _syncState;
- public bool CommDebuggingIsOn;
- private CodecDirectory _currentDirectoryResult;
- private uint _jsonCurlyBraceCounter;
- private bool _jsonFeedbackMessageIsIncoming;
- private StringBuilder _jsonMessage;
- private int _previousVolumeLevel;
- private CameraBase _selectedCamera;
- private string _lastDialedMeetingNumber;
-
- private CTimer contactsDebounceTimer;
-
-
- private readonly ZoomRoomPropertiesConfig _props;
-
- private bool _meetingPasswordRequired;
-
- private bool _waitingForUserToAcceptOrRejectIncomingCall;
-
- public void Poll(string pollString)
- {
- if(_meetingPasswordRequired || _waitingForUserToAcceptOrRejectIncomingCall) return;
-
- SendText(string.Format("{0}{1}", pollString, SendDelimiter));
- }
-
- public ZoomRoom(DeviceConfig config, IBasicCommunication comm)
- : base(config)
- {
- DefaultMeetingDurationMin = 30;
-
- _props = JsonConvert.DeserializeObject(config.Properties.ToString());
-
- _receiveQueue = new GenericQueue(Key + "-rxQueue", Thread.eThreadPriority.MediumPriority, 2048);
-
- Communication = comm;
-
- if (_props.CommunicationMonitorProperties != null)
- {
- CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, _props.CommunicationMonitorProperties.PollInterval, _props.CommunicationMonitorProperties.TimeToWarning, _props.CommunicationMonitorProperties.TimeToError,
- () => Poll(_props.CommunicationMonitorProperties.PollString));
- }
- else
- {
- CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, () => Poll("zStatus SystemUnit"));
- }
-
- DeviceManager.AddDevice(CommunicationMonitor);
-
- Status = new ZoomRoomStatus();
-
- Configuration = new ZoomRoomConfiguration();
-
- CodecInfo = new ZoomRoomInfo(Status, Configuration);
-
- _syncState = new ZoomRoomSyncState(Key + "--Sync", this);
-
- _syncState.InitialSyncCompleted += SyncState_InitialSyncCompleted;
-
- _syncState.FirstJsonResponseReceived += (o, a) => SetUpSyncQueries();
-
- PhonebookSyncState = new CodecPhonebookSyncState(Key + "--PhonebookSync");
-
- PhonebookSyncState.InitialSyncCompleted += (o, a) => ResubscribeForAddedContacts();
-
- PortGather = new CommunicationGather(Communication, Delimiters) {IncludeDelimiter = true};
- PortGather.LineReceived += Port_LineReceived;
-
- CodecOsdIn = new RoutingInputPort(RoutingPortNames.CodecOsd,
- eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, new Action(StopSharing), this);
-
- Output1 = new RoutingOutputPort(RoutingPortNames.HdmiOut1,
- eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, null, this);
-
- Output2 = new RoutingOutputPort(RoutingPortNames.HdmiOut2,
- eRoutingSignalType.Video,
- eRoutingPortConnectionType.DisplayPort, null, this);
-
- Output3 = new RoutingOutputPort(RoutingPortNames.HdmiOut3,
- eRoutingSignalType.Audio | eRoutingSignalType.Video,
- eRoutingPortConnectionType.Hdmi, null, this);
-
- SelfviewIsOnFeedback = new BoolFeedback(SelfViewIsOnFeedbackFunc);
-
- CameraIsOffFeedback = new BoolFeedback(CameraIsOffFeedbackFunc);
-
- CameraIsMutedFeedback = CameraIsOffFeedback;
-
- CameraAutoModeIsOnFeedback = new BoolFeedback(CameraAutoModeIsOnFeedbackFunc);
-
- CodecSchedule = new CodecScheduleAwareness(MeetingRefreshTimer);
-
- if (_props.MinutesBeforeMeetingStart > 0)
- {
- CodecSchedule.MeetingWarningMinutes = _props.MinutesBeforeMeetingStart;
- }
-
- ReceivingContent = new BoolFeedback(FarEndIsSharingContentFeedbackFunc);
-
- SelfviewPipPositionFeedback = new StringFeedback(SelfviewPipPositionFeedbackFunc);
-
- // TODO: #714 [ ] SelfviewPipSizeFeedback
- SelfviewPipSizeFeedback = new StringFeedback(SelfviewPipSizeFeedbackFunc);
-
- SetUpFeedbackActions();
-
- Cameras = new List();
-
- SetUpDirectory();
-
- Participants = new CodecParticipants();
-
- SupportsCameraOff = true; // Always allow turning off the camera for zoom calls?
- SupportsCameraAutoMode = _props.SupportsCameraAutoMode;
-
- PhoneOffHookFeedback = new BoolFeedback(PhoneOffHookFeedbackFunc);
- CallerIdNameFeedback = new StringFeedback(CallerIdNameFeedbackFunc);
- CallerIdNumberFeedback = new StringFeedback(CallerIdNumberFeedbackFunc);
-
- LocalLayoutFeedback = new StringFeedback(LocalLayoutFeedbackFunc);
-
- LayoutViewIsOnFirstPageFeedback = new BoolFeedback(LayoutViewIsOnFirstPageFeedbackFunc);
- LayoutViewIsOnLastPageFeedback = new BoolFeedback(LayoutViewIsOnLastPageFeedbackFunc);
- CanSwapContentWithThumbnailFeedback = new BoolFeedback(CanSwapContentWithThumbnailFeedbackFunc);
- ContentSwappedWithThumbnailFeedback = new BoolFeedback(ContentSwappedWithThumbnailFeedbackFunc);
-
- NumberOfScreensFeedback = new IntFeedback(NumberOfScreensFeedbackFunc);
-
- MeetingIsLockedFeedback = new BoolFeedback(() => Configuration.Call.Lock.Enable );
-
- MeetingIsRecordingFeedback = new BoolFeedback(() => Status.Call.CallRecordInfo.meetingIsBeingRecorded );
-
- RecordConsentPromptIsVisible = new BoolFeedback(() => _recordConsentPromptIsVisible);
-
- SetUpRouting();
- }
-
- public CommunicationGather PortGather { get; private set; }
-
- public ZoomRoomStatus Status { get; private set; }
-
- public ZoomRoomConfiguration Configuration { get; private set; }
-
- //CTimer LoginMessageReceivedTimer;
- //CTimer RetryConnectionTimer;
-
- ///
- /// Gets and returns the scaled volume of the codec
- ///
- protected override Func VolumeLevelFeedbackFunc
- {
- get
- {
- return () =>
- {
- var scaledVol = CrestronEnvironment.ScaleWithLimits(Configuration.Audio.Output.Volume, 100, 0, 65535, 0);
-
- if (Configuration.Audio.Output.Volume != 0)
- {
- Debug.Console(2, this, "Storing previous volume level as: {0}, scaled: {1}", Configuration.Audio.Output.Volume,
- scaledVol);
- _previousVolumeLevel = scaledVol; // Store the previous level for recall
- }
-
- return scaledVol;
- };
- }
- }
-
- protected override Func PrivacyModeIsOnFeedbackFunc
- {
- get
- {
- return () =>
- {
- //Debug.Console(2, this, "PrivacyModeIsOnFeedbackFunc. IsInCall: {0} muteState: {1}", IsInCall, Configuration.Call.Microphone.Mute);
- if (IsInCall)
- {
- //Debug.Console(2, this, "reporting muteState: ", Configuration.Call.Microphone.Mute);
- return Configuration.Call.Microphone.Mute;
- }
- else
- {
- //Debug.Console(2, this, "muteState: true", IsInCall);
- return false;
- }
- };
- }
- }
-
- protected override Func StandbyIsOnFeedbackFunc
- {
- get { return () => false; }
- }
-
- protected override Func SharingSourceFeedbackFunc
- {
- get
- {
- return () =>
- {
- if (Status.Sharing.isAirHostClientConnected)
- return "Airplay";
- else if (Status.Sharing.isDirectPresentationConnected || Status.Sharing.isBlackMagicConnected)
- return "Laptop";
- else return "None";
-
- };
- }
- }
-
- protected override Func SharingContentIsOnFeedbackFunc
- {
- get { return () => Status.Sharing.isAirHostClientConnected || Status.Sharing.isDirectPresentationConnected || Status.Sharing.isSharingBlackMagic; }
- }
-
- protected Func FarEndIsSharingContentFeedbackFunc
- {
- get { return () => Status.Call.Sharing.State == zEvent.eSharingState.Receiving; }
- }
-
- protected override Func MuteFeedbackFunc
- {
- get { return () => Configuration.Audio.Output.Volume == 0; }
- }
-
- //protected Func RoomIsOccupiedFeedbackFunc
- //{
- // get
- // {
- // return () => false;
- // }
- //}
-
- //protected Func PeopleCountFeedbackFunc
- //{
- // get
- // {
- // return () => 0;
- // }
- //}
-
- protected Func SelfViewIsOnFeedbackFunc
- {
- get { return () => !Configuration.Video.HideConfSelfVideo; }
- }
-
- protected Func CameraIsOffFeedbackFunc
- {
- get { return () => Configuration.Call.Camera.Mute; }
- }
-
- protected Func CameraAutoModeIsOnFeedbackFunc
- {
- get { return () => false; }
- }
-
- protected Func SelfviewPipPositionFeedbackFunc
- {
- get
- {
- return
- () =>
- _currentSelfviewPipPosition != null
- ? _currentSelfviewPipPosition.Command ?? "Unknown"
- : "Unknown";
- }
- }
-
- // TODO: #714 [ ] SelfviewPipSizeFeedbackFunc
- protected Func SelfviewPipSizeFeedbackFunc
- {
- get
- {
- return
- () =>
- _currentSelfviewPipSize != null
- ? _currentSelfviewPipSize.Command ?? "Unknown"
- : "Unknown";
- }
- }
-
- protected Func LocalLayoutIsProminentFeedbackFunc
- {
- get { return () => false; }
- }
-
-
- public RoutingInputPort CodecOsdIn { get; private set; }
- public RoutingOutputPort Output1 { get; private set; }
- public RoutingOutputPort Output2 { get; private set; }
- public RoutingOutputPort Output3 { get; private set; }
-
- #region ICommunicationMonitor Members
-
- public StatusMonitorBase CommunicationMonitor { get; private set; }
-
- #endregion
-
- #region IHasCodecCameras Members
-
- public event EventHandler CameraSelected;
-
- public List Cameras { get; private set; }
-
- public CameraBase SelectedCamera
- {
- get { return _selectedCamera; }
- private set
- {
- _selectedCamera = value;
- SelectedCameraFeedback.FireUpdate();
- ControllingFarEndCameraFeedback.FireUpdate();
-
- var handler = CameraSelected;
- if (handler != null)
- {
- handler(this, new CameraSelectedEventArgs(_selectedCamera));
- }
- }
- }
-
-
- public StringFeedback SelectedCameraFeedback { get; private set; }
-
- public void SelectCamera(string key)
- {
- if (CameraIsMutedFeedback.BoolValue)
- {
- CameraMuteOff();
- }
-
- SendText(string.Format("zConfiguration Video Camera selectedId: {0}", key));
- }
-
- public CameraBase FarEndCamera { get; private set; }
-
- public BoolFeedback ControllingFarEndCameraFeedback { get; private set; }
-
- #endregion
-
- #region IHasCodecSelfView Members
-
- public BoolFeedback SelfviewIsOnFeedback { get; private set; }
-
- public void GetSelfViewMode()
- {
- SendText("zConfiguration Video hide_conf_self_video");
- }
-
- public void SelfViewModeOn()
- {
- SendText("zConfiguration Video hide_conf_self_video: off");
- }
-
- public void SelfViewModeOff()
- {
- SendText("zConfiguration Video hide_conf_self_video: on");
- }
-
- public void SelfViewModeToggle()
- {
- if (SelfviewIsOnFeedback.BoolValue)
- {
- SelfViewModeOff();
- }
- else
- {
- SelfViewModeOn();
- }
- }
-
- #endregion
-
- #region IHasDirectoryHistoryStack Members
-
- public event EventHandler DirectoryResultReturned;
- public CodecDirectory DirectoryRoot { get; private set; }
-
- public CodecDirectory CurrentDirectoryResult
- {
- get { return _currentDirectoryResult; }
- private set
- {
- _currentDirectoryResult = value;
-
- Debug.Console(2, this, "CurrentDirectoryResult Updated. ResultsFolderId: {0} Contact Count: {1}",
- _currentDirectoryResult.ResultsFolderId, _currentDirectoryResult.CurrentDirectoryResults.Count);
-
- OnDirectoryResultReturned(_currentDirectoryResult);
- }
- }
-
- public CodecPhonebookSyncState PhonebookSyncState { get; private set; }
-
- public void SearchDirectory(string searchString)
- {
- var directoryResults = new CodecDirectory();
-
- directoryResults.AddContactsToDirectory(
- DirectoryRoot.CurrentDirectoryResults.FindAll(
- c => c.Name.IndexOf(searchString, 0, StringComparison.OrdinalIgnoreCase) > -1));
-
- DirectoryBrowseHistoryStack.Clear();
- CurrentDirectoryResult = directoryResults;
- }
-
- public void GetDirectoryFolderContents(string folderId)
- {
- var directoryResults = new CodecDirectory {ResultsFolderId = folderId};
-
- directoryResults.AddContactsToDirectory(
- DirectoryRoot.CurrentDirectoryResults.FindAll(c => c.ParentFolderId.Equals(folderId)));
-
- DirectoryBrowseHistoryStack.Push(_currentDirectoryResult);
-
- CurrentDirectoryResult = directoryResults;
- }
-
- public void SetCurrentDirectoryToRoot()
- {
- DirectoryBrowseHistoryStack.Clear();
-
- CurrentDirectoryResult = DirectoryRoot;
- }
-
- public void GetDirectoryParentFolderContents()
- {
- if (DirectoryBrowseHistoryStack.Count == 0)
- {
- return;
- }
-
- var currentDirectory = DirectoryBrowseHistoryStack.Pop();
-
- CurrentDirectoryResult = currentDirectory;
- }
-
- public BoolFeedback CurrentDirectoryResultIsNotDirectoryRoot { get; private set; }
-
- public List DirectoryBrowseHistory { get; private set; }
-
- public Stack DirectoryBrowseHistoryStack { get; private set; }
-
- #endregion
-
- #region IHasScheduleAwareness Members
-
- public CodecScheduleAwareness CodecSchedule { get; private set; }
-
- public void GetSchedule()
- {
- GetBookings();
- }
-
- #endregion
-
- #region IRouting Members
-
- public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
- {
- ExecuteSwitch(inputSelector);
- }
-
- #endregion
-
- private void SyncState_InitialSyncCompleted(object sender, EventArgs e)
- {
- SetIsReady();
- }
-
- ///
- /// Handles subscriptions to Status.Call and sub objects. Needs to be called whenever Status.Call is constructed
- ///
- private void SetUpCallFeedbackActions()
- {
- Status.Sharing.PropertyChanged -= HandleSharingStateUpdate;
- Status.Sharing.PropertyChanged += HandleSharingStateUpdate;
-
- Status.Call.Sharing.PropertyChanged -= HandleSharingStateUpdate;
- Status.Call.Sharing.PropertyChanged += HandleSharingStateUpdate;
-
- Status.Call.PropertyChanged -= HandleCallStateUpdate;
- Status.Call.PropertyChanged += HandleCallStateUpdate;
-
- Status.Call.CallRecordInfo.PropertyChanged -= HandleCallRecordInfoStateUpdate;
- Status.Call.CallRecordInfo.PropertyChanged += HandleCallRecordInfoStateUpdate;
- }
-
- private void HandleCallRecordInfoStateUpdate(object sender, PropertyChangedEventArgs a)
- {
- if (a.PropertyName == "meetingIsBeingRecorded" || a.PropertyName == "emailRequired" || a.PropertyName == "canRecord")
- {
- MeetingIsRecordingFeedback.FireUpdate();
-
- var meetingInfo = new MeetingInfo(MeetingInfo.Id,
- MeetingInfo.Name,
- MeetingInfo.Host,
- MeetingInfo.Password,
- GetSharingStatus(),
- GetIsHostMyself(),
- MeetingInfo.IsSharingMeeting,
- MeetingInfo.WaitingForHost,
- MeetingIsLockedFeedback.BoolValue,
- MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
- MeetingInfo = meetingInfo;
- }
- }
-
- private void HandleCallStateUpdate(object sender, PropertyChangedEventArgs a)
- {
- switch (a.PropertyName)
- {
- case "Info":
- {
- Debug.Console(1, this, "Updating Call Status");
- UpdateCallStatus();
- break;
- }
-
- case "Status":
- {
- UpdateCallStatus();
- break;
- }
- }
- }
-
- private void HandleSharingStateUpdate(object sender, PropertyChangedEventArgs a)
- {
- //if (a.PropertyName != "State")
- //{
- // return;
- //}
-
- SharingContentIsOnFeedback.FireUpdate();
- ReceivingContent.FireUpdate();
- try
- {
-
- // Update the share status of the meeting info
- if (MeetingInfo == null)
- {
- MeetingInfo = new MeetingInfo("", "", "", "", GetSharingStatus(), GetIsHostMyself(), true, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
- return;
- }
-
- var meetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, Participants.Host != null ? Participants.Host.Name : "None",
- MeetingInfo.Password, GetSharingStatus(), GetIsHostMyself(), MeetingInfo.IsSharingMeeting, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
- MeetingInfo = meetingInfo;
- }
- catch (Exception e)
- {
- Debug.Console(1, this, "Error processing state property update. {0}", e.Message);
- Debug.Console(2, this, e.StackTrace);
- MeetingInfo = new MeetingInfo("", "", "", "", "None", false, false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, false);
- }
- }
-
- ///
- /// Subscribes to the PropertyChanged events on the state objects and fires the corresponding feedbacks.
- ///
- private void SetUpFeedbackActions()
- {
- // Set these up initially.
- SetUpCallFeedbackActions();
-
- Configuration.Audio.Output.PropertyChanged += (o, a) =>
- {
- if (a.PropertyName == "Volume")
- {
- VolumeLevelFeedback.FireUpdate();
- MuteFeedback.FireUpdate();
- }
- };
-
- Configuration.Call.Microphone.PropertyChanged += (o, a) =>
- {
- if (a.PropertyName == "Mute")
- {
- PrivacyModeIsOnFeedback.FireUpdate();
- }
- };
-
- Configuration.Video.PropertyChanged += (o, a) =>
- {
- if (a.PropertyName == "HideConfSelfVideo")
- {
- SelfviewIsOnFeedback.FireUpdate();
- }
- };
- Configuration.Video.Camera.PropertyChanged += (o, a) =>
- {
- if (a.PropertyName == "SelectedId")
- {
- if (Cameras == null)
- {
- return;
- }
-
- var camera = Cameras.FirstOrDefault(c => c.Key.IndexOf(Configuration.Video.Camera.SelectedId, StringComparison.OrdinalIgnoreCase) > -1);
- if (camera != null)
- {
- Debug.Console(1, this, "Camera selected with key: '{0}'", camera.Key);
-
- SelectedCamera = camera;
-
- if (CameraIsMutedFeedback.BoolValue)
- {
- CameraMuteOff();
- }
- }
- else
- {
- Debug.Console(1, this, "No camera found with key: '{0}'", Configuration.Video.Camera.SelectedId);
- }
- }
- };
-
- Configuration.Call.Camera.PropertyChanged += (o, a) =>
- {
- Debug.Console(1, this, "Configuration.Call.Camera.PropertyChanged: {0}", a.PropertyName);
-
- if (a.PropertyName != "Mute") return;
-
- CameraIsOffFeedback.FireUpdate();
- CameraAutoModeIsOnFeedback.FireUpdate();
- };
-
- Configuration.Call.Layout.PropertyChanged += (o, a) =>
- {
- switch (a.PropertyName)
- {
- case "Position":
- {
- ComputeSelfviewPipPositionStatus();
-
- SelfviewPipPositionFeedback.FireUpdate();
-
- break;
- }
- case "ShareThumb":
- {
- ContentSwappedWithThumbnailFeedback.FireUpdate();
- OnLayoutInfoChanged();
- break;
- }
- case "Style":
- {
- LocalLayoutFeedback.FireUpdate();
- OnLayoutInfoChanged();
- break;
- }
- case "Size":
- {
- // TODO: #714 [ ] SetupFeedbackActions >> Size
- ComputeSelfviewPipSizeStatus();
-
- SelfviewPipSizeFeedback.FireUpdate();
-
- break;
- }
- }
- };
-
- Configuration.Call.Lock.PropertyChanged += (o, a) =>
- {
- if (a.PropertyName == "Enable")
- {
- MeetingIsLockedFeedback.FireUpdate();
- MeetingInfo = new MeetingInfo
- (
- MeetingInfo.Id,
- MeetingInfo.Name,
- MeetingInfo.Host,
- MeetingInfo.Password,
- GetSharingStatus(),
- MeetingInfo.IsHost,
- MeetingInfo.IsSharingMeeting,
- MeetingInfo.WaitingForHost,
- MeetingIsLockedFeedback.BoolValue,
- MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord
- );
- }
- };
-
- // This is to deal with incorrect object structure coming back from the Zoom Room on v 5.6.3
- Configuration.Client.Call.Layout.PropertyChanged += (o, a) =>
- {
- switch (a.PropertyName)
- {
- case "Position":
- {
- ComputeSelfviewPipPositionStatus();
-
- SelfviewPipPositionFeedback.FireUpdate();
-
- break;
- }
- case "ShareThumb":
- {
- ContentSwappedWithThumbnailFeedback.FireUpdate();
- OnLayoutInfoChanged();
- break;
- }
- case "Style":
- {
- LocalLayoutFeedback.FireUpdate();
- OnLayoutInfoChanged();
- break;
- }
- }
- };
-
-
- Status.Sharing.PropertyChanged += (o, a) =>
- {
- OnShareInfoChanged(Status.Sharing);
- SharingSourceFeedback.FireUpdate();
- switch (a.PropertyName)
- {
- case "password":
- break;
- case "isSharingBlackMagic":
- {
- Debug.Console(2, this, "Updating sharing status: {0}", a.PropertyName);
-
- SharingContentIsOnFeedback.FireUpdate();
- if (MeetingInfo == null)
- {
- //Ignoring for now, as the CallInfo return will create the appropriate value
- return;
- }
- // Update the share status of the meeting info
- var meetingInfo = new MeetingInfo(MeetingInfo.Id,
- MeetingInfo.Name,
- MeetingInfo.Host,
- MeetingInfo.Password,
- GetSharingStatus(),
- GetIsHostMyself(),
- MeetingInfo.IsSharingMeeting,
- MeetingInfo.WaitingForHost,
- MeetingIsLockedFeedback.BoolValue,
- MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
- MeetingInfo = meetingInfo;
- break;
- }
- }
- };
-
- Status.PhoneCall.PropertyChanged += (o, a) =>
- {
- switch (a.PropertyName)
- {
- case "IsIncomingCall":
- Debug.Console(1, this, "Incoming Phone Call: {0}", Status.PhoneCall.IsIncomingCall);
- break;
- case "PeerDisplayName":
- Debug.Console(1, this, "Peer Display Name: {0}", Status.PhoneCall.PeerDisplayName);
- CallerIdNameFeedback.FireUpdate();
- break;
- case "PeerNumber":
- Debug.Console(1, this, "Peer Number: {0}", Status.PhoneCall.PeerNumber);
- CallerIdNumberFeedback.FireUpdate();
- break;
- case "OffHook":
- Debug.Console(1, this, "Phone is OffHook: {0}", Status.PhoneCall.OffHook);
- PhoneOffHookFeedback.FireUpdate();
- break;
- }
- };
-
- Status.Layout.PropertyChanged += (o, a) =>
- {
- Debug.Console(1, this, "Status.Layout.PropertyChanged a.PropertyName: {0}", a.PropertyName);
- switch (a.PropertyName.ToLower())
- {
- case "can_Switch_speaker_view":
- case "can_switch_wall_view":
- case "can_switch_strip_view":
- case "video_type":
- case "can_switch_share_on_all_screens":
- {
- ComputeAvailableLayouts();
- break;
- }
- case "is_in_first_page":
- {
- LayoutViewIsOnFirstPageFeedback.FireUpdate();
- break;
- }
- case "is_in_last_page":
- {
- LayoutViewIsOnLastPageFeedback.FireUpdate();
- break;
- }
- case "can_switch_floating_share_content":
- {
- CanSwapContentWithThumbnailFeedback.FireUpdate();
- break;
- }
- }
- OnLayoutInfoChanged();
- };
-
- Status.NumberOfScreens.PropertyChanged += (o, a) =>
- {
- switch (a.PropertyName)
- {
- case "NumberOfScreens":
- {
- NumberOfScreensFeedback.FireUpdate();
- break;
- }
- }
- };
- }
-
- private void SetUpDirectory()
- {
- DirectoryRoot = new CodecDirectory() {ResultsFolderId = "root"};
-
- CurrentDirectoryResultIsNotDirectoryRoot = new BoolFeedback(() => CurrentDirectoryResult.ResultsFolderId != "root");
-
- CurrentDirectoryResult = DirectoryRoot;
-
- DirectoryBrowseHistory = new List();
- DirectoryBrowseHistoryStack = new Stack();
- }
-
- private void SetUpRouting()
- {
- // Set up input ports
- CreateOsdSource();
- InputPorts.Add(CodecOsdIn);
-
- // Set up output ports
- OutputPorts.Add(Output1);
- OutputPorts.Add(Output2);
- }
-
- ///
- /// Creates the fake OSD source, and connects it's AudioVideo output to the CodecOsdIn input
- /// to enable routing
- ///
- private void CreateOsdSource()
- {
- OsdSource = new DummyRoutingInputsDevice(Key + "[osd]");
- DeviceManager.AddDevice(OsdSource);
- var tl = new TieLine(OsdSource.AudioVideoOutputPort, CodecOsdIn);
- TieLineCollection.Default.Add(tl);
-
- //foreach(var input in Status.Video.
- }
-
- ///
- /// Starts the HTTP feedback server and syncronizes state of codec
- ///
- ///
- public override bool CustomActivate()
- {
- CrestronConsole.AddNewConsoleCommand(SetCommDebug, "SetCodecCommDebug", "0 for Off, 1 for on",
- ConsoleAccessLevelEnum.AccessOperator);
- if (!_props.DisablePhonebookAutoDownload)
- {
- CrestronConsole.AddNewConsoleCommand(s => SendText("zCommand Phonebook List Offset: 0 Limit: 10000"),
- "GetZoomRoomContacts", "Triggers a refresh of the codec phonebook",
- ConsoleAccessLevelEnum.AccessOperator);
- }
-
- CrestronConsole.AddNewConsoleCommand(s => GetBookings(), "GetZoomRoomBookings",
- "Triggers a refresh of the booking data for today", ConsoleAccessLevelEnum.AccessOperator);
-
-
-
- return base.CustomActivate();
- }
-
- #region Overrides of Device
-
- public override void Initialize()
- {
- var socket = Communication as ISocketStatus;
- if (socket != null)
- {
- socket.ConnectionChange += socket_ConnectionChange;
- }
-
- CommDebuggingIsOn = false;
-
- Communication.Connect();
-
- CommunicationMonitor.Start();
- }
-
- #endregion
-
- public void SetCommDebug(string s)
- {
- if (s == "1")
- {
- CommDebuggingIsOn = true;
- Debug.Console(1, this, "Comm Debug Enabled.");
- }
- else
- {
- CommDebuggingIsOn = false;
- Debug.Console(1, this, "Comm Debug Disabled.");
- }
- }
-
- private void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
- {
- Debug.Console(1, this, "Socket status change {0}", e.Client.ClientStatus);
- if (e.Client.IsConnected)
- {
- }
- else
- {
- _syncState.CodecDisconnected();
- PhonebookSyncState.CodecDisconnected();
- }
- }
-
- public void SendText(string command)
- {
- if (_meetingPasswordRequired)
- {
- Debug.Console(2, this, "Blocking commands to ZoomRoom while waiting for user to enter meeting password");
- return;
- }
-
- if (_waitingForUserToAcceptOrRejectIncomingCall)
- {
- Debug.Console(2, this, "Blocking commands to ZoomRoom while waiting for user to accept or reject incoming call");
- return;
- }
-
- if (CommDebuggingIsOn)
- {
- Debug.Console(1, this, "Sending: '{0}'", command);
- }
-
- Communication.SendText(command + SendDelimiter);
- }
-
- ///
- /// Gathers responses and enqueues them.
- ///
- ///
- ///
- private void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
- {
- //Debug.Console(0, this, "Port_LineReceived");
-
- if (args.Delimiter != JsonDelimiter)
- {
-// Debug.Console(0, this,
-//@"Non JSON response:
-//Delimiter: {0}
-//{1}", ComTextHelper.GetDebugText(args.Delimiter), args.Text);
- ProcessNonJsonResponse(args.Text);
- return;
- }
- else
- {
-// Debug.Console(0, this,
-//@"JSON response:
-//Delimiter: {0}
-//{1}", ComTextHelper.GetDebugText(args.Delimiter), args.Text);
- _receiveQueue.Enqueue(new ProcessStringMessage(args.Text, DeserializeResponse));
- //_receiveQueue.Enqueue(new ProcessStringMessage(args.Text, ProcessMessage));
- }
- }
-
- ///
- /// Queues the initial queries to be sent upon connection
- ///
- private void SetUpSyncQueries()
- {
- // zStatus
- _syncState.AddQueryToQueue("zStatus Call Status");
- _syncState.AddQueryToQueue("zStatus Audio Input Line");
- _syncState.AddQueryToQueue("zStatus Audio Output Line");
- _syncState.AddQueryToQueue("zStatus Video Camera Line");
- _syncState.AddQueryToQueue("zStatus Video Optimizable");
- _syncState.AddQueryToQueue("zStatus Capabilities");
- _syncState.AddQueryToQueue("zStatus Sharing");
- _syncState.AddQueryToQueue("zStatus CameraShare");
- _syncState.AddQueryToQueue("zStatus Call Layout");
- _syncState.AddQueryToQueue("zStatus Call ClosedCaption Available");
- _syncState.AddQueryToQueue("zStatus NumberOfScreens");
-
- // zConfiguration
-
- _syncState.AddQueryToQueue("zConfiguration Call Sharing optimize_video_sharing");
- _syncState.AddQueryToQueue("zConfiguration Call Microphone Mute");
- _syncState.AddQueryToQueue("zConfiguration Call Camera Mute");
- _syncState.AddQueryToQueue("zConfiguration Audio Input SelectedId");
- _syncState.AddQueryToQueue("zConfiguration Audio Input is_sap_disabled");
- _syncState.AddQueryToQueue("zConfiguration Audio Input reduce_reverb");
- _syncState.AddQueryToQueue("zConfiguration Audio Input volume");
- _syncState.AddQueryToQueue("zConfiguration Audio Output selectedId");
- _syncState.AddQueryToQueue("zConfiguration Audio Output volume");
- _syncState.AddQueryToQueue("zConfiguration Video hide_conf_self_video");
- _syncState.AddQueryToQueue("zConfiguration Video Camera selectedId");
- _syncState.AddQueryToQueue("zConfiguration Video Camera Mirror");
- _syncState.AddQueryToQueue("zConfiguration Client appVersion");
- _syncState.AddQueryToQueue("zConfiguration Client deviceSystem");
- _syncState.AddQueryToQueue("zConfiguration Call Layout ShareThumb");
- _syncState.AddQueryToQueue("zConfiguration Call Layout Style");
- _syncState.AddQueryToQueue("zConfiguration Call Layout Size");
- _syncState.AddQueryToQueue("zConfiguration Call Layout Position");
- _syncState.AddQueryToQueue("zConfiguration Call Lock Enable");
- _syncState.AddQueryToQueue("zConfiguration Call MuteUserOnEntry Enable");
- _syncState.AddQueryToQueue("zConfiguration Call ClosedCaption FontSize ");
- _syncState.AddQueryToQueue("zConfiguration Call ClosedCaption Visible");
-
- // zCommand
-
- if (!_props.DisablePhonebookAutoDownload)
- {
- _syncState.AddQueryToQueue("zCommand Phonebook List Offset: 0 Limit: 10000");
- }
-
- _syncState.AddQueryToQueue("zCommand Bookings List");
- _syncState.AddQueryToQueue("zCommand Call ListParticipants");
- _syncState.AddQueryToQueue("zCommand Call Info");
-
-
- _syncState.StartSync();
- }
-
- private void SetupSession()
- {
- // disable echo of commands
- SendText("echo off");
- // switch to json format
- // set feedback exclusions
- // Currently the feedback exclusions don't work when using the API in JSON response mode
- // But leave these here in case the API gets updated in the future
- // These may work as of 5.9.4
-
- // In 5.9.4 we're getting sent an AddedContact message for every contact in the phonebook on connect, which is redunant and way too much data
- // We want to exclude these messages right away until after we've retrieved the entire phonebook and then we can re-enable them
- SendText("zFeedback Register Op: ex Path: /Event/Phonebook/AddedContact");
-
- SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/callin_country_list");
- SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/callout_country_list");
- SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/toll_free_callinLlist");
-
- SendText("zStatus SystemUnit");
- }
-
- ///
- /// Removes the feedback exclusion for added contacts
- ///
- private void ResubscribeForAddedContacts()
- {
- SendText("zFeedback Register Op: in Path: /Event/Phonebook/AddedContact");
- }
-
- ///
- /// Processes non-JSON responses as their are received
- ///
- ///
- private void ProcessNonJsonResponse(string response)
- {
- if (response.Contains("client_loop: send disconnect: Broken pipe"))
- {
- Debug.Console(1, this, Debug.ErrorLogLevel.Error,
- "Zoom Room Controller or App connected. Essentials will NOT control the Zoom Room until it is disconnected.");
-
- return;
- }
-
- if (!_syncState.InitialSyncComplete)
- {
- if(response.ToLower().Contains("*r login successful"))
- {
- _syncState.LoginResponseReceived();
-
- SendText("format json");
-
- SetupSession();
- }
-
- //switch (response.Trim().ToLower()) // remove the whitespace
- //{
- // case "*r login successful":
- // {
- // _syncState.LoginMessageReceived();
-
- // //// Fire up a thread to send the intial commands.
- // //CrestronInvoke.BeginInvoke(o =>
- // //{
- // // disable echo of commands
- // SendText("echo off");
- // // switch to json format
- // SendText("format json");
- // // set feedback exclusions
- // // Currently the feedback exclusions don't work when using the API in JSON response mode
- // // But leave these here in case the API gets updated in the future
- // // These may work as of 5.9.4
- // if (_props.DisablePhonebookAutoDownload)
- // {
- // SendText("zFeedback Register Op: ex Path: /Event/Phonebook/AddedContact");
- // }
- // SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/callin_country_list");
- // SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/callout_country_list");
- // SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/toll_free_callinLlist");
-
- // //});
-
- // break;
- // }
- //}
- }
- }
-
- ///
- /// Processes messages as they are dequeued
- ///
- ///
- private void ProcessMessage(string message)
- {
- // Counts the curly braces
- if (message.Contains("client_loop: send disconnect: Broken pipe"))
- {
- Debug.Console(1, this, Debug.ErrorLogLevel.Error,
- "Zoom Room Controller or App connected. Essentials will NOT control the Zoom Room until it is disconnected.");
-
- return;
- }
-
- if (message.Contains('{'))
- {
- _jsonCurlyBraceCounter++;
- }
-
- if (message.Contains('}'))
- {
- _jsonCurlyBraceCounter--;
- }
-
- //Debug.Console(2, this, "JSON Curly Brace Count: {0}", _jsonCurlyBraceCounter);
-
- if (!_jsonFeedbackMessageIsIncoming && message.Trim('\x20') == "{" + EchoDelimiter)
- // Check for the beginning of a new JSON message
- {
- _jsonFeedbackMessageIsIncoming = true;
- _jsonCurlyBraceCounter = 1; // reset the counter for each new message
-
- _jsonMessage = new StringBuilder();
-
- _jsonMessage.Append(message);
-
- if (CommDebuggingIsOn)
- {
- Debug.Console(2, this, "Incoming JSON message...");
- }
-
- return;
- }
- if (_jsonFeedbackMessageIsIncoming && message.Trim('\x20') == "}" + EchoDelimiter)
- // Check for the end of a JSON message
- {
- _jsonMessage.Append(message);
-
- if (_jsonCurlyBraceCounter == 0)
- {
- _jsonFeedbackMessageIsIncoming = false;
-
- if (CommDebuggingIsOn)
- {
- Debug.Console(2, this, "Complete JSON Received:\n{0}", _jsonMessage.ToString());
- }
-
- // Forward the complete message to be deserialized
- DeserializeResponse(_jsonMessage.ToString());
- }
-
- //JsonMessage = new StringBuilder();
- return;
- }
-
- // NOTE: This must happen after the above conditions have been checked
- // Append subsequent partial JSON fragments to the string builder
- if (_jsonFeedbackMessageIsIncoming)
- {
- _jsonMessage.Append(message);
-
- //Debug.Console(1, this, "Building JSON:\n{0}", JsonMessage.ToString());
- return;
- }
-
- if (CommDebuggingIsOn)
- {
- Debug.Console(1, this, "Non-JSON response: '{0}'", message);
- }
-
- _jsonCurlyBraceCounter = 0; // reset on non-JSON response
-
- if (!_syncState.InitialSyncComplete)
- {
- switch (message.Trim().ToLower()) // remove the whitespace
- {
- case "*r login successful":
- {
- _syncState.LoginResponseReceived();
-
-
- // Fire up a thread to send the intial commands.
- CrestronInvoke.BeginInvoke(o =>
- {
- // Currently the feedback exclusions don't work when using the API in JSON response mode
- // But leave these here in case the API gets updated in the future
-
-
- Thread.Sleep(100);
- // disable echo of commands
- SendText("echo off");
- Thread.Sleep(100);
- // set feedback exclusions
- SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/callin_country_list");
- Thread.Sleep(100);
- SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/callout_country_list");
- Thread.Sleep(100);
- SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/toll_free_callinLlist");
- Thread.Sleep(100);
-
- if (_props.DisablePhonebookAutoDownload)
- {
- SendText("zFeedback Register Op: ex Path: /Event/Phonebook/AddedContact");
- }
- // switch to json format
- SendText("format json");
- });
-
- break;
- }
- }
- }
- }
-
- ///
- /// Deserializes a JSON formatted response
- ///
- ///
- private void DeserializeResponse(string response)
- {
- try
- {
- var trimmedResponse = response.Trim();
-
- if (trimmedResponse.Length <= 0)
- {
- return;
- }
-
- var message = JObject.Parse(trimmedResponse);
-
- if (!_syncState.FirstJsonResponseWasReceived)
- {
- _syncState.ReceivedFirstJsonResponse();
- }
-
- var eType =
- (eZoomRoomResponseType)
- Enum.Parse(typeof (eZoomRoomResponseType), message["type"].Value(), true);
-
- var topKey = message["topKey"].Value();
-
- var responseObj = message[topKey];
-
- Debug.Console(1, this, "{0} Response Received. topKey: '{1}'\n{2}", eType, topKey, responseObj.ToString().Replace("\n", CrestronEnvironment.NewLine));
-
- switch (eType)
- {
- case eZoomRoomResponseType.zConfiguration:
- {
- switch (topKey.ToLower())
- {
- case "call":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Configuration.Call);
-
- break;
- }
- case "audio":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Configuration.Audio);
-
- break;
- }
- case "video":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Configuration.Video);
-
- break;
- }
- case "client":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Configuration.Client);
-
- break;
- }
- default:
- {
- break;
- }
- }
- break;
- }
- case eZoomRoomResponseType.zCommand:
- {
- switch (topKey.ToLower())
- {
- case "inforesult":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.Call.Info);
- break;
- }
- case "phonebooklistresult":
- {
- // This result will always be the complete contents of the directory and never
- // A subset of the results via a search
-
- // Clear out any existing data
- Status.Phonebook = new zStatus.Phonebook();
-
- JsonConvert.PopulateObject(responseObj.ToString(), Status.Phonebook);
-
- UpdateDirectory();
-
- break;
- }
- case "listparticipantsresult":
- {
- Debug.Console(1, this, "JTokenType: {0}", responseObj.Type);
-
- switch (responseObj.Type)
- {
- case JTokenType.Array:
- Status.Call.Participants =
- JsonConvert.DeserializeObject>(
- responseObj.ToString());
- break;
- case JTokenType.Object:
- {
- // this is a single participant event notification
-
- var participant =
- JsonConvert.DeserializeObject(
- responseObj.ToString());
-
- if (participant != null)
- {
- Debug.Console(1, this,
- "[DeserializeResponse] zCommands.listparticipantresult - participant.event: {0} **********************************",
- participant.Event);
- Debug.Console(1, this,
- "[DeserializeResponse] zCommands.listparticipantresult - participant.event: {0} - UserId: {1} Name: {2} IsHost: {3}",
- participant.Event, participant.UserId, participant.UserName, participant.IsHost);
-
- switch (participant.Event)
- {
- case "ZRCUserChangedEventUserInfoUpdated":
- case "ZRCUserChangedEventLeftMeeting":
- {
- var existingParticipant =
- Status.Call.Participants.FirstOrDefault(
- p => p.UserId.Equals(participant.UserId));
-
- if (existingParticipant != null)
- {
- switch (participant.Event)
- {
- case "ZRCUserChangedEventLeftMeeting":
- Status.Call.Participants.Remove(existingParticipant);
- break;
- case "ZRCUserChangedEventUserInfoUpdated":
- JsonConvert.PopulateObject(responseObj.ToString(),
- existingParticipant);
- break;
- }
- }
- }
- break;
- case "ZRCUserChangedEventJoinedMeeting":
- {
- var existingParticipant =
- Status.Call.Participants.FirstOrDefault(p => p.UserId.Equals(participant.UserId));
-
- if (existingParticipant != null)
- {
- Debug.Console(1, this,
- "[DeserializeResponse] zCommands.listparticipantresult - participant.event: {0} ...updating matching UserId participant with UserId: {1} UserName: {2}",
- participant.Event, participant.UserId, participant.UserName);
-
- JsonConvert.PopulateObject(responseObj.ToString(), existingParticipant);
- }
- else
- {
- Debug.Console(1, this,
- "[DeserializeResponse] zCommands.listparticipantresult - participant.event: {0} ...adding participant with UserId: {1} UserName: {2}",
- participant.Event, participant.UserId, participant.UserName);
-
- Status.Call.Participants.Add(participant);
- }
-
- break;
- }
- }
-
- Debug.Console(1, this,
- "[DeserializeResponse] zCommands.listparticipantresult - participant.event: {0} ***********************************",
- participant.Event);
- }
- }
- break;
- }
-
- var participants =
- zCommand.ListParticipant.GetGenericParticipantListFromParticipantsResult(
- Status.Call.Participants);
-
- Participants.CurrentParticipants = participants;
-
- // Update the share status of the meeting info
- var meetingInfo = new MeetingInfo(
- MeetingInfo.Id,
- MeetingInfo.Name,
- Participants.Host.Name,
- MeetingInfo.Password,
- GetSharingStatus(),
- GetIsHostMyself(),
- MeetingInfo.IsSharingMeeting,
- MeetingInfo.WaitingForHost,
- MeetingIsLockedFeedback.BoolValue,
- MeetingIsRecordingFeedback.BoolValue,
- Status.Call.CallRecordInfo.AllowRecord
- );
- MeetingInfo = meetingInfo;
-
- PrintCurrentCallParticipants();
-
- break;
- }
- default:
- {
- break;
- }
- }
- break;
- }
- case eZoomRoomResponseType.zEvent:
- {
- switch (topKey.ToLower())
- {
- case "phonebook":
- {
- zStatus.Contact contact = new zStatus.Contact();
-
- if (responseObj["Updated Contact"] != null)
- {
- contact = responseObj["Updated Contact"].ToObject();
- }
- else if (responseObj["Added Contact"] != null)
- {
- contact = responseObj["Added Contact"].ToObject();
- }
-
- var existingContactIndex = Status.Phonebook.Contacts.FindIndex(c => c.Jid.Equals(contact.Jid));
-
- if (existingContactIndex > 0)
- {
- Status.Phonebook.Contacts[existingContactIndex] = contact;
- }
- else
- {
- Status.Phonebook.Contacts.Add(contact);
- }
-
- if(contactsDebounceTimer == null)
- {
- contactsDebounceTimer = new CTimer(o => UpdateDirectory(), 2000);
- }
- else
- {
- contactsDebounceTimer.Reset();
- }
-
- break;
- }
- case "bookingslistresult":
- {
- if (!_syncState.InitialSyncComplete)
- {
- _syncState.LastQueryResponseReceived();
- }
-
- var codecBookings = JsonConvert.DeserializeObject>(
- responseObj.ToString());
-
- if (codecBookings != null && codecBookings.Count > 0)
- {
- CodecSchedule.Meetings = zCommand.GetGenericMeetingsFromBookingResult(
- codecBookings, CodecSchedule.MeetingWarningMinutes);
- }
- else
- {
- //need to clear the list if it's empty
- CodecSchedule.Meetings = new List