mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-09 17:54:59 +00:00
lots of updates
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
|
||||
|
||||
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
{
|
||||
public interface IHasSelfviewPosition
|
||||
{
|
||||
StringFeedback SelfviewPipPositionFeedback { get; }
|
||||
|
||||
void SelfviewPipPositionSet(CodecCommandWithLabel position);
|
||||
|
||||
void SelfviewPipPositionToggle();
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,8 @@ using PepperDash.Core.WebApi.Presets;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.Devices;
|
||||
using PepperDash.Essentials.Core.Devices;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
@@ -198,7 +199,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
/// <param name="previousStatus"></param>
|
||||
/// <param name="newStatus"></param>
|
||||
/// <param name="item"></param>
|
||||
protected void OnCallStatusChange(CodecActiveCallItem item)
|
||||
protected virtual void OnCallStatusChange(CodecActiveCallItem item)
|
||||
{
|
||||
var handler = CallStatusChange;
|
||||
if (handler != null)
|
||||
@@ -320,6 +321,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
if (codec is IHasCodecLayouts)
|
||||
{
|
||||
LinkVideoCodecCameraLayoutsToApi(codec as IHasCodecLayouts, trilist, joinMap);
|
||||
}
|
||||
|
||||
if (codec is IHasSelfviewPosition)
|
||||
{
|
||||
LinkVideoCodecSelfviewPositionToApi(codec as IHasSelfviewPosition, trilist, joinMap);
|
||||
}
|
||||
|
||||
if (codec is IHasDirectory)
|
||||
@@ -335,6 +341,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
if (codec is IHasParticipants)
|
||||
{
|
||||
LinkVideoCodecParticipantsToApi(codec as IHasParticipants, trilist, joinMap);
|
||||
}
|
||||
|
||||
if (codec is IHasFarEndContentStatus)
|
||||
{
|
||||
(codec as IHasFarEndContentStatus).ReceivingContent.LinkInputSig(trilist.BooleanInput[joinMap.RecievingContent.JoinNumber]);
|
||||
}
|
||||
|
||||
trilist.OnlineStatusChange += (device, args) =>
|
||||
@@ -360,15 +371,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
{
|
||||
trilist.SetBool(joinMap.CameraSupportsAutoMode.JoinNumber, true);
|
||||
|
||||
(codec as IHasCameraAutoMode).CameraAutoModeIsOnFeedback.InvokeFireUpdate();
|
||||
(codec as IHasCameraAutoMode).CameraAutoModeIsOnFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
if (codec is IHasCodecSelfView)
|
||||
{
|
||||
(codec as IHasCodecSelfView).SelfviewIsOnFeedback.InvokeFireUpdate();
|
||||
(codec as IHasCodecSelfView).SelfviewIsOnFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
if (codec is IHasCameraAutoMode)
|
||||
{
|
||||
(codec as IHasCameraAutoMode).CameraAutoModeIsOnFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
if (codec is IHasCameraOff)
|
||||
{
|
||||
(codec as IHasCameraOff).CameraIsOffFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
SharingContentIsOnFeedback.InvokeFireUpdate();
|
||||
SharingContentIsOnFeedback.FireUpdate();
|
||||
|
||||
trilist.SetBool(joinMap.HookState.JoinNumber, IsInCall);
|
||||
|
||||
@@ -376,11 +397,53 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
};
|
||||
}
|
||||
|
||||
private void LinkVideoCodecSelfviewPositionToApi(IHasSelfviewPosition codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
{
|
||||
trilist.SetSigFalseAction(joinMap.SelfviewPosition.JoinNumber, codec.SelfviewPipPositionToggle);
|
||||
|
||||
codec.SelfviewPipPositionFeedback.LinkInputSig(trilist.StringInput[joinMap.SelfviewPositionFb.JoinNumber]);
|
||||
}
|
||||
|
||||
private void LinkVideoCodecCameraOffToApi(IHasCameraOff codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
{
|
||||
codec.CameraIsOffFeedback.LinkInputSig(trilist.BooleanInput[joinMap.CameraModeOff.JoinNumber]);
|
||||
|
||||
trilist.SetSigFalseAction(joinMap.CameraModeOff.JoinNumber, codec.CameraOff);
|
||||
|
||||
codec.CameraIsOffFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (a.BoolValue)
|
||||
{
|
||||
trilist.SetBool(joinMap.CameraModeOff.JoinNumber, true);
|
||||
trilist.SetBool(joinMap.CameraModeManual.JoinNumber, false);
|
||||
trilist.SetBool(joinMap.CameraModeAuto.JoinNumber, false);
|
||||
return;
|
||||
}
|
||||
|
||||
trilist.SetBool(joinMap.CameraModeOff.JoinNumber, false);
|
||||
|
||||
var autoCodec = codec as IHasCameraAutoMode;
|
||||
|
||||
if (autoCodec == null) return;
|
||||
|
||||
trilist.SetBool(joinMap.CameraModeAuto.JoinNumber, autoCodec.CameraAutoModeIsOnFeedback.BoolValue);
|
||||
trilist.SetBool(joinMap.CameraModeManual.JoinNumber, !autoCodec.CameraAutoModeIsOnFeedback.BoolValue);
|
||||
};
|
||||
|
||||
if (codec.CameraIsOffFeedback.BoolValue)
|
||||
{
|
||||
trilist.SetBool(joinMap.CameraModeOff.JoinNumber, true);
|
||||
trilist.SetBool(joinMap.CameraModeManual.JoinNumber, false);
|
||||
trilist.SetBool(joinMap.CameraModeAuto.JoinNumber, false);
|
||||
return;
|
||||
}
|
||||
|
||||
trilist.SetBool(joinMap.CameraModeOff.JoinNumber, false);
|
||||
|
||||
var autoModeCodec = codec as IHasCameraAutoMode;
|
||||
|
||||
if (autoModeCodec == null) return;
|
||||
|
||||
trilist.SetBool(joinMap.CameraModeAuto.JoinNumber, autoModeCodec.CameraAutoModeIsOnFeedback.BoolValue);
|
||||
trilist.SetBool(joinMap.CameraModeManual.JoinNumber, !autoModeCodec.CameraAutoModeIsOnFeedback.BoolValue);
|
||||
}
|
||||
|
||||
private void LinkVideoCodecVolumeToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
@@ -779,15 +842,56 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
private void LinkVideoCodecCameraModeToApi(IHasCameraAutoMode codec, BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||
{
|
||||
trilist.SetSigFalseAction(joinMap.CameraModeAuto.JoinNumber, codec.CameraAutoModeOn);
|
||||
trilist.SetSigFalseAction(joinMap.CameraModeManual.JoinNumber, codec.CameraAutoModeOff);
|
||||
|
||||
codec.CameraAutoModeIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.CameraModeAuto.JoinNumber]);
|
||||
codec.CameraAutoModeIsOnFeedback.LinkComplementInputSig(
|
||||
trilist.BooleanInput[joinMap.CameraModeManual.JoinNumber]);
|
||||
trilist.SetSigFalseAction(joinMap.CameraModeManual.JoinNumber, codec.CameraAutoModeOff);
|
||||
|
||||
codec.CameraAutoModeIsOnFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
var offCodec = codec as IHasCameraOff;
|
||||
|
||||
if (offCodec != null)
|
||||
{
|
||||
if (offCodec.CameraIsOffFeedback.BoolValue)
|
||||
{
|
||||
trilist.SetBool(joinMap.CameraModeAuto.JoinNumber, false);
|
||||
trilist.SetBool(joinMap.CameraModeManual.JoinNumber, false);
|
||||
trilist.SetBool(joinMap.CameraModeOff.JoinNumber, true);
|
||||
return;
|
||||
}
|
||||
|
||||
trilist.SetBool(joinMap.CameraModeAuto.JoinNumber, a.BoolValue);
|
||||
trilist.SetBool(joinMap.CameraModeManual.JoinNumber, !a.BoolValue);
|
||||
trilist.SetBool(joinMap.CameraModeOff.JoinNumber, false);
|
||||
return;
|
||||
}
|
||||
|
||||
trilist.SetBool(joinMap.CameraModeAuto.JoinNumber, a.BoolValue);
|
||||
trilist.SetBool(joinMap.CameraModeManual.JoinNumber, !a.BoolValue);
|
||||
trilist.SetBool(joinMap.CameraModeOff.JoinNumber, false);
|
||||
};
|
||||
|
||||
var offModeCodec = codec as IHasCameraOff;
|
||||
|
||||
if (offModeCodec != null)
|
||||
{
|
||||
if (offModeCodec.CameraIsOffFeedback.BoolValue)
|
||||
{
|
||||
trilist.SetBool(joinMap.CameraModeAuto.JoinNumber, false);
|
||||
trilist.SetBool(joinMap.CameraModeManual.JoinNumber, false);
|
||||
trilist.SetBool(joinMap.CameraModeOff.JoinNumber, true);
|
||||
return;
|
||||
}
|
||||
|
||||
trilist.SetBool(joinMap.CameraModeAuto.JoinNumber, codec.CameraAutoModeIsOnFeedback.BoolValue);
|
||||
trilist.SetBool(joinMap.CameraModeManual.JoinNumber, !codec.CameraAutoModeIsOnFeedback.BoolValue);
|
||||
trilist.SetBool(joinMap.CameraModeOff.JoinNumber, false);
|
||||
return;
|
||||
}
|
||||
|
||||
trilist.SetBool(joinMap.CameraModeAuto.JoinNumber, codec.CameraAutoModeIsOnFeedback.BoolValue);
|
||||
trilist.SetBool(joinMap.CameraModeManual.JoinNumber, !codec.CameraAutoModeIsOnFeedback.BoolValue);
|
||||
trilist.SetBool(joinMap.CameraModeOff.JoinNumber, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void LinkVideoCodecSelfviewToApi(IHasCodecSelfView codec, BasicTriList trilist,
|
||||
VideoCodecControllerJoinMap joinMap)
|
||||
{
|
||||
@@ -875,9 +979,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
{
|
||||
var i = (ushort) codec.Cameras.FindIndex((c) => c.Key == args.SelectedCamera.Key);
|
||||
|
||||
trilist.SetUshort(joinMap.CameraPresetSelect.JoinNumber, i);
|
||||
|
||||
if (codec is IHasCodecRoomPresets)
|
||||
if (codec is IHasCodecRoomPresets)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -890,25 +992,59 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
var cam = args.SelectedCamera as IHasCameraPresets;
|
||||
SetCameraPresetNames(cam.Presets);
|
||||
|
||||
(args.SelectedCamera as IHasCameraPresets).PresetsListHasChanged += (o, eventArgs) => SetCameraPresetNames(cam.Presets);
|
||||
};
|
||||
(args.SelectedCamera as IHasCameraPresets).PresetsListHasChanged += (o, eventArgs) => SetCameraPresetNames(cam.Presets);
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.CameraPresetSelect.JoinNumber,
|
||||
(a) =>
|
||||
{
|
||||
cam.PresetSelect(a);
|
||||
trilist.SetUshort(joinMap.CameraPresetSelect.JoinNumber, a);
|
||||
});
|
||||
|
||||
trilist.SetSigFalseAction(joinMap.CameraPresetSave.JoinNumber,
|
||||
() =>
|
||||
{
|
||||
cam.PresetStore(trilist.UShortOutput[joinMap.CameraPresetSelect.JoinNumber].UShortValue,
|
||||
String.Empty);
|
||||
trilist.PulseBool(joinMap.CameraPresetSave.JoinNumber, 3000);
|
||||
});
|
||||
};
|
||||
|
||||
if (!(codec is IHasCodecRoomPresets)) return;
|
||||
|
||||
var presetCodec = codec as IHasCodecRoomPresets;
|
||||
|
||||
presetCodec.CodecRoomPresetsListHasChanged +=
|
||||
(sender, args) => SetCameraPresetNames(presetCodec.NearEndPresets);
|
||||
|
||||
//Camera Presets
|
||||
trilist.SetUShortSigAction(joinMap.CameraPresetSelect.JoinNumber, (i) =>
|
||||
{
|
||||
if (codec.SelectedCamera == null) return;
|
||||
|
||||
var cam = codec.SelectedCamera as IHasCameraPresets;
|
||||
|
||||
if (cam == null) return;
|
||||
|
||||
cam.PresetSelect(i);
|
||||
trilist.SetUShortSigAction(joinMap.CameraPresetSelect.JoinNumber, (i) =>
|
||||
{
|
||||
presetCodec.CodecRoomPresetSelect(i);
|
||||
|
||||
trilist.SetUshort(joinMap.CameraPresetSelect.JoinNumber, i);
|
||||
});
|
||||
});
|
||||
|
||||
trilist.SetSigFalseAction(joinMap.CameraPresetSave.JoinNumber,
|
||||
() =>
|
||||
{
|
||||
presetCodec.CodecRoomPresetStore(
|
||||
trilist.UShortOutput[joinMap.CameraPresetSelect.JoinNumber].UShortValue, String.Empty);
|
||||
trilist.PulseBool(joinMap.CameraPresetSave.JoinNumber, 3000);
|
||||
});
|
||||
}
|
||||
|
||||
private string SetCameraPresetNames(IEnumerable<CodecRoomPreset> presets)
|
||||
{
|
||||
return SetCameraPresetNames(presets.Select(p => p.Description).ToList());
|
||||
}
|
||||
|
||||
private string SetCameraPresetNames(IEnumerable<CameraPreset> presets)
|
||||
{
|
||||
return SetCameraPresetNames(presets.Select(p => p.Description).ToList());
|
||||
}
|
||||
|
||||
private string SetCameraPresetNames(List<CameraPreset> presets)
|
||||
private string SetCameraPresetNames(ICollection<string> presets)
|
||||
{
|
||||
var i = 1; //start index for xsig;
|
||||
|
||||
@@ -916,7 +1052,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
foreach (var preset in presets)
|
||||
{
|
||||
var cameraPreset = new XSigSerialToken(i, preset.Description);
|
||||
var cameraPreset = new XSigSerialToken(i, preset);
|
||||
tokenArray[i - 1] = cameraPreset;
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -370,7 +370,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
public CallRecordInfo CallRecordInfo { get; set; }
|
||||
|
||||
public zCommand.InfoResult Info { get; set; }
|
||||
private zCommand.InfoResult _info;
|
||||
|
||||
public zCommand.InfoResult Info
|
||||
{
|
||||
get
|
||||
{
|
||||
return _info;
|
||||
}
|
||||
set
|
||||
{
|
||||
_info = value;
|
||||
NotifyPropertyChanged("Info");
|
||||
}
|
||||
}
|
||||
|
||||
public Call()
|
||||
{
|
||||
@@ -702,7 +715,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
public class Camera : NotifiableObject
|
||||
{
|
||||
private string _muteState;
|
||||
private bool _mute;
|
||||
|
||||
public bool Mute
|
||||
@@ -710,30 +722,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
get { return _mute; }
|
||||
set
|
||||
{
|
||||
Debug.Console(1, "Camera Mute response received: {0}", value);
|
||||
|
||||
if (value == _mute) return;
|
||||
|
||||
|
||||
_mute = value;
|
||||
NotifyPropertyChanged("Mute");
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("mute")]
|
||||
public string MuteState
|
||||
{
|
||||
get
|
||||
{
|
||||
return _muteState;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != _muteState)
|
||||
{
|
||||
_muteState = value;
|
||||
|
||||
Mute = _muteState == "on";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Microphone : NotifiableObject
|
||||
@@ -787,12 +783,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
DownLeft
|
||||
}
|
||||
|
||||
public class Layout
|
||||
public class Layout:NotifiableObject
|
||||
{
|
||||
public bool ShareThumb { get; set; }
|
||||
public eLayoutStyle Style { get; set; }
|
||||
public eLayoutSize Size { get; set; }
|
||||
public eLayoutPosition Position { get; set; }
|
||||
|
||||
private eLayoutPosition _position;
|
||||
public eLayoutPosition Position {
|
||||
get { return _position; }
|
||||
set
|
||||
{
|
||||
_position = value;
|
||||
NotifyPropertyChanged("Position");
|
||||
} }
|
||||
}
|
||||
|
||||
public class Lock
|
||||
|
||||
@@ -11,16 +11,18 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
public class ZoomRoom : VideoCodecBase, IHasCodecSelfView, IHasDirectoryHistoryStack, ICommunicationMonitor,
|
||||
IRouting,
|
||||
IHasScheduleAwareness, IHasCodecCameras, IHasParticipants, IHasCameraOff, IHasCameraAutoMode
|
||||
IHasScheduleAwareness, IHasCodecCameras, IHasParticipants, IHasCameraOff, IHasCameraAutoMode, IHasFarEndContentStatus, IHasSelfviewPosition
|
||||
{
|
||||
private const long MeetingRefreshTimer = 60000;
|
||||
private const uint DefaultMeetingDurationMin = 30;
|
||||
@@ -98,6 +100,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
CodecSchedule = new CodecScheduleAwareness(MeetingRefreshTimer);
|
||||
|
||||
ReceivingContent = new BoolFeedback(FarEndIsSharingContentFeedbackFunc);
|
||||
|
||||
SelfviewPipPositionFeedback = new StringFeedback(SelfviewPipPositionFeedbackFunc);
|
||||
|
||||
SetUpFeedbackActions();
|
||||
|
||||
Cameras = new List<CameraBase>();
|
||||
@@ -152,7 +158,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
protected Func<bool> FarEndIsSharingContentFeedbackFunc
|
||||
{
|
||||
get { return () => false; }
|
||||
get { return () => Status.Call.Sharing.State == zEvent.eSharingState.Receiving; }
|
||||
}
|
||||
|
||||
protected override Func<bool> MuteFeedbackFunc
|
||||
@@ -183,17 +189,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
protected Func<bool> CameraIsOffFeedbackFunc
|
||||
{
|
||||
get { return () => Configuration.Camera.Mute; }
|
||||
get { return () => Configuration.Call.Camera.Mute; }
|
||||
}
|
||||
|
||||
protected Func<bool> CameraAutoModeIsOnFeedbackFunc
|
||||
{
|
||||
get { return () => !Configuration.Camera.Mute; }
|
||||
get { return () => false; }
|
||||
}
|
||||
|
||||
protected Func<string> SelfviewPipPositionFeedbackFunc
|
||||
{
|
||||
get { return () => ""; }
|
||||
get { return () => _currentSelfviewPipPosition.Command; }
|
||||
}
|
||||
|
||||
protected Func<string> LocalLayoutFeedbackFunc
|
||||
@@ -432,11 +438,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
};
|
||||
|
||||
Configuration.Camera.PropertyChanged += (o, a) =>
|
||||
Configuration.Call.Camera.PropertyChanged += (o, a) =>
|
||||
{
|
||||
Debug.Console(1, this, "Configuration.Call.Camera.PropertyChanged: {0}", a.PropertyName);
|
||||
|
||||
if (a.PropertyName != "Mute") return;
|
||||
|
||||
CameraIsOffFeedback.FireUpdate();
|
||||
CameraAutoModeIsOnFeedback.FireUpdate();
|
||||
};
|
||||
|
||||
Configuration.Call.Layout.PropertyChanged += (o, a) =>
|
||||
{
|
||||
if (a.PropertyName != "Position") return;
|
||||
|
||||
ComputeSelfviewPipStatus();
|
||||
|
||||
SelfviewPipPositionFeedback.FireUpdate();
|
||||
};
|
||||
|
||||
Status.Call.Sharing.PropertyChanged += (o, a) =>
|
||||
@@ -444,6 +462,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
if (a.PropertyName == "State")
|
||||
{
|
||||
SharingContentIsOnFeedback.FireUpdate();
|
||||
ReceivingContent.FireUpdate();
|
||||
}
|
||||
};
|
||||
|
||||
Status.Call.PropertyChanged += (o, a) =>
|
||||
{
|
||||
if (a.PropertyName == "Info")
|
||||
{
|
||||
Debug.Console(1, this, "Updating Call Status");
|
||||
UpdateCallStatus();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -658,6 +686,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
_syncState.AddQueryToQueue("zCommand Bookings List");
|
||||
_syncState.AddQueryToQueue("zCommand Call ListParticipants");
|
||||
_syncState.AddQueryToQueue("zCommand Call Info");
|
||||
|
||||
|
||||
_syncState.StartSync();
|
||||
@@ -670,6 +699,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
private void ProcessMessage(string message)
|
||||
{
|
||||
// Counts the curly braces
|
||||
if (message.Contains("client_loop: send disconnect: Broken pipe"))
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Error,
|
||||
"Zoom Room Controller or App connected. Essentials will NOT control the Zoom Room until it is disconnected.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (message.Contains('{'))
|
||||
{
|
||||
_jsonCurlyBraceCounter++;
|
||||
@@ -759,9 +796,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
SendText("zFeedback Register Op: ex Path: /Event/InfoResult/info/callout_country_list");
|
||||
Thread.Sleep(100);
|
||||
|
||||
if (!_props.DisablePhonebookAutoDownload)
|
||||
if (_props.DisablePhonebookAutoDownload)
|
||||
{
|
||||
SendText("zFeedback Register ");
|
||||
SendText("zFeedback Register Op: ex Path: /Event/Phonebook/AddedContact");
|
||||
}
|
||||
// switch to json format
|
||||
SendText("format json");
|
||||
@@ -841,6 +878,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
switch (topKey.ToLower())
|
||||
{
|
||||
case "inforesult":
|
||||
{
|
||||
JsonConvert.PopulateObject(responseObj.ToString(), Status.Call.Info);
|
||||
break;
|
||||
}
|
||||
case "phonebooklistresult":
|
||||
{
|
||||
JsonConvert.PopulateObject(responseObj.ToString(), Status.Phonebook);
|
||||
@@ -1160,6 +1202,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
JsonConvert.PopulateObject(responseObj.ToString(), Status.Sharing);
|
||||
|
||||
SetLayout();
|
||||
|
||||
break;
|
||||
}
|
||||
case "numberofscreens":
|
||||
@@ -1224,6 +1268,24 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
private void SetLayout()
|
||||
{
|
||||
if(!_props.AutoDefaultLayouts) return;
|
||||
|
||||
if (
|
||||
(Status.Call.Sharing.State == zEvent.eSharingState.Receiving ||
|
||||
Status.Call.Sharing.State == zEvent.eSharingState.Sending))
|
||||
{
|
||||
SendText(String.Format("zconfiguration call layout style: {0}",
|
||||
_props.DefaultSharingLayout));
|
||||
}
|
||||
else
|
||||
{
|
||||
SendText(String.Format("zconfiguration call layout style: {0}",
|
||||
_props.DefaultCallLayout));
|
||||
}
|
||||
}
|
||||
|
||||
public void PrintCurrentCallParticipants()
|
||||
{
|
||||
if (Debug.Level <= 0)
|
||||
@@ -1329,6 +1391,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
Debug.Console(1, this, "**************************************************************************");
|
||||
}
|
||||
|
||||
protected override void OnCallStatusChange(CodecActiveCallItem item)
|
||||
{
|
||||
base.OnCallStatusChange(item);
|
||||
|
||||
if (_props.AutoDefaultLayouts)
|
||||
{
|
||||
SetLayout();
|
||||
}
|
||||
}
|
||||
public override void StartSharing()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
@@ -1631,6 +1702,52 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
public BoolFeedback CameraAutoModeIsOnFeedback { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Implementation of IHasFarEndContentStatus
|
||||
|
||||
public BoolFeedback ReceivingContent { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Implementation of IHasSelfviewPosition
|
||||
|
||||
private CodecCommandWithLabel _currentSelfviewPipPosition;
|
||||
|
||||
public StringFeedback SelfviewPipPositionFeedback { get; private set; }
|
||||
|
||||
public void SelfviewPipPositionSet(CodecCommandWithLabel position)
|
||||
{
|
||||
SendText(String.Format("zConfiguration Call Layout Position: {0}", position.Command));
|
||||
}
|
||||
|
||||
public void SelfviewPipPositionToggle()
|
||||
{
|
||||
if (_currentSelfviewPipPosition != null)
|
||||
{
|
||||
var nextPipPositionIndex = SelfviewPipPositions.IndexOf(_currentSelfviewPipPosition) + 1;
|
||||
|
||||
if (nextPipPositionIndex >= SelfviewPipPositions.Count) // Check if we need to loop back to the first item in the list
|
||||
nextPipPositionIndex = 0;
|
||||
|
||||
SelfviewPipPositionSet(SelfviewPipPositions[nextPipPositionIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
public List<CodecCommandWithLabel> SelfviewPipPositions = new List<CodecCommandWithLabel>()
|
||||
{
|
||||
new CodecCommandWithLabel("UpLeft", "Center Left"),
|
||||
new CodecCommandWithLabel("UpRight", "Center Right"),
|
||||
new CodecCommandWithLabel("DownLeft", "Lower Left"),
|
||||
new CodecCommandWithLabel("DownRight", "Lower Right")
|
||||
};
|
||||
|
||||
void ComputeSelfviewPipStatus()
|
||||
{
|
||||
_currentSelfviewPipPosition =
|
||||
SelfviewPipPositions.FirstOrDefault(
|
||||
p => p.Command.ToLower().Equals(Configuration.Call.Layout.Position.ToString()));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -68,7 +68,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
/// <summary>
|
||||
/// Builds the command and triggers the parent ZoomRoom to send it
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="state"></param>
|
||||
/// <param name="action"></param>
|
||||
void SendCommand(eZoomRoomCameraState state, eZoomRoomCameraAction action)
|
||||
@@ -86,16 +85,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
void SendContinueAction(eZoomRoomCameraAction action)
|
||||
{
|
||||
SendCommand(eZoomRoomCameraState.Continue, action);
|
||||
ContinueTimer.Reset();
|
||||
}
|
||||
|
||||
void StopContinueTimer()
|
||||
{
|
||||
if (ContinueTimer != null)
|
||||
if (ContinueTimer == null)
|
||||
{
|
||||
ContinueTimer.Stop();
|
||||
ContinueTimer.Dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
ContinueTimer.Stop();
|
||||
ContinueTimer.Dispose();
|
||||
ContinueTimer = null;
|
||||
}
|
||||
|
||||
#region IHasCameraPtzControl Members
|
||||
@@ -111,22 +112,26 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
public void PanLeft()
|
||||
{
|
||||
if (!isMoving)
|
||||
if (isMoving)
|
||||
{
|
||||
SendCommand(eZoomRoomCameraState.Start, eZoomRoomCameraAction.Left);
|
||||
StartContinueTimer();
|
||||
isPanning = true;
|
||||
return;
|
||||
}
|
||||
|
||||
SendCommand(eZoomRoomCameraState.Start, eZoomRoomCameraAction.Left);
|
||||
StartContinueTimer();
|
||||
isPanning = true;
|
||||
}
|
||||
|
||||
public void PanRight()
|
||||
{
|
||||
if (!isMoving)
|
||||
if (isMoving)
|
||||
{
|
||||
SendCommand(eZoomRoomCameraState.Start, eZoomRoomCameraAction.Right);
|
||||
StartContinueTimer();
|
||||
isPanning = true;
|
||||
return;
|
||||
}
|
||||
|
||||
SendCommand(eZoomRoomCameraState.Start, eZoomRoomCameraAction.Right);
|
||||
StartContinueTimer();
|
||||
isPanning = true;
|
||||
}
|
||||
|
||||
public void PanStop()
|
||||
|
||||
@@ -16,5 +16,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
public bool DisablePhonebookAutoDownload { get; set; }
|
||||
public bool SupportsCameraAutoMode { get; set; }
|
||||
public bool SupportsCameraOff { get; set; }
|
||||
|
||||
//if true, the layouts will be set automatically when sharing starts/ends or a call is joined
|
||||
public bool AutoDefaultLayouts { get; set; }
|
||||
|
||||
/* This layout will be selected when Sharing starts (either from Far end or locally)*/
|
||||
public string DefaultSharingLayout { get; set; }
|
||||
|
||||
//This layout will be selected when a call is connected and no content is being shared
|
||||
public string DefaultCallLayout { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user