diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasParticipants.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasParticipants.cs
index f6d32149..d8c0c55c 100644
--- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasParticipants.cs
+++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasParticipants.cs
@@ -1,100 +1,102 @@
using System;
using System.Collections.Generic;
+using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
{
- ///
- /// Describes a device that has call participants
- ///
- public interface IHasParticipants
- {
- CodecParticipants Participants { get; }
- }
+ ///
+ /// Describes a device that has call participants
+ ///
+ public interface IHasParticipants
+ {
+ CodecParticipants Participants { get; }
+ }
- ///
- /// Describes the ability to mute and unmute a participant's video in a meeting
- ///
- public interface IHasParticipantVideoMute:IHasParticipants
- {
- void MuteVideoForParticipant(int userId);
- void UnmuteVideoForParticipant(int userId);
- void ToggleVideoForParticipant(int userId);
- }
+ ///
+ /// Describes the ability to mute and unmute a participant's video in a meeting
+ ///
+ public interface IHasParticipantVideoMute : IHasParticipants
+ {
+ void MuteVideoForParticipant(int userId);
+ void UnmuteVideoForParticipant(int userId);
+ void ToggleVideoForParticipant(int userId);
+ }
- ///
- /// Describes the ability to mute and unmute a participant's audio in a meeting
- ///
- public interface IHasParticipantAudioMute : IHasParticipantVideoMute
- {
- void MuteAudioForParticipant(int userId);
- void UnmuteAudioForParticipant(int userId);
- void ToggleAudioForParticipant(int userId);
- }
+ ///
+ /// Describes the ability to mute and unmute a participant's audio in a meeting
+ ///
+ public interface IHasParticipantAudioMute : IHasParticipantVideoMute
+ {
+ void MuteAudioForParticipant(int userId);
+ void UnmuteAudioForParticipant(int userId);
+ void ToggleAudioForParticipant(int userId);
+ }
- ///
- /// Describes the ability to pin and unpin a participant in a meeting
- ///
- public interface IHasParticipantPinUnpin : IHasParticipants
- {
- IntFeedback NumberOfScreensFeedback { get; }
- int ScreenIndexToPinUserTo { get; }
+ ///
+ /// Describes the ability to pin and unpin a participant in a meeting
+ ///
+ public interface IHasParticipantPinUnpin : IHasParticipants
+ {
+ IntFeedback NumberOfScreensFeedback { get; }
+ int ScreenIndexToPinUserTo { get; }
- void PinParticipant(int userId, int screenIndex);
- void UnPinParticipant(int userId);
- void ToggleParticipantPinState(int userId, int screenIndex);
- }
+ void PinParticipant(int userId, int screenIndex);
+ void UnPinParticipant(int userId);
+ void ToggleParticipantPinState(int userId, int screenIndex);
+ }
- public class CodecParticipants
- {
- private List _currentParticipants;
-
- public List CurrentParticipants {
- get { return _currentParticipants; }
- set
- {
- _currentParticipants = value;
- OnParticipantsChanged();
- }
- }
+ public class CodecParticipants
+ {
+ private List _currentParticipants;
- public event EventHandler ParticipantsListHasChanged;
+ public List CurrentParticipants
+ {
+ get { return _currentParticipants; }
+ set
+ {
+ _currentParticipants = value;
+ OnParticipantsChanged();
+ }
+ }
- public CodecParticipants()
- {
- _currentParticipants = new List();
- }
+ public event EventHandler ParticipantsListHasChanged;
- public void OnParticipantsChanged()
- {
- var handler = ParticipantsListHasChanged;
+ public CodecParticipants()
+ {
+ _currentParticipants = new List();
+ }
- if (handler == null) return;
+ public void OnParticipantsChanged()
+ {
+ var handler = ParticipantsListHasChanged;
- handler(this, new EventArgs());
- }
- }
+ if (handler == null) return;
- ///
- /// Represents a call participant
- ///
- public class Participant
- {
- public int UserId { get; set; }
- public bool IsHost { get; set; }
- public string Name { get; set; }
- public bool CanMuteVideo { get; set; }
- public bool CanUnmuteVideo { get; set; }
- public bool VideoMuteFb { get; set; }
- public bool AudioMuteFb { get; set; }
- public bool HandIsRaisedFb { get; set; }
- public bool IsPinnedFb { get; set; }
- public int ScreenIndexIsPinnedToFb { get; set; }
+ handler(this, new EventArgs());
+ }
+ }
- public Participant()
- {
- // Initialize to -1 (no screen)
- ScreenIndexIsPinnedToFb = -1;
- }
- }
+ ///
+ /// Represents a call participant
+ ///
+ public class Participant
+ {
+ public int UserId { get; set; }
+ public bool IsHost { get; set; }
+ public string Name { get; set; }
+ public bool CanMuteVideo { get; set; }
+ public bool CanUnmuteVideo { get; set; }
+ public bool VideoMuteFb { get; set; }
+ public bool AudioMuteFb { get; set; }
+ public bool HandIsRaisedFb { get; set; }
+ public bool IsPinnedFb { get; set; }
+ public int ScreenIndexIsPinnedToFb { get; set; }
+
+ public Participant()
+ {
+ // Initialize to -1 (no screen)
+ ScreenIndexIsPinnedToFb = -1;
+ }
+ }
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs
index 5df53635..5473cbb8 100644
--- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs
+++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs
@@ -3,13 +3,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
-using Crestron.SimplSharp.Reflection;
using Crestron.SimplSharpPro.CrestronThread;
using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
-using PepperDash.Core.Intersystem.Tokens;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
@@ -26,17 +24,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public class ZoomRoom : VideoCodecBase, IHasCodecSelfView, IHasDirectoryHistoryStack, ICommunicationMonitor,
IRouting,
IHasScheduleAwareness, IHasCodecCameras, IHasParticipants, IHasCameraOff, IHasCameraMute, IHasCameraAutoMode,
- IHasFarEndContentStatus, IHasSelfviewPosition, IHasPhoneDialing, IHasZoomRoomLayouts, IHasParticipantPinUnpin, IHasParticipantAudioMute, IHasSelfviewSize
+ IHasFarEndContentStatus, IHasSelfviewPosition, IHasPhoneDialing, IHasZoomRoomLayouts, IHasParticipantPinUnpin,
+ IHasParticipantAudioMute, IHasSelfviewSize
{
private const long MeetingRefreshTimer = 60000;
private const uint DefaultMeetingDurationMin = 30;
private const string Delimiter = "\x0D\x0A";
- private readonly GenericQueue _receiveQueue;
- //private readonly CrestronQueue _receiveQueue;
+ private readonly GenericQueue _receiveQueue;
+ //private readonly CrestronQueue _receiveQueue;
- //private readonly Thread _receiveThread;
+ //private readonly Thread _receiveThread;
private readonly ZoomRoomSyncState _syncState;
public bool CommDebuggingIsOn;
@@ -54,7 +53,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{
_props = JsonConvert.DeserializeObject(config.Properties.ToString());
- _receiveQueue = new GenericQueue(Key + "-rxQueue", Thread.eThreadPriority.MediumPriority, 512);
+ _receiveQueue = new GenericQueue(Key + "-rxQueue", Thread.eThreadPriority.MediumPriority, 512);
Communication = comm;
@@ -83,7 +82,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
PhonebookSyncState = new CodecPhonebookSyncState(Key + "--PhonebookSync");
- PortGather = new CommunicationGather(Communication, "\x0A") { IncludeDelimiter = true };
+ PortGather = new CommunicationGather(Communication, "\x0A") {IncludeDelimiter = true};
PortGather.LineReceived += Port_LineReceived;
CodecOsdIn = new RoutingInputPort(RoutingPortNames.CodecOsd,
@@ -94,9 +93,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, null, this);
- Output2 = new RoutingOutputPort(RoutingPortNames.AnyVideoOut,
- eRoutingSignalType.Video,
- eRoutingPortConnectionType.DisplayPort, null, this);
+ Output2 = new RoutingOutputPort(RoutingPortNames.AnyVideoOut,
+ eRoutingSignalType.Video,
+ eRoutingPortConnectionType.DisplayPort, null, this);
SelfviewIsOnFeedback = new BoolFeedback(SelfViewIsOnFeedbackFunc);
@@ -114,7 +113,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
// TODO: #714 [ ] SelfviewPipSizeFeedback
SelfviewPipSizeFeedback = new StringFeedback(SelfviewPipSizeFeedbackFunc);
-
+
SetUpFeedbackActions();
Cameras = new List();
@@ -123,7 +122,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
Participants = new CodecParticipants();
- SupportsCameraOff = true; // Always allow turning off the camera for zoom calls?
+ SupportsCameraOff = true; // Always allow turning off the camera for zoom calls?
SupportsCameraAutoMode = _props.SupportsCameraAutoMode;
PhoneOffHookFeedback = new BoolFeedback(PhoneOffHookFeedbackFunc);
@@ -138,7 +137,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
ContentSwappedWithThumbnailFeedback = new BoolFeedback(ContentSwappedWithThumbnailFeedbackFunc);
NumberOfScreensFeedback = new IntFeedback(NumberOfScreensFeedbackFunc);
-
}
public CommunicationGather PortGather { get; private set; }
@@ -157,18 +155,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{
get
{
- return () =>
- {
- var scaledVol = CrestronEnvironment.ScaleWithLimits(Configuration.Audio.Output.Volume, 100, 0, 65535, 0);
+ 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
- }
+ 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;
- };
+ return scaledVol;
+ };
}
}
@@ -266,7 +265,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public RoutingInputPort CodecOsdIn { get; private set; }
public RoutingOutputPort Output1 { get; private set; }
- public RoutingOutputPort Output2 { get; private set; }
+ public RoutingOutputPort Output2 { get; private set; }
#region ICommunicationMonitor Members
@@ -366,16 +365,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public CodecDirectory CurrentDirectoryResult
{
get { return _currentDirectoryResult; }
- private set
- {
- _currentDirectoryResult = value;
+ private set
+ {
+ _currentDirectoryResult = value;
- Debug.Console(2, this, "CurrentDirectoryResult Updated. ResultsFolderId: {0}", _currentDirectoryResult.ResultsFolderId);
+ Debug.Console(2, this, "CurrentDirectoryResult Updated. ResultsFolderId: {0}",
+ _currentDirectoryResult.ResultsFolderId);
- CurrentDirectoryResultIsNotDirectoryRoot.FireUpdate();
+ CurrentDirectoryResultIsNotDirectoryRoot.FireUpdate();
- OnDirectoryResultReturned(_currentDirectoryResult);
- }
+ OnDirectoryResultReturned(_currentDirectoryResult);
+ }
}
public CodecPhonebookSyncState PhonebookSyncState { get; private set; }
@@ -390,12 +390,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
DirectoryBrowseHistoryStack.Clear();
CurrentDirectoryResult = directoryResults;
-
}
public void GetDirectoryFolderContents(string folderId)
{
- var directoryResults = new CodecDirectory { ResultsFolderId = folderId };
+ var directoryResults = new CodecDirectory {ResultsFolderId = folderId};
directoryResults.AddContactsToDirectory(
DirectoryRoot.CurrentDirectoryResults.FindAll(c => c.ParentFolderId.Equals(folderId)));
@@ -403,15 +402,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
DirectoryBrowseHistoryStack.Push(_currentDirectoryResult);
CurrentDirectoryResult = directoryResults;
-
}
public void SetCurrentDirectoryToRoot()
{
DirectoryBrowseHistoryStack.Clear();
- CurrentDirectoryResult = DirectoryRoot;
- }
+ CurrentDirectoryResult = DirectoryRoot;
+ }
public void GetDirectoryParentFolderContents()
{
@@ -422,8 +420,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
var currentDirectory = DirectoryBrowseHistoryStack.Pop();
- CurrentDirectoryResult = currentDirectory;
- }
+ CurrentDirectoryResult = currentDirectory;
+ }
public BoolFeedback CurrentDirectoryResultIsNotDirectoryRoot { get; private set; }
@@ -534,23 +532,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
switch (a.PropertyName)
{
case "Position":
- {
- ComputeSelfviewPipPositionStatus();
+ {
+ ComputeSelfviewPipPositionStatus();
- SelfviewPipPositionFeedback.FireUpdate();
+ SelfviewPipPositionFeedback.FireUpdate();
- break;
- }
+ break;
+ }
case "ShareThumb":
- {
- ContentSwappedWithThumbnailFeedback.FireUpdate();
- break;
- }
+ {
+ ContentSwappedWithThumbnailFeedback.FireUpdate();
+ break;
+ }
case "Style":
- {
- LocalLayoutFeedback.FireUpdate();
- break;
- }
+ {
+ LocalLayoutFeedback.FireUpdate();
+ break;
+ }
case "Size":
{
// TODO: #714 [ ] SetupFeedbackActions >> Size
@@ -560,36 +558,34 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
break;
}
-
}
};
- // 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();
+ // 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();
+ SelfviewPipPositionFeedback.FireUpdate();
- break;
- }
- case "ShareThumb":
- {
- ContentSwappedWithThumbnailFeedback.FireUpdate();
- break;
- }
- case "Style":
- {
- LocalLayoutFeedback.FireUpdate();
- break;
- }
-
- }
- };
+ break;
+ }
+ case "ShareThumb":
+ {
+ ContentSwappedWithThumbnailFeedback.FireUpdate();
+ break;
+ }
+ case "Style":
+ {
+ LocalLayoutFeedback.FireUpdate();
+ break;
+ }
+ }
+ };
Status.Call.Sharing.PropertyChanged += (o, a) =>
{
@@ -651,53 +647,52 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
case "can_switch_speaker_view":
case "can_switch_wall_view":
case "can_switch_share_on_all_screens":
- {
- ComputeAvailableLayouts();
- break;
- }
+ {
+ ComputeAvailableLayouts();
+ break;
+ }
case "is_in_first_page":
- {
- LayoutViewIsOnFirstPageFeedback.FireUpdate();
- break;
- }
+ {
+ LayoutViewIsOnFirstPageFeedback.FireUpdate();
+ break;
+ }
case "is_in_last_page":
- {
- LayoutViewIsOnLastPageFeedback.FireUpdate();
- break;
- }
- //case "video_type":
- // {
- // It appears as though the actual value we want to watch is Configuration.Call.Layout.Style
- // LocalLayoutFeedback.FireUpdate();
- // break;
- // }
+ {
+ LayoutViewIsOnLastPageFeedback.FireUpdate();
+ break;
+ }
+ //case "video_type":
+ // {
+ // It appears as though the actual value we want to watch is Configuration.Call.Layout.Style
+ // LocalLayoutFeedback.FireUpdate();
+ // break;
+ // }
}
};
Status.NumberOfScreens.PropertyChanged += (o, a) =>
+ {
+ switch (a.PropertyName)
{
- switch (a.PropertyName)
+ case "NumberOfScreens":
{
- case "NumberOfScreens":
- {
- NumberOfScreensFeedback.FireUpdate();
- break;
- }
+ NumberOfScreensFeedback.FireUpdate();
+ break;
}
- };
+ }
+ };
}
private void SetUpDirectory()
{
- DirectoryRoot = new CodecDirectory() { ResultsFolderId = "root" };
+ DirectoryRoot = new CodecDirectory() {ResultsFolderId = "root"};
- CurrentDirectoryResultIsNotDirectoryRoot = new BoolFeedback(() => CurrentDirectoryResult.ResultsFolderId != "root");
+ CurrentDirectoryResultIsNotDirectoryRoot = new BoolFeedback(() => CurrentDirectoryResult.ResultsFolderId != "root");
- CurrentDirectoryResult = DirectoryRoot;
+ CurrentDirectoryResult = DirectoryRoot;
DirectoryBrowseHistory = new List();
DirectoryBrowseHistoryStack = new Stack();
-
}
private void SetUpRouting()
@@ -708,7 +703,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
// Set up output ports
OutputPorts.Add(Output1);
- OutputPorts.Add(Output2);
+ OutputPorts.Add(Output2);
}
///
@@ -772,12 +767,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
if (s == "1")
{
CommDebuggingIsOn = true;
- Debug.Console(0, this, "Comm Debug Enabled.");
+ Debug.Console(1, this, "Comm Debug Enabled.");
}
else
{
CommDebuggingIsOn = false;
- Debug.Console(0, this, "Comm Debug Disabled.");
+ Debug.Console(1, this, "Comm Debug Disabled.");
}
}
@@ -885,7 +880,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
// Counts the curly braces
if (message.Contains("client_loop: send disconnect: Broken pipe"))
{
- Debug.Console(0, this, Debug.ErrorLogLevel.Error,
+ 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;
@@ -904,7 +899,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
//Debug.Console(2, this, "JSON Curly Brace Count: {0}", _jsonCurlyBraceCounter);
if (!_jsonFeedbackMessageIsIncoming && message.Trim('\x20') == "{" + Delimiter)
- // Check for the beginning of a new JSON message
+ // Check for the beginning of a new JSON message
{
_jsonFeedbackMessageIsIncoming = true;
_jsonCurlyBraceCounter = 1; // reset the counter for each new message
@@ -921,7 +916,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
return;
}
if (_jsonFeedbackMessageIsIncoming && message.Trim('\x20') == "}" + Delimiter)
- // Check for the end of a JSON message
+ // Check for the end of a JSON message
{
_jsonMessage.Append(message);
@@ -964,34 +959,34 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
switch (message.Trim().ToLower()) // remove the whitespace
{
case "*r login successful":
+ {
+ _syncState.LoginMessageReceived();
+
+ // Fire up a thread to send the intial commands.
+ CrestronInvoke.BeginInvoke(o =>
{
- _syncState.LoginMessageReceived();
+ 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);
- // Fire up a thread to send the intial commands.
- CrestronInvoke.BeginInvoke(o =>
+ if (!_props.DisablePhonebookAutoDownload)
{
- 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);
+ SendText("zFeedback Register Op: ex Path: /Event/Phonebook/AddedContact");
+ }
+ // switch to json format
+ SendText("format json");
+ });
- if (!_props.DisablePhonebookAutoDownload)
- {
- SendText("zFeedback Register Op: ex Path: /Event/Phonebook/AddedContact");
- }
- // switch to json format
- SendText("format json");
- });
-
- break;
- }
+ break;
+ }
}
}
}
@@ -1015,7 +1010,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
var eType =
(eZoomRoomResponseType)
- Enum.Parse(typeof(eZoomRoomResponseType), message["type"].Value(), true);
+ Enum.Parse(typeof (eZoomRoomResponseType), message["type"].Value(), true);
var topKey = message["topKey"].Value();
@@ -1026,489 +1021,545 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
switch (eType)
{
case eZoomRoomResponseType.zConfiguration:
+ {
+ switch (topKey.ToLower())
{
- switch (topKey.ToLower())
+ case "call":
{
- case "call":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Configuration.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;
}
- break;
- }
- case eZoomRoomResponseType.zCommand:
- {
- switch (topKey.ToLower())
+ case "audio":
{
- case "inforesult":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.Call.Info);
+ 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
+
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.Phonebook);
+
+ var directoryResults =
+ zStatus.Phonebook.ConvertZoomContactsToGeneric(Status.Phonebook.Contacts);
+
+ if (!PhonebookSyncState.InitialSyncComplete)
+ {
+ PhonebookSyncState.InitialPhonebookFoldersReceived();
+ PhonebookSyncState.PhonebookRootEntriesReceived();
+ PhonebookSyncState.SetPhonebookHasFolders(true);
+ PhonebookSyncState.SetNumberOfContacts(Status.Phonebook.Contacts.Count);
+ }
+
+ if (directoryResults.ResultsFolderId != "root")
+ {
+ directoryResults.ResultsFolderId = "root";
+ }
+
+ DirectoryRoot = directoryResults;
+
+ CurrentDirectoryResult = directoryResults;
+
+ 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 "phonebooklistresult":
+ case JTokenType.Object:
{
- // This result will always be the complete contents of the directory and never
- // A subset of the results via a search
+ // this is a single participant event notification
- JsonConvert.PopulateObject(responseObj.ToString(), Status.Phonebook);
+ var participant =
+ JsonConvert.DeserializeObject(
+ responseObj.ToString());
- var directoryResults =
- zStatus.Phonebook.ConvertZoomContactsToGeneric(Status.Phonebook.Contacts);
-
- if (!PhonebookSyncState.InitialSyncComplete)
+ if (participant != null)
{
- PhonebookSyncState.InitialPhonebookFoldersReceived();
- PhonebookSyncState.PhonebookRootEntriesReceived();
- PhonebookSyncState.SetPhonebookHasFolders(true);
- PhonebookSyncState.SetNumberOfContacts(Status.Phonebook.Contacts.Count);
- }
+ 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);
- if (directoryResults.ResultsFolderId != "root")
- {
- directoryResults.ResultsFolderId = "root";
- }
-
- DirectoryRoot = directoryResults;
-
- CurrentDirectoryResult = directoryResults;
-
- 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:
+ switch (participant.Event)
+ {
+ case "ZRCUserChangedEventUserInfoUpdated":
+ case "ZRCUserChangedEventLeftMeeting":
{
- // this is a single participant event notification
+ var existingParticipant =
+ Status.Call.Participants.FirstOrDefault(
+ p => p.UserId.Equals(participant.UserId));
- var participant =
- JsonConvert.DeserializeObject(
- responseObj.ToString());
-
- if (participant != null)
+ if (existingParticipant != null)
{
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;
- }
- }
- }
+ Status.Call.Participants.Remove(existingParticipant);
break;
- case "ZRCUserChangedEventJoinedMeeting":
- Status.Call.Participants.Add(participant);
+ case "ZRCUserChangedEventUserInfoUpdated":
+ JsonConvert.PopulateObject(responseObj.ToString(),
+ existingParticipant);
break;
}
}
}
- break;
- }
-
- var participants =
- zCommand.ListParticipant.GetGenericParticipantListFromParticipantsResult(
- Status.Call.Participants);
-
- Participants.CurrentParticipants = participants;
-
- PrintCurrentCallParticipants();
-
- break;
- }
- default:
- {
- break;
- }
- }
- break;
- }
- case eZoomRoomResponseType.zEvent:
- {
- switch (topKey.ToLower())
- {
- case "phonebook":
- {
- if (responseObj["Updated Contact"] != null)
- {
- var updatedContact =
- JsonConvert.DeserializeObject(
- responseObj["Updated Contact"].ToString());
-
- var existingContact =
- Status.Phonebook.Contacts.FirstOrDefault(c => c.Jid.Equals(updatedContact.Jid));
-
- if (existingContact != null)
- {
- // Update existing contact
- JsonConvert.PopulateObject(responseObj["Updated Contact"].ToString(),
- existingContact);
- }
- }
- else if (responseObj["Added Contact"] != null)
- {
- var jToken = responseObj["Updated Contact"];
- if (jToken != null)
- {
- var newContact =
- JsonConvert.DeserializeObject(
- jToken.ToString());
-
- // Add a new contact
- Status.Phonebook.Contacts.Add(newContact);
- }
- }
-
- 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);
- }
-
- break;
- }
- case "bookings updated":
- {
- GetBookings();
-
- break;
- }
- case "sharingstate":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.Call.Sharing);
-
- SetLayout();
-
- break;
- }
- case "incomingcallindication":
- {
- var incomingCall =
- JsonConvert.DeserializeObject(responseObj.ToString());
-
- if (incomingCall != null)
- {
- var newCall = new CodecActiveCallItem
- {
- Direction = eCodecCallDirection.Incoming,
- Status = eCodecCallStatus.Ringing,
- Type = eCodecCallType.Video,
- Name = incomingCall.callerName,
- Id = incomingCall.callerJID
- };
-
- ActiveCalls.Add(newCall);
-
- OnCallStatusChange(newCall);
- }
-
- break;
- }
- case "treatedincomingcallindication":
- {
- var incomingCall =
- JsonConvert.DeserializeObject(responseObj.ToString());
-
- if (incomingCall != null)
- {
- var existingCall =
- ActiveCalls.FirstOrDefault(c => c.Id.Equals(incomingCall.callerJID));
-
- if (existingCall != null)
- {
- existingCall.Status = !incomingCall.accepted
- ? eCodecCallStatus.Disconnected
- : eCodecCallStatus.Connecting;
-
- OnCallStatusChange(existingCall);
- }
-
- UpdateCallStatus();
- }
-
- break;
- }
- case "calldisconnect":
- {
- var disconnectEvent =
- JsonConvert.DeserializeObject(responseObj.ToString());
-
- if (disconnectEvent.Successful)
- {
- if (ActiveCalls.Count > 0)
- {
- var activeCall = ActiveCalls.FirstOrDefault(c => c.IsActiveCall);
-
- if (activeCall != null)
+ break;
+ case "ZRCUserChangedEventJoinedMeeting":
{
- activeCall.Status = eCodecCallStatus.Disconnected;
+ var existingParticipant =
+ Status.Call.Participants.FirstOrDefault(p => p.UserId.Equals(participant.UserId));
- OnCallStatusChange(activeCall);
+ 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;
}
}
- var emptyList = new List();
- Participants.CurrentParticipants = emptyList;
+
+ Debug.Console(1, this,
+ "[DeserializeResponse] zCommands.listparticipantresult - participant.event: {0} ***********************************",
+ participant.Event);
}
-
- UpdateCallStatus();
- break;
}
- case "callconnecterror":
- {
- UpdateCallStatus();
break;
- }
- case "videounmuterequest":
- {
- // TODO: notify room of a request to unmute video
- break;
- }
- case "meetingneedspassword":
- {
- // TODO: notify user to enter a password
- break;
- }
- case "needwaitforhost":
- {
- var needWait =
- JsonConvert.DeserializeObject(responseObj.ToString());
+ }
- if (needWait.Wait)
- {
- // TODO: notify user to wait for host
- }
+ var participants =
+ zCommand.ListParticipant.GetGenericParticipantListFromParticipantsResult(
+ Status.Call.Participants);
- break;
- }
- case "openvideofailforhoststop":
- {
- // TODO: notify user that host has disabled unmuting video
- break;
- }
- case "updatedcallrecordinfo":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.Call.CallRecordInfo);
+ Participants.CurrentParticipants = participants;
+ PrintCurrentCallParticipants();
- break;
- }
- case "phonecallstatus":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.PhoneCall);
- break;
- }
- case "pinstatusofscreennotification":
- {
- var status = responseObj.ToObject();
-
- Debug.Console(1, this, "Pin Status notification for UserId: {0}, ScreenIndex: {1}", status.PinnedUserId, status.ScreenIndex);
-
- Participant alreadyPinnedParticipant = null;
-
- // Check for a participant already pinned to the same screen index.
- if (status.PinnedUserId > 0)
- {
- alreadyPinnedParticipant = Participants.CurrentParticipants.FirstOrDefault(p => p.ScreenIndexIsPinnedToFb.Equals(status.ScreenIndex));
-
- // Make sure that the already pinned participant isn't the same ID as for this message. If true, clear the pinned fb.
- if (alreadyPinnedParticipant != null && alreadyPinnedParticipant.UserId != status.PinnedUserId)
- {
- Debug.Console(1, this, "Participant: {0} with id: {1} already pinned to screenIndex {2}. Clearing pinned fb.",
- alreadyPinnedParticipant.Name, alreadyPinnedParticipant.UserId, alreadyPinnedParticipant.ScreenIndexIsPinnedToFb);
- alreadyPinnedParticipant.IsPinnedFb = false;
- alreadyPinnedParticipant.ScreenIndexIsPinnedToFb = -1;
- }
- }
-
- var participant = Participants.CurrentParticipants.FirstOrDefault(p => p.UserId.Equals(status.PinnedUserId));
-
- if (participant != null)
- {
- participant.IsPinnedFb = true;
- participant.ScreenIndexIsPinnedToFb = status.ScreenIndex;
- }
- else
- {
- participant = Participants.CurrentParticipants.FirstOrDefault(p => p.ScreenIndexIsPinnedToFb.Equals(status.ScreenIndex));
-
- if (participant == null && alreadyPinnedParticipant == null)
- {
- Debug.Console(1, this, "no matching participant found by pinned_user_id: {0} or screen_index: {1}", status.PinnedUserId, status.ScreenIndex);
- return;
- }
- else if (participant != null)
- {
- Debug.Console(2, this, "Unpinning {0} with id: {1} from screen index: {2}", participant.Name, participant.UserId, status.ScreenIndex);
- participant.IsPinnedFb = false;
- participant.ScreenIndexIsPinnedToFb = -1;
- }
- }
-
- // fire the event as we've modified the participants list
- Participants.OnParticipantsChanged();
-
- break;
- }
- default:
- {
- break;
- }
+ break;
}
- break;
- }
- case eZoomRoomResponseType.zStatus:
- {
- switch (topKey.ToLower())
+ default:
{
- case "login":
- {
- _syncState.LoginMessageReceived();
-
- if (!_syncState.InitialQueryMessagesWereSent)
- {
- SetUpSyncQueries();
- }
-
- JsonConvert.PopulateObject(responseObj.ToString(), Status.Login);
-
- break;
- }
- case "systemunit":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.SystemUnit);
-
- break;
- }
- case "call":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.Call);
-
- UpdateCallStatus();
-
- break;
- }
- case "capabilities":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.Capabilities);
- break;
- }
- case "sharing":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.Sharing);
-
- break;
- }
- case "numberofscreens":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.NumberOfScreens);
- break;
- }
- case "video":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.Video);
- break;
- }
- case "camerashare":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.CameraShare);
- break;
- }
- case "layout":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.Layout);
- break;
- }
- case "audio input line":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.AudioInputs);
- break;
- }
- case "audio output line":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.AudioOuputs);
- break;
- }
- case "video camera line":
- {
- JsonConvert.PopulateObject(responseObj.ToString(), Status.Cameras);
-
- if (!_syncState.CamerasHaveBeenSetUp)
- {
- SetUpCameras();
- }
-
- break;
- }
- default:
- {
- break;
- }
+ break;
}
-
- break;
}
- default:
+ break;
+ }
+ case eZoomRoomResponseType.zEvent:
+ {
+ switch (topKey.ToLower())
{
- Debug.Console(1, "Unknown Response Type:");
- break;
+ case "phonebook":
+ {
+ if (responseObj["Updated Contact"] != null)
+ {
+ var updatedContact =
+ JsonConvert.DeserializeObject(
+ responseObj["Updated Contact"].ToString());
+
+ var existingContact =
+ Status.Phonebook.Contacts.FirstOrDefault(c => c.Jid.Equals(updatedContact.Jid));
+
+ if (existingContact != null)
+ {
+ // Update existing contact
+ JsonConvert.PopulateObject(responseObj["Updated Contact"].ToString(),
+ existingContact);
+ }
+ }
+ else if (responseObj["Added Contact"] != null)
+ {
+ var jToken = responseObj["Updated Contact"];
+ if (jToken != null)
+ {
+ var newContact =
+ JsonConvert.DeserializeObject(
+ jToken.ToString());
+
+ // Add a new contact
+ Status.Phonebook.Contacts.Add(newContact);
+ }
+ }
+
+ 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);
+ }
+
+ break;
+ }
+ case "bookings updated":
+ {
+ GetBookings();
+
+ break;
+ }
+ case "sharingstate":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.Call.Sharing);
+
+ SetLayout();
+
+ break;
+ }
+ case "incomingcallindication":
+ {
+ var incomingCall =
+ JsonConvert.DeserializeObject(responseObj.ToString());
+
+ if (incomingCall != null)
+ {
+ var newCall = new CodecActiveCallItem
+ {
+ Direction = eCodecCallDirection.Incoming,
+ Status = eCodecCallStatus.Ringing,
+ Type = eCodecCallType.Video,
+ Name = incomingCall.callerName,
+ Id = incomingCall.callerJID
+ };
+
+ ActiveCalls.Add(newCall);
+
+ OnCallStatusChange(newCall);
+ }
+
+ break;
+ }
+ case "treatedincomingcallindication":
+ {
+ var incomingCall =
+ JsonConvert.DeserializeObject(responseObj.ToString());
+
+ if (incomingCall != null)
+ {
+ var existingCall =
+ ActiveCalls.FirstOrDefault(c => c.Id.Equals(incomingCall.callerJID));
+
+ if (existingCall != null)
+ {
+ existingCall.Status = !incomingCall.accepted
+ ? eCodecCallStatus.Disconnected
+ : eCodecCallStatus.Connecting;
+
+ OnCallStatusChange(existingCall);
+ }
+
+ UpdateCallStatus();
+ }
+
+ break;
+ }
+ case "calldisconnect":
+ {
+ var disconnectEvent =
+ JsonConvert.DeserializeObject(responseObj.ToString());
+
+ Debug.Console(1, this,
+ "[DeserializeResponse] zEvent.calldisconnect ********************************************");
+ Debug.Console(1, this, "[DeserializeResponse] zEvent.calldisconnect - disconnectEvent.Successful: {0}",
+ disconnectEvent.Successful);
+
+ if (disconnectEvent.Successful)
+ {
+ if (ActiveCalls.Count > 0)
+ {
+ var activeCall = ActiveCalls.FirstOrDefault(c => c.IsActiveCall);
+
+ if (activeCall != null)
+ {
+ Debug.Console(1, this,
+ "[DeserializeResponse] zEvent.calldisconnect - ActiveCalls.Count: {0} activeCall.Id: {1}, activeCall.Number: {2} activeCall.Name: {3}, activeCall.IsActive: {4}",
+ ActiveCalls.Count, activeCall.Id, activeCall.Number, activeCall.Name, activeCall.IsActiveCall);
+ activeCall.Status = eCodecCallStatus.Disconnected;
+
+ OnCallStatusChange(activeCall);
+ }
+ }
+ }
+
+ Debug.Console(1, this,
+ "[DeserializeResponse] zEvent.calldisconnect ********************************************");
+
+ UpdateCallStatus();
+ break;
+ }
+ case "callconnecterror":
+ {
+ UpdateCallStatus();
+ break;
+ }
+ case "videounmuterequest":
+ {
+ // TODO: notify room of a request to unmute video
+ break;
+ }
+ case "meetingneedspassword":
+ {
+ // TODO: notify user to enter a password
+ break;
+ }
+ case "needwaitforhost":
+ {
+ var needWait =
+ JsonConvert.DeserializeObject(responseObj.ToString());
+
+ if (needWait.Wait)
+ {
+ // TODO: notify user to wait for host
+ }
+
+ break;
+ }
+ case "openvideofailforhoststop":
+ {
+ // TODO: notify user that host has disabled unmuting video
+ break;
+ }
+ case "updatedcallrecordinfo":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.Call.CallRecordInfo);
+
+ break;
+ }
+ case "phonecallstatus":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.PhoneCall);
+ break;
+ }
+ case "pinstatusofscreennotification":
+ {
+ var status = responseObj.ToObject();
+
+ Debug.Console(1, this, "Pin Status notification for UserId: {0}, ScreenIndex: {1}", status.PinnedUserId,
+ status.ScreenIndex);
+
+ Participant alreadyPinnedParticipant = null;
+
+ // Check for a participant already pinned to the same screen index.
+ if (status.PinnedUserId > 0)
+ {
+ alreadyPinnedParticipant =
+ Participants.CurrentParticipants.FirstOrDefault(p => p.ScreenIndexIsPinnedToFb.Equals(status.ScreenIndex));
+
+ // Make sure that the already pinned participant isn't the same ID as for this message. If true, clear the pinned fb.
+ if (alreadyPinnedParticipant != null && alreadyPinnedParticipant.UserId != status.PinnedUserId)
+ {
+ Debug.Console(1, this, "Participant: {0} with id: {1} already pinned to screenIndex {2}. Clearing pinned fb.",
+ alreadyPinnedParticipant.Name, alreadyPinnedParticipant.UserId,
+ alreadyPinnedParticipant.ScreenIndexIsPinnedToFb);
+ alreadyPinnedParticipant.IsPinnedFb = false;
+ alreadyPinnedParticipant.ScreenIndexIsPinnedToFb = -1;
+ }
+ }
+
+ var participant = Participants.CurrentParticipants.FirstOrDefault(p => p.UserId.Equals(status.PinnedUserId));
+
+ if (participant != null)
+ {
+ participant.IsPinnedFb = true;
+ participant.ScreenIndexIsPinnedToFb = status.ScreenIndex;
+ }
+ else
+ {
+ participant =
+ Participants.CurrentParticipants.FirstOrDefault(p => p.ScreenIndexIsPinnedToFb.Equals(status.ScreenIndex));
+
+ if (participant == null && alreadyPinnedParticipant == null)
+ {
+ Debug.Console(1, this, "no matching participant found by pinned_user_id: {0} or screen_index: {1}",
+ status.PinnedUserId, status.ScreenIndex);
+ return;
+ }
+ else if (participant != null)
+ {
+ Debug.Console(2, this, "Unpinning {0} with id: {1} from screen index: {2}", participant.Name,
+ participant.UserId, status.ScreenIndex);
+ participant.IsPinnedFb = false;
+ participant.ScreenIndexIsPinnedToFb = -1;
+ }
+ }
+
+ // fire the event as we've modified the participants list
+ Participants.OnParticipantsChanged();
+
+ break;
+ }
+ default:
+ {
+ break;
+ }
}
+ break;
+ }
+ case eZoomRoomResponseType.zStatus:
+ {
+ switch (topKey.ToLower())
+ {
+ case "login":
+ {
+ _syncState.LoginMessageReceived();
+
+ if (!_syncState.InitialQueryMessagesWereSent)
+ {
+ SetUpSyncQueries();
+ }
+
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.Login);
+
+ break;
+ }
+ case "systemunit":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.SystemUnit);
+
+ break;
+ }
+ case "call":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.Call);
+
+ Debug.Console(1, this,
+ "[DeserializeResponse] zStatus.call - Status.Call.Info.meeting_id: {0} Status.Call.Info.meeting_list_item.meetingName: {1}",
+ Status.Call.Info.meeting_id, Status.Call.Info.meeting_list_item.meetingName);
+ foreach (var participant in Status.Call.Participants)
+ {
+ Debug.Console(1, this,
+ "[DeserializeResponse] zStatus.call - Status.Call.Participants participant.UserId: {0} participant.UserName: {1}",
+ participant.UserId, participant.UserName);
+ }
+
+ UpdateCallStatus();
+
+ break;
+ }
+ case "capabilities":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.Capabilities);
+ break;
+ }
+ case "sharing":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.Sharing);
+
+ break;
+ }
+ case "numberofscreens":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.NumberOfScreens);
+ break;
+ }
+ case "video":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.Video);
+ break;
+ }
+ case "camerashare":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.CameraShare);
+ break;
+ }
+ case "layout":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.Layout);
+ break;
+ }
+ case "audio input line":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.AudioInputs);
+ break;
+ }
+ case "audio output line":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.AudioOuputs);
+ break;
+ }
+ case "video camera line":
+ {
+ JsonConvert.PopulateObject(responseObj.ToString(), Status.Cameras);
+
+ if (!_syncState.CamerasHaveBeenSetUp)
+ {
+ SetUpCameras();
+ }
+
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+
+ break;
+ }
+ default:
+ {
+ Debug.Console(1, "Unknown Response Type:");
+ break;
+ }
}
}
catch (Exception ex)
@@ -1535,18 +1586,26 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
}
+ ///
+ /// Retrieves the current call participants list
+ ///
+ public void GetCurrentCallParticipants()
+ {
+ SendText("zCommand Call ListParticipants");
+ }
+
+ ///
+ /// Prints the current call particiapnts list
+ ///
public void PrintCurrentCallParticipants()
{
- if (Debug.Level <= 0)
- {
- return;
- }
+ if (Debug.Level <= 0) return;
Debug.Console(1, this, "*************************** Call Participants **************************");
foreach (var participant in Participants.CurrentParticipants)
{
- Debug.Console(1, this, "Name: {0} Audio: {1} IsHost: {2}", participant.Name,
- participant.AudioMuteFb, participant.IsHost);
+ Debug.Console(1, this, "UserId: {3} Name: {0} Audio: {1} IsHost: {2}",
+ participant.Name, participant.AudioMuteFb, participant.IsHost, participant.UserId);
}
Debug.Console(1, this, "************************************************************************");
}
@@ -1566,19 +1625,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
private void UpdateCallStatus()
{
Debug.Console(1, this, "[UpdateCallStatus] Current Call Status: {0}",
- Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call");
+ Status.Call != null ? Status.Call.Status.ToString() : "no call");
if (Status.Call != null)
{
var callStatus = Status.Call.Status;
- // If not currently in a meeting, intialize the call object
+ // If not crrently in a meeting, intialize the call object
if (callStatus != zStatus.eCallStatus.IN_MEETING && callStatus != zStatus.eCallStatus.CONNECTING_MEETING)
{
- Debug.Console(1, this, "Creating new Status.Call object");
- Status.Call = new zStatus.Call { Status = callStatus };
+ Debug.Console(1, this, "[UpdateCallStatus] Creating new Status.Call object");
+ Status.Call = new zStatus.Call {Status = callStatus};
- OnCallStatusChange( new CodecActiveCallItem() { Status = eCodecCallStatus.Disconnected });
+ OnCallStatusChange(new CodecActiveCallItem() {Status = eCodecCallStatus.Disconnected});
SetUpCallFeedbackActions();
}
@@ -1586,7 +1645,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
if (ActiveCalls.Count == 0)
{
if (callStatus == zStatus.eCallStatus.CONNECTING_MEETING ||
- callStatus == zStatus.eCallStatus.IN_MEETING)
+ callStatus == zStatus.eCallStatus.IN_MEETING)
{
var newStatus = eCodecCallStatus.Unknown;
@@ -1600,24 +1659,30 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
break;
}
- var newCall = new CodecActiveCallItem
- {
- Name = Status.Call.Info.meeting_list_item.meetingName,
- Number = Status.Call.Info.meeting_id,
- Id = Status.Call.Info.meeting_id,
- Status = newStatus,
- Type = eCodecCallType.Video,
- };
+ if (!string.IsNullOrEmpty(Status.Call.Info.meeting_id))
+ {
+ var newCall = new CodecActiveCallItem
+ {
+ Name = Status.Call.Info.meeting_list_item.meetingName,
+ Number = Status.Call.Info.meeting_list_item.meetingNumber,
+ Id = Status.Call.Info.meeting_id,
+ Status = newStatus,
+ Type = eCodecCallType.Video,
+ };
- ActiveCalls.Add(newCall);
+ ActiveCalls.Add(newCall);
- Debug.Console(1, this, "[UpdateCallStatus] Current Call Status: {0}",
- Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call");
+ Debug.Console(1, this, "[UpdateCallStatus] IF w/ meeting_id AcitveCalls.Count == {1} - Current Call Status: {0}",
+ Status.Call != null ? Status.Call.Status.ToString() : "no call", ActiveCalls.Count);
- OnCallStatusChange(newCall);
+ OnCallStatusChange(newCall);
+ }
+ else
+ {
+ Debug.Console(1, this, "[UpdateCallStatus] IF w/o meeting_id AcitveCalls.Count == {1} - Current Call Status: {0}",
+ Status.Call != null ? Status.Call.Status.ToString() : "no call", ActiveCalls.Count);
+ }
}
-
-
}
else
{
@@ -1633,14 +1698,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
break;
}
- Debug.Console(1, this, "[UpdateCallStatus] Current Call Status: {0}",
- Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call");
+ Debug.Console(1, this, "[UpdateCallStatus] ELSE ActiveCalls.Count == {1} - Current Call Status: {0}",
+ Status.Call != null ? Status.Call.Status.ToString() : "no call", ActiveCalls.Count);
OnCallStatusChange(existingCall);
}
}
- Debug.Console(1, this, "*************************** Active Calls ********************************");
+ Debug.Console(1, this, "[UpdateCallStatus] Active Calls ------------------------------");
// Clean up any disconnected calls left in the list
for (int i = 0; i < ActiveCalls.Count; i++)
@@ -1648,26 +1713,27 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
var call = ActiveCalls[i];
Debug.Console(1, this,
- @"Name: {0}
- ID: {1}
+ @"ID: {1}
+ Number: {5}
+ Name: {0}
IsActive: {2}
Status: {3}
- Direction: {4}", call.Name, call.Id, call.IsActiveCall, call.Status, call.Direction);
+ Direction: {4}
+ IsActiveCall: {6}", call.Name, call.Id, call.IsActiveCall, call.Status, call.Direction, call.Number,
+ call.IsActiveCall);
if (!call.IsActiveCall)
{
- Debug.Console(1, this, "***** Removing Inactive Call: {0} *****", call.Name);
+ Debug.Console(1, this, "[UpdateCallStatus] Removing Inactive call.Id: {1} call.Name: {0}", call.Name, call.Id);
ActiveCalls.Remove(call);
}
}
- Debug.Console(1, this, "**************************************************************************");
+ Debug.Console(1, this, "[UpdateCallStatus] Active Calls ------------------------------");
//clear participants list after call cleanup
- if (ActiveCalls.Count == 0)
- {
- var emptyList = new List();
- Participants.CurrentParticipants = emptyList;
- }
+ var emptyList = new List();
+ Participants.CurrentParticipants = emptyList;
+ if (ActiveCalls.Count > 0) GetCurrentCallParticipants();
}
protected override void OnCallStatusChange(CodecActiveCallItem item)
@@ -1675,7 +1741,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
base.OnCallStatusChange(item);
Debug.Console(1, this, "[OnCallStatusChange] Current Call Status: {0}",
- Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call");
+ Status.Call != null ? Status.Call.Status.ToString() : "no call");
if (_props.AutoDefaultLayouts)
{
@@ -1720,13 +1786,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public override void MuteOff()
{
- Debug.Console(2, this, "Unmuting to previous level: {0}", _previousVolumeLevel);
- SetVolume((ushort)_previousVolumeLevel);
+ Debug.Console(2, this, "Unmuting to previous level: {0}", _previousVolumeLevel);
+ SetVolume((ushort) _previousVolumeLevel);
}
public override void MuteOn()
{
-
SetVolume(0);
}
@@ -1812,7 +1877,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
LinkVideoCodecToApi(this, trilist, joinMap);
- LinkZoomRoomToApi(trilist, joinMap);
+ LinkZoomRoomToApi(trilist, joinMap);
}
///
@@ -1828,13 +1893,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
layoutsCodec.AvailableLayoutsChanged += (o, a) =>
{
trilist.SetBool(joinMap.LayoutGalleryIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.Gallery
- == (a.AvailableLayouts & zConfiguration.eLayoutStyle.Gallery));
+ ==
+ (a.AvailableLayouts &
+ zConfiguration.eLayoutStyle.Gallery));
trilist.SetBool(joinMap.LayoutSpeakerIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.Speaker
- == (a.AvailableLayouts & zConfiguration.eLayoutStyle.Speaker));
+ ==
+ (a.AvailableLayouts &
+ zConfiguration.eLayoutStyle.Speaker));
trilist.SetBool(joinMap.LayoutStripIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.Strip
- == (a.AvailableLayouts & zConfiguration.eLayoutStyle.Strip));
+ ==
+ (a.AvailableLayouts & zConfiguration.eLayoutStyle.Strip));
trilist.SetBool(joinMap.LayoutShareAllIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.ShareAll
- == (a.AvailableLayouts & zConfiguration.eLayoutStyle.ShareAll));
+ ==
+ (a.AvailableLayouts &
+ zConfiguration.eLayoutStyle.ShareAll));
// pass the names used to set the layout through the bridge
trilist.SetString(joinMap.LayoutGalleryIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.Gallery.ToString());
@@ -1842,32 +1914,35 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
trilist.SetString(joinMap.LayoutStripIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.Strip.ToString());
trilist.SetString(joinMap.LayoutShareAllIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.ShareAll.ToString());
};
-
+
trilist.SetSigFalseAction(joinMap.SwapContentWithThumbnail.JoinNumber, () => layoutsCodec.SwapContentWithThumbnail());
- layoutsCodec.CanSwapContentWithThumbnailFeedback.LinkInputSig(trilist.BooleanInput[joinMap.CanSwapContentWithThumbnail.JoinNumber]);
- layoutsCodec.ContentSwappedWithThumbnailFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SwapContentWithThumbnail.JoinNumber]);
+ layoutsCodec.CanSwapContentWithThumbnailFeedback.LinkInputSig(
+ trilist.BooleanInput[joinMap.CanSwapContentWithThumbnail.JoinNumber]);
+ layoutsCodec.ContentSwappedWithThumbnailFeedback.LinkInputSig(
+ trilist.BooleanInput[joinMap.SwapContentWithThumbnail.JoinNumber]);
- layoutsCodec.LayoutViewIsOnFirstPageFeedback.LinkInputSig(trilist.BooleanInput[joinMap.LayoutIsOnFirstPage.JoinNumber]);
+ layoutsCodec.LayoutViewIsOnFirstPageFeedback.LinkInputSig(
+ trilist.BooleanInput[joinMap.LayoutIsOnFirstPage.JoinNumber]);
layoutsCodec.LayoutViewIsOnLastPageFeedback.LinkInputSig(trilist.BooleanInput[joinMap.LayoutIsOnLastPage.JoinNumber]);
trilist.SetSigFalseAction(joinMap.LayoutTurnToNextPage.JoinNumber, () => layoutsCodec.LayoutTurnNextPage());
trilist.SetSigFalseAction(joinMap.LayoutTurnToPreviousPage.JoinNumber, () => layoutsCodec.LayoutTurnPreviousPage());
trilist.SetSigFalseAction(joinMap.GetAvailableLayouts.JoinNumber, () => layoutsCodec.GetAvailableLayouts());
trilist.SetStringSigAction(joinMap.GetSetCurrentLayout.JoinNumber, (s) =>
+ {
+ try
{
- try
- {
- var style = (zConfiguration.eLayoutStyle)Enum.Parse(typeof(zConfiguration.eLayoutStyle), s, true);
- SetLayout(style);
- }
- catch (Exception e)
- {
- Debug.Console(1, this, "Unable to parse '{0}' to zConfiguration.eLayoutStyle: {1}", s, e);
- }
- });
+ var style = (zConfiguration.eLayoutStyle) Enum.Parse(typeof (zConfiguration.eLayoutStyle), s, true);
+ SetLayout(style);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "Unable to parse '{0}' to zConfiguration.eLayoutStyle: {1}", s, e);
+ }
+ });
- layoutsCodec.LocalLayoutFeedback.LinkInputSig(trilist.StringInput[joinMap.GetSetCurrentLayout.JoinNumber]);
+ layoutsCodec.LocalLayoutFeedback.LinkInputSig(trilist.StringInput[joinMap.GetSetCurrentLayout.JoinNumber]);
}
var pinCodec = this as IHasParticipantPinUnpin;
@@ -1888,7 +1963,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{
try
{
- var size = (zConfiguration.eLayoutSize)Enum.Parse(typeof(zConfiguration.eLayoutSize), s, true);
+ var size = (zConfiguration.eLayoutSize) Enum.Parse(typeof (zConfiguration.eLayoutSize), s, true);
var cmd = SelfviewPipSizes.FirstOrDefault(c => c.Command.Equals(size.ToString()));
SelfviewPipSizeSet(cmd);
}
@@ -1906,7 +1981,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
if (!args.DeviceOnLine) return;
ComputeAvailableLayouts();
- layoutsCodec.LocalLayoutFeedback.FireUpdate();
+ layoutsCodec.LocalLayoutFeedback.FireUpdate();
layoutsCodec.CanSwapContentWithThumbnailFeedback.FireUpdate();
layoutsCodec.ContentSwappedWithThumbnailFeedback.FireUpdate();
layoutsCodec.LayoutViewIsOnFirstPageFeedback.FireUpdate();
@@ -1914,7 +1989,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
pinCodec.NumberOfScreensFeedback.FireUpdate();
layoutSizeCodec.SelfviewPipSizeFeedback.FireUpdate();
};
- }
+ }
public override void ExecuteSwitch(object selector)
{
@@ -2024,43 +2099,45 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
///
private void OnDirectoryResultReturned(CodecDirectory result)
{
- try
- {
- Debug.Console(2, this, "OnDirectoryResultReturned");
+ try
+ {
+ Debug.Console(2, this, "OnDirectoryResultReturned");
- var directoryResult = new CodecDirectory();
+ var directoryResult = new CodecDirectory();
- // If result is Root, create a copy and filter out contacts whose parent folder is not root
- if (!CurrentDirectoryResultIsNotDirectoryRoot.BoolValue)
- {
- Debug.Console(2, this, "Filtering DirectoryRoot to remove contacts for display");
+ // If result is Root, create a copy and filter out contacts whose parent folder is not root
+ if (!CurrentDirectoryResultIsNotDirectoryRoot.BoolValue)
+ {
+ Debug.Console(2, this, "Filtering DirectoryRoot to remove contacts for display");
- directoryResult.ResultsFolderId = result.ResultsFolderId;
- directoryResult.AddFoldersToDirectory(result.Folders);
- directoryResult.AddContactsToDirectory(result.Contacts.Where((c) => c.ParentFolderId == result.ResultsFolderId).ToList());
- }
- else
- {
- directoryResult = result;
- }
+ directoryResult.ResultsFolderId = result.ResultsFolderId;
+ directoryResult.AddFoldersToDirectory(result.Folders);
+ directoryResult.AddContactsToDirectory(
+ result.Contacts.Where((c) => c.ParentFolderId == result.ResultsFolderId).ToList());
+ }
+ else
+ {
+ directoryResult = result;
+ }
- Debug.Console(2, this, "Updating directoryResult. IsOnRoot: {0}", !CurrentDirectoryResultIsNotDirectoryRoot.BoolValue);
+ Debug.Console(2, this, "Updating directoryResult. IsOnRoot: {0}",
+ !CurrentDirectoryResultIsNotDirectoryRoot.BoolValue);
- // 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)
- {
- handler(this, new DirectoryEventArgs
- {
- Directory = directoryResult,
- DirectoryIsOnRoot = !CurrentDirectoryResultIsNotDirectoryRoot.BoolValue
- });
- }
- }
- catch (Exception e)
- {
- Debug.Console(2, this, "Error: {0}", e);
- }
+ // 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)
+ {
+ handler(this, new DirectoryEventArgs
+ {
+ Directory = directoryResult,
+ DirectoryIsOnRoot = !CurrentDirectoryResultIsNotDirectoryRoot.BoolValue
+ });
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Console(2, this, "Error: {0}", e);
+ }
//PrintDirectory(result);
}
@@ -2076,15 +2153,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
foreach (var cam in Status.Cameras)
{
- // Known Issue:
- // Crestron UC engine systems seem to report an item in the cameras list that represnts the USB bridge device.
- // If we know the name and it's reliably consistent, we could ignore it here...
+ // Known Issue:
+ // Crestron UC engine systems seem to report an item in the cameras list that represnts the USB bridge device.
+ // If we know the name and it's reliably consistent, we could ignore it here...
- if (cam.Name.IndexOf("HD-CONV-USB") > -1)
- {
- // Skip this as it's the Crestron USB box, not a real camera
- continue;
- }
+ if (cam.Name.IndexOf("HD-CONV-USB") > -1)
+ {
+ // Skip this as it's the Crestron USB box, not a real camera
+ continue;
+ }
var camera = new ZoomRoomCamera(cam.id, cam.Name, this);
@@ -2188,7 +2265,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
#region IHasParticipantPinUnpin Members
- private Func NumberOfScreensFeedbackFunc { get { return () => Status.NumberOfScreens.NumOfScreens; } }
+ private Func NumberOfScreensFeedbackFunc
+ {
+ get { return () => Status.NumberOfScreens.NumOfScreens; }
+ }
public IntFeedback NumberOfScreensFeedback { get; private set; }
@@ -2313,12 +2393,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
public List SelfviewPipPositions = new List()
- {
- new CodecCommandWithLabel("UpLeft", "Center Left"),
- new CodecCommandWithLabel("UpRight", "Center Right"),
- new CodecCommandWithLabel("DownRight", "Lower Right"),
- new CodecCommandWithLabel("DownLeft", "Lower Left")
- };
+ {
+ new CodecCommandWithLabel("UpLeft", "Center Left"),
+ new CodecCommandWithLabel("UpRight", "Center Right"),
+ new CodecCommandWithLabel("DownRight", "Lower Right"),
+ new CodecCommandWithLabel("DownLeft", "Lower Left")
+ };
private void ComputeSelfviewPipPositionStatus()
{
@@ -2330,6 +2410,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
#endregion
// TODO: #714 [ ] Implementation of IHasSelfviewPipSize
+
#region Implementation of IHasSelfviewPipSize
private CodecCommandWithLabel _currentSelfviewPipSize;
@@ -2356,13 +2437,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
}
public List SelfviewPipSizes = new List()
- {
- new CodecCommandWithLabel("Off", "Off"),
- new CodecCommandWithLabel("Size1", "Size 1"),
- new CodecCommandWithLabel("Size2", "Size 2"),
- new CodecCommandWithLabel("Size3", "Size 3"),
+ {
+ new CodecCommandWithLabel("Off", "Off"),
+ new CodecCommandWithLabel("Size1", "Size 1"),
+ new CodecCommandWithLabel("Size2", "Size 2"),
+ new CodecCommandWithLabel("Size3", "Size 3"),
new CodecCommandWithLabel("Strip", "Strip")
- };
+ };
private void ComputeSelfviewPipSizeStatus()
{
@@ -2371,14 +2452,24 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
p => p.Command.ToLower().Equals(Configuration.Call.Layout.Size.ToString().ToLower()));
}
-
#endregion
#region Implementation of IHasPhoneDialing
- private Func PhoneOffHookFeedbackFunc { get { return () => Status.PhoneCall.OffHook; } }
- private Func CallerIdNameFeedbackFunc { get { return () => Status.PhoneCall.PeerDisplayName; } }
- private Func CallerIdNumberFeedbackFunc { get { return () => Status.PhoneCall.PeerNumber; } }
+ private Func PhoneOffHookFeedbackFunc
+ {
+ get { return () => Status.PhoneCall.OffHook; }
+ }
+
+ private Func CallerIdNameFeedbackFunc
+ {
+ get { return () => Status.PhoneCall.PeerDisplayName; }
+ }
+
+ private Func CallerIdNumberFeedbackFunc
+ {
+ get { return () => Status.PhoneCall.PeerNumber; }
+ }
public BoolFeedback PhoneOffHookFeedback { get; private set; }
public StringFeedback CallerIdNameFeedback { get; private set; }
@@ -2405,10 +2496,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public event EventHandler AvailableLayoutsChanged;
- private Func LayoutViewIsOnFirstPageFeedbackFunc { get { return () => Status.Layout.is_In_First_Page; } }
- private Func LayoutViewIsOnLastPageFeedbackFunc { get { return () => Status.Layout.is_In_Last_Page; } }
- private Func CanSwapContentWithThumbnailFeedbackFunc { get { return () => Status.Layout.can_Switch_Floating_Share_Content; } }
- private Func ContentSwappedWithThumbnailFeedbackFunc { get { return () => Configuration.Call.Layout.ShareThumb; } }
+ private Func LayoutViewIsOnFirstPageFeedbackFunc
+ {
+ get { return () => Status.Layout.is_In_First_Page; }
+ }
+
+ private Func LayoutViewIsOnLastPageFeedbackFunc
+ {
+ get { return () => Status.Layout.is_In_Last_Page; }
+ }
+
+ private Func CanSwapContentWithThumbnailFeedbackFunc
+ {
+ get { return () => Status.Layout.can_Switch_Floating_Share_Content; }
+ }
+
+ private Func ContentSwappedWithThumbnailFeedbackFunc
+ {
+ get { return () => Configuration.Call.Layout.ShareThumb; }
+ }
public BoolFeedback LayoutViewIsOnFirstPageFeedback { get; private set; }
@@ -2452,12 +2558,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
availableLayouts |= zConfiguration.eLayoutStyle.Strip;
}
- Debug.Console(1, this, "availablelayouts: {0}", availableLayouts);
+ Debug.Console(1, this, "availablelayouts: {0}", availableLayouts);
var handler = AvailableLayoutsChanged;
if (handler != null)
{
- handler(this, new LayoutInfoChangedEventArgs() { AvailableLayouts = availableLayouts });
+ handler(this, new LayoutInfoChangedEventArgs() {AvailableLayouts = availableLayouts});
}
AvailableLayouts = availableLayouts;
@@ -2478,7 +2584,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{
if (CanSwapContentWithThumbnailFeedback.BoolValue)
{
- var oppositeValue = ContentSwappedWithThumbnailFeedback.BoolValue ? "on" : "off"; // Get the value based on the opposite of the current state
+ var oppositeValue = ContentSwappedWithThumbnailFeedback.BoolValue ? "on" : "off";
+ // Get the value based on the opposite of the current state
// TODO: #697 [*] Need to verify the ternary above and make sure that the correct on/off value is being send based on the true/false value of the feedback
// to toggle the state
SendText(String.Format("zConfiguration Call Layout ShareThumb: {0}", oppositeValue));
@@ -2499,68 +2606,69 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
#region IHasCodecLayouts Members
- private Func LocalLayoutFeedbackFunc
- {
- get
- {
- return () =>
- {
- if (Configuration.Call.Layout.Style != zConfiguration.eLayoutStyle.None)
- return Configuration.Call.Layout.Style.ToString();
- else
- return Configuration.Client.Call.Layout.Style.ToString();
- };
- }
- }
+ private Func LocalLayoutFeedbackFunc
+ {
+ get
+ {
+ return () =>
+ {
+ if (Configuration.Call.Layout.Style != zConfiguration.eLayoutStyle.None)
+ return Configuration.Call.Layout.Style.ToString();
+ else
+ return Configuration.Client.Call.Layout.Style.ToString();
+ };
+ }
+ }
public StringFeedback LocalLayoutFeedback { get; private set; }
public void LocalLayoutToggle()
{
- var currentLayout = LocalLayoutFeedback.StringValue;
+ var currentLayout = LocalLayoutFeedback.StringValue;
- var eCurrentLayout = (int)Enum.Parse(typeof(zConfiguration.eLayoutStyle), currentLayout, true);
+ var eCurrentLayout = (int) Enum.Parse(typeof (zConfiguration.eLayoutStyle), currentLayout, true);
- var nextLayout = GetNextLayout(eCurrentLayout);
+ var nextLayout = GetNextLayout(eCurrentLayout);
- if (nextLayout != zConfiguration.eLayoutStyle.None)
- {
- SetLayout(nextLayout);
- }
+ if (nextLayout != zConfiguration.eLayoutStyle.None)
+ {
+ SetLayout(nextLayout);
+ }
}
- ///
- /// Tries to get the next available layout
- ///
- ///
- ///
- private zConfiguration.eLayoutStyle GetNextLayout(int currentLayout)
- {
- if (AvailableLayouts == zConfiguration.eLayoutStyle.None)
- {
- return zConfiguration.eLayoutStyle.None;
- }
+ ///
+ /// Tries to get the next available layout
+ ///
+ ///
+ ///
+ private zConfiguration.eLayoutStyle GetNextLayout(int currentLayout)
+ {
+ if (AvailableLayouts == zConfiguration.eLayoutStyle.None)
+ {
+ return zConfiguration.eLayoutStyle.None;
+ }
- zConfiguration.eLayoutStyle nextLayout;
+ zConfiguration.eLayoutStyle nextLayout;
- if (((zConfiguration.eLayoutStyle)currentLayout & zConfiguration.eLayoutStyle.ShareAll) == zConfiguration.eLayoutStyle.ShareAll)
- {
- nextLayout = zConfiguration.eLayoutStyle.Gallery;
- }
- else
- {
- nextLayout = (zConfiguration.eLayoutStyle)(currentLayout << 1);
- }
+ if (((zConfiguration.eLayoutStyle) currentLayout & zConfiguration.eLayoutStyle.ShareAll) ==
+ zConfiguration.eLayoutStyle.ShareAll)
+ {
+ nextLayout = zConfiguration.eLayoutStyle.Gallery;
+ }
+ else
+ {
+ nextLayout = (zConfiguration.eLayoutStyle) (currentLayout << 1);
+ }
- if ((AvailableLayouts & nextLayout) == nextLayout)
- {
- return nextLayout;
- }
- else
- {
- return GetNextLayout((int)nextLayout);
- }
- }
+ if ((AvailableLayouts & nextLayout) == nextLayout)
+ {
+ return nextLayout;
+ }
+ else
+ {
+ return GetNextLayout((int) nextLayout);
+ }
+ }
public void LocalLayoutToggleSingleProminent()
{
@@ -2570,10 +2678,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public void MinMaxLayoutToggle()
{
throw new NotImplementedException();
- }
+ }
#endregion
-
}
///
@@ -2774,7 +2881,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
private void CheckSyncStatus()
{
if (LoginMessageWasReceived && InitialQueryMessagesWereSent && LastQueryResponseWasReceived &&
- CamerasHaveBeenSetUp)
+ CamerasHaveBeenSetUp)
{
InitialSyncComplete = true;
Debug.Console(1, this, "Initial Codec Sync Complete!");
@@ -2790,7 +2897,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{
public ZoomRoomFactory()
{
- TypeNames = new List { "zoomroom" };
+ TypeNames = new List {"zoomroom"};
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)