diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs index d78b43b5..b4022232 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs @@ -60,8 +60,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec public List ActiveCalls { get; set; } - public bool ShowSelfViewByDefault { get; protected set; } - + public bool ShowSelfViewByDefault { get; protected set; } + + protected bool SupportsCameraOff; + protected bool SupportsCameraAutoMode; public bool IsReady { get; protected set; } @@ -305,8 +307,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec if (codec is IHasCameraAutoMode) { - trilist.SetBool(joinMap.CameraSupportsAutoMode.JoinNumber, true); + trilist.SetBool(joinMap.CameraSupportsAutoMode.JoinNumber, SupportsCameraAutoMode); LinkVideoCodecCameraModeToApi(codec as IHasCameraAutoMode, trilist, joinMap); + } + + if (codec is IHasCameraOff) + { + trilist.SetBool(joinMap.CameraSupportsOffMode.JoinNumber, SupportsCameraOff); + LinkVideoCodecCameraOffToApi(codec as IHasCameraOff, trilist, joinMap); } if (codec is IHasCodecLayouts) @@ -364,8 +372,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec UpdateCallStatusXSig(); }; - } - + } + + private void LinkVideoCodecCameraOffToApi(IHasCameraOff codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap) + { + codec.CameraIsOffFeedback.LinkInputSig(trilist.BooleanInput[joinMap.CameraModeOff.JoinNumber]); + + trilist.SetSigFalseAction(joinMap.CameraModeOff.JoinNumber, codec.CameraOff); + } + private void LinkVideoCodecVolumeToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap) { MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMuteOn.JoinNumber]); @@ -767,6 +782,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec trilist.BooleanInput[joinMap.CameraModeManual.JoinNumber]); } + + private void LinkVideoCodecSelfviewToApi(IHasCodecSelfView codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap) { 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 2c33317e..0bb0b524 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 @@ -86,6 +86,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public zConfiguration.Audio Audio { get; set; } public zConfiguration.Video Video { get; set; } public zConfiguration.Client Client { get; set; } + public zConfiguration.Camera Camera { get; set; } public ZoomRoomConfiguration() { @@ -93,6 +94,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom Audio = new zConfiguration.Audio(); Video = new zConfiguration.Video(); Client = new zConfiguration.Client(); + Camera = new zConfiguration.Camera(); } } @@ -698,9 +700,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public bool OptimizeVideoSharing { get; set; } } - public class Camera + public class Camera : NotifiableObject { - public bool Mute { get; set; } + private bool _mute; + + public bool Mute + { + get + { + return _mute; + } + set + { + if (value != _mute) + { + _mute = value; + NotifyPropertyChanged("Mute"); + } + } + } } public class Microphone : NotifiableObject 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 a142534e..f4d6a7c3 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 @@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom { public class ZoomRoom : VideoCodecBase, IHasCodecSelfView, IHasDirectoryHistoryStack, ICommunicationMonitor, IRouting, - IHasScheduleAwareness, IHasCodecCameras, IHasParticipants + IHasScheduleAwareness, IHasCodecCameras, IHasParticipants, IHasCameraOff, IHasCameraAutoMode { private const long MeetingRefreshTimer = 60000; private const uint DefaultMeetingDurationMin = 30; @@ -92,6 +92,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom SelfviewIsOnFeedback = new BoolFeedback(SelfViewIsOnFeedbackFunc); + CameraIsOffFeedback = new BoolFeedback(CameraIsOffFeedbackFunc); + CodecSchedule = new CodecScheduleAwareness(MeetingRefreshTimer); SetUpFeedbackActions(); @@ -101,6 +103,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom SetUpDirectory(); Participants = new CodecParticipants(); + + SupportsCameraOff = _props.SupportsCameraOff; + SupportsCameraAutoMode = _props.SupportsCameraAutoMode; } public CommunicationGather PortGather { get; private set; } @@ -174,6 +179,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom get { return () => !Configuration.Video.HideConfSelfVideo; } } + protected Func CameraIsOffFeedbackFunc + { + get { return () => !Configuration.Camera.Mute; } + } + + protected Func SelfviewPipPositionFeedbackFunc { get { return () => ""; } @@ -415,6 +426,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom } }; + Configuration.Camera.PropertyChanged += (o, a) => + { + if (a.PropertyName != "Mute") return; + + CameraIsOffFeedback.FireUpdate(); + }; + Status.Call.Sharing.PropertyChanged += (o, a) => { if (a.PropertyName == "State") @@ -961,13 +979,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom break; } - case "bookings": + case "bookings updated": { - // Bookings have been updated, trigger a query to retreive the new bookings - if (responseObj["Updated"] != null) - { - GetBookings(); - } + GetBookings(); break; } @@ -1560,6 +1574,39 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public CodecParticipants Participants { get; private set; } #endregion + + #region Implementation of IHasCameraOff + + public BoolFeedback CameraIsOffFeedback { get; private set; } + + public void CameraOff() + { + SendText("zCommand Call Camera Mute: On"); + } + + #endregion + + #region Implementation of IHasCameraAutoMode + //Zoom doesn't support camera auto modes. Setting this to just unmute video + public void CameraAutoModeOn() + { + throw new NotImplementedException("Zoom Room Doesn't support camera auto mode"); + } + + //Zoom doesn't support camera auto modes. Setting this to just unmute video + public void CameraAutoModeOff() + { + SendText("zCommand Call Camera Mute: Off"); + } + + public void CameraAutoModeToggle() + { + throw new NotImplementedException("Zoom Room doesn't support camera auto mode"); + } + + public BoolFeedback CameraAutoModeIsOnFeedback { get; private set; } + + #endregion } /// 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 f9249c5a..4e2545ec 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 @@ -14,5 +14,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; } public bool DisablePhonebookAutoDownload { get; set; } + public bool SupportsCameraAutoMode { get; set; } + public bool SupportsCameraOff { get; set; } } } \ No newline at end of file