feat(essentials): More updates to add ringtone volume and focus near/far to bridge

This commit is contained in:
Neil Dorin
2021-11-10 18:02:23 -07:00
parent dc53ce42e7
commit a043309bb1
5 changed files with 170 additions and 19 deletions

View File

@@ -525,6 +525,48 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
[JoinName("CameraFocusNear")]
public JoinDataComplete CameraFocusNear = new JoinDataComplete(
new JoinData
{
JoinNumber = 117,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Camera Focus Near",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraFocusFar")]
public JoinDataComplete CameraFocusFar = new JoinDataComplete(
new JoinData
{
JoinNumber = 118,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Camera Focus Far",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraFocusAuto")]
public JoinDataComplete CameraFocusAuto = new JoinDataComplete(
new JoinData
{
JoinNumber = 119,
JoinSpan = 1
},
new JoinMetadata
{
Description = "Camera Auto Focus Trigger",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraPresetSave")]
public JoinDataComplete CameraPresetSave = new JoinDataComplete(
new JoinData

View File

@@ -64,6 +64,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public BoolFeedback FarEndIsSharingContentFeedback { get; private set; }
public IntFeedback RingtoneVolumeFeedback { get; private set; }
private CodecCommandWithLabel CurrentSelfviewPipPosition;
private CodecCommandWithLabel CurrentLocalLayout;
@@ -324,6 +326,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
PresentationViewMaximizedFeedback = new BoolFeedback(() => CurrentPresentationView == "Maximized");
RingtoneVolumeFeedback = new IntFeedback(() => CodecConfiguration.Configuration.Audio.SoundsAndAlerts.RingVolume.Volume);
Communication = comm;
if (props.CommunicationMonitorProperties != null)
@@ -436,6 +440,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = FarEndIsSharingContentFeedback.FireUpdate;
CodecStatus.Status.Conference.DoNotDisturb.ValueChangedAction = DoNotDisturbModeIsOnFeedback.FireUpdate;
CodecConfiguration.Configuration.Audio.SoundsAndAlerts.RingVolume.ValueChangedAction = RingtoneVolumeFeedback.FireUpdate;
try
{
CodecStatus.Status.Video.Input.MainVideoMute.ValueChangedAction = CameraIsOffFeedback.FireUpdate;
@@ -1419,11 +1425,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
#endregion
/// <summary>
/// Sends tones to the last connected call
/// </summary>
/// <param name="s"></param>
public override void SendDtmf(string s)
{
SendText(string.Format("xCommand Call DTMFSend CallId: {0} DTMFString: \"{1}\"", GetCallId(), s));
}
/// <summary>
/// Sends tones to a specific call
/// </summary>
/// <param name="s"></param>
/// <param name="activeCall"></param>
public void SendDtmf(string s, CodecActiveCallItem activeCall)
{
SendText(string.Format("xCommand Call DTMFSend CallId: {0} DTMFString: \"{1}\"", activeCall.Id, s));
}
public void SelectPresentationSource(int source)
{
PresentationSource = source;
@@ -1431,6 +1451,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
StartSharing();
}
/// <summary>
/// Sets the ringtone volume level
/// </summary>
/// <param name="volume">level from 0 - 100 in increments of 5</param>
public void SetRingtoneVolume(int volume)
{
SendText(string.Format("xConfiguration Audio SoundsAndAlerts RingVolume: [0]", volume));
}
/// <summary>
/// Select source 1 as the presetnation source
/// </summary>
@@ -1447,6 +1476,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SelectPresentationSource(3);
}
/// <summary>
/// Starts presentation sharing
/// </summary>
@@ -1473,6 +1504,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SendText("xCommand Presentation Stop");
}
public override void PrivacyModeOn()
{
SendText("xCommand Audio Microphones Mute");
@@ -1601,6 +1634,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
trilist.SetSigFalseAction(joinMap.DeactivateStandby.JoinNumber, () => halfwakeCodec.StandbyDeactivate());
trilist.SetSigFalseAction(joinMap.ActivateHalfWakeMode.JoinNumber, () => halfwakeCodec.HalfwakeActivate());
}
// TODO: Add mechanism to select a call instance to be able to direct DTMF tones to...
}
/// <summary>

View File

@@ -112,16 +112,46 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public string Value { get; set; }
}
public class RingVolume
public class RingVolume : ValueProperty
{
public string valueSpaceRef { get; set; }
public string Value { get; set; }
string _Value;
/// <summary>
/// Sets Value and triggers the action when set
/// </summary>
public string Value
{
get
{
return _Value;
}
set
{
_Value = value;
OnValueChanged();
}
}
public int Volume
{
get
{
return Int32.Parse(_Value);
}
}
}
public class SoundsAndAlerts
{
public RingTone RingTone { get; set; }
public RingVolume RingVolume { get; set; }
public SoundsAndAlerts()
{
RingVolume = new RingVolume();
}
}
public class Audio
@@ -131,6 +161,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public Microphones Microphones { get; set; }
public Output Output { get; set; }
public SoundsAndAlerts SoundsAndAlerts { get; set; }
public Audio()
{
SoundsAndAlerts = new SoundsAndAlerts();
}
}
public class DefaultMode
@@ -1797,6 +1833,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public UserInterface UserInterface { get; set; }
public UserManagement UserManagement { get; set; }
public Video2 Video { get; set; }
public Configuration()
{
Audio = new Audio();
}
}
public class RootObject

View File

@@ -12,28 +12,28 @@ using PepperDash.Essentials.Devices.Common.VideoCodec.CiscoCodec;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
// Helper Classes for Proerties
public abstract class ValueProperty
{
/// <summary>
/// Triggered when Value is set
/// </summary>
public Action ValueChangedAction { get; set; }
protected void OnValueChanged()
{
var a = ValueChangedAction;
if (a != null)
a();
}
}
/// <summary>
/// This class exists to capture serialized data sent back by a Cisco codec in JSON output mode
/// </summary>
public class CiscoCodecStatus
{
// Helper Classes for Proerties
public abstract class ValueProperty
{
/// <summary>
/// Triggered when Value is set
/// </summary>
public Action ValueChangedAction { get; set; }
protected void OnValueChanged()
{
var a = ValueChangedAction;
if (a != null)
a();
}
}
public class ConnectionStatus
{

View File

@@ -1201,6 +1201,39 @@ ScreenIndexIsPinnedTo: {8} (a{17})
else camera.ZoomStop();
});
trilist.SetBoolSigAction(joinMap.CameraFocusNear.JoinNumber, (b) =>
{
if (codec.SelectedCamera == null) return;
var camera = codec.SelectedCamera as IHasCameraFocusControl;
if (camera == null) return;
if (b) camera.FocusNear();
else camera.FocusStop();
});
trilist.SetBoolSigAction(joinMap.CameraFocusFar.JoinNumber, (b) =>
{
if (codec.SelectedCamera == null) return;
var camera = codec.SelectedCamera as IHasCameraFocusControl;
if (camera == null) return;
if (b) camera.FocusFar();
else camera.FocusStop();
});
trilist.SetSigFalseAction(joinMap.CameraFocusAuto.JoinNumber, () =>
{
if (codec.SelectedCamera == null) return;
var camera = codec.SelectedCamera as IHasCameraFocusControl;
if (camera == null) return;
camera.TriggerAutoFocus();
});
//Camera Select
trilist.SetUShortSigAction(joinMap.CameraNumberSelect.JoinNumber, (i) =>
{