mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +00:00
Adds new event to DeviceManager to indicate that all devices have been activated. Necessary for MicrophonePrivacyManager
#485
This commit is contained in:
parent
73addfefe7
commit
3d224496a8
3 changed files with 437 additions and 420 deletions
|
|
@ -41,12 +41,12 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||
{
|
||||
InputPort = postActivationFunc(config);
|
||||
|
||||
InputPort.Register();
|
||||
|
||||
InputPort.SetVersiportConfiguration(eVersiportConfiguration.DigitalInput);
|
||||
if (config.DisablePullUpResistor)
|
||||
InputPort.DisablePullUpResistor = true;
|
||||
|
||||
InputPort.Register();
|
||||
|
||||
InputPort.VersiportChange += InputPort_VersiportChange;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ namespace PepperDash.Essentials.Core
|
|||
{
|
||||
public static class DeviceManager
|
||||
{
|
||||
public static event EventHandler<EventArgs> AllDevicesActivated;
|
||||
|
||||
private static readonly CCriticalSection DeviceCriticalSection = new CCriticalSection();
|
||||
private static readonly CEvent AllowAddDevicesCEvent = new CEvent(false, true);
|
||||
//public static List<Device> Devices { get { return _Devices; } }
|
||||
|
|
@ -98,6 +100,8 @@ namespace PepperDash.Essentials.Core
|
|||
Debug.Console(0, d, "ERROR: Device PostActivation failure:\r{0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
OnAllDevicesActivated();
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
@ -105,6 +109,15 @@ namespace PepperDash.Essentials.Core
|
|||
}
|
||||
}
|
||||
|
||||
private static void OnAllDevicesActivated()
|
||||
{
|
||||
var handler = AllDevicesActivated;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(null, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls activate on all Device class items
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -88,8 +88,12 @@ namespace PepperDash.Essentials.Core.Privacy
|
|||
else
|
||||
Debug.Console(0, this, "Unable to add Red LED device");
|
||||
|
||||
AddPostActivationAction(() => {
|
||||
DeviceManager.AllDevicesActivated += (o, a) =>
|
||||
{
|
||||
CheckPrivacyMode();
|
||||
};
|
||||
|
||||
AddPostActivationAction(() => {
|
||||
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange -= PrivacyModeIsOnFeedback_OutputChange;
|
||||
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue