Merge branch 'development' into feature/room-combining

This commit is contained in:
Neil Dorin
2021-08-16 14:46:52 -06:00
12 changed files with 661 additions and 467 deletions

View File

@@ -454,7 +454,8 @@ namespace PepperDash.Essentials
else else
{ {
Debug.Console(1, this, "sourceListKey present but not yet implemented"); Debug.Console(1, this, "sourceListKey present but not yet implemented");
throw new NotImplementedException();
RunRouteAction(routeKey, new Action(() => { }));
} }
} }
@@ -471,7 +472,11 @@ namespace PepperDash.Essentials
RunRouteAction(routeKey, successCallback); RunRouteAction(routeKey, successCallback);
} }
else else
throw new NotImplementedException(); {
Debug.Console(1, this, "sourceListKey present but not yet implemented");
RunRouteAction(routeKey, successCallback);
}
} }
/// <summary> /// <summary>

View File

@@ -752,10 +752,10 @@ namespace PepperDash.Essentials
/// 15044 Close button for source modal overlay /// 15044 Close button for source modal overlay
/// </summary> /// </summary>
public const uint SourceBackgroundOverlayClosePress = 15044; public const uint SourceBackgroundOverlayClosePress = 15044;
/// <summary> ///// <summary>
/// 15045 - Visibility for the bar containing call navigation button list ///// 15045 - Visibility for the bar containing call navigation button list
/// </summary> ///// </summary>
public const uint CallStagingBarVisible = 15045; //public const uint CallStagingBarVisible = 15045;
/// <summary> /// <summary>
/// 15046 /// 15046
/// </summary> /// </summary>

View File

@@ -316,7 +316,7 @@ namespace PepperDash.Essentials.UIDrivers
void CommunicationMonitor_StatusChange(object sender, MonitorStatusChangeEventArgs e) void CommunicationMonitor_StatusChange(object sender, MonitorStatusChangeEventArgs e)
{ {
var c = sender as ICommunicationMonitor; var c = sender as ICommunicationMonitor;
if (StatusListDeviceIndexes.ContainsKey(c)) if (c != null && StatusListDeviceIndexes.ContainsKey(c))
{ {
var i = StatusListDeviceIndexes[c]; var i = StatusListDeviceIndexes[c];
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)e.Status; StatusList.UShortInputSig(i, 1).UShortValue = (ushort)e.Status;

View File

@@ -173,10 +173,28 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController Keyboard { get; private set; } public PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController Keyboard { get; private set; }
private UiDisplayMode _currentMode;
/// <summary> /// <summary>
/// The mode showing. Presentation or call. /// The mode showing. Presentation or call.
/// </summary> /// </summary>
UiDisplayMode CurrentMode = UiDisplayMode.Start; UiDisplayMode CurrentMode
{
get
{
return _currentMode;
}
set
{
if (value != _currentMode)
{
_currentMode = value;
SetActivityFooterFeedbacks();
}
}
}
CTimer NextMeetingTimer; CTimer NextMeetingTimer;
@@ -207,6 +225,7 @@ namespace PepperDash.Essentials
MeetingOrContactMethodModalSrl = new SubpageReferenceList(TriList, UISmartObjectJoin.MeetingListSRL, 3, 3, 5); MeetingOrContactMethodModalSrl = new SubpageReferenceList(TriList, UISmartObjectJoin.MeetingListSRL, 3, 3, 5);
CurrentMode = UiDisplayMode.Start;
// buttons are added in SetCurrentRoom // buttons are added in SetCurrentRoom
//HeaderButtonsList = new SmartObjectHeaderButtonList(TriList.SmartObjects[UISmartObjectJoin.HeaderButtonList]); //HeaderButtonsList = new SmartObjectHeaderButtonList(TriList.SmartObjects[UISmartObjectJoin.HeaderButtonList]);
@@ -607,12 +626,22 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
void SetActivityFooterFeedbacks() void SetActivityFooterFeedbacks()
{ {
CallButtonSig.BoolValue = CurrentMode == UiDisplayMode.Call if (CurrentRoom != null)
{
var startMode = CurrentMode == UiDisplayMode.Start;
var presentationMode = CurrentMode == UiDisplayMode.Presentation;
var callMode = CurrentMode == UiDisplayMode.Call;
TriList.SetBool(StartPageVisibleJoin, startMode ? true : false);
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, presentationMode ? true : false);
CallButtonSig.BoolValue = callMode
&& CurrentRoom.ShutdownType == eShutdownType.None; && CurrentRoom.ShutdownType == eShutdownType.None;
ShareButtonSig.BoolValue = CurrentMode == UiDisplayMode.Presentation ShareButtonSig.BoolValue = presentationMode
&& CurrentRoom.ShutdownType == eShutdownType.None; && CurrentRoom.ShutdownType == eShutdownType.None;
EndMeetingButtonSig.BoolValue = CurrentRoom.ShutdownType != eShutdownType.None; EndMeetingButtonSig.BoolValue = CurrentRoom.ShutdownType != eShutdownType.None;
} }
}
/// <summary> /// <summary>
/// ///
@@ -623,14 +652,13 @@ namespace PepperDash.Essentials
return; return;
HideLogo(); HideLogo();
HideNextMeetingPopup(); HideNextMeetingPopup();
TriList.SetBool(StartPageVisibleJoin, false); //TriList.SetBool(StartPageVisibleJoin, false);
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, false); //TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, false);
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false); //TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
if (CurrentSourcePageManager != null) if (CurrentSourcePageManager != null)
CurrentSourcePageManager.Hide(); CurrentSourcePageManager.Hide();
PowerOnFromCall(); PowerOnFromCall();
CurrentMode = UiDisplayMode.Call; CurrentMode = UiDisplayMode.Call;
SetActivityFooterFeedbacks();
VCDriver.Show(); VCDriver.Show();
} }
@@ -643,9 +671,6 @@ namespace PepperDash.Essentials
if (VCDriver.IsVisible) if (VCDriver.IsVisible)
VCDriver.Hide(); VCDriver.Hide();
HideNextMeetingPopup(); HideNextMeetingPopup();
TriList.SetBool(StartPageVisibleJoin, false);
TriList.SetBool(UIBoolJoin.CallStagingBarVisible, false);
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, true);
// 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)
{ {
@@ -665,7 +690,6 @@ namespace PepperDash.Essentials
} }
CurrentMode = UiDisplayMode.Presentation; CurrentMode = UiDisplayMode.Presentation;
SetupSourceList(); SetupSourceList();
SetActivityFooterFeedbacks();
} }
/// <summary> /// <summary>
@@ -707,6 +731,8 @@ namespace PepperDash.Essentials
if (CurrentRoom.CurrentSourceInfo == null) if (CurrentRoom.CurrentSourceInfo == null)
return; return;
CurrentMode = UiDisplayMode.Presentation;
if (CurrentRoom.CurrentSourceInfo.SourceDevice == null) if (CurrentRoom.CurrentSourceInfo.SourceDevice == null)
{ {
TriList.SetBool(UIBoolJoin.SelectASourceVisible, true); TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
@@ -1218,9 +1244,8 @@ namespace PepperDash.Essentials
VCDriver.Hide(); VCDriver.Hide();
SetupActivityFooterWhenRoomOff(); SetupActivityFooterWhenRoomOff();
ShowLogo(); ShowLogo();
SetActivityFooterFeedbacks(); //TriList.BooleanInput[UIBoolJoin.VolumeDualMute1Visible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.VolumeDualMute1Visible].BoolValue = false; //TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false;
// Clear this so that the pesky meeting warning can resurface every minute when off // Clear this so that the pesky meeting warning can resurface every minute when off
LastMeetingDismissedId = null; LastMeetingDismissedId = null;
} }

View File

@@ -787,12 +787,14 @@ namespace PepperDash.Essentials.UIDrivers.VC
if (camerasCodec != null && camerasCodec.SelectedCamera != null) if (camerasCodec != null && camerasCodec.SelectedCamera != null)
{ {
Debug.Console(2, "Attempting to map camera actions to selected camera: '{0}'", camerasCodec.SelectedCamera.Key);
var dpad = CameraPtzPad; var dpad = CameraPtzPad;
var camera = camerasCodec.SelectedCamera as IHasCameraPtzControl; var camera = camerasCodec.SelectedCamera as IHasCameraPtzControl;
if (camera != null) if (camera != null)
{ {
Debug.Console(2, "Selected camera is IHasCameraPtzControl");
if (camerasCodec.SelectedCamera.CanTilt) if (camerasCodec.SelectedCamera.CanTilt)
{ {
dpad.SigUp.SetBoolSigAction((b) => dpad.SigUp.SetBoolSigAction((b) =>
@@ -857,6 +859,14 @@ namespace PepperDash.Essentials.UIDrivers.VC
} }
} }
else
{
Debug.Console(2, "Selected Camera is not IHasCameraPtzControl. No controls to map");
}
}
else
{
Debug.Console(2, "Codec does not have cameras of selected camera is null");
} }
} }
@@ -1036,21 +1046,20 @@ namespace PepperDash.Essentials.UIDrivers.VC
void SetupDirectoryList() void SetupDirectoryList()
{ {
var codec = Codec as IHasDirectory; var codec = Codec as IHasDirectory;
if (codec != null) if (codec == null)
{ {
return;
}
DirectoryList = new SmartObjectDynamicList(TriList.SmartObjects[UISmartObjectJoin.VCDirectoryList], DirectoryList = new SmartObjectDynamicList(TriList.SmartObjects[UISmartObjectJoin.VCDirectoryList],
true, 1300); true, 1300);
codec.DirectoryResultReturned += new EventHandler<DirectoryEventArgs>(dir_DirectoryResultReturned); codec.DirectoryResultReturned += dir_DirectoryResultReturned;
if (codec.PhonebookSyncState.InitialSyncComplete) if (codec.PhonebookSyncState.InitialSyncComplete)
SetCurrentDirectoryToRoot(); SetCurrentDirectoryToRoot();
else else
{ {
codec.PhonebookSyncState.InitialSyncCompleted += new EventHandler<EventArgs>(PhonebookSyncState_InitialSyncCompleted); codec.PhonebookSyncState.InitialSyncCompleted += PhonebookSyncState_InitialSyncCompleted;
}
RefreshDirectory();
} }
} }
@@ -1059,11 +1068,15 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary> /// </summary>
void SetCurrentDirectoryToRoot() void SetCurrentDirectoryToRoot()
{ {
(Codec as IHasDirectory).SetCurrentDirectoryToRoot(); var hasDirectory = Codec as IHasDirectory;
if (hasDirectory == null)
{
return;
}
hasDirectory.SetCurrentDirectoryToRoot();
SearchKeypadClear(); SearchKeypadClear();
RefreshDirectory();
} }
/// <summary> /// <summary>
@@ -1075,10 +1088,17 @@ namespace PepperDash.Essentials.UIDrivers.VC
{ {
var codec = Codec as IHasDirectory; var codec = Codec as IHasDirectory;
if (codec == null)
{
return;
}
if (!codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue)
{
return;
}
SetCurrentDirectoryToRoot(); SetCurrentDirectoryToRoot();
RefreshDirectory();
} }
/// <summary> /// <summary>
@@ -1088,8 +1108,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// <param name="e"></param> /// <param name="e"></param>
void dir_DirectoryResultReturned(object sender, DirectoryEventArgs e) void dir_DirectoryResultReturned(object sender, DirectoryEventArgs e)
{ {
RefreshDirectory(e.Directory);
RefreshDirectory();
} }
/// <summary> /// <summary>
@@ -1121,13 +1140,24 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="dir"></param>
void RefreshDirectory() void RefreshDirectory()
{ {
if ((Codec as IHasDirectory).CurrentDirectoryResult.CurrentDirectoryResults.Count > 0) var codec = Codec as IHasDirectory;
if (codec == null)
{
return;
}
RefreshDirectory(codec.CurrentDirectoryResult);
}
void RefreshDirectory(CodecDirectory directory)
{
if (directory.CurrentDirectoryResults.Count > 0)
{ {
ushort i = 0; ushort i = 0;
foreach (var r in (Codec as IHasDirectory).CurrentDirectoryResult.CurrentDirectoryResults) foreach (var r in directory.CurrentDirectoryResults)
{ {
if (i == DirectoryList.MaxCount) if (i == DirectoryList.MaxCount)
{ {
@@ -1147,21 +1177,35 @@ namespace PepperDash.Essentials.UIDrivers.VC
// If more than one contact method, show contact method modal dialog // If more than one contact method, show contact method modal dialog
DirectoryList.SetItemButtonAction(i, b => DirectoryList.SetItemButtonAction(i, b =>
{ {
if (!b) if (b)
{ {
return;
}
// Refresh the contact methods list // Refresh the contact methods list
RefreshContactMethodsModalList(dc); RefreshContactMethodsModalList(dc);
Parent.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MeetingsOrContacMethodsListVisible); Parent.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MeetingsOrContacMethodsListVisible);
}
}); });
} }
else if (dc.ContactMethods.Count == 1)
{
var invitableContact = dc as IInvitableContact;
if (invitableContact != null)
{
DirectoryList.SetItemButtonAction(i, b => { if (!b) Codec.Dial(invitableContact); });
}
else else
{ {
// If only one contact method, just dial that method // If only one contact method, just dial that method
DirectoryList.SetItemButtonAction(i, b => { if (!b) Codec.Dial(dc.ContactMethods[0].Number); }); DirectoryList.SetItemButtonAction(i, b => { if (!b) Codec.Dial(dc.ContactMethods[0].Number); });
} }
} }
else
{
Debug.Console(1, "Unable to dial contact. No availble ContactMethod(s) specified");
}
}
else // is DirectoryFolder else // is DirectoryFolder
{ {
DirectoryList.SetItemMainText(i, string.Format("[+] {0}", r.Name)); DirectoryList.SetItemMainText(i, string.Format("[+] {0}", r.Name));
@@ -1186,7 +1230,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
DirectoryList.SetItemMainText(1, "No Results Found"); DirectoryList.SetItemMainText(1, "No Results Found");
} }
} }
void RefreshContactMethodsModalList(DirectoryContact contact) void RefreshContactMethodsModalList(DirectoryContact contact)

View File

@@ -216,21 +216,11 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
var presetsCamera = cameraDevice as IHasCameraPresets; var presetsCamera = cameraDevice as IHasCameraPresets;
presetsCamera.PresetsListHasChanged += new EventHandler<EventArgs>((o, a) => presetsCamera.PresetsListHasChanged += new EventHandler<EventArgs>((o, a) =>
{ {
for (int i = 1; i <= joinMap.NumberOfPresets.JoinNumber; i++) SendCameraPresetNamesToApi(presetsCamera, joinMap, trilist);
{
int tempNum = i - 1;
string label = "";
var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
if (preset != null)
label = preset.Description;
trilist.SetString((ushort) (joinMap.PresetLabelStart.JoinNumber + tempNum), label);
}
}); });
SendCameraPresetNamesToApi(presetsCamera, joinMap, trilist);
for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++) for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++)
{ {
int tempNum = i; int tempNum = i;
@@ -246,10 +236,35 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
presetsCamera.PresetStore(tempNum, label); presetsCamera.PresetStore(tempNum, label);
}); });
} }
trilist.OnlineStatusChange += (sender, args) =>
{
if (!args.DeviceOnLine)
{ return; }
SendCameraPresetNamesToApi(presetsCamera, joinMap, trilist);
};
}
}
private void SendCameraPresetNamesToApi(IHasCameraPresets presetsCamera, CameraControllerJoinMap joinMap, BasicTriList trilist)
{
for (int i = 1; i <= joinMap.NumberOfPresets.JoinNumber; i++)
{
int tempNum = i - 1;
string label = "";
var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
if (preset != null)
label = preset.Description;
trilist.SetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum), label);
} }
} }
} }
public class CameraPreset : PresetBase public class CameraPreset : PresetBase
{ {
public CameraPreset(int id, string description, bool isDefined, bool isDefinable) public CameraPreset(int id, string description, bool isDefined, bool isDefinable)

View File

@@ -525,6 +525,15 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
public event EventHandler<EventArgs> PresetsListHasChanged; public event EventHandler<EventArgs> PresetsListHasChanged;
protected void OnPresetsListHasChanged()
{
var handler = PresetsListHasChanged;
if (handler == null)
return;
handler.Invoke(this, EventArgs.Empty);
}
public List<CameraPreset> Presets { get; private set; } public List<CameraPreset> Presets { get; private set; }
public void PresetSelect(int preset) public void PresetSelect(int preset)
@@ -537,6 +546,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
SavePreset(preset); SavePreset(preset);
} }
#endregion #endregion
#region IHasCameraFocusControl Members #region IHasCameraFocusControl Members

View File

@@ -69,6 +69,22 @@ namespace PepperDash.Essentials.Devices.Common.Codec
[JsonProperty("directoryResults")] [JsonProperty("directoryResults")]
public List<DirectoryItem> CurrentDirectoryResults { get; private set; } public List<DirectoryItem> CurrentDirectoryResults { get; private set; }
public List<DirectoryItem> Contacts
{
get
{
return CurrentDirectoryResults.OfType<DirectoryContact>().Cast<DirectoryItem>().ToList();
}
}
public List<DirectoryItem> Folders
{
get
{
return CurrentDirectoryResults.OfType<DirectoryFolder>().Cast<DirectoryItem>().ToList();
}
}
/// <summary> /// <summary>
/// Used to store the ID of the current folder for CurrentDirectoryResults /// Used to store the ID of the current folder for CurrentDirectoryResults
/// </summary> /// </summary>
@@ -104,6 +120,15 @@ namespace PepperDash.Essentials.Devices.Common.Codec
SortDirectory(); SortDirectory();
} }
/// <summary>
/// Filters the CurrentDirectoryResults by the predicate
/// </summary>
/// <param name="predicate"></param>
public void FilterContacts(Func<DirectoryItem, bool> predicate)
{
CurrentDirectoryResults = CurrentDirectoryResults.Where(predicate).ToList();
}
/// <summary> /// <summary>
/// Sorts the DirectoryResults list to display all folders alphabetically, then all contacts alphabetically /// Sorts the DirectoryResults list to display all folders alphabetically, then all contacts alphabetically
/// </summary> /// </summary>

View File

@@ -276,6 +276,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
if (zoomRooms.Count > 0) if (zoomRooms.Count > 0)
{ {
// If so, setup a rooms and contacts folder and add them. // If so, setup a rooms and contacts folder and add them.
directory.ResultsFolderId = "root";
roomFolder.Name = "Rooms"; roomFolder.Name = "Rooms";
roomFolder.ParentFolderId = "root"; roomFolder.ParentFolderId = "root";
roomFolder.FolderId = "rooms"; roomFolder.FolderId = "rooms";
@@ -292,12 +295,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
try try
{ {
if (zoomContacts.Count == 0) return directory; if (zoomContacts.Count == 0)
{ {
return directory;
}
foreach (Contact c in zoomContacts) foreach (Contact c in zoomContacts)
{ {
var contact = new ZoomDirectoryContact { Name = c.ScreenName, ContactId = c.Jid }; var contact = new ZoomDirectoryContact { Name = c.ScreenName, ContactId = c.Jid };
contact.ContactMethods.Add(new ContactMethod() { Number = c.Jid, Device = eContactMethodDevice.Video, CallType = eContactMethodCallType.Video, ContactMethodId = c.Jid });
if (folders.Count > 0) if (folders.Count > 0)
{ {
contact.ParentFolderId = c.IsZoomRoom ? "rooms" : "contacts"; contact.ParentFolderId = c.IsZoomRoom ? "rooms" : "contacts";
@@ -308,7 +316,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
directory.AddContactsToDirectory(contacts); directory.AddContactsToDirectory(contacts);
} }
}
catch (Exception e) catch (Exception e)
{ {
Debug.Console(1, "Error converting Zoom Phonebook results to generic: {0}", e); Debug.Console(1, "Error converting Zoom Phonebook results to generic: {0}", e);
@@ -1161,11 +1168,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
} }
set set
{ {
if (value != _hideConfSelfVideo) //if (value != _hideConfSelfVideo)
{ //{
_hideConfSelfVideo = value; _hideConfSelfVideo = value;
NotifyPropertyChanged("HideConfSelfVideo"); NotifyPropertyChanged("HideConfSelfVideo");
} //}
} }
} }

View File

@@ -157,7 +157,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
get get
{ {
return () => 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
}
return scaledVol;
};
} }
} }
@@ -281,7 +292,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
var handler = CameraSelected; var handler = CameraSelected;
if (handler != null) if (handler != null)
{ {
handler(this, new CameraSelectedEventArgs(SelectedCamera)); handler(this, new CameraSelectedEventArgs(_selectedCamera));
} }
} }
} }
@@ -318,6 +329,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public BoolFeedback SelfviewIsOnFeedback { get; private set; } public BoolFeedback SelfviewIsOnFeedback { get; private set; }
public void GetSelfViewMode()
{
SendText("zConfiguration Video hide_conf_self_video");
}
public void SelfViewModeOn() public void SelfViewModeOn()
{ {
SendText("zConfiguration Video hide_conf_self_video: off"); SendText("zConfiguration Video hide_conf_self_video: off");
@@ -350,6 +366,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public CodecDirectory CurrentDirectoryResult public CodecDirectory CurrentDirectoryResult
{ {
get { return _currentDirectoryResult; } get { return _currentDirectoryResult; }
private set
{
_currentDirectoryResult = value;
Debug.Console(2, this, "CurrentDirectoryResult Updated. ResultsFolderId: {0}", _currentDirectoryResult.ResultsFolderId);
CurrentDirectoryResultIsNotDirectoryRoot.FireUpdate();
OnDirectoryResultReturned(_currentDirectoryResult);
}
} }
public CodecPhonebookSyncState PhonebookSyncState { get; private set; } public CodecPhonebookSyncState PhonebookSyncState { get; private set; }
@@ -363,9 +389,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
c => c.Name.IndexOf(searchString, 0, StringComparison.OrdinalIgnoreCase) > -1)); c => c.Name.IndexOf(searchString, 0, StringComparison.OrdinalIgnoreCase) > -1));
DirectoryBrowseHistoryStack.Clear(); DirectoryBrowseHistoryStack.Clear();
_currentDirectoryResult = directoryResults; CurrentDirectoryResult = directoryResults;
OnDirectoryResultReturned(directoryResults);
} }
public void GetDirectoryFolderContents(string folderId) public void GetDirectoryFolderContents(string folderId)
@@ -377,18 +402,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
DirectoryBrowseHistoryStack.Push(_currentDirectoryResult); DirectoryBrowseHistoryStack.Push(_currentDirectoryResult);
_currentDirectoryResult = directoryResults; CurrentDirectoryResult = directoryResults;
OnDirectoryResultReturned(directoryResults);
} }
public void SetCurrentDirectoryToRoot() public void SetCurrentDirectoryToRoot()
{ {
DirectoryBrowseHistoryStack.Clear(); DirectoryBrowseHistoryStack.Clear();
_currentDirectoryResult = DirectoryRoot; CurrentDirectoryResult = DirectoryRoot;
OnDirectoryResultReturned(DirectoryRoot);
} }
public void GetDirectoryParentFolderContents() public void GetDirectoryParentFolderContents()
@@ -400,9 +422,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
var currentDirectory = DirectoryBrowseHistoryStack.Pop(); var currentDirectory = DirectoryBrowseHistoryStack.Pop();
_currentDirectoryResult = currentDirectory; CurrentDirectoryResult = currentDirectory;
OnDirectoryResultReturned(currentDirectory);
} }
public BoolFeedback CurrentDirectoryResultIsNotDirectoryRoot { get; private set; } public BoolFeedback CurrentDirectoryResultIsNotDirectoryRoot { get; private set; }
@@ -669,16 +689,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
private void SetUpDirectory() private void SetUpDirectory()
{ {
DirectoryRoot = new CodecDirectory(); DirectoryRoot = new CodecDirectory() { ResultsFolderId = "root" };
_currentDirectoryResult = DirectoryRoot; CurrentDirectoryResultIsNotDirectoryRoot = new BoolFeedback(() => CurrentDirectoryResult.ResultsFolderId != "root");
CurrentDirectoryResult = DirectoryRoot;
DirectoryBrowseHistory = new List<CodecDirectory>(); DirectoryBrowseHistory = new List<CodecDirectory>();
DirectoryBrowseHistoryStack = new Stack<CodecDirectory>(); DirectoryBrowseHistoryStack = new Stack<CodecDirectory>();
CurrentDirectoryResultIsNotDirectoryRoot = new BoolFeedback(() => _currentDirectoryResult != DirectoryRoot);
CurrentDirectoryResultIsNotDirectoryRoot.FireUpdate();
} }
private void SetUpRouting() private void SetUpRouting()
@@ -1052,24 +1071,30 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
} }
case "phonebooklistresult": 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); JsonConvert.PopulateObject(responseObj.ToString(), Status.Phonebook);
var directoryResults =
zStatus.Phonebook.ConvertZoomContactsToGeneric(Status.Phonebook.Contacts);
if (!PhonebookSyncState.InitialSyncComplete) if (!PhonebookSyncState.InitialSyncComplete)
{ {
PhonebookSyncState.InitialPhonebookFoldersReceived(); PhonebookSyncState.InitialPhonebookFoldersReceived();
PhonebookSyncState.PhonebookRootEntriesReceived(); PhonebookSyncState.PhonebookRootEntriesReceived();
PhonebookSyncState.SetPhonebookHasFolders(false); PhonebookSyncState.SetPhonebookHasFolders(true);
PhonebookSyncState.SetNumberOfContacts(Status.Phonebook.Contacts.Count); PhonebookSyncState.SetNumberOfContacts(Status.Phonebook.Contacts.Count);
} }
var directoryResults = if (directoryResults.ResultsFolderId != "root")
zStatus.Phonebook.ConvertZoomContactsToGeneric(Status.Phonebook.Contacts); {
directoryResults.ResultsFolderId = "root";
}
DirectoryRoot = directoryResults; DirectoryRoot = directoryResults;
_currentDirectoryResult = DirectoryRoot; CurrentDirectoryResult = directoryResults;
OnDirectoryResultReturned(directoryResults);
break; break;
} }
@@ -1225,7 +1250,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
Direction = eCodecCallDirection.Incoming, Direction = eCodecCallDirection.Incoming,
Status = eCodecCallStatus.Ringing, Status = eCodecCallStatus.Ringing,
Type = eCodecCallType.Unknown, Type = eCodecCallType.Video,
Name = incomingCall.callerName, Name = incomingCall.callerName,
Id = incomingCall.callerJID Id = incomingCall.callerJID
}; };
@@ -1578,8 +1603,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
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,
Id = Status.Call.Info.meeting_id, Id = Status.Call.Info.meeting_id,
Status = newStatus Status = newStatus,
Type = eCodecCallType.Video,
}; };
ActiveCalls.Add(newCall); ActiveCalls.Add(newCall);
@@ -1693,12 +1720,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public override void MuteOff() public override void MuteOff()
{ {
Debug.Console(2, this, "Unmuting to previous level: {0}", _previousVolumeLevel);
SetVolume((ushort)_previousVolumeLevel); SetVolume((ushort)_previousVolumeLevel);
} }
public override void MuteOn() public override void MuteOn()
{ {
_previousVolumeLevel = Configuration.Audio.Output.Volume; // Store the previous level for recall
SetVolume(0); SetVolume(0);
} }
@@ -1997,7 +2024,27 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
/// <param name="result"></param> /// <param name="result"></param>
private void OnDirectoryResultReturned(CodecDirectory result) private void OnDirectoryResultReturned(CodecDirectory result)
{ {
CurrentDirectoryResultIsNotDirectoryRoot.FireUpdate(); try
{
Debug.Console(2, this, "OnDirectoryResultReturned");
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");
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);
// 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;
@@ -2005,9 +2052,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
handler(this, new DirectoryEventArgs handler(this, new DirectoryEventArgs
{ {
Directory = result, Directory = directoryResult,
DirectoryIsOnRoot = !CurrentDirectoryResultIsNotDirectoryRoot.BoolValue DirectoryIsOnRoot = !CurrentDirectoryResultIsNotDirectoryRoot.BoolValue
}); });
}
}
catch (Exception e)
{
Debug.Console(2, this, "Error: {0}", e);
} }
//PrintDirectory(result); //PrintDirectory(result);
@@ -2024,6 +2076,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
foreach (var cam in Status.Cameras) 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...
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); var camera = new ZoomRoomCamera(cam.id, cam.Name, this);
Cameras.Add(camera); Cameras.Add(camera);

View File

@@ -63,6 +63,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
: base(key, name) : base(key, name)
{ {
ParentCodec = codec; ParentCodec = codec;
Capabilities = eCameraCapabilities.Pan | eCameraCapabilities.Tilt | eCameraCapabilities.Zoom;
} }
/// <summary> /// <summary>