mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +00:00
Added behaviour options for MicrophonePrivacyController to track either room power state or room call state from config
This commit is contained in:
parent
d9013157ad
commit
f9d1a737c4
5 changed files with 51 additions and 15 deletions
|
|
@ -19,6 +19,8 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
|
|||
{
|
||||
MicrophonePrivacyControllerConfig Config;
|
||||
|
||||
bool initialized;
|
||||
|
||||
public bool EnableLeds
|
||||
{
|
||||
get
|
||||
|
|
@ -29,6 +31,8 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
|
|||
{
|
||||
_enableLeds = value;
|
||||
|
||||
if (initialized)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
CheckPrivacyMode();
|
||||
|
|
@ -38,6 +42,7 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
|
|||
TurnOffAllLeds();
|
||||
}
|
||||
}
|
||||
}
|
||||
bool _enableLeds;
|
||||
|
||||
public List<IDigitalInput> Inputs { get; private set; }
|
||||
|
|
@ -84,6 +89,8 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
|
|||
|
||||
CheckPrivacyMode();
|
||||
|
||||
initialized = true;
|
||||
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||
{
|
||||
get
|
||||
{
|
||||
var value = ActiveCalls.Any(c => c.IsActiveCall);
|
||||
bool value;
|
||||
|
||||
if (ActiveCalls != null)
|
||||
value = ActiveCalls.Any(c => c.IsActiveCall);
|
||||
else
|
||||
value = false;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,6 +112,12 @@ namespace PepperDash.Essentials.Room.Config
|
|||
{
|
||||
mP.SetPrivacyDevice(room);
|
||||
|
||||
var behaviour = props.MicrophonePrivacy.Behaviour.ToLower();
|
||||
|
||||
if (behaviour != null)
|
||||
{
|
||||
if (behaviour == "trackroomstate")
|
||||
{
|
||||
// Tie LED enable to room power state
|
||||
room.OnFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
|
|
@ -122,6 +128,23 @@ namespace PepperDash.Essentials.Room.Config
|
|||
};
|
||||
|
||||
mP.EnableLeds = room.OnFeedback.BoolValue;
|
||||
}
|
||||
else if (behaviour == "trackcallstate")
|
||||
{
|
||||
// Tie LED enable to room power state
|
||||
room.InCallFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (room.InCallFeedback.BoolValue)
|
||||
mP.EnableLeds = true;
|
||||
else
|
||||
mP.EnableLeds = false;
|
||||
};
|
||||
|
||||
mP.EnableLeds = room.InCallFeedback.BoolValue;
|
||||
}
|
||||
}
|
||||
else
|
||||
Debug.Console(0, "No behaviour defined for MicrophonePrivacyController");
|
||||
|
||||
return mP;
|
||||
}
|
||||
|
|
@ -153,6 +176,7 @@ namespace PepperDash.Essentials.Room.Config
|
|||
public class EssentialsRoomMicrophonePrivacyConfig
|
||||
{
|
||||
public string DeviceKey { get; set; }
|
||||
public string Behaviour { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue