From a524b1607d88391d5a648beb08e3f2bd8356f8c7 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 28 Sep 2022 12:28:37 -0600 Subject: [PATCH 1/8] fix(essentials): Updates to deal with layouts and default layout for ZoomRoom --- .../DeviceTypeInterfaces/IPasswordPrompt.cs | 109 +++++++++--------- .../VideoCodec/ZoomRoom/ResponseObjects.cs | 18 +++ .../VideoCodec/ZoomRoom/ZoomRoom.cs | 42 ++++--- .../ZoomRoom/ZoomRoomPropertiesConfig.cs | 7 +- 4 files changed, 98 insertions(+), 78 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IPasswordPrompt.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IPasswordPrompt.cs index 6b3bae57..da61bbc0 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IPasswordPrompt.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/DeviceTypeInterfaces/IPasswordPrompt.cs @@ -1,61 +1,56 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - -namespace PepperDash.Essentials.Core -{ - /// - /// Describes the functionality required to prompt a user to enter a password - /// - public interface IPasswordPrompt - { - /// - /// Notifies when a password is required or is entered incorrectly - /// - event EventHandler PasswordRequired; - - /// - /// Submits the password - /// - /// - void SubmitPassword(string password); +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +namespace PepperDash.Essentials.Core +{ + /// + /// Describes the functionality required to prompt a user to enter a password + /// + public interface IPasswordPrompt + { + /// + /// Notifies when a password is required or is entered incorrectly + /// + event EventHandler PasswordRequired; /// - /// Cancels the password submission + /// Submits the password /// - void CancelPasswordPrompt(); - } - - public class PasswordPromptEventArgs : EventArgs - { - /// - /// Indicates if the last submitted password was incorrect - /// - public bool LastAttemptWasIncorrect { get; private set; } - - /// - /// Indicates that the login attempt has failed - /// - public bool LoginAttemptFailed { get; private set; } - - /// - /// Indicates that the process was cancelled and the prompt should be dismissed - /// - public bool LoginAttemptCancelled { get; private set; } - - /// - /// A message to be displayed to the user - /// - public string Message { get; private set; } - - public PasswordPromptEventArgs(bool lastAttemptIncorrect, bool loginFailed, bool loginCancelled, string message) - { - LastAttemptWasIncorrect = lastAttemptIncorrect; - LoginAttemptFailed = loginFailed; - LoginAttemptCancelled = loginCancelled; - Message = message; - } - } + /// + void SubmitPassword(string password); + } + + public class PasswordPromptEventArgs : EventArgs + { + /// + /// Indicates if the last submitted password was incorrect + /// + public bool LastAttemptWasIncorrect { get; private set; } + + /// + /// Indicates that the login attempt has failed + /// + public bool LoginAttemptFailed { get; private set; } + + /// + /// Indicates that the process was cancelled and the prompt should be dismissed + /// + public bool LoginAttemptCancelled { get; private set; } + + /// + /// A message to be displayed to the user + /// + public string Message { get; private set; } + + public PasswordPromptEventArgs(bool lastAttemptIncorrect, bool loginFailed, bool loginCancelled, string message) + { + LastAttemptWasIncorrect = lastAttemptIncorrect; + LoginAttemptFailed = loginFailed; + LoginAttemptCancelled = loginCancelled; + Message = message; + } + } } \ No newline at end of file diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs index 66b7fb1e..8ace1e71 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs @@ -627,6 +627,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom // backer variables private bool _can_Switch_Speaker_View; private bool _can_Switch_Wall_View; + private bool _can_Switch_Strip_View; private bool _can_Switch_Share_On_All_Screens; private bool _can_Switch_Floating_Share_Content; private bool _is_In_First_Page; @@ -714,6 +715,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom } } + [JsonProperty("can_Switch_Strip_View")] + public bool can_Switch_Strip_View + { + get + { + return _can_Switch_Strip_View; + } + set + { + if (value != _can_Switch_Strip_View) + { + _can_Switch_Strip_View = value; + NotifyPropertyChanged("can_Switch_Strip_View"); + } + } + } + [JsonProperty("is_In_First_Page")] public bool is_In_First_Page { 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 d491fa59..61737c90 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 @@ -810,8 +810,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom Debug.Console(1, this, "Status.Layout.PropertyChanged a.PropertyName: {0}", a.PropertyName); switch (a.PropertyName.ToLower()) { - case "can_switch_speaker_view": + case "can_Switch_speaker_view": case "can_switch_wall_view": + case "can_switch_strip_view": + case "video_type": case "can_switch_share_on_all_screens": { ComputeAvailableLayouts(); @@ -827,7 +829,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom LayoutViewIsOnLastPageFeedback.FireUpdate(); break; } - case "can_Switch_Floating_Share_Content": + case "can_switch_floating_share_content": { CanSwapContentWithThumbnailFeedback.FireUpdate(); break; @@ -1559,7 +1561,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom { JsonConvert.PopulateObject(responseObj.ToString(), Status.Call.Sharing); - SetLayout(); + SetDefaultLayout(); break; } @@ -1935,7 +1937,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom } } - private void SetLayout() + private void SetDefaultLayout() { if (!_props.AutoDefaultLayouts) return; @@ -1948,8 +1950,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom } else { - SendText(String.Format("zconfiguration call layout style: {0}", - _props.DefaultCallLayout)); + if (_props.DefaultCallLayout == (_props.DefaultCallLayout & AvailableLayouts)) + { + SendText(String.Format("zconfiguration call layout style: {0}", + _props.DefaultCallLayout)); + } + else + Debug.Console(0, this, "Unable to set default Layout. {0} not currently an available layout based on meeting state", _props.DefaultCallLayout); } } @@ -2149,8 +2156,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue ); + + SetDefaultLayout(); } - // TODO [ ] Issue #868 + else if (item.Status == eCodecCallStatus.Disconnected) { MeetingInfo = new MeetingInfo( @@ -2171,11 +2180,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom Debug.Console(1, this, "[OnCallStatusChange] Current Call Status: {0}", Status.Call != null ? Status.Call.Status.ToString() : "no call"); - - if (_props.AutoDefaultLayouts) - { - SetLayout(); - } } private string GetSharingStatus() @@ -3264,7 +3268,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom // There is no property that directly reports if strip mode is valid, but API stipulates // that strip mode is available if the number of screens is 1 - if (Status.NumberOfScreens.NumOfScreens == 1) + if (Status.NumberOfScreens.NumOfScreens == 1 || Status.Layout.can_Switch_Strip_View || Status.Layout.video_type.ToLower() == "strip") { availableLayouts |= zConfiguration.eLayoutStyle.Strip; } @@ -3279,10 +3283,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom var handler = LayoutInfoChanged; if (handler != null) { + + var currentLayout = zConfiguration.eLayoutStyle.None; + + currentLayout = (zConfiguration.eLayoutStyle)Enum.Parse(typeof(zConfiguration.eLayoutStyle), string.IsNullOrEmpty(LocalLayoutFeedback.StringValue) ? "None" : LocalLayoutFeedback.StringValue, true); + handler(this, new LayoutInfoChangedEventArgs() { AvailableLayouts = AvailableLayouts, - CurrentSelectedLayout = (zConfiguration.eLayoutStyle)Enum.Parse(typeof(zConfiguration.eLayoutStyle),string.IsNullOrEmpty(LocalLayoutFeedback.StringValue) ? "None" : LocalLayoutFeedback.StringValue , true), + CurrentSelectedLayout = currentLayout, LayoutViewIsOnFirstPage = LayoutViewIsOnFirstPageFeedback.BoolValue, LayoutViewIsOnLastPage = LayoutViewIsOnLastPageFeedback.BoolValue, CanSwapContentWithThumbnail = CanSwapContentWithThumbnailFeedback.BoolValue, @@ -3415,11 +3424,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom //OnPasswordRequired(false, false, true, ""); } - public void CancelPasswordPrompt() - { - OnPasswordRequired(false, false, true, "Login Cancelled"); - } - void OnPasswordRequired(bool lastAttemptIncorrect, bool loginFailed, bool loginCancelled, string message) { var handler = PasswordRequired; diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoomPropertiesConfig.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoomPropertiesConfig.cs index 3f752f43..771cfe11 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoomPropertiesConfig.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoomPropertiesConfig.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using Crestron.SimplSharp; using Newtonsoft.Json; +using Newtonsoft.Json.Converters; using PepperDash.Core; using PepperDash.Essentials.Core; @@ -29,11 +30,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom /* This layout will be selected when Sharing starts (either from Far end or locally)*/ [JsonProperty("defaultSharingLayout")] - public string DefaultSharingLayout { get; set; } + [JsonConverter(typeof(StringEnumConverter))] + public zConfiguration.eLayoutStyle DefaultSharingLayout { get; set; } //This layout will be selected when a call is connected and no content is being shared [JsonProperty("defaultCallLayout")] - public string DefaultCallLayout { get; set; } + [JsonConverter(typeof(StringEnumConverter))] + public zConfiguration.eLayoutStyle DefaultCallLayout { get; set; } [JsonProperty("minutesBeforeMeetingStart")] public int MinutesBeforeMeetingStart { get; set; } From 4deb9a08287163f9a0b749683639d91c4e1716bc Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 28 Sep 2022 14:55:14 -0600 Subject: [PATCH 2/8] fix(essentials): Updates to deal with sharing status and adds a property to notify if meeting can be recorded --- .../VideoCodec/Interfaces/IHasMeetingInfo.cs | 9 ++- .../VideoCodec/ZoomRoom/ResponseObjects.cs | 47 ++++++++++++++- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 60 ++++++++++++------- .../VideoCodec/ZoomRoom/ZoomRoomJoinMap.cs | 14 +++++ 4 files changed, 102 insertions(+), 28 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasMeetingInfo.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasMeetingInfo.cs index cfe70e1b..4d27535a 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasMeetingInfo.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasMeetingInfo.cs @@ -43,10 +43,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces [JsonProperty("isLocked", NullValueHandling = NullValueHandling.Ignore)] public Boolean IsLocked { get; private set; } [JsonProperty("isRecording", NullValueHandling = NullValueHandling.Ignore)] - public Boolean IsRecording { get; private set; } + public Boolean IsRecording { get; private set; } + [JsonProperty("canRecord", NullValueHandling = NullValueHandling.Ignore)] + public Boolean CanRecord { get; private set; } - public MeetingInfo(string id, string name, string host, string password, string shareStatus, bool isHost, bool isSharingMeeting, bool waitingForHost, bool isLocked, bool isRecording) + public MeetingInfo(string id, string name, string host, string password, string shareStatus, bool isHost, bool isSharingMeeting, bool waitingForHost, bool isLocked, bool isRecording, bool canRecord) { Id = id; Name = name; @@ -57,7 +59,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces IsSharingMeeting = isSharingMeeting; WaitingForHost = waitingForHost; IsLocked = isLocked; - IsRecording = isRecording; + IsRecording = isRecording; + CanRecord = CanRecord; } } diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs index 8ace1e71..1518c9d5 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs @@ -793,11 +793,43 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public class CallRecordInfo : NotifiableObject { private bool _meetingIsBeingRecorded; + private bool _canRecord; + private bool _emailRequired; - public bool canRecord { get; set; } - public bool emailRequired { get; set; } public bool amIRecording { get; set; } + public bool canRecord + { + get + { + return _canRecord; + } + set + { + if (value != _canRecord) + { + _canRecord = value; + NotifyPropertyChanged("canRecord"); + } + } + } + + public bool emailRequired + { + get + { + return _emailRequired; + } + set + { + if (value != _emailRequired) + { + _emailRequired = value; + NotifyPropertyChanged("emailRequired"); + } + } + } + public bool meetingIsBeingRecorded { get @@ -816,6 +848,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom } } + /// + /// Indicates if recording is allowed (when meeting capable and and email is not required to be entered by the user) + /// + public bool AllowRecord + { + get + { + return canRecord && !emailRequired; + } + } + public CallRecordInfo() { Debug.Console(2, Debug.ErrorLogLevel.Notice, "********************************************* CallRecordInfo() ******************************************"); 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 61737c90..a3b2cc8b 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 @@ -529,6 +529,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom /// private void SetUpCallFeedbackActions() { + Status.Sharing.PropertyChanged -= HandleSharingStateUpdate; + Status.Sharing.PropertyChanged += HandleSharingStateUpdate; + Status.Call.Sharing.PropertyChanged -= HandleSharingStateUpdate; Status.Call.Sharing.PropertyChanged += HandleSharingStateUpdate; @@ -541,7 +544,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom private void HandleCallRecordInfoStateUpdate(object sender, PropertyChangedEventArgs a) { - if (a.PropertyName == "meetingIsBeingRecorded") + if (a.PropertyName == "meetingIsBeingRecorded" || a.PropertyName == "emailRequired" || a.PropertyName == "canRecord") { MeetingIsRecordingFeedback.FireUpdate(); @@ -554,7 +557,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom MeetingInfo.IsSharingMeeting, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, - MeetingIsRecordingFeedback.BoolValue); + MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord); MeetingInfo = meetingInfo; } } @@ -580,10 +583,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom private void HandleSharingStateUpdate(object sender, PropertyChangedEventArgs a) { - if (a.PropertyName != "State") - { - return; - } + //if (a.PropertyName != "State") + //{ + // return; + //} SharingContentIsOnFeedback.FireUpdate(); ReceivingContent.FireUpdate(); @@ -593,21 +596,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom // Update the share status of the meeting info if (MeetingInfo == null) { - var sharingStatus = GetSharingStatus(); - - MeetingInfo = new MeetingInfo("", "", "", "", sharingStatus, GetIsHostMyself(), true, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue); + MeetingInfo = new MeetingInfo("", "", "", "", GetSharingStatus(), GetIsHostMyself(), true, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord); return; } var meetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, Participants.Host != null ? Participants.Host.Name : "None", - MeetingInfo.Password, GetSharingStatus(), GetIsHostMyself(), MeetingInfo.IsSharingMeeting, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue); + MeetingInfo.Password, GetSharingStatus(), GetIsHostMyself(), MeetingInfo.IsSharingMeeting, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord); MeetingInfo = meetingInfo; } catch (Exception e) { Debug.Console(1, this, "Error processing state property update. {0}", e.Message); Debug.Console(2, this, e.StackTrace); - MeetingInfo = new MeetingInfo("", "", "", "", "None", false, false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue); + MeetingInfo = new MeetingInfo("", "", "", "", "None", false, false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, false); } } @@ -714,7 +715,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom MeetingInfo.IsSharingMeeting, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, - MeetingIsRecordingFeedback.BoolValue + MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord ); } }; @@ -776,7 +777,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom MeetingInfo.IsSharingMeeting, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, - MeetingIsRecordingFeedback.BoolValue); + MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord); MeetingInfo = meetingInfo; break; } @@ -1470,13 +1471,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom MeetingInfo.Id, MeetingInfo.Name, Participants.Host.Name, - MeetingInfo.Password, - MeetingInfo.ShareStatus, + MeetingInfo.Password, + GetSharingStatus(), GetIsHostMyself(), MeetingInfo.IsSharingMeeting, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, - MeetingIsRecordingFeedback.BoolValue); + MeetingIsRecordingFeedback.BoolValue, + Status.Call.CallRecordInfo.AllowRecord + ); MeetingInfo = meetingInfo; PrintCurrentCallParticipants(); @@ -1691,14 +1694,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom if (MeetingInfo == null) { MeetingInfo = new MeetingInfo("Waiting For Host", "Waiting For Host", "Waiting For Host", "", - GetSharingStatus(), false, false, true, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue); + GetSharingStatus(), false, false, true, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord); UpdateCallStatus(); break; } MeetingInfo = new MeetingInfo("Waiting For Host", "Waiting For Host", "Waiting For Host", "", - GetSharingStatus(), false, false, true, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue); + GetSharingStatus(), false, false, true, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord); UpdateCallStatus(); @@ -1708,12 +1711,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom if (MeetingInfo == null) { MeetingInfo = new MeetingInfo("Waiting For Host", "Waiting For Host", "Waiting For Host", "", - GetSharingStatus(), false, false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue); + GetSharingStatus(), false, false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord); break; } MeetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, MeetingInfo.Host, MeetingInfo.Password, - GetSharingStatus(), GetIsHostMyself(), false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue); + GetSharingStatus(), GetIsHostMyself(), false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord); break; } @@ -1803,7 +1806,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom if (result.Success) { - MeetingInfo = new MeetingInfo("", "", "", "", "", true, true, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue); + MeetingInfo = new MeetingInfo("", "", "", "", GetSharingStatus(), true, true, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord); break; } @@ -2154,7 +2157,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom !String.Equals(Status.Call.Info.meeting_type,"NORMAL"), false, MeetingIsLockedFeedback.BoolValue, - MeetingIsRecordingFeedback.BoolValue + MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord ); SetDefaultLayout(); @@ -2172,7 +2175,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom false, false, false, - false + false, Status.Call.CallRecordInfo.AllowRecord ); } @@ -2392,6 +2395,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom /// public void LinkZoomRoomToApi(BasicTriList trilist, ZoomRoomJoinMap joinMap) { + var meetingInfoCodec = this as IHasMeetingInfo; + if (meetingInfoCodec != null) + { + trilist.SetBool(joinMap.MeetingCanRecord.JoinNumber, meetingInfoCodec.MeetingInfo.CanRecord); + + meetingInfoCodec.MeetingInfoChanged += (o, a) => + { + trilist.SetBool(joinMap.MeetingCanRecord.JoinNumber, a.Info.CanRecord); + }; + } + var recordingCodec = this as IHasMeetingRecordingWithPrompt; if (recordingCodec != null) { diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoomJoinMap.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoomJoinMap.cs index c377a664..7affd835 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoomJoinMap.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoomJoinMap.cs @@ -373,6 +373,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom JoinType = eJoinType.Digital }); + [JoinName("MeetingCanRecord")] + public JoinDataComplete MeetingCanRecord = new JoinDataComplete( + new JoinData + { + JoinNumber = 246, + JoinSpan = 1 + }, + new JoinMetadata + { + Description = "When high, indicated that the current meeting can be recorded", + JoinCapabilities = eJoinCapabilities.ToSIMPL, + JoinType = eJoinType.Digital + }); + #region Sharing Status From 3670bde7cf944a45ca49dac91a5ebe826e95263e Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 29 Sep 2022 10:53:55 -0600 Subject: [PATCH 3/8] fix(essentials): Adds extra private field to trigger OnShareInfoChanged --- .../VideoCodec/ZoomRoom/ResponseObjects.cs | 14 +++++++++++++- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 12 ++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs index 1518c9d5..0075b657 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ResponseObjects.cs @@ -448,6 +448,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom private bool _isAirHostClientConnected; private bool _isSharingBlackMagic; private bool _isDirectPresentationConnected; + private bool _isBlackMagicConnected; public string directPresentationPairingCode { get; set; } @@ -484,7 +485,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom } } - public bool isBlackMagicConnected { get; set; } + public bool isBlackMagicConnected + { + get { return _isBlackMagicConnected; } + set + { + if (value != _isBlackMagicConnected) + { + _isBlackMagicConnected = value; + NotifyPropertyChanged("isBlackMagicConnected"); + } + } + } public bool isBlackMagicDataAvailable { get; set; } public bool isDirectPresentationConnected 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 a3b2cc8b..438e4400 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 @@ -3586,6 +3586,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom void OnShareInfoChanged(zStatus.Sharing status) { + Debug.Console(2, this, +@"ShareInfoChanged: +isSharingHDMI: {0} +isSharingAirplay: {1} +AirplayPassword: {2} +OSD Display State: {3} +", +status.isSharingBlackMagic, +status.isAirHostClientConnected, +status.password, +status.dispState); + var handler = ShareInfoChanged; if (handler != null) { From 4938071f70c1177a4280ef4f11daa760d449eecc Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 29 Sep 2022 11:22:13 -0600 Subject: [PATCH 4/8] fix(essentials): Updates the func to return whether sharing content --- .../Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoom.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 438e4400..36b13c19 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 @@ -252,7 +252,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom protected override Func SharingContentIsOnFeedbackFunc { - get { return () => Status.Call.Sharing.IsSharing; } + get { return () => Status.Sharing.isAirHostClientConnected || Status.Sharing.isDirectPresentationConnected || Status.Sharing.isSharingBlackMagic; } } protected Func FarEndIsSharingContentFeedbackFunc From 55031d16aff5de0b5f86fbf5c1deab9e17560e91 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 29 Sep 2022 12:33:42 -0600 Subject: [PATCH 5/8] docs(essentials): Add join name to printjoinmap and update description on StartMeetingNow join --- .../PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs | 3 ++- .../VideoCodec/ZoomRoom/ZoomRoomJoinMap.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs index aa8e2e6d..04abc7f8 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/JoinMaps/JoinMapBase.cs @@ -283,9 +283,10 @@ namespace PepperDash.Essentials.Core foreach (var join in joins) { Debug.Console(0, - @"Join Number: {0} | JoinSpan: '{1}' | Description: '{2}' | Type: '{3}' | Capabilities: '{4}'", + @"Join Number: {0} | JoinSpan: '{1}' | JoinName: {2} | Description: '{3}' | Type: '{4}' | Capabilities: '{5}'", join.Value.JoinNumber, join.Value.JoinSpan, + join.Key, String.IsNullOrEmpty(join.Value.AttributeName) ? join.Value.Metadata.Label : join.Value.AttributeName, join.Value.Metadata.JoinType.ToString(), join.Value.Metadata.JoinCapabilities.ToString()); diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoomJoinMap.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoomJoinMap.cs index 7affd835..878f88d5 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoomJoinMap.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/ZoomRoom/ZoomRoomJoinMap.cs @@ -101,7 +101,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom }, new JoinMetadata { - Description = "FB Indicates the password prompt is active", + Description = "Pulse to start an ad-hoc meeting with the default duration", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital }); From dbd77f5f9f56334ebfea5c8a4ba9980760bef834 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 29 Sep 2022 12:35:05 -0600 Subject: [PATCH 6/8] fix(essentials): Switch to SetSigTrueAction for a few joins --- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 36b13c19..b6763609 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 @@ -2520,9 +2520,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom //trilist.SetString(joinMap.CurrentSource.JoinNumber, args.Info.ShareStatus); }; - trilist.SetSigTrueAction(joinMap.StartMeetingNow.JoinNumber, () => StartMeeting(0)); - trilist.SetSigTrueAction(joinMap.ShareOnlyMeeting.JoinNumber, StartSharingOnlyMeeting); - trilist.SetSigTrueAction(joinMap.StartNormalMeetingFromSharingOnlyMeeting.JoinNumber, StartNormalMeetingFromSharingOnlyMeeting); + trilist.SetSigFalseAction(joinMap.StartMeetingNow.JoinNumber, () => StartMeeting(0)); + trilist.SetSigFalseAction(joinMap.ShareOnlyMeeting.JoinNumber, StartSharingOnlyMeeting); + trilist.SetSigFalseAction(joinMap.StartNormalMeetingFromSharingOnlyMeeting.JoinNumber, StartNormalMeetingFromSharingOnlyMeeting); trilist.SetStringSigAction(joinMap.SubmitPassword.JoinNumber, SubmitPassword); //trilist.SetSigFalseAction(joinMap.CancelPasswordPrompt.JoinNumber, () => From f82b7f8f12b8dffec526d3203d3dac5694d33a53 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 29 Sep 2022 13:33:15 -0600 Subject: [PATCH 7/8] refactor(essentials): cleans up some args names for clarity --- .../Interfaces/IHasPresentationOnlyMeeting.cs | 6 +++--- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 15 +++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasPresentationOnlyMeeting.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasPresentationOnlyMeeting.cs index 06730d2a..a76a6da2 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasPresentationOnlyMeeting.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasPresentationOnlyMeeting.cs @@ -3,9 +3,9 @@ public interface IHasPresentationOnlyMeeting { void StartSharingOnlyMeeting(); - void StartSharingOnlyMeeting(eSharingMeetingMode mode); - void StartSharingOnlyMeeting(eSharingMeetingMode mode, ushort duration); - void StartSharingOnlyMeeting(eSharingMeetingMode mode, ushort duration, string password); + void StartSharingOnlyMeeting(eSharingMeetingMode displayMode); + void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, ushort duration); + void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, ushort duration, string password); void StartNormalMeetingFromSharingOnlyMeeting(); } 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 b6763609..7942b61e 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 @@ -2250,6 +2250,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom } } + /// + /// Starts sharing HDMI source + /// public override void StartSharing() { SendText("zCommand Call Sharing HDMI Start"); @@ -3482,19 +3485,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom StartSharingOnlyMeeting(eSharingMeetingMode.None, 30, String.Empty); } - public void StartSharingOnlyMeeting(eSharingMeetingMode mode) + public void StartSharingOnlyMeeting(eSharingMeetingMode displayMode) { - StartSharingOnlyMeeting(mode, 30, String.Empty); + StartSharingOnlyMeeting(displayMode, DefaultMeetingDurationMin, String.Empty); } - public void StartSharingOnlyMeeting(eSharingMeetingMode mode, ushort duration) + public void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, ushort duration) { - StartSharingOnlyMeeting(mode, duration, String.Empty); + StartSharingOnlyMeeting(displayMode, duration, String.Empty); } - public void StartSharingOnlyMeeting(eSharingMeetingMode mode, ushort duration, string password) + public void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, uint duration, string password) { - SendText(String.Format("zCommand Dial Sharing Duration: {0} DisplayState: {1} Password: {2}", duration, mode, password)); + SendText(String.Format("zCommand Dial Sharing Duration: {0} DisplayState: {1} Password: {2}", duration, displayMode, password)); } public void StartNormalMeetingFromSharingOnlyMeeting() From ca1cbb6e05201d7b881dc39b69c60a8eea0ce415 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 29 Sep 2022 14:11:41 -0600 Subject: [PATCH 8/8] fix(essentials): Resolves null ref in LinkZoomRoomToApi --- .../Interfaces/IHasPresentationOnlyMeeting.cs | 4 ++-- .../VideoCodec/ZoomRoom/ZoomRoom.cs | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasPresentationOnlyMeeting.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasPresentationOnlyMeeting.cs index a76a6da2..a620af1e 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasPresentationOnlyMeeting.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/Interfaces/IHasPresentationOnlyMeeting.cs @@ -4,8 +4,8 @@ { void StartSharingOnlyMeeting(); void StartSharingOnlyMeeting(eSharingMeetingMode displayMode); - void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, ushort duration); - void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, ushort duration, string password); + void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, uint duration); + void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, uint duration, string password); void StartNormalMeetingFromSharingOnlyMeeting(); } 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 7942b61e..820d3ab1 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 @@ -2401,7 +2401,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom var meetingInfoCodec = this as IHasMeetingInfo; if (meetingInfoCodec != null) { - trilist.SetBool(joinMap.MeetingCanRecord.JoinNumber, meetingInfoCodec.MeetingInfo.CanRecord); + if (meetingInfoCodec.MeetingInfo != null) + { + trilist.SetBool(joinMap.MeetingCanRecord.JoinNumber, meetingInfoCodec.MeetingInfo.CanRecord); + } meetingInfoCodec.MeetingInfoChanged += (o, a) => { @@ -2528,8 +2531,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom trilist.SetSigFalseAction(joinMap.StartNormalMeetingFromSharingOnlyMeeting.JoinNumber, StartNormalMeetingFromSharingOnlyMeeting); trilist.SetStringSigAction(joinMap.SubmitPassword.JoinNumber, SubmitPassword); - //trilist.SetSigFalseAction(joinMap.CancelPasswordPrompt.JoinNumber, () => - // OnPasswordRequired(false, false, true, "")); // Subscribe to call status to clear ShowPasswordPrompt when in meeting this.CallStatusChange += (o, a) => @@ -2588,7 +2589,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom var wirelessInfoCodec = this as IZoomWirelessShareInstructions; if (wirelessInfoCodec != null) { - SetSharingStateJoins(Status.Sharing, trilist, joinMap); + if (Status != null && Status.Sharing != null) + { + SetSharingStateJoins(Status.Sharing, trilist, joinMap); + } wirelessInfoCodec.ShareInfoChanged += (o, a) => { @@ -3490,7 +3494,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom StartSharingOnlyMeeting(displayMode, DefaultMeetingDurationMin, String.Empty); } - public void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, ushort duration) + public void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, uint duration) { StartSharingOnlyMeeting(displayMode, duration, String.Empty); }