feat(essentials): improves functionality of LayoutInfoChanged event

This commit is contained in:
Neil Dorin
2021-11-05 12:36:04 -06:00
parent 31f976d719
commit 949a04647b
3 changed files with 54 additions and 16 deletions

View File

@@ -25,7 +25,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
/// </summary> /// </summary>
public interface IHasZoomRoomLayouts : IHasCodecLayouts public interface IHasZoomRoomLayouts : IHasCodecLayouts
{ {
event EventHandler<LayoutInfoChangedEventArgs> AvailableLayoutsChanged; event EventHandler<LayoutInfoChangedEventArgs> LayoutInfoChanged;
BoolFeedback LayoutViewIsOnFirstPageFeedback { get; } // TODO: #697 [*] Consider modifying to report button visibility in func BoolFeedback LayoutViewIsOnFirstPageFeedback { get; } // TODO: #697 [*] Consider modifying to report button visibility in func
BoolFeedback LayoutViewIsOnLastPageFeedback { get; } // TODO: #697 [*] Consider modifying to report button visibility in func BoolFeedback LayoutViewIsOnLastPageFeedback { get; } // TODO: #697 [*] Consider modifying to report button visibility in func
@@ -46,5 +46,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public class LayoutInfoChangedEventArgs : EventArgs public class LayoutInfoChangedEventArgs : EventArgs
{ {
public ZoomRoom.zConfiguration.eLayoutStyle AvailableLayouts { get; set; } public ZoomRoom.zConfiguration.eLayoutStyle AvailableLayouts { get; set; }
public ZoomRoom.zConfiguration.eLayoutStyle LastSelectedLayout { get; set; }
public bool CanSwapContentWithThumbnail { get; set; }
public bool ContentSwappedWithThumbnail { get; set; }
public bool LayoutViewIsOnFirstPage { get; set; }
public bool LayoutViewIsOnLastPage { get; set; }
} }
} }

View File

@@ -618,13 +618,31 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
private bool _can_Switch_Speaker_View; private bool _can_Switch_Speaker_View;
private bool _can_Switch_Wall_View; private bool _can_Switch_Wall_View;
private bool _can_Switch_Share_On_All_Screens; private bool _can_Switch_Share_On_All_Screens;
private bool _can_Switch_Floating_Share_Content;
private bool _is_In_First_Page; private bool _is_In_First_Page;
private bool _is_In_Last_Page; private bool _is_In_Last_Page;
private string _video_type; private string _video_type;
public bool can_Adjust_Floating_Video { get; set; } public bool can_Adjust_Floating_Video { get; set; }
public bool can_Switch_Floating_Share_Content { get; set; }
public bool can_Switch_Floating_Share_Content
{
get
{
return _can_Switch_Floating_Share_Content;
}
set
{
if (value != _can_Switch_Floating_Share_Content)
{
_can_Switch_Floating_Share_Content = value;
NotifyPropertyChanged("can_Switch_Floating_Share_Content");
}
}
}
/// <summary> /// <summary>
/// [on/off] // Set to On if it is possible to invoke zConfiguration Call Layout Style: ShareAll, to switch to the ShareAll mode, where the content sharing is shown full screen on all monitors. /// [on/off] // Set to On if it is possible to invoke zConfiguration Call Layout Style: ShareAll, to switch to the ShareAll mode, where the content sharing is shown full screen on all monitors.

View File

@@ -583,11 +583,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
case "ShareThumb": case "ShareThumb":
{ {
ContentSwappedWithThumbnailFeedback.FireUpdate(); ContentSwappedWithThumbnailFeedback.FireUpdate();
OnLayoutInfoChanged();
break; break;
} }
case "Style": case "Style":
{ {
LocalLayoutFeedback.FireUpdate(); LocalLayoutFeedback.FireUpdate();
OnLayoutInfoChanged();
break; break;
} }
case "Size": case "Size":
@@ -626,11 +628,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
case "ShareThumb": case "ShareThumb":
{ {
ContentSwappedWithThumbnailFeedback.FireUpdate(); ContentSwappedWithThumbnailFeedback.FireUpdate();
OnLayoutInfoChanged();
break; break;
} }
case "Style": case "Style":
{ {
LocalLayoutFeedback.FireUpdate(); LocalLayoutFeedback.FireUpdate();
OnLayoutInfoChanged();
break; break;
} }
} }
@@ -735,13 +739,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
LayoutViewIsOnLastPageFeedback.FireUpdate(); LayoutViewIsOnLastPageFeedback.FireUpdate();
break; break;
} }
//case "video_type": case "can_Switch_Floating_Share_Content":
// { {
// It appears as though the actual value we want to watch is Configuration.Call.Layout.Style CanSwapContentWithThumbnailFeedback.FireUpdate();
// LocalLayoutFeedback.FireUpdate(); break;
// break; }
// }
} }
OnLayoutInfoChanged();
}; };
Status.NumberOfScreens.PropertyChanged += (o, a) => Status.NumberOfScreens.PropertyChanged += (o, a) =>
@@ -2153,7 +2157,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
var layoutsCodec = this as IHasZoomRoomLayouts; var layoutsCodec = this as IHasZoomRoomLayouts;
if (layoutsCodec != null) if (layoutsCodec != null)
{ {
layoutsCodec.AvailableLayoutsChanged += (o, a) => layoutsCodec.LayoutInfoChanged += (o, a) =>
{ {
trilist.SetBool(joinMap.LayoutGalleryIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.Gallery trilist.SetBool(joinMap.LayoutGalleryIsAvailable.JoinNumber, zConfiguration.eLayoutStyle.Gallery
== ==
@@ -2856,7 +2860,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
#region IHasZoomRoomLayouts Members #region IHasZoomRoomLayouts Members
public event EventHandler<LayoutInfoChangedEventArgs> AvailableLayoutsChanged; public event EventHandler<LayoutInfoChangedEventArgs> LayoutInfoChanged;
private Func<bool> LayoutViewIsOnFirstPageFeedbackFunc private Func<bool> LayoutViewIsOnFirstPageFeedbackFunc
{ {
@@ -2922,15 +2926,26 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
Debug.Console(1, this, "availablelayouts: {0}", availableLayouts); Debug.Console(1, this, "availablelayouts: {0}", availableLayouts);
var handler = AvailableLayoutsChanged;
if (handler != null)
{
handler(this, new LayoutInfoChangedEventArgs() {AvailableLayouts = availableLayouts});
}
AvailableLayouts = availableLayouts; AvailableLayouts = availableLayouts;
} }
private void OnLayoutInfoChanged()
{
var handler = LayoutInfoChanged;
if (handler != null)
{
handler(this, new LayoutInfoChangedEventArgs()
{
AvailableLayouts = AvailableLayouts,
LastSelectedLayout = (zConfiguration.eLayoutStyle)Enum.Parse(typeof(zConfiguration.eLayoutStyle),LocalLayoutFeedback.StringValue, true),
LayoutViewIsOnFirstPage = LayoutViewIsOnFirstPageFeedback.BoolValue,
LayoutViewIsOnLastPage = LayoutViewIsOnLastPageFeedback.BoolValue,
CanSwapContentWithThumbnail = CanSwapContentWithThumbnailFeedback.BoolValue,
ContentSwappedWithThumbnail = ContentSwappedWithThumbnailFeedback.BoolValue,
});
}
}
public void GetAvailableLayouts() public void GetAvailableLayouts()
{ {
SendText("zStatus Call Layout"); SendText("zStatus Call Layout");