This commit is contained in:
Neil Dorin
2021-08-18 00:02:59 +00:00
committed by GitHub
4 changed files with 993 additions and 856 deletions

View File

@@ -918,6 +918,7 @@ namespace PepperDash.Essentials
TriList.BooleanInput[StartPageVisibleJoin].BoolValue = true; TriList.BooleanInput[StartPageVisibleJoin].BoolValue = true;
TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = false; TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false; TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = false;
} }
} }

View File

@@ -633,7 +633,10 @@ namespace PepperDash.Essentials
var callMode = CurrentMode == UiDisplayMode.Call; var callMode = CurrentMode == UiDisplayMode.Call;
TriList.SetBool(StartPageVisibleJoin, startMode ? true : false); TriList.SetBool(StartPageVisibleJoin, startMode ? true : false);
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, presentationMode ? true : false); TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, presentationMode ? true : false);
if (!presentationMode)
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
CallButtonSig.BoolValue = callMode CallButtonSig.BoolValue = callMode
&& CurrentRoom.ShutdownType == eShutdownType.None; && CurrentRoom.ShutdownType == eShutdownType.None;
@@ -672,22 +675,22 @@ namespace PepperDash.Essentials
VCDriver.Hide(); VCDriver.Hide();
HideNextMeetingPopup(); HideNextMeetingPopup();
// Run default source when room is off and share is pressed // Run default source when room is off and share is pressed
if (!CurrentRoom.OnFeedback.BoolValue)
{
if (!CurrentRoom.OnFeedback.BoolValue) if (!CurrentRoom.OnFeedback.BoolValue)
{ {
// If there's no default, show UI elements // If there's no default, show UI elements
if (!(CurrentRoom as IRunDefaultPresentRoute).RunDefaultPresentRoute()) if (!(CurrentRoom as IRunDefaultPresentRoute).RunDefaultPresentRoute())
TriList.SetBool(UIBoolJoin.SelectASourceVisible, true); TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
} }
}
else // room is on show what's active or select a source if nothing is yet active else // room is on show what's active or select a source if nothing is yet active
{ {
if(CurrentRoom.CurrentSourceInfo == null || CurrentRoom.CurrentSourceInfoKey == CurrentRoom.DefaultCodecRouteString) if(CurrentRoom.CurrentSourceInfo == null || (CurrentRoom.VideoCodec != null && CurrentRoom.CurrentSourceInfo.SourceDevice.Key == CurrentRoom.VideoCodec.OsdSource.Key))
TriList.SetBool(UIBoolJoin.SelectASourceVisible, true); TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
else if (CurrentSourcePageManager != null) else if (CurrentSourcePageManager != null)
{
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
CurrentSourcePageManager.Show(); CurrentSourcePageManager.Show();
} }
}
CurrentMode = UiDisplayMode.Presentation; CurrentMode = UiDisplayMode.Presentation;
SetupSourceList(); SetupSourceList();
} }
@@ -1131,6 +1134,30 @@ namespace PepperDash.Essentials
/// <param name="type"></param> /// <param name="type"></param>
void CurrentRoom_CurrentSingleSourceChange(SourceListItem info, ChangeType type) void CurrentRoom_CurrentSingleSourceChange(SourceListItem info, ChangeType type)
{ {
Debug.Console(1, "AvFunctionsDriver: CurrentSingleSourceChange");
// Show the Select a source subpage
if (TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue)
{
Debug.Console(1, "AvFunctionsDriver: CurrentSingleSourceChange SourceStagingBarVisisble: true");
if (_CurrentRoom.CurrentSourceInfo == null || (_CurrentRoom.VideoCodec != null && _CurrentRoom.CurrentSourceInfo.SourceDevice.Key == _CurrentRoom.VideoCodec.OsdSource.Key))
{
Debug.Console(1, "AvFunctionsDriver: CurrentSingleSourceChange Showing SelectASourceVisible");
TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
}
else
{
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
Debug.Console(1, "AvFunctionsDriver: CurrentSingleSourceChange Hiding SelectASourceVisible");
}
}
else
{
Debug.Console(1, "AvFunctionsDriver: CurrentSingleSourceChange Hiding SelectASourceVisible");
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
}
if (_CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue && _CurrentRoom.CurrentSourceInfo != null) if (_CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue && _CurrentRoom.CurrentSourceInfo != null)
TriList.StringInput[UIStringJoin.CallSharedSourceNameText].StringValue = _CurrentRoom.CurrentSourceInfo.PreferredName; TriList.StringInput[UIStringJoin.CallSharedSourceNameText].StringValue = _CurrentRoom.CurrentSourceInfo.PreferredName;
} }
@@ -1228,12 +1255,12 @@ namespace PepperDash.Essentials
var value = _CurrentRoom.OnFeedback.BoolValue; var value = _CurrentRoom.OnFeedback.BoolValue;
TriList.BooleanInput[UIBoolJoin.RoomIsOn].BoolValue = value; TriList.BooleanInput[UIBoolJoin.RoomIsOn].BoolValue = value;
TriList.BooleanInput[StartPageVisibleJoin].BoolValue = !value; //TriList.BooleanInput[StartPageVisibleJoin].BoolValue = !value;
if (value) //ON if (value) //ON
{ {
SetupActivityFooterWhenRoomOn(); SetupActivityFooterWhenRoomOn();
TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = false; //TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.VolumeDualMute1Visible].BoolValue = true; TriList.BooleanInput[UIBoolJoin.VolumeDualMute1Visible].BoolValue = true;
} }

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
@@ -49,7 +50,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
{ {
private List<Participant> _currentParticipants; private List<Participant> _currentParticipants;
public List<Participant> CurrentParticipants { public List<Participant> CurrentParticipants
{
get { return _currentParticipants; } get { return _currentParticipants; }
set set
{ {

View File

@@ -3,13 +3,11 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharp.Reflection;
using Crestron.SimplSharpPro.CrestronThread; using Crestron.SimplSharpPro.CrestronThread;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Core.Intersystem.Tokens;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
@@ -26,7 +24,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public class ZoomRoom : VideoCodecBase, IHasCodecSelfView, IHasDirectoryHistoryStack, ICommunicationMonitor, public class ZoomRoom : VideoCodecBase, IHasCodecSelfView, IHasDirectoryHistoryStack, ICommunicationMonitor,
IRouting, IRouting,
IHasScheduleAwareness, IHasCodecCameras, IHasParticipants, IHasCameraOff, IHasCameraMute, IHasCameraAutoMode, 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 long MeetingRefreshTimer = 60000;
private const uint DefaultMeetingDurationMin = 30; private const uint DefaultMeetingDurationMin = 30;
@@ -138,7 +137,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
ContentSwappedWithThumbnailFeedback = new BoolFeedback(ContentSwappedWithThumbnailFeedbackFunc); ContentSwappedWithThumbnailFeedback = new BoolFeedback(ContentSwappedWithThumbnailFeedbackFunc);
NumberOfScreensFeedback = new IntFeedback(NumberOfScreensFeedbackFunc); NumberOfScreensFeedback = new IntFeedback(NumberOfScreensFeedbackFunc);
} }
public CommunicationGather PortGather { get; private set; } public CommunicationGather PortGather { get; private set; }
@@ -163,7 +161,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
if (Configuration.Audio.Output.Volume != 0) if (Configuration.Audio.Output.Volume != 0)
{ {
Debug.Console(2, this, "Storing previous volume level as: {0}, scaled: {1}", Configuration.Audio.Output.Volume, scaledVol); 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 _previousVolumeLevel = scaledVol; // Store the previous level for recall
} }
@@ -370,7 +369,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
_currentDirectoryResult = value; _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();
@@ -390,7 +390,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
DirectoryBrowseHistoryStack.Clear(); DirectoryBrowseHistoryStack.Clear();
CurrentDirectoryResult = directoryResults; CurrentDirectoryResult = directoryResults;
} }
public void GetDirectoryFolderContents(string folderId) public void GetDirectoryFolderContents(string folderId)
@@ -403,7 +402,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
DirectoryBrowseHistoryStack.Push(_currentDirectoryResult); DirectoryBrowseHistoryStack.Push(_currentDirectoryResult);
CurrentDirectoryResult = directoryResults; CurrentDirectoryResult = directoryResults;
} }
public void SetCurrentDirectoryToRoot() public void SetCurrentDirectoryToRoot()
@@ -560,7 +558,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
break; break;
} }
} }
}; };
@@ -587,7 +584,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
LocalLayoutFeedback.FireUpdate(); LocalLayoutFeedback.FireUpdate();
break; break;
} }
} }
}; };
@@ -697,7 +693,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
DirectoryBrowseHistory = new List<CodecDirectory>(); DirectoryBrowseHistory = new List<CodecDirectory>();
DirectoryBrowseHistoryStack = new Stack<CodecDirectory>(); DirectoryBrowseHistoryStack = new Stack<CodecDirectory>();
} }
private void SetUpRouting() private void SetUpRouting()
@@ -772,12 +767,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
if (s == "1") if (s == "1")
{ {
CommDebuggingIsOn = true; CommDebuggingIsOn = true;
Debug.Console(0, this, "Comm Debug Enabled."); Debug.Console(1, this, "Comm Debug Enabled.");
} }
else else
{ {
CommDebuggingIsOn = false; 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 // Counts the curly braces
if (message.Contains("client_loop: send disconnect: Broken pipe")) 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."); "Zoom Room Controller or App connected. Essentials will NOT control the Zoom Room until it is disconnected.");
return; return;
@@ -1119,6 +1114,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
if (participant != null) 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) switch (participant.Event)
{ {
case "ZRCUserChangedEventUserInfoUpdated": case "ZRCUserChangedEventUserInfoUpdated":
@@ -1144,10 +1146,35 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
} }
break; break;
case "ZRCUserChangedEventJoinedMeeting": 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); Status.Call.Participants.Add(participant);
}
break; break;
} }
} }
Debug.Console(1, this,
"[DeserializeResponse] zCommands.listparticipantresult - participant.event: {0} ***********************************",
participant.Event);
}
} }
break; break;
} }
@@ -1157,7 +1184,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
Status.Call.Participants); Status.Call.Participants);
Participants.CurrentParticipants = participants; Participants.CurrentParticipants = participants;
PrintCurrentCallParticipants(); PrintCurrentCallParticipants();
break; break;
@@ -1291,6 +1317,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
var disconnectEvent = var disconnectEvent =
JsonConvert.DeserializeObject<zEvent.CallDisconnect>(responseObj.ToString()); JsonConvert.DeserializeObject<zEvent.CallDisconnect>(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 (disconnectEvent.Successful)
{ {
if (ActiveCalls.Count > 0) if (ActiveCalls.Count > 0)
@@ -1299,15 +1330,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
if (activeCall != null) 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; activeCall.Status = eCodecCallStatus.Disconnected;
OnCallStatusChange(activeCall); OnCallStatusChange(activeCall);
} }
} }
var emptyList = new List<Participant>();
Participants.CurrentParticipants = emptyList;
} }
Debug.Console(1, this,
"[DeserializeResponse] zEvent.calldisconnect ********************************************");
UpdateCallStatus(); UpdateCallStatus();
break; break;
} }
@@ -1358,20 +1393,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
var status = responseObj.ToObject<zEvent.PinStatusOfScreenNotification>(); var status = responseObj.ToObject<zEvent.PinStatusOfScreenNotification>();
Debug.Console(1, this, "Pin Status notification for UserId: {0}, ScreenIndex: {1}", status.PinnedUserId, status.ScreenIndex); Debug.Console(1, this, "Pin Status notification for UserId: {0}, ScreenIndex: {1}", status.PinnedUserId,
status.ScreenIndex);
Participant alreadyPinnedParticipant = null; Participant alreadyPinnedParticipant = null;
// Check for a participant already pinned to the same screen index. // Check for a participant already pinned to the same screen index.
if (status.PinnedUserId > 0) if (status.PinnedUserId > 0)
{ {
alreadyPinnedParticipant = Participants.CurrentParticipants.FirstOrDefault(p => p.ScreenIndexIsPinnedToFb.Equals(status.ScreenIndex)); 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. // 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) if (alreadyPinnedParticipant != null && alreadyPinnedParticipant.UserId != status.PinnedUserId)
{ {
Debug.Console(1, this, "Participant: {0} with id: {1} already pinned to screenIndex {2}. Clearing pinned fb.", Debug.Console(1, this, "Participant: {0} with id: {1} already pinned to screenIndex {2}. Clearing pinned fb.",
alreadyPinnedParticipant.Name, alreadyPinnedParticipant.UserId, alreadyPinnedParticipant.ScreenIndexIsPinnedToFb); alreadyPinnedParticipant.Name, alreadyPinnedParticipant.UserId,
alreadyPinnedParticipant.ScreenIndexIsPinnedToFb);
alreadyPinnedParticipant.IsPinnedFb = false; alreadyPinnedParticipant.IsPinnedFb = false;
alreadyPinnedParticipant.ScreenIndexIsPinnedToFb = -1; alreadyPinnedParticipant.ScreenIndexIsPinnedToFb = -1;
} }
@@ -1386,16 +1424,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
} }
else else
{ {
participant = Participants.CurrentParticipants.FirstOrDefault(p => p.ScreenIndexIsPinnedToFb.Equals(status.ScreenIndex)); participant =
Participants.CurrentParticipants.FirstOrDefault(p => p.ScreenIndexIsPinnedToFb.Equals(status.ScreenIndex));
if (participant == null && alreadyPinnedParticipant == null) 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); Debug.Console(1, this, "no matching participant found by pinned_user_id: {0} or screen_index: {1}",
status.PinnedUserId, status.ScreenIndex);
return; return;
} }
else if (participant != null) else if (participant != null)
{ {
Debug.Console(2, this, "Unpinning {0} with id: {1} from screen index: {2}", participant.Name, participant.UserId, status.ScreenIndex); Debug.Console(2, this, "Unpinning {0} with id: {1} from screen index: {2}", participant.Name,
participant.UserId, status.ScreenIndex);
participant.IsPinnedFb = false; participant.IsPinnedFb = false;
participant.ScreenIndexIsPinnedToFb = -1; participant.ScreenIndexIsPinnedToFb = -1;
} }
@@ -1440,6 +1481,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
JsonConvert.PopulateObject(responseObj.ToString(), Status.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(); UpdateCallStatus();
break; break;
@@ -1535,18 +1586,26 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
} }
} }
/// <summary>
/// Retrieves the current call participants list
/// </summary>
public void GetCurrentCallParticipants()
{
SendText("zCommand Call ListParticipants");
}
/// <summary>
/// Prints the current call particiapnts list
/// </summary>
public void PrintCurrentCallParticipants() public void PrintCurrentCallParticipants()
{ {
if (Debug.Level <= 0) if (Debug.Level <= 0) return;
{
return;
}
Debug.Console(1, this, "*************************** Call Participants **************************"); Debug.Console(1, this, "*************************** Call Participants **************************");
foreach (var participant in Participants.CurrentParticipants) foreach (var participant in Participants.CurrentParticipants)
{ {
Debug.Console(1, this, "Name: {0} Audio: {1} IsHost: {2}", participant.Name, Debug.Console(1, this, "UserId: {3} Name: {0} Audio: {1} IsHost: {2}",
participant.AudioMuteFb, participant.IsHost); participant.Name, participant.AudioMuteFb, participant.IsHost, participant.UserId);
} }
Debug.Console(1, this, "************************************************************************"); Debug.Console(1, this, "************************************************************************");
} }
@@ -1566,16 +1625,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
private void UpdateCallStatus() private void UpdateCallStatus()
{ {
Debug.Console(1, this, "[UpdateCallStatus] Current Call Status: {0}", 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) if (Status.Call != null)
{ {
var callStatus = Status.Call.Status; 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) if (callStatus != zStatus.eCallStatus.IN_MEETING && callStatus != zStatus.eCallStatus.CONNECTING_MEETING)
{ {
Debug.Console(1, this, "Creating new Status.Call object"); Debug.Console(1, this, "[UpdateCallStatus] Creating new Status.Call object");
Status.Call = new zStatus.Call {Status = callStatus}; Status.Call = new zStatus.Call {Status = callStatus};
OnCallStatusChange(new CodecActiveCallItem() {Status = eCodecCallStatus.Disconnected}); OnCallStatusChange(new CodecActiveCallItem() {Status = eCodecCallStatus.Disconnected});
@@ -1600,10 +1659,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
break; break;
} }
if (!string.IsNullOrEmpty(Status.Call.Info.meeting_id))
{
var newCall = new CodecActiveCallItem var newCall = new CodecActiveCallItem
{ {
Name = Status.Call.Info.meeting_list_item.meetingName, Name = Status.Call.Info.meeting_list_item.meetingName,
Number = Status.Call.Info.meeting_id, Number = Status.Call.Info.meeting_list_item.meetingNumber,
Id = Status.Call.Info.meeting_id, Id = Status.Call.Info.meeting_id,
Status = newStatus, Status = newStatus,
Type = eCodecCallType.Video, Type = eCodecCallType.Video,
@@ -1611,13 +1672,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
ActiveCalls.Add(newCall); ActiveCalls.Add(newCall);
Debug.Console(1, this, "[UpdateCallStatus] Current Call Status: {0}", Debug.Console(1, this, "[UpdateCallStatus] IF w/ meeting_id AcitveCalls.Count == {1} - Current Call Status: {0}",
Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call"); 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 else
{ {
@@ -1633,14 +1698,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
break; break;
} }
Debug.Console(1, this, "[UpdateCallStatus] Current Call Status: {0}", Debug.Console(1, this, "[UpdateCallStatus] ELSE ActiveCalls.Count == {1} - Current Call Status: {0}",
Status.Call != null ? Status.Call.Sharing.State.ToString() : "no call"); Status.Call != null ? Status.Call.Status.ToString() : "no call", ActiveCalls.Count);
OnCallStatusChange(existingCall); OnCallStatusChange(existingCall);
} }
} }
Debug.Console(1, this, "*************************** Active Calls ********************************"); Debug.Console(1, this, "[UpdateCallStatus] Active Calls ------------------------------");
// Clean up any disconnected calls left in the list // Clean up any disconnected calls left in the list
for (int i = 0; i < ActiveCalls.Count; i++) for (int i = 0; i < ActiveCalls.Count; i++)
@@ -1648,26 +1713,27 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
var call = ActiveCalls[i]; var call = ActiveCalls[i];
Debug.Console(1, this, Debug.Console(1, this,
@"Name: {0} @"ID: {1}
ID: {1} Number: {5}
Name: {0}
IsActive: {2} IsActive: {2}
Status: {3} 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) 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); ActiveCalls.Remove(call);
} }
} }
Debug.Console(1, this, "**************************************************************************"); Debug.Console(1, this, "[UpdateCallStatus] Active Calls ------------------------------");
//clear participants list after call cleanup //clear participants list after call cleanup
if (ActiveCalls.Count == 0)
{
var emptyList = new List<Participant>(); var emptyList = new List<Participant>();
Participants.CurrentParticipants = emptyList; Participants.CurrentParticipants = emptyList;
} if (ActiveCalls.Count > 0) GetCurrentCallParticipants();
} }
protected override void OnCallStatusChange(CodecActiveCallItem item) protected override void OnCallStatusChange(CodecActiveCallItem item)
@@ -1675,7 +1741,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
base.OnCallStatusChange(item); base.OnCallStatusChange(item);
Debug.Console(1, this, "[OnCallStatusChange] Current Call Status: {0}", 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) if (_props.AutoDefaultLayouts)
{ {
@@ -1726,7 +1792,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public override void MuteOn() public override void MuteOn()
{ {
SetVolume(0); SetVolume(0);
} }
@@ -1828,13 +1893,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
layoutsCodec.AvailableLayoutsChanged += (o, a) => layoutsCodec.AvailableLayoutsChanged += (o, a) =>
{ {
trilist.SetBool(joinMap.LayoutGalleryIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.Gallery 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 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 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 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 // pass the names used to set the layout through the bridge
trilist.SetString(joinMap.LayoutGalleryIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.Gallery.ToString()); trilist.SetString(joinMap.LayoutGalleryIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.Gallery.ToString());
@@ -1845,10 +1917,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
trilist.SetSigFalseAction(joinMap.SwapContentWithThumbnail.JoinNumber, () => layoutsCodec.SwapContentWithThumbnail()); trilist.SetSigFalseAction(joinMap.SwapContentWithThumbnail.JoinNumber, () => layoutsCodec.SwapContentWithThumbnail());
layoutsCodec.CanSwapContentWithThumbnailFeedback.LinkInputSig(trilist.BooleanInput[joinMap.CanSwapContentWithThumbnail.JoinNumber]); layoutsCodec.CanSwapContentWithThumbnailFeedback.LinkInputSig(
layoutsCodec.ContentSwappedWithThumbnailFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SwapContentWithThumbnail.JoinNumber]); 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]); layoutsCodec.LayoutViewIsOnLastPageFeedback.LinkInputSig(trilist.BooleanInput[joinMap.LayoutIsOnLastPage.JoinNumber]);
trilist.SetSigFalseAction(joinMap.LayoutTurnToNextPage.JoinNumber, () => layoutsCodec.LayoutTurnNextPage()); trilist.SetSigFalseAction(joinMap.LayoutTurnToNextPage.JoinNumber, () => layoutsCodec.LayoutTurnNextPage());
trilist.SetSigFalseAction(joinMap.LayoutTurnToPreviousPage.JoinNumber, () => layoutsCodec.LayoutTurnPreviousPage()); trilist.SetSigFalseAction(joinMap.LayoutTurnToPreviousPage.JoinNumber, () => layoutsCodec.LayoutTurnPreviousPage());
@@ -2037,14 +2112,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
directoryResult.ResultsFolderId = result.ResultsFolderId; directoryResult.ResultsFolderId = result.ResultsFolderId;
directoryResult.AddFoldersToDirectory(result.Folders); directoryResult.AddFoldersToDirectory(result.Folders);
directoryResult.AddContactsToDirectory(result.Contacts.Where((c) => c.ParentFolderId == result.ResultsFolderId).ToList()); directoryResult.AddContactsToDirectory(
result.Contacts.Where((c) => c.ParentFolderId == result.ResultsFolderId).ToList());
} }
else else
{ {
directoryResult = result; 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 // This will return the latest results to all UIs. Multiple indendent UI Directory browsing will require a different methodology
var handler = DirectoryResultReturned; var handler = DirectoryResultReturned;
@@ -2188,7 +2265,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
#region IHasParticipantPinUnpin Members #region IHasParticipantPinUnpin Members
private Func<int> NumberOfScreensFeedbackFunc { get { return () => Status.NumberOfScreens.NumOfScreens; } } private Func<int> NumberOfScreensFeedbackFunc
{
get { return () => Status.NumberOfScreens.NumOfScreens; }
}
public IntFeedback NumberOfScreensFeedback { get; private set; } public IntFeedback NumberOfScreensFeedback { get; private set; }
@@ -2330,6 +2410,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
#endregion #endregion
// TODO: #714 [ ] Implementation of IHasSelfviewPipSize // TODO: #714 [ ] Implementation of IHasSelfviewPipSize
#region Implementation of IHasSelfviewPipSize #region Implementation of IHasSelfviewPipSize
private CodecCommandWithLabel _currentSelfviewPipSize; private CodecCommandWithLabel _currentSelfviewPipSize;
@@ -2371,14 +2452,24 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
p => p.Command.ToLower().Equals(Configuration.Call.Layout.Size.ToString().ToLower())); p => p.Command.ToLower().Equals(Configuration.Call.Layout.Size.ToString().ToLower()));
} }
#endregion #endregion
#region Implementation of IHasPhoneDialing #region Implementation of IHasPhoneDialing
private Func<bool> PhoneOffHookFeedbackFunc { get { return () => Status.PhoneCall.OffHook; } } private Func<bool> PhoneOffHookFeedbackFunc
private Func<string> CallerIdNameFeedbackFunc { get { return () => Status.PhoneCall.PeerDisplayName; } } {
private Func<string> CallerIdNumberFeedbackFunc { get { return () => Status.PhoneCall.PeerNumber; } } get { return () => Status.PhoneCall.OffHook; }
}
private Func<string> CallerIdNameFeedbackFunc
{
get { return () => Status.PhoneCall.PeerDisplayName; }
}
private Func<string> CallerIdNumberFeedbackFunc
{
get { return () => Status.PhoneCall.PeerNumber; }
}
public BoolFeedback PhoneOffHookFeedback { get; private set; } public BoolFeedback PhoneOffHookFeedback { get; private set; }
public StringFeedback CallerIdNameFeedback { get; private set; } public StringFeedback CallerIdNameFeedback { get; private set; }
@@ -2405,10 +2496,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public event EventHandler<LayoutInfoChangedEventArgs> AvailableLayoutsChanged; public event EventHandler<LayoutInfoChangedEventArgs> AvailableLayoutsChanged;
private Func<bool> LayoutViewIsOnFirstPageFeedbackFunc { get { return () => Status.Layout.is_In_First_Page; } } private Func<bool> LayoutViewIsOnFirstPageFeedbackFunc
private Func<bool> LayoutViewIsOnLastPageFeedbackFunc { get { return () => Status.Layout.is_In_Last_Page; } } {
private Func<bool> CanSwapContentWithThumbnailFeedbackFunc { get { return () => Status.Layout.can_Switch_Floating_Share_Content; } } get { return () => Status.Layout.is_In_First_Page; }
private Func<bool> ContentSwappedWithThumbnailFeedbackFunc { get { return () => Configuration.Call.Layout.ShareThumb; } } }
private Func<bool> LayoutViewIsOnLastPageFeedbackFunc
{
get { return () => Status.Layout.is_In_Last_Page; }
}
private Func<bool> CanSwapContentWithThumbnailFeedbackFunc
{
get { return () => Status.Layout.can_Switch_Floating_Share_Content; }
}
private Func<bool> ContentSwappedWithThumbnailFeedbackFunc
{
get { return () => Configuration.Call.Layout.ShareThumb; }
}
public BoolFeedback LayoutViewIsOnFirstPageFeedback { get; private set; } public BoolFeedback LayoutViewIsOnFirstPageFeedback { get; private set; }
@@ -2478,7 +2584,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
if (CanSwapContentWithThumbnailFeedback.BoolValue) 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 // 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 // to toggle the state
SendText(String.Format("zConfiguration Call Layout ShareThumb: {0}", oppositeValue)); SendText(String.Format("zConfiguration Call Layout ShareThumb: {0}", oppositeValue));
@@ -2543,7 +2650,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
zConfiguration.eLayoutStyle nextLayout; zConfiguration.eLayoutStyle nextLayout;
if (((zConfiguration.eLayoutStyle)currentLayout & zConfiguration.eLayoutStyle.ShareAll) == zConfiguration.eLayoutStyle.ShareAll) if (((zConfiguration.eLayoutStyle) currentLayout & zConfiguration.eLayoutStyle.ShareAll) ==
zConfiguration.eLayoutStyle.ShareAll)
{ {
nextLayout = zConfiguration.eLayoutStyle.Gallery; nextLayout = zConfiguration.eLayoutStyle.Gallery;
} }
@@ -2573,7 +2681,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
} }
#endregion #endregion
} }
/// <summary> /// <summary>