mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-15 05:24:58 +00:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd4bb24945 | ||
|
|
10104e2a09 | ||
|
|
c99ba9ca1d | ||
|
|
74de1c2475 | ||
|
|
ce247b8e8a | ||
|
|
8e0262e1c3 | ||
|
|
f2e2166146 | ||
|
|
84374a8af0 | ||
|
|
c0b59c375e | ||
|
|
405677a3df | ||
|
|
1a9546c970 | ||
|
|
89f6300d14 | ||
|
|
2012f55735 | ||
|
|
ed468add2c | ||
|
|
c22e95cad2 | ||
|
|
59b2e9a8d6 | ||
|
|
13132c29fc | ||
|
|
407a354cfe | ||
|
|
5b05e8bb48 |
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IChannelExtensions
|
||||
{
|
||||
public static void LinkActions(this IChannel dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IChannel dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IChannel dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IChannel dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IColorExtensions
|
||||
{
|
||||
public static void LinkActions(this IColor dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IColor dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "blue", new PressAndHoldAction(dev.Blue));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IColor dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IColor dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IDPadExtensions
|
||||
{
|
||||
public static void LinkActions(this IDPad dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IDPad dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IDPad dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IDPad dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IDvrExtensions
|
||||
{
|
||||
public static void LinkActions(this IDvr dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IDvr dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IDvr dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IDvr dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class INumericExtensions
|
||||
{
|
||||
public static void LinkActions(this INumericKeypad dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this INumericKeypad dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
// Deal with the Accessory functions on the numpad later
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this INumericKeypad dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this INumericKeypad dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class IPowerExtensions
|
||||
{
|
||||
public static void LinkActions(this IPower dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this IPower dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "powerToggle", new Action(dev.PowerToggle));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this IPower dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this IPower dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class ISetTopBoxControlsExtensions
|
||||
{
|
||||
public static void LinkActions(this ISetTopBoxControls dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this ISetTopBoxControls dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "replay", new PressAndHoldAction(dev.Replay));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this ISetTopBoxControls dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this ISetTopBoxControls dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public static class ITransportExtensions
|
||||
{
|
||||
public static void LinkActions(this ITransport dev, CotijaSystemController controller)
|
||||
public static void LinkActions(this ITransport dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record));
|
||||
}
|
||||
|
||||
public static void UnlinkActions(this ITransport dev, CotijaSystemController controller)
|
||||
public static void UnlinkActions(this ITransport dev, MobileControlSystemController controller)
|
||||
{
|
||||
var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a room whose configuration is derived from runtime data,
|
||||
@@ -19,42 +19,3 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
}
|
||||
}
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
/// <summary>
|
||||
/// For rooms with a single presentation source, change event
|
||||
/// </summary>
|
||||
public interface IHasCurrentSourceInfoChange
|
||||
{
|
||||
string CurrentSourceInfoKey { get; }
|
||||
SourceListItem CurrentSourceInfo { get; }
|
||||
event SourceInfoChangeHandler CurrentSingleSourceChange;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with routing
|
||||
/// </summary>
|
||||
public interface IRunRouteAction
|
||||
{
|
||||
void RunRouteAction(string routeKey);
|
||||
|
||||
void RunRouteAction(string routeKey, Action successCallback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms that default presentation only routing
|
||||
/// </summary>
|
||||
public interface IRunDefaultPresentRoute
|
||||
{
|
||||
bool RunDefaultPresentRoute();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms that have default presentation and calling routes
|
||||
/// </summary>
|
||||
public interface IRunDefaultCallRoute : IRunDefaultPresentRoute
|
||||
{
|
||||
bool RunDefaultCallRoute();
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendAtcFullMessageObject));
|
||||
appServerController.AddAction(MessagePath + "/dial", new Action<string>(s => Codec.Dial(s)));
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
PostUpdateStatus(e.UpdateStatus.ToString());
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction(MessagePath + "/updateConfig", new Action<string>(s => GetConfigFile(s)));
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
//EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s }));
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
var asc = appServerController;
|
||||
EISC.SetStringSigAction(SHookState, s =>
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public CotijaSystemController AppServerController { get; private set; }
|
||||
public MobileControlSystemController AppServerController { get; private set; }
|
||||
|
||||
public string MessagePath { get; private set; }
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// Registers this messenger with appserver controller
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
public void RegisterWithAppServer(CotijaSystemController appServerController)
|
||||
public void RegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
if (appServerController == null)
|
||||
throw new ArgumentNullException("appServerController");
|
||||
@@ -60,7 +60,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// Implemented in extending classes. Wire up API calls and feedback here
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
abstract protected void CustomRegisterWithAppServer(CotijaSystemController appServerController);
|
||||
abstract protected void CustomRegisterWithAppServer(MobileControlSystemController appServerController);
|
||||
|
||||
/// <summary>
|
||||
/// Helper for posting status message
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
});
|
||||
}
|
||||
|
||||
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
AppServerController.AddAction(MessagePath + "/fullStatus", new Action(SendFullStatusMessage));
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// Called from base's RegisterWithAppServer method
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController)
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
{
|
||||
appServerController.AddAction("/device/videoCodec/isReady", new Action(SendIsReady));
|
||||
appServerController.AddAction("/device/videoCodec/fullStatus", new Action(SendVtcFullMessageObject));
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class CotijaConfig
|
||||
public class MobileControlConfig
|
||||
{
|
||||
[JsonProperty("serverUrl")]
|
||||
public string ServerUrl { get; set; }
|
||||
@@ -25,7 +25,7 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class CotijaDdvc01RoomBridgePropertiesConfig
|
||||
public class MobileControlDdvc01RoomBridgePropertiesConfig
|
||||
{
|
||||
[JsonProperty("eiscId")]
|
||||
public string EiscId { get; set; }
|
||||
@@ -8,19 +8,19 @@ using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic device connection through to and EISC for DDVC01
|
||||
/// </summary>
|
||||
public class CotijaDdvc01DeviceBridge : Device, IChannel, INumericKeypad
|
||||
public class MobileControlDdvc01DeviceBridge : Device, IChannel, INumericKeypad
|
||||
{
|
||||
/// <summary>
|
||||
/// EISC used to talk to Simpl
|
||||
/// </summary>
|
||||
ThreeSeriesTcpIpEthernetIntersystemCommunications EISC;
|
||||
|
||||
public CotijaDdvc01DeviceBridge(string key, string name, ThreeSeriesTcpIpEthernetIntersystemCommunications eisc)
|
||||
public MobileControlDdvc01DeviceBridge(string key, string name, ThreeSeriesTcpIpEthernetIntersystemCommunications eisc)
|
||||
: base(key, name)
|
||||
{
|
||||
EISC = eisc;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,15 +12,15 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class CotijaBridgeBase: Device
|
||||
public abstract class MobileControlBridgeBase: Device
|
||||
{
|
||||
public CotijaSystemController Parent { get; private set; }
|
||||
public MobileControlSystemController Parent { get; private set; }
|
||||
|
||||
public string UserCode { get; private set; }
|
||||
|
||||
public abstract string RoomName { get; }
|
||||
|
||||
public CotijaBridgeBase(string key, string name)
|
||||
public MobileControlBridgeBase(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
}
|
||||
@@ -30,7 +30,7 @@ namespace PepperDash.Essentials
|
||||
/// as adding actions to parent
|
||||
/// </summary>
|
||||
/// <param name="parent"></param>
|
||||
public virtual void AddParent(CotijaSystemController parent)
|
||||
public virtual void AddParent(MobileControlSystemController parent)
|
||||
{
|
||||
Parent = parent;
|
||||
}
|
||||
@@ -16,9 +16,9 @@ using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class CotijaDdvc01RoomBridge : CotijaBridgeBase, IDelayedConfiguration
|
||||
public class MobileControlDdvc01RoomBridge : MobileControlBridgeBase, IDelayedConfiguration
|
||||
{
|
||||
public class BoolJoin
|
||||
{
|
||||
@@ -236,7 +236,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
}
|
||||
}
|
||||
|
||||
CotijaDdvc01DeviceBridge SourceBridge;
|
||||
MobileControlDdvc01DeviceBridge SourceBridge;
|
||||
|
||||
Ddvc01AtcMessenger AtcMessenger;
|
||||
Ddvc01VtcMessenger VtcMessenger;
|
||||
@@ -248,7 +248,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="ipId"></param>
|
||||
public CotijaDdvc01RoomBridge(string key, string name, uint ipId)
|
||||
public MobileControlDdvc01RoomBridge(string key, string name, uint ipId)
|
||||
: base(key, name)
|
||||
{
|
||||
try
|
||||
@@ -258,7 +258,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
if (reg != Crestron.SimplSharpPro.eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
Debug.Console(0, this, "Cannot connect EISC at IPID {0}: \r{1}", ipId, reg);
|
||||
|
||||
SourceBridge = new CotijaDdvc01DeviceBridge(key + "-sourceBridge", "DDVC01 source bridge", EISC);
|
||||
SourceBridge = new MobileControlDdvc01DeviceBridge(key + "-sourceBridge", "DDVC01 source bridge", EISC);
|
||||
DeviceManager.AddDevice(SourceBridge);
|
||||
}
|
||||
catch (Exception)
|
||||
@@ -590,7 +590,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
// rmProps.VolumeSliderNames.Add(EISC.StringInput[i].StringValue);
|
||||
//}
|
||||
|
||||
// There should be cotija devices in here, I think...
|
||||
// There should be Mobile Control devices in here, I think...
|
||||
if(co.Devices == null)
|
||||
co.Devices = new List<DeviceConfig>();
|
||||
|
||||
@@ -9,14 +9,14 @@ using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Room.Cotija;
|
||||
using PepperDash.Essentials.Room.MobileControl;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class CotijaEssentialsHuddleSpaceRoomBridge : CotijaBridgeBase
|
||||
public class MobileConrolEssentialsHuddleSpaceRoomBridge : MobileControlBridgeBase
|
||||
{
|
||||
|
||||
public EssentialsRoomBase Room { get; private set; }
|
||||
@@ -42,7 +42,7 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
/// <param name="parent"></param>
|
||||
/// <param name="room"></param>
|
||||
public CotijaEssentialsHuddleSpaceRoomBridge(EssentialsRoomBase room):
|
||||
public MobileConrolEssentialsHuddleSpaceRoomBridge(EssentialsRoomBase room):
|
||||
base("mobileControlBridge-essentialsHuddle", "Essentials Mobile Control Bridge-Huddle")
|
||||
{
|
||||
Room = room;
|
||||
@@ -52,7 +52,7 @@ namespace PepperDash.Essentials
|
||||
/// Override of base: calls base to add parent and then registers actions and events.
|
||||
/// </summary>
|
||||
/// <param name="parent"></param>
|
||||
public override void AddParent(CotijaSystemController parent)
|
||||
public override void AddParent(MobileControlSystemController parent)
|
||||
{
|
||||
base.AddParent(parent);
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
var sscRoom = Room as IHasCurrentSourceInfoChange;
|
||||
if(sscRoom != null)
|
||||
sscRoom.CurrentSingleSourceChange += new SourceInfoChangeHandler(Room_CurrentSingleSourceChange);
|
||||
sscRoom.CurrentSourceChange += new SourceInfoChangeHandler(Room_CurrentSingleSourceChange);
|
||||
|
||||
var vcRoom = Room as IHasVideoCodec;
|
||||
if (vcRoom != null && vcRoom.VideoCodec != null)
|
||||
@@ -169,19 +169,6 @@ namespace PepperDash.Essentials
|
||||
});
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Handler for codec changes
|
||||
///// </summary>
|
||||
//void codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
|
||||
//{
|
||||
// PostStatusMessage(new
|
||||
// {
|
||||
// calls = GetCallsMessageObject(),
|
||||
// //vtc = GetVtcCallsMessageObject()
|
||||
// });
|
||||
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Helper for posting status message
|
||||
/// </summary>
|
||||
@@ -334,7 +321,7 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
|
||||
|
||||
void Room_CurrentSingleSourceChange(EssentialsRoomBase room, PepperDash.Essentials.Core.SourceListItem info, ChangeType type)
|
||||
void Room_CurrentSingleSourceChange(PepperDash.Essentials.Core.SourceListItem info, ChangeType type)
|
||||
{
|
||||
/* Example message
|
||||
* {
|
||||
@@ -395,11 +382,14 @@ namespace PepperDash.Essentials
|
||||
if (dev is ITransport)
|
||||
(dev as ITransport).LinkActions(Parent);
|
||||
|
||||
var srcRm = room as IHasCurrentSourceInfoChange;
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = srcRm.CurrentSourceInfoKey
|
||||
});
|
||||
var srcRm = Room as IHasCurrentSourceInfoChange;
|
||||
if (srcRm != null)
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
selectedSourceKey = srcRm.CurrentSourceInfoKey
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -432,45 +422,6 @@ namespace PepperDash.Essentials
|
||||
volumes = volumes
|
||||
});
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Helper to return a anonymous object with the call data for JSON message
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//object GetCallsMessageObject()
|
||||
//{
|
||||
// var callRm = Room as IHasVideoCodec;
|
||||
// if (callRm == null)
|
||||
// return null;
|
||||
// return new
|
||||
// {
|
||||
// activeCalls = callRm.VideoCodec.ActiveCalls,
|
||||
// callType = callRm.CallTypeFeedback.IntValue,
|
||||
// inCall = callRm.InCallFeedback.BoolValue,
|
||||
// isSharing = callRm.IsSharingFeedback.BoolValue,
|
||||
// privacyModeIsOn = callRm.PrivacyModeIsOnFeedback.BoolValue
|
||||
// };
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Helper method to build call status for vtc
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//object GetVtcCallsMessageObject()
|
||||
//{
|
||||
// var callRm = Room as IHasVideoCodec;
|
||||
// object vtc = null;
|
||||
// if (callRm != null)
|
||||
// {
|
||||
// var codec = callRm.VideoCodec;
|
||||
// vtc = new
|
||||
// {
|
||||
// isInCall = codec.IsInCall,
|
||||
// calls = codec.ActiveCalls
|
||||
// };
|
||||
// }
|
||||
// return vtc;
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -6,7 +6,7 @@ using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Cotija
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class Volumes
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ using PepperDash.Essentials.Devices.Common;
|
||||
using PepperDash.Essentials.DM;
|
||||
using PepperDash.Essentials.Fusion;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
using PepperDash.Essentials.Room.Cotija;
|
||||
using PepperDash.Essentials.Room.MobileControl;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -42,8 +42,11 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
DeterminePlatform();
|
||||
|
||||
//CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file",
|
||||
// ConsoleAccessLevelEnum.AccessOperator);
|
||||
if (Debug.DoNotLoadOnNextBoot)
|
||||
{
|
||||
CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
}
|
||||
|
||||
// CrestronConsole.AddNewConsoleCommand(S => { ConfigWriter.WriteConfigFile(null); }, "writeconfig", "writes the current config to a file", ConsoleAccessLevelEnum.AccessOperator);
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
@@ -73,7 +76,8 @@ namespace PepperDash.Essentials
|
||||
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
|
||||
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
GoWithLoad();
|
||||
if (!Debug.DoNotLoadOnNextBoot)
|
||||
GoWithLoad();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -83,57 +87,64 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
public void DeterminePlatform()
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Determining Platform....");
|
||||
|
||||
string filePathPrefix;
|
||||
|
||||
var dirSeparator = Global.DirectorySeparator;
|
||||
|
||||
var version = Crestron.SimplSharp.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
|
||||
var versionString = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build);
|
||||
|
||||
string directoryPrefix;
|
||||
|
||||
directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
|
||||
|
||||
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows OS
|
||||
try
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on 3-series Appliance", versionString);
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Determining Platform....");
|
||||
|
||||
// Check if User/ProgramX exists
|
||||
if (Directory.Exists(directoryPrefix + dirSeparator + "User"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
|
||||
string filePathPrefix;
|
||||
|
||||
var dirSeparator = Global.DirectorySeparator;
|
||||
|
||||
var version = Crestron.SimplSharp.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
|
||||
var versionString = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build);
|
||||
|
||||
string directoryPrefix;
|
||||
|
||||
directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
|
||||
|
||||
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows OS
|
||||
{
|
||||
Debug.Console(0, @"User/program{0} directory found", InitialParametersClass.ApplicationNumber);
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "User"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on 3-series Appliance", versionString);
|
||||
|
||||
// Check if User/ProgramX exists
|
||||
if (Directory.Exists(directoryPrefix + dirSeparator + "User"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
|
||||
{
|
||||
Debug.Console(0, @"User/program{0} directory found", InitialParametersClass.ApplicationNumber);
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "User"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
|
||||
}
|
||||
// Check if Nvram/Programx exists
|
||||
else if (Directory.Exists(directoryPrefix + dirSeparator + "Nvram"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
|
||||
{
|
||||
Debug.Console(0, @"Nvram/program{0} directory found", InitialParametersClass.ApplicationNumber);
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "Nvram"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
|
||||
}
|
||||
// If neither exists, set path to User/ProgramX
|
||||
else
|
||||
{
|
||||
Debug.Console(0, @"No previous directory found. Using User/program{0}", InitialParametersClass.ApplicationNumber);
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "User"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
|
||||
}
|
||||
}
|
||||
// Check if Nvram/Programx exists
|
||||
else if (Directory.Exists(directoryPrefix + dirSeparator + "Nvram"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
|
||||
else // Handles Linux OS (Virtual Control)
|
||||
{
|
||||
Debug.Console(0, @"Nvram/program{0} directory found", InitialParametersClass.ApplicationNumber);
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "Nvram"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
|
||||
}
|
||||
// If neither exists, set path to User/ProgramX
|
||||
else
|
||||
{
|
||||
Debug.Console(0, @"No previous directory found. Using User/program{0}", InitialParametersClass.ApplicationNumber);
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "User"
|
||||
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on Virtual Control Server", versionString);
|
||||
|
||||
// Set path to User/
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "User" + dirSeparator;
|
||||
}
|
||||
|
||||
Global.SetFilePathPrefix(filePathPrefix);
|
||||
}
|
||||
else // Handles Linux OS (Virtual Control)
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on Virtual Control Server", versionString);
|
||||
|
||||
// Set path to User/
|
||||
filePathPrefix = directoryPrefix + dirSeparator + "User" + dirSeparator;
|
||||
Debug.Console(0, "Unable to Determine Platform due to Exception: {0}", e.Message);
|
||||
}
|
||||
|
||||
Global.SetFilePathPrefix(filePathPrefix);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -143,6 +154,8 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
try
|
||||
{
|
||||
Debug.SetDoNotLoadOnNextBoot(false);
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
|
||||
|
||||
var filesReady = SetupFilesystem();
|
||||
@@ -337,7 +350,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
var sysMon = DeviceManager.GetDeviceForKey("systemMonitor") as PepperDash.Essentials.Core.Monitoring.SystemMonitorController;
|
||||
|
||||
var appServer = DeviceManager.GetDeviceForKey("appServer") as CotijaSystemController;
|
||||
var appServer = DeviceManager.GetDeviceForKey("appServer") as MobileControlSystemController;
|
||||
|
||||
|
||||
if (sysMon != null && appServer != null)
|
||||
@@ -493,16 +506,16 @@ namespace PepperDash.Essentials
|
||||
DeviceManager.AddDevice(room);
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
|
||||
DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
|
||||
DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
|
||||
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Cotija Bridge...");
|
||||
// Cotija bridge
|
||||
var bridge = new CotijaEssentialsHuddleSpaceRoomBridge(room as EssentialsHuddleSpaceRoom);
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
||||
// Mobile Control bridge
|
||||
var bridge = new MobileConrolEssentialsHuddleSpaceRoomBridge(room as EssentialsHuddleSpaceRoom);
|
||||
AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
|
||||
DeviceManager.AddDevice(bridge);
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Cotija Bridge Added...");
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control Bridge Added...");
|
||||
}
|
||||
else if (room is EssentialsHuddleVtc1Room)
|
||||
{
|
||||
@@ -511,9 +524,9 @@ namespace PepperDash.Essentials
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
|
||||
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((EssentialsHuddleVtc1Room)room, 0xf1));
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Cotija Bridge...");
|
||||
// Cotija bridge
|
||||
var bridge = new CotijaEssentialsHuddleSpaceRoomBridge(room);
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
||||
// Mobile Control bridge
|
||||
var bridge = new MobileConrolEssentialsHuddleSpaceRoomBridge(room);
|
||||
AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
|
||||
DeviceManager.AddDevice(bridge);
|
||||
}
|
||||
@@ -536,11 +549,11 @@ namespace PepperDash.Essentials
|
||||
/// Helps add the post activation steps that link bridges to main controller
|
||||
/// </summary>
|
||||
/// <param name="bridge"></param>
|
||||
void AddBridgePostActivationHelper(CotijaBridgeBase bridge)
|
||||
void AddBridgePostActivationHelper(MobileControlBridgeBase bridge)
|
||||
{
|
||||
bridge.AddPostActivationAction(() =>
|
||||
{
|
||||
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as CotijaSystemController;
|
||||
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as MobileControlSystemController;
|
||||
if (parent == null)
|
||||
{
|
||||
Debug.Console(0, bridge, "ERROR: Cannot connect app server room bridge. System controller not present");
|
||||
|
||||
@@ -12,6 +12,32 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
public class Amplifier : Device, IRoutingSinkNoSwitching
|
||||
{
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
|
||||
public string CurrentSourceInfoKey { get; set; }
|
||||
public SourceListItem CurrentSourceInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return _CurrentSourceInfo;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == _CurrentSourceInfo) return;
|
||||
|
||||
var handler = CurrentSourceChange;
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.WillChange);
|
||||
|
||||
_CurrentSourceInfo = value;
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
||||
}
|
||||
}
|
||||
SourceListItem _CurrentSourceInfo;
|
||||
|
||||
public RoutingInputPort AudioIn { get; private set; }
|
||||
|
||||
public Amplifier(string key, string name)
|
||||
|
||||
@@ -61,18 +61,18 @@ namespace PepperDash.Essentials
|
||||
|
||||
else if (typeName == "appserver")
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject<CotijaConfig>(properties.ToString());
|
||||
return new CotijaSystemController(key, name, props);
|
||||
var props = JsonConvert.DeserializeObject<MobileControlConfig>(properties.ToString());
|
||||
return new MobileControlSystemController(key, name, props);
|
||||
}
|
||||
|
||||
else if (typeName == "mobilecontrolbridge-ddvc01")
|
||||
{
|
||||
var comm = CommFactory.GetControlPropertiesConfig(dc);
|
||||
|
||||
var bridge = new PepperDash.Essentials.Room.Cotija.CotijaDdvc01RoomBridge(key, name, comm.IpIdInt);
|
||||
var bridge = new PepperDash.Essentials.Room.MobileControl.MobileControlDdvc01RoomBridge(key, name, comm.IpIdInt);
|
||||
bridge.AddPreActivationAction(() =>
|
||||
{
|
||||
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as CotijaSystemController;
|
||||
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as MobileControlSystemController;
|
||||
if (parent == null)
|
||||
{
|
||||
Debug.Console(0, bridge, "ERROR: Cannot connect bridge. System controller not present");
|
||||
@@ -87,7 +87,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
else if (typeName == "roomonwhenoccupancydetectedfeature")
|
||||
{
|
||||
return new Room.Behaviours.RoomOnToDefaultSourceWhenOccupied(dc);
|
||||
return new RoomOnToDefaultSourceWhenOccupied(dc);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -14,6 +14,7 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.Fusion;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
using PepperDash.Essentials.Devices.Common.Occupancy;
|
||||
|
||||
@@ -181,7 +182,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
// Moved to
|
||||
CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(84, "Display 1 - Current Source", eSigIoMask.InputSigOnly);
|
||||
// Don't think we need to get current status of this as nothing should be alive yet.
|
||||
(Room as EssentialsHuddleVtc1Room).CurrentSingleSourceChange += Room_CurrentSourceInfoChange;
|
||||
(Room as EssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
|
||||
|
||||
|
||||
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
|
||||
@@ -220,7 +221,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
break;
|
||||
}
|
||||
|
||||
var laptops = dict.Where(d => d.Value.SourceDevice is Laptop);
|
||||
var laptops = dict.Where(d => d.Value.SourceDevice is Core.Devices.Laptop);
|
||||
i = 1;
|
||||
foreach (var kvp in laptops)
|
||||
{
|
||||
@@ -175,28 +175,23 @@
|
||||
<Compile Include="Devices\NUMERIC AppleTV.cs" />
|
||||
<Compile Include="ControlSystem.cs" />
|
||||
<Compile Include="Factory\UiDeviceFactory.cs" />
|
||||
<Compile Include="FOR REFERENCE UI\OTHER\Fusion\EssentialsHuddleVtc1FusionController.cs" />
|
||||
<Compile Include="FOR REFERENCE UI\OTHER\Fusion\FusionCustomPropertiesBridge.cs" />
|
||||
<Compile Include="FOR REFERENCE UI\OTHER\Fusion\FusionEventHandlers.cs" />
|
||||
<Compile Include="FOR REFERENCE UI\OTHER\Fusion\FusionProcessorQueries.cs" />
|
||||
<Compile Include="FOR REFERENCE UI\OTHER\Fusion\FusionRviDataClasses.cs" />
|
||||
<Compile Include="Fusion\EssentialsHuddleVtc1FusionController.cs" />
|
||||
<Compile Include="REMOVE EssentialsApp.cs" />
|
||||
<Compile Include="FOR REFERENCE UI\OTHER\Fusion\EssentialsHuddleSpaceFusionSystemControllerBase.cs" />
|
||||
<Compile Include="HttpApiHandler.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Room\Behaviours\RoomOnToDefaultSourceWhenOccupied.cs" />
|
||||
<Compile Include="Room\Config\EssentialsDualDisplayRoomPropertiesConfig.cs" />
|
||||
<Compile Include="Room\Config\EssentialsNDisplayRoomPropertiesConfig.cs" />
|
||||
<Compile Include="Room\Config\DDVC01RoomPropertiesConfig.cs" />
|
||||
<Compile Include="Room\Config\EssentialsPresentationPropertiesConfig.cs" />
|
||||
<Compile Include="Room\Config\EssentialsHuddleRoomPropertiesConfig.cs" />
|
||||
<Compile Include="Room\Config\EssentialsHuddleVtc1PropertiesConfig.cs" />
|
||||
<Compile Include="Room\Config\EssentialsRoomEmergencyConfig.cs" />
|
||||
<Compile Include="AppServer\CotijaConfig.cs" />
|
||||
<Compile Include="AppServer\CotijaDdvc01DeviceBridge.cs" />
|
||||
<Compile Include="AppServer\MobileControlConfig.cs" />
|
||||
<Compile Include="AppServer\MobileControlDdvc01DeviceBridge.cs" />
|
||||
<Compile Include="AppServer\Interfaces.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\CotijaBridgeBase.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\CotijaDdvc01RoomBridge.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\CotijaEssentialsHuddleSpaceRoomBridge.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\MobileControlBridgeBase.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\MobileControlDdvc01RoomBridge.cs" />
|
||||
<Compile Include="AppServer\RoomBridges\MobileControlEssentialsHuddleSpaceRoomBridge.cs" />
|
||||
<Compile Include="AppServer\DeviceTypeInterfaces\IChannelExtensions.cs" />
|
||||
<Compile Include="AppServer\DeviceTypeInterfaces\IColorExtensions.cs" />
|
||||
<Compile Include="AppServer\DeviceTypeInterfaces\IDPadExtensions.cs" />
|
||||
@@ -208,10 +203,10 @@
|
||||
<Compile Include="AppServer\RoomBridges\SourceDeviceMapDictionary.cs" />
|
||||
<Compile Include="AppServer\Volumes.cs" />
|
||||
<Compile Include="Room\Emergency\EsentialsRoomEmergencyContactClosure.cs" />
|
||||
<Compile Include="Room\Types\EssentialsDualDisplayRoom.cs" />
|
||||
<Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
|
||||
<Compile Include="Room\Types\EssentialsNDisplayRoomBase.cs" />
|
||||
<Compile Include="Room\Types\EssentialsPresentationRoom.cs" />
|
||||
<Compile Include="Room\Types\EssentialsRoomBase.cs" />
|
||||
<Compile Include="Room\Config\EssentialsRoomConfig.cs" />
|
||||
<Compile Include="FOR REFERENCE UI\PageControllers\DevicePageControllerBase.cs" />
|
||||
<Compile Include="FOR REFERENCE UI\PageControllers\PageControllerLaptop.cs" />
|
||||
@@ -245,7 +240,7 @@
|
||||
<Compile Include="UIDrivers\Page Drivers\SingleSubpageModalAndBackDriver.cs" />
|
||||
<Compile Include="UIDrivers\SmartObjectRoomsList.cs" />
|
||||
<Compile Include="UI\JoinConstants\UIBoolJoin.cs" />
|
||||
<Compile Include="AppServer\CotijaSystemController.cs" />
|
||||
<Compile Include="AppServer\MobileControlSystemController.cs" />
|
||||
<Compile Include="UI\DualDisplaySourceSRLController.cs" />
|
||||
<Compile Include="UI\SubpageReferenceListActivityItem.cs" />
|
||||
<Compile Include="FOR REFERENCE UI\Panels\REMOVE UiCue.cs" />
|
||||
@@ -275,6 +270,9 @@
|
||||
<Name>Essentials Devices Common</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="FOR REFERENCE UI\OTHER\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
{
|
||||
public class EssentialsDualDisplayRoomPropertiesConfig : EssentialsNDisplayRoomPropertiesConfig
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,19 +8,10 @@ using Newtonsoft.Json;
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
{
|
||||
|
||||
public class EssentialsHuddleVtc1PropertiesConfig : EssentialsRoomPropertiesConfig
|
||||
public class EssentialsHuddleVtc1PropertiesConfig : EssentialsConferenceRoomPropertiesConfig
|
||||
{
|
||||
[JsonProperty("defaultDisplayKey")]
|
||||
public string DefaultDisplayKey { get; set; }
|
||||
[JsonProperty("defaultAudioKey")]
|
||||
public string DefaultAudioKey { get; set; }
|
||||
[JsonProperty("sourceListKey")]
|
||||
public string SourceListKey { get; set; }
|
||||
[JsonProperty("defaultSourceItem")]
|
||||
public string DefaultSourceItem { get; set; }
|
||||
[JsonProperty("videoCodecKey")]
|
||||
public string VideoCodecKey { get; set; }
|
||||
[JsonProperty("audioCodecKey")]
|
||||
public string AudioCodecKey { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,22 +4,36 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Config
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class EssentialsNDisplayRoomPropertiesConfig : EssentialsRoomPropertiesConfig
|
||||
public class EssentialsNDisplayRoomPropertiesConfig : EssentialsConferenceRoomPropertiesConfig
|
||||
{
|
||||
[JsonProperty("defaultAudioBehavior")]
|
||||
public string DefaultAudioBehavior { get; set; }
|
||||
public string DefaultAudioKey { get; set; }
|
||||
[JsonProperty("defaultVideoBehavior")]
|
||||
public string DefaultVideoBehavior { get; set; }
|
||||
public Dictionary<string, string> Displays { get; set; }
|
||||
public string SourceListKey { get; set; }
|
||||
[JsonProperty("displays")]
|
||||
public Dictionary<eSourceListItemDestinationTypes, DisplayItem> Displays { get; set; }
|
||||
|
||||
public EssentialsNDisplayRoomPropertiesConfig()
|
||||
{
|
||||
Displays = new Dictionary<string, string>();
|
||||
Displays = new Dictionary<eSourceListItemDestinationTypes, DisplayItem>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class DisplayItem : IKeyName
|
||||
{
|
||||
public string Key { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,6 +38,12 @@ namespace PepperDash.Essentials.Room.Config
|
||||
{
|
||||
return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
|
||||
}
|
||||
else if (typeName == "dualdisplay")
|
||||
{
|
||||
var rm = new EssentialsDualDisplayRoom(roomConfig);
|
||||
|
||||
return rm;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -65,8 +71,8 @@ namespace PepperDash.Essentials.Room.Config
|
||||
/// <param name="props"></param>
|
||||
/// <param name="room"></param>
|
||||
/// <returns></returns>
|
||||
public static PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController GetMicrophonePrivacy(
|
||||
EssentialsRoomPropertiesConfig props, EssentialsHuddleVtc1Room room)
|
||||
public static Core.Privacy.MicrophonePrivacyController GetMicrophonePrivacy(
|
||||
EssentialsRoomPropertiesConfig props, IPrivacy room)
|
||||
{
|
||||
var microphonePrivacy = props.MicrophonePrivacy;
|
||||
if (microphonePrivacy == null)
|
||||
@@ -76,7 +82,7 @@ namespace PepperDash.Essentials.Room.Config
|
||||
}
|
||||
// Get the MicrophonePrivacy device from the device manager
|
||||
var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as
|
||||
PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController);
|
||||
Core.Privacy.MicrophonePrivacyController);
|
||||
// Set this room as the IPrivacy device
|
||||
if (mP == null)
|
||||
{
|
||||
@@ -95,28 +101,30 @@ namespace PepperDash.Essentials.Room.Config
|
||||
if (behaviour == "trackroomstate")
|
||||
{
|
||||
// Tie LED enable to room power state
|
||||
room.OnFeedback.OutputChange += (o, a) =>
|
||||
var essRoom = room as EssentialsRoomBase;
|
||||
essRoom.OnFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (room.OnFeedback.BoolValue)
|
||||
if (essRoom.OnFeedback.BoolValue)
|
||||
mP.EnableLeds = true;
|
||||
else
|
||||
mP.EnableLeds = false;
|
||||
};
|
||||
|
||||
mP.EnableLeds = room.OnFeedback.BoolValue;
|
||||
mP.EnableLeds = essRoom.OnFeedback.BoolValue;
|
||||
}
|
||||
else if (behaviour == "trackcallstate")
|
||||
{
|
||||
// Tie LED enable to room power state
|
||||
room.InCallFeedback.OutputChange += (o, a) =>
|
||||
var inCallRoom = room as IHasInCallFeedback;
|
||||
inCallRoom.InCallFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (room.InCallFeedback.BoolValue)
|
||||
if (inCallRoom.InCallFeedback.BoolValue)
|
||||
mP.EnableLeds = true;
|
||||
else
|
||||
mP.EnableLeds = false;
|
||||
};
|
||||
|
||||
mP.EnableLeds = room.InCallFeedback.BoolValue;
|
||||
mP.EnableLeds = inCallRoom.InCallFeedback.BoolValue;
|
||||
}
|
||||
|
||||
return mP;
|
||||
@@ -175,6 +183,25 @@ namespace PepperDash.Essentials.Room.Config
|
||||
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
|
||||
}
|
||||
|
||||
public class EssentialsAvRoomPropertiesConfig : EssentialsRoomPropertiesConfig
|
||||
{
|
||||
[JsonProperty("defaultAudioKey")]
|
||||
public string DefaultAudioKey { get; set; }
|
||||
[JsonProperty("sourceListKey")]
|
||||
public string SourceListKey { get; set; }
|
||||
[JsonProperty("defaultSourceItem")]
|
||||
public string DefaultSourceItem { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class EssentialsConferenceRoomPropertiesConfig : EssentialsAvRoomPropertiesConfig
|
||||
{
|
||||
[JsonProperty("videoCodecKey")]
|
||||
public string VideoCodecKey { get; set; }
|
||||
[JsonProperty("audioCodecKey")]
|
||||
public string AudioCodecKey { get; set; }
|
||||
}
|
||||
|
||||
public class EssentialsEnvironmentPropertiesConfig
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
@@ -12,15 +12,7 @@ using PepperDash.Essentials.Room.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Room
|
||||
{
|
||||
public abstract class EssentialsRoomEmergencyBase : IKeyed
|
||||
{
|
||||
public string Key { get; private set; }
|
||||
|
||||
public EssentialsRoomEmergencyBase(string key)
|
||||
{
|
||||
Key = key;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class EssentialsRoomEmergencyContactClosure : EssentialsRoomEmergencyBase
|
||||
|
||||
656
PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs
Normal file
656
PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs
Normal file
@@ -0,0 +1,656 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Devices;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class EssentialsDualDisplayRoom : EssentialsNDisplayRoomBase, IHasCurrentVolumeControls,
|
||||
IRunRouteAction, IPrivacy, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasInCallFeedback
|
||||
{
|
||||
public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
|
||||
public EssentialsDualDisplayRoomPropertiesConfig PropertiesConfig { get; private set; }
|
||||
|
||||
//************************
|
||||
// Call-related stuff
|
||||
|
||||
public BoolFeedback InCallFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// States: 0 for on hook, 1 for video, 2 for audio, 3 for telekenesis
|
||||
/// </summary>
|
||||
public IntFeedback CallTypeFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public BoolFeedback PrivacyModeIsOnFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// When something in the room is sharing with the far end or through other means
|
||||
/// </summary>
|
||||
public BoolFeedback IsSharingFeedback { get; private set; }
|
||||
|
||||
public IRoutingSinkWithSwitching LeftDisplay { get; private set; }
|
||||
public IRoutingSinkWithSwitching RightDisplay { get; private set; }
|
||||
|
||||
|
||||
protected override Func<bool> OnFeedbackFunc
|
||||
{
|
||||
get
|
||||
{
|
||||
return () =>
|
||||
{
|
||||
var leftDisp = LeftDisplay as DisplayBase;
|
||||
var rightDisp = RightDisplay as DisplayBase;
|
||||
var val = leftDisp != null && leftDisp.CurrentSourceInfo != null
|
||||
&& leftDisp.CurrentSourceInfo.Type == eSourceListItemType.Route
|
||||
&& rightDisp != null && rightDisp.CurrentSourceInfo != null
|
||||
&& rightDisp.CurrentSourceInfo.Type == eSourceListItemType.Route;
|
||||
return val;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
protected override Func<bool> IsWarmingFeedbackFunc
|
||||
{
|
||||
get
|
||||
{
|
||||
return () =>
|
||||
{
|
||||
var leftDisp = LeftDisplay as DisplayBase;
|
||||
var rightDisp = RightDisplay as DisplayBase;
|
||||
if (leftDisp != null && RightDisplay != null)
|
||||
return leftDisp.IsWarmingUpFeedback.BoolValue || rightDisp.IsWarmingUpFeedback.BoolValue;
|
||||
else
|
||||
return false;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
protected override Func<bool> IsCoolingFeedbackFunc
|
||||
{
|
||||
get
|
||||
{
|
||||
return () =>
|
||||
{
|
||||
var leftDisp = LeftDisplay as DisplayBase;
|
||||
var rightDisp = RightDisplay as DisplayBase;
|
||||
if (leftDisp != null && RightDisplay != null)
|
||||
return leftDisp.IsCoolingDownFeedback.BoolValue || rightDisp.IsCoolingDownFeedback.BoolValue;
|
||||
else
|
||||
return false;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public IBasicVolumeControls DefaultAudioDevice { get; private set; }
|
||||
public IBasicVolumeControls DefaultVolumeControls { get; private set; }
|
||||
|
||||
public VideoCodecBase VideoCodec { get; private set; }
|
||||
|
||||
public AudioCodecBase AudioCodec { get; private set; }
|
||||
|
||||
public bool ExcludeFromGlobalFunctions { get; set; }
|
||||
|
||||
public string DefaultSourceItem { get; set; }
|
||||
|
||||
public ushort DefaultVolume { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If room is off, enables power on to last source. Default true
|
||||
/// </summary>
|
||||
public bool EnablePowerOnToLastSource { get; set; }
|
||||
string LastSourceKey;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the volume control device, and attaches/removes InUseTrackers with "audio"
|
||||
/// tag to device.
|
||||
/// </summary>
|
||||
public IBasicVolumeControls CurrentVolumeControls
|
||||
{
|
||||
get { return _CurrentAudioDevice; }
|
||||
set
|
||||
{
|
||||
if (value == _CurrentAudioDevice) return;
|
||||
|
||||
var oldDev = _CurrentAudioDevice;
|
||||
// derigister this room from the device, if it can
|
||||
if (oldDev is IInUseTracking)
|
||||
(oldDev as IInUseTracking).InUseTracker.RemoveUser(this, "audio");
|
||||
var handler = CurrentVolumeDeviceChange;
|
||||
if (handler != null)
|
||||
CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.WillChange));
|
||||
_CurrentAudioDevice = value;
|
||||
if (handler != null)
|
||||
CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.DidChange));
|
||||
// register this room with new device, if it can
|
||||
if (_CurrentAudioDevice is IInUseTracking)
|
||||
(_CurrentAudioDevice as IInUseTracking).InUseTracker.AddUser(this, "audio");
|
||||
}
|
||||
}
|
||||
IBasicVolumeControls _CurrentAudioDevice;
|
||||
|
||||
/// <summary>
|
||||
/// "codecOsd"
|
||||
/// </summary>
|
||||
public string DefaultCodecRouteString { get { return "codecOsd"; } }
|
||||
|
||||
/// <summary>
|
||||
/// Temporary implementation. Returns the schedule-ready object or null if none. Fow now,
|
||||
/// always returns the VideoCodec if it is capable
|
||||
/// </summary>
|
||||
public IHasScheduleAwareness ScheduleSource { get { return VideoCodec as IHasScheduleAwareness; } }
|
||||
|
||||
CCriticalSection SourceSelectLock = new CCriticalSection();
|
||||
|
||||
public EssentialsDualDisplayRoom(DeviceConfig config)
|
||||
: base(config)
|
||||
{
|
||||
try
|
||||
{
|
||||
PropertiesConfig = JsonConvert.DeserializeObject<EssentialsDualDisplayRoomPropertiesConfig>
|
||||
(config.Properties.ToString());
|
||||
|
||||
var leftDisp = PropertiesConfig.Displays[eSourceListItemDestinationTypes.leftDisplay];
|
||||
if (leftDisp != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(leftDisp.Key))
|
||||
{
|
||||
LeftDisplay = DeviceManager.GetDeviceForKey(leftDisp.Key) as IRoutingSinkWithSwitching;
|
||||
Displays.Add(eSourceListItemDestinationTypes.leftDisplay, LeftDisplay);
|
||||
}
|
||||
else
|
||||
Debug.Console(0, this, "Unable to get LeftDisplay for Room");
|
||||
}
|
||||
|
||||
var rightDisp = PropertiesConfig.Displays[eSourceListItemDestinationTypes.rightDisplay];
|
||||
if (rightDisp != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(rightDisp.Key))
|
||||
{
|
||||
LeftDisplay = DeviceManager.GetDeviceForKey(rightDisp.Key) as IRoutingSinkWithSwitching;
|
||||
Displays.Add(eSourceListItemDestinationTypes.rightDisplay, RightDisplay);
|
||||
}
|
||||
else
|
||||
Debug.Console(0, this, "Unable to get LeftDisplay for Room");
|
||||
}
|
||||
|
||||
VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
|
||||
PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
|
||||
if (VideoCodec == null)
|
||||
throw new ArgumentNullException("codec cannot be null");
|
||||
|
||||
AudioCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.AudioCodecKey) as
|
||||
PepperDash.Essentials.Devices.Common.AudioCodec.AudioCodecBase;
|
||||
if (AudioCodec == null)
|
||||
Debug.Console(0, this, "No Audio Codec Found");
|
||||
|
||||
DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls;
|
||||
|
||||
Initialize();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, this, "Error building room \n{0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
if (DefaultAudioDevice is IBasicVolumeControls)
|
||||
DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
|
||||
else if (DefaultAudioDevice is IHasVolumeDevice)
|
||||
DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
|
||||
CurrentVolumeControls = DefaultVolumeControls;
|
||||
|
||||
|
||||
var leftDisp = LeftDisplay as DisplayBase;
|
||||
if (leftDisp != null)
|
||||
InitializeDisplay(leftDisp);
|
||||
|
||||
var rightDisp = RightDisplay as DisplayBase;
|
||||
if (rightDisp != null)
|
||||
InitializeDisplay(rightDisp);
|
||||
|
||||
// Get Microphone Privacy object, if any
|
||||
this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);
|
||||
|
||||
Debug.Console(2, this, "Microphone Privacy Config evaluated.");
|
||||
|
||||
// Get emergency object, if any
|
||||
this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
|
||||
|
||||
Debug.Console(2, this, "Emergency Config evaluated.");
|
||||
|
||||
// Combines call feedback from both codecs if available
|
||||
InCallFeedback = new BoolFeedback(() =>
|
||||
{
|
||||
bool inAudioCall = false;
|
||||
bool inVideoCall = false;
|
||||
|
||||
if (AudioCodec != null)
|
||||
inAudioCall = AudioCodec.IsInCall;
|
||||
|
||||
if (VideoCodec != null)
|
||||
inVideoCall = VideoCodec.IsInCall;
|
||||
|
||||
if (inAudioCall || inVideoCall)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
});
|
||||
|
||||
VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
|
||||
|
||||
if (AudioCodec != null)
|
||||
AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
|
||||
|
||||
IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue);
|
||||
VideoCodec.SharingContentIsOnFeedback.OutputChange += (o, a) => this.IsSharingFeedback.FireUpdate();
|
||||
|
||||
// link privacy to VC (for now?)
|
||||
PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue);
|
||||
VideoCodec.PrivacyModeIsOnFeedback.OutputChange += (o, a) => this.PrivacyModeIsOnFeedback.FireUpdate();
|
||||
|
||||
CallTypeFeedback = new IntFeedback(() => 0);
|
||||
|
||||
SourceListKey = "default";
|
||||
EnablePowerOnToLastSource = true;
|
||||
}
|
||||
|
||||
void InitializeDisplay(DisplayBase disp)
|
||||
{
|
||||
if (disp != null)
|
||||
{
|
||||
// Link power, warming, cooling to display
|
||||
disp.PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
||||
{
|
||||
if (!disp.PowerIsOnFeedback.BoolValue)
|
||||
disp.CurrentSourceInfo = null;
|
||||
OnFeedback.FireUpdate();
|
||||
}
|
||||
if (disp.PowerIsOnFeedback.BoolValue)
|
||||
{
|
||||
SetDefaultLevels();
|
||||
}
|
||||
};
|
||||
|
||||
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
IsWarmingUpFeedback.FireUpdate();
|
||||
if (!IsWarmingUpFeedback.BoolValue)
|
||||
(CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
|
||||
};
|
||||
disp.IsCoolingDownFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
IsCoolingDownFeedback.FireUpdate();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
protected override void CustomSetConfig(DeviceConfig config)
|
||||
{
|
||||
var newPropertiesConfig = JsonConvert.DeserializeObject<EssentialsDualDisplayRoomPropertiesConfig>(config.Properties.ToString());
|
||||
|
||||
if (newPropertiesConfig != null)
|
||||
PropertiesConfig = newPropertiesConfig;
|
||||
|
||||
ConfigWriter.UpdateRoomConfig(config);
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Add Occupancy object from config
|
||||
if (PropertiesConfig.Occupancy != null)
|
||||
this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
|
||||
IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
|
||||
|
||||
this.LogoUrl = PropertiesConfig.Logo.GetUrl();
|
||||
this.SourceListKey = PropertiesConfig.SourceListKey;
|
||||
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
|
||||
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
|
||||
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
protected override void EndShutdown()
|
||||
{
|
||||
VideoCodec.EndAllCalls();
|
||||
|
||||
SetDefaultLevels();
|
||||
|
||||
RunDefaultPresentRoute();
|
||||
|
||||
CrestronEnvironment.Sleep(1000);
|
||||
|
||||
RunRouteAction("roomOff");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Routes the default source item, if any. Returns true when default route exists
|
||||
/// </summary>
|
||||
public override bool RunDefaultPresentRoute()
|
||||
{
|
||||
if (DefaultSourceItem != null)
|
||||
RunRouteAction(DefaultSourceItem);
|
||||
|
||||
return DefaultSourceItem != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets up the room when started into call mode without presenting a source
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool RunDefaultCallRoute()
|
||||
{
|
||||
RunRouteAction(DefaultCodecRouteString);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="routeKey"></param>
|
||||
public void RunRouteAction(string routeKey)
|
||||
{
|
||||
RunRouteAction(routeKey, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a source from config list SourceListKey and dynamically build and executes the
|
||||
/// route or commands
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
public void RunRouteAction(string routeKey, Action successCallback)
|
||||
{
|
||||
// Run this on a separate thread
|
||||
new CTimer(o =>
|
||||
{
|
||||
// try to prevent multiple simultaneous selections
|
||||
SourceSelectLock.TryEnter();
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Debug.Console(1, this, "Run route action '{0}'", routeKey);
|
||||
var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey);
|
||||
if (dict == null)
|
||||
{
|
||||
Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey);
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to get the list item by it's string key
|
||||
if (!dict.ContainsKey(routeKey))
|
||||
{
|
||||
Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'",
|
||||
routeKey, SourceListKey);
|
||||
return;
|
||||
}
|
||||
|
||||
// End usage timer on last source
|
||||
if (!string.IsNullOrEmpty(LastSourceKey))
|
||||
{
|
||||
var usageLastSource = dict[LastSourceKey].SourceDevice as IUsageTracking;
|
||||
if (usageLastSource != null && usageLastSource.UsageTracker != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
// There MAY have been failures in here. Protect
|
||||
usageLastSource.UsageTracker.EndDeviceUsage();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, this, "*#* EXCEPTION in end usage tracking:\r{0}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Let's run it
|
||||
var item = dict[routeKey];
|
||||
if (routeKey.ToLower() != "roomoff")
|
||||
{
|
||||
|
||||
LastSourceKey = routeKey;
|
||||
}
|
||||
//else
|
||||
// CurrentSourceInfoKey = null;
|
||||
|
||||
// hand off the individual routes to this helper
|
||||
foreach (var route in item.RouteList)
|
||||
DoRouteItem(route, item, routeKey);
|
||||
|
||||
// Start usage timer on routed source
|
||||
var usageNewSource = item.SourceDevice as IUsageTracking;
|
||||
if (usageNewSource != null && usageNewSource.UsageTracker != null) // Have to make sure there is a usage tracker!
|
||||
{
|
||||
(item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage();
|
||||
}
|
||||
|
||||
// See if this can be moved into common, base-class method -------------
|
||||
|
||||
|
||||
// Set volume control, using default if non provided
|
||||
IBasicVolumeControls volDev = null;
|
||||
// Handle special cases for volume control
|
||||
if (string.IsNullOrEmpty(item.VolumeControlKey)
|
||||
|| item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase))
|
||||
volDev = DefaultVolumeControls;
|
||||
|
||||
// Or a specific device, probably rarely used.
|
||||
else
|
||||
{
|
||||
var dev = DeviceManager.GetDeviceForKey(item.VolumeControlKey);
|
||||
if (dev is IBasicVolumeControls)
|
||||
volDev = dev as IBasicVolumeControls;
|
||||
else if (dev is IHasVolumeDevice)
|
||||
volDev = (dev as IHasVolumeDevice).VolumeDevice;
|
||||
}
|
||||
|
||||
if (volDev != CurrentVolumeControls)
|
||||
{
|
||||
// zero the volume on the device we are leaving.
|
||||
// Set the volume to default on device we are entering
|
||||
if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
|
||||
{
|
||||
var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
|
||||
SavedVolumeLevels[vd] = (uint)vd.VolumeLevelFeedback.IntValue;
|
||||
vd.SetVolume(0);
|
||||
}
|
||||
|
||||
CurrentVolumeControls = volDev;
|
||||
if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
|
||||
{
|
||||
var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
|
||||
ushort vol = (SavedVolumeLevels.ContainsKey(vd) ? (ushort)SavedVolumeLevels[vd] : DefaultVolume);
|
||||
vd.SetVolume(vol);
|
||||
}
|
||||
}
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// store the name and UI info for routes
|
||||
if (item.SourceKey == "$off")
|
||||
{
|
||||
LeftDisplay.CurrentSourceInfoKey = routeKey;
|
||||
LeftDisplay.CurrentSourceInfo = null;
|
||||
RightDisplay.CurrentSourceInfoKey = routeKey;
|
||||
RightDisplay.CurrentSourceInfo = null;
|
||||
}
|
||||
//else if (item.SourceKey != null)
|
||||
//{
|
||||
// if(item.RouteList
|
||||
// CurrentSourceInfoKey = routeKey;
|
||||
// CurrentSourceInfo = item;
|
||||
//}
|
||||
|
||||
OnFeedback.FireUpdate();
|
||||
|
||||
// report back when done
|
||||
if (successCallback != null)
|
||||
successCallback();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, this, "ERROR in routing: {0}", e);
|
||||
}
|
||||
|
||||
SourceSelectLock.Leave();
|
||||
}, 0); // end of CTimer
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="route"></param>
|
||||
void DoRouteItem(SourceRouteListItem route, SourceListItem sourceItem, string sourceItemKey)
|
||||
{
|
||||
// if there is a $defaultAll on route, run two separate
|
||||
if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// Going to assume a single-path route for now
|
||||
var tempVideo = new SourceRouteListItem
|
||||
{
|
||||
DestinationKey = "$defaultDisplay",
|
||||
SourceKey = route.SourceKey,
|
||||
Type = eRoutingSignalType.Video
|
||||
};
|
||||
DoRoute(tempVideo, sourceItem, sourceItemKey);
|
||||
}
|
||||
else
|
||||
DoRoute(route, sourceItem, sourceItemKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="route"></param>
|
||||
/// <returns></returns>
|
||||
bool DoRoute(SourceRouteListItem route, SourceListItem sourceItem, string sourceItemKey)
|
||||
{
|
||||
IRoutingSinkNoSwitching dest = null;
|
||||
|
||||
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
|
||||
dest = DefaultAudioDevice as IRoutingSinkNoSwitching;
|
||||
else if (route.DestinationKey.Equals(LeftDisplay.Key, StringComparison.OrdinalIgnoreCase))
|
||||
dest = LeftDisplay;
|
||||
else if (route.DestinationKey.Equals(RightDisplay.Key, StringComparison.OrdinalIgnoreCase))
|
||||
dest = RightDisplay;
|
||||
else
|
||||
dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSinkNoSwitching;
|
||||
|
||||
if (dest == null)
|
||||
{
|
||||
Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
dest.ReleaseRoute();
|
||||
|
||||
|
||||
|
||||
if (dest is IPower)
|
||||
(dest as IPower).PowerOff();
|
||||
}
|
||||
else
|
||||
{
|
||||
var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs;
|
||||
if (source == null)
|
||||
{
|
||||
Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
|
||||
return false;
|
||||
}
|
||||
dest.ReleaseAndMakeRoute(source, route.Type);
|
||||
|
||||
dest.CurrentSourceInfoKey = sourceItemKey;
|
||||
dest.CurrentSourceInfo = sourceItem;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void RoomVacatedForTimeoutPeriod(object o)
|
||||
{
|
||||
//Implement this
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Does what it says
|
||||
/// </summary>
|
||||
public override void SetDefaultLevels()
|
||||
{
|
||||
Debug.Console(1, this, "Restoring default levels");
|
||||
var vc = CurrentVolumeControls as IBasicVolumeWithFeedback;
|
||||
if (vc != null)
|
||||
vc.SetVolume(DefaultVolume);
|
||||
}
|
||||
/// <summary>
|
||||
/// Will power the room on with the last-used source
|
||||
/// </summary>
|
||||
public override void PowerOnToDefaultOrLastSource()
|
||||
{
|
||||
if (!EnablePowerOnToLastSource || LastSourceKey == null)
|
||||
return;
|
||||
RunRouteAction(LastSourceKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs "roomOff" action on all rooms not set to ExcludeFromGlobalFunctions
|
||||
/// </summary>
|
||||
public static void AllRoomsOff()
|
||||
{
|
||||
var allRooms = DeviceManager.AllDevices.Where(d =>
|
||||
d is EssentialsHuddleSpaceRoom && !(d as EssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
|
||||
foreach (var room in allRooms)
|
||||
(room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
|
||||
}
|
||||
|
||||
#region IPrivacy Members
|
||||
|
||||
|
||||
public void PrivacyModeOff()
|
||||
{
|
||||
VideoCodec.PrivacyModeOff();
|
||||
}
|
||||
|
||||
public void PrivacyModeOn()
|
||||
{
|
||||
VideoCodec.PrivacyModeOn();
|
||||
}
|
||||
|
||||
public void PrivacyModeToggle()
|
||||
{
|
||||
VideoCodec.PrivacyModeToggle();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -13,10 +13,10 @@ using PepperDash.Essentials.Room.Config;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class EssentialsHuddleSpaceRoom : EssentialsRoomBase, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute, IHasCurrentVolumeControls
|
||||
public class EssentialsHuddleSpaceRoom : EssentialsRoomBase, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute, IHasCurrentVolumeControls, IHasDefaultDisplay
|
||||
{
|
||||
public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
public event SourceInfoChangeHandler CurrentSingleSourceChange;
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
|
||||
protected override Func<bool> OnFeedbackFunc
|
||||
{
|
||||
@@ -76,11 +76,6 @@ namespace PepperDash.Essentials
|
||||
|
||||
public bool ExcludeFromGlobalFunctions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The config name of the source list
|
||||
/// </summary>
|
||||
public string SourceListKey { get; set; }
|
||||
|
||||
public string DefaultSourceItem { get; set; }
|
||||
|
||||
public ushort DefaultVolume { get; set; }
|
||||
@@ -124,17 +119,17 @@ namespace PepperDash.Essentials
|
||||
public SourceListItem CurrentSourceInfo
|
||||
{
|
||||
get { return _CurrentSourceInfo; }
|
||||
private set
|
||||
set
|
||||
{
|
||||
if (value == _CurrentSourceInfo) return;
|
||||
|
||||
var handler = CurrentSingleSourceChange;
|
||||
var handler = CurrentSourceChange;
|
||||
// remove from in-use tracker, if so equipped
|
||||
if(_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
|
||||
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.RemoveUser(this, "control");
|
||||
|
||||
if (handler != null)
|
||||
handler(this, _CurrentSourceInfo, ChangeType.WillChange);
|
||||
handler(_CurrentSourceInfo, ChangeType.WillChange);
|
||||
|
||||
_CurrentSourceInfo = value;
|
||||
|
||||
@@ -142,12 +137,12 @@ namespace PepperDash.Essentials
|
||||
if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
|
||||
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
|
||||
if (handler != null)
|
||||
handler(this, _CurrentSourceInfo, ChangeType.DidChange);
|
||||
handler( _CurrentSourceInfo, ChangeType.DidChange);
|
||||
}
|
||||
}
|
||||
SourceListItem _CurrentSourceInfo;
|
||||
|
||||
public string CurrentSourceInfoKey { get; private set; }
|
||||
public string CurrentSourceInfoKey { get; set; }
|
||||
|
||||
public EssentialsHuddleSpaceRoom(DeviceConfig config)
|
||||
: base(config)
|
||||
@@ -251,7 +246,7 @@ namespace PepperDash.Essentials
|
||||
// Add Occupancy object from config
|
||||
if (PropertiesConfig.Occupancy != null)
|
||||
this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
|
||||
PepperDash.Essentials.Devices.Common.Occupancy.IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
|
||||
IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
|
||||
|
||||
this.LogoUrl = PropertiesConfig.Logo.GetUrl();
|
||||
this.SourceListKey = PropertiesConfig.SourceListKey;
|
||||
|
||||
@@ -16,11 +16,11 @@ using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IHasCurrentSourceInfoChange,
|
||||
IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec
|
||||
public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IHasCurrentSourceInfoChange,
|
||||
IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasDefaultDisplay, IHasInCallFeedback
|
||||
{
|
||||
public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
public event SourceInfoChangeHandler CurrentSingleSourceChange;
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
|
||||
|
||||
//************************
|
||||
@@ -112,11 +112,6 @@ namespace PepperDash.Essentials
|
||||
public AudioCodecBase AudioCodec { get; private set; }
|
||||
|
||||
public bool ExcludeFromGlobalFunctions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The config name of the source list
|
||||
/// </summary>
|
||||
public string SourceListKey { get; set; }
|
||||
|
||||
public string DefaultSourceItem { get; set; }
|
||||
|
||||
@@ -162,17 +157,17 @@ namespace PepperDash.Essentials
|
||||
public SourceListItem CurrentSourceInfo
|
||||
{
|
||||
get { return _CurrentSourceInfo; }
|
||||
private set
|
||||
set
|
||||
{
|
||||
if (value == _CurrentSourceInfo) return;
|
||||
|
||||
var handler = CurrentSingleSourceChange;
|
||||
var handler = CurrentSourceChange;
|
||||
// remove from in-use tracker, if so equipped
|
||||
if(_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
|
||||
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.RemoveUser(this, "control");
|
||||
|
||||
if (handler != null)
|
||||
handler(this, _CurrentSourceInfo, ChangeType.WillChange);
|
||||
handler(_CurrentSourceInfo, ChangeType.WillChange);
|
||||
|
||||
_CurrentSourceInfo = value;
|
||||
|
||||
@@ -180,12 +175,12 @@ namespace PepperDash.Essentials
|
||||
if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
|
||||
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
|
||||
if (handler != null)
|
||||
handler(this, _CurrentSourceInfo, ChangeType.DidChange);
|
||||
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
||||
}
|
||||
}
|
||||
SourceListItem _CurrentSourceInfo;
|
||||
|
||||
public string CurrentSourceInfoKey { get; private set; }
|
||||
public string CurrentSourceInfoKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// "codecOsd"
|
||||
@@ -231,64 +226,25 @@ namespace PepperDash.Essentials
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
if (DefaultAudioDevice is IBasicVolumeControls)
|
||||
DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
|
||||
else if (DefaultAudioDevice is IHasVolumeDevice)
|
||||
DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
|
||||
CurrentVolumeControls = DefaultVolumeControls;
|
||||
|
||||
|
||||
var disp = DefaultDisplay as DisplayBase;
|
||||
if (disp != null)
|
||||
try
|
||||
{
|
||||
// Link power, warming, cooling to display
|
||||
disp.PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
||||
{
|
||||
if (!disp.PowerIsOnFeedback.BoolValue)
|
||||
CurrentSourceInfo = null;
|
||||
OnFeedback.FireUpdate();
|
||||
}
|
||||
if (disp.PowerIsOnFeedback.BoolValue)
|
||||
{
|
||||
SetDefaultLevels();
|
||||
}
|
||||
};
|
||||
|
||||
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
IsWarmingUpFeedback.FireUpdate();
|
||||
if (!IsWarmingUpFeedback.BoolValue)
|
||||
(CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
|
||||
};
|
||||
disp.IsCoolingDownFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
IsCoolingDownFeedback.FireUpdate();
|
||||
};
|
||||
|
||||
// Get Microphone Privacy object, if any
|
||||
this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);
|
||||
|
||||
Debug.Console(2, this, "Microphone Privacy Config evaluated.");
|
||||
|
||||
// Get emergency object, if any
|
||||
this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
|
||||
|
||||
Debug.Console(2, this, "Emergency Config evaluated.");
|
||||
}
|
||||
if (DefaultAudioDevice is IBasicVolumeControls)
|
||||
DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
|
||||
else if (DefaultAudioDevice is IHasVolumeDevice)
|
||||
DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
|
||||
CurrentVolumeControls = DefaultVolumeControls;
|
||||
|
||||
|
||||
// Combines call feedback from both codecs if available
|
||||
InCallFeedback = new BoolFeedback(() =>
|
||||
// Combines call feedback from both codecs if available
|
||||
InCallFeedback = new BoolFeedback(() =>
|
||||
{
|
||||
bool inAudioCall = false;
|
||||
bool inVideoCall = false;
|
||||
|
||||
if(AudioCodec != null)
|
||||
if (AudioCodec != null)
|
||||
inAudioCall = AudioCodec.IsInCall;
|
||||
|
||||
if(VideoCodec != null)
|
||||
if (VideoCodec != null)
|
||||
inVideoCall = VideoCodec.IsInCall;
|
||||
|
||||
if (inAudioCall || inVideoCall)
|
||||
@@ -297,22 +253,71 @@ namespace PepperDash.Essentials
|
||||
return false;
|
||||
});
|
||||
|
||||
VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
|
||||
var disp = DefaultDisplay as DisplayBase;
|
||||
if (disp != null)
|
||||
{
|
||||
// Link power, warming, cooling to display
|
||||
disp.PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
||||
{
|
||||
if (!disp.PowerIsOnFeedback.BoolValue)
|
||||
CurrentSourceInfo = null;
|
||||
OnFeedback.FireUpdate();
|
||||
}
|
||||
if (disp.PowerIsOnFeedback.BoolValue)
|
||||
{
|
||||
SetDefaultLevels();
|
||||
}
|
||||
};
|
||||
|
||||
if (AudioCodec != null)
|
||||
AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
|
||||
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
IsWarmingUpFeedback.FireUpdate();
|
||||
if (!IsWarmingUpFeedback.BoolValue)
|
||||
(CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
|
||||
};
|
||||
disp.IsCoolingDownFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
IsCoolingDownFeedback.FireUpdate();
|
||||
};
|
||||
|
||||
IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue);
|
||||
VideoCodec.SharingContentIsOnFeedback.OutputChange += (o, a) => this.IsSharingFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
// link privacy to VC (for now?)
|
||||
PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue);
|
||||
VideoCodec.PrivacyModeIsOnFeedback.OutputChange += (o, a) => this.PrivacyModeIsOnFeedback.FireUpdate();
|
||||
|
||||
CallTypeFeedback = new IntFeedback(() => 0);
|
||||
|
||||
SourceListKey = "default";
|
||||
EnablePowerOnToLastSource = true;
|
||||
|
||||
// Get Microphone Privacy object, if any MUST HAPPEN AFTER setting InCallFeedback
|
||||
this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);
|
||||
|
||||
Debug.Console(2, this, "Microphone Privacy Config evaluated.");
|
||||
|
||||
// Get emergency object, if any
|
||||
this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
|
||||
|
||||
Debug.Console(2, this, "Emergency Config evaluated.");
|
||||
|
||||
|
||||
VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
|
||||
|
||||
if (AudioCodec != null)
|
||||
AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
|
||||
|
||||
IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue);
|
||||
VideoCodec.SharingContentIsOnFeedback.OutputChange += (o, a) => this.IsSharingFeedback.FireUpdate();
|
||||
|
||||
// link privacy to VC (for now?)
|
||||
PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue);
|
||||
VideoCodec.PrivacyModeIsOnFeedback.OutputChange += (o, a) => this.PrivacyModeIsOnFeedback.FireUpdate();
|
||||
|
||||
CallTypeFeedback = new IntFeedback(() => 0);
|
||||
|
||||
SourceListKey = "default";
|
||||
EnablePowerOnToLastSource = true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, this, "Error Initializing Room: {0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void CustomSetConfig(DeviceConfig config)
|
||||
@@ -330,7 +335,7 @@ namespace PepperDash.Essentials
|
||||
// Add Occupancy object from config
|
||||
if (PropertiesConfig.Occupancy != null)
|
||||
this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
|
||||
PepperDash.Essentials.Devices.Common.Occupancy.IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
|
||||
IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
|
||||
|
||||
this.LogoUrl = PropertiesConfig.Logo.GetUrl();
|
||||
this.SourceListKey = PropertiesConfig.SourceListKey;
|
||||
|
||||
@@ -12,34 +12,22 @@ using PepperDash.Essentials.Core.Devices;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Room.Types
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for rooms with more than a single display
|
||||
/// </summary>
|
||||
public abstract class EssentialsNDisplayRoomBase : EssentialsRoomBase
|
||||
public abstract class EssentialsNDisplayRoomBase : EssentialsRoomBase, IHasMultipleDisplays
|
||||
{
|
||||
public event SourceInfoChangeHandler CurrentSingleSourceChange;
|
||||
//public event SourceInfoChangeHandler CurrentSingleSourceChange;
|
||||
|
||||
public Dictionary<string, IRoutingSinkWithSwitching> Displays { get; protected set; }
|
||||
|
||||
protected override Func<bool> IsWarmingFeedbackFunc { get { return () => false; ; } }
|
||||
protected override Func<bool> IsCoolingFeedbackFunc { get { return () => false; } }
|
||||
public Dictionary<eSourceListItemDestinationTypes, IRoutingSinkWithSwitching> Displays { get; protected set;}
|
||||
|
||||
public EssentialsNDisplayRoomBase(DeviceConfig config)
|
||||
: base (config)
|
||||
{
|
||||
Displays = new Dictionary<string, IRoutingSinkWithSwitching>();
|
||||
Displays = new Dictionary<eSourceListItemDestinationTypes, IRoutingSinkWithSwitching>();
|
||||
|
||||
var propertiesConfig = JsonConvert.DeserializeObject<EssentialsNDisplayRoomPropertiesConfig>(config.Properties.ToString());
|
||||
|
||||
foreach (var display in propertiesConfig.Displays)
|
||||
{
|
||||
var displayDevice = DeviceManager.GetDeviceForKey(display.Value) as IRoutingSinkWithSwitching;
|
||||
|
||||
if (displayDevice != null)
|
||||
Displays.Add(display.Key, displayDevice);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ using PepperDash.Essentials.Core.PageManagers;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class EssentialsTouchpanelController : Device
|
||||
public class EssentialsTouchpanelController : Device, IHasBasicTriListWithSmartObject
|
||||
{
|
||||
public BasicTriListWithSmartObject Panel { get; private set; }
|
||||
|
||||
|
||||
@@ -25,11 +25,11 @@ namespace PepperDash.Essentials
|
||||
|
||||
public void RegisterForSourceChange(IHasCurrentSourceInfoChange room)
|
||||
{
|
||||
room.CurrentSingleSourceChange -= room_CurrentSourceInfoChange;
|
||||
room.CurrentSingleSourceChange += room_CurrentSourceInfoChange;
|
||||
room.CurrentSourceChange -= room_CurrentSourceInfoChange;
|
||||
room.CurrentSourceChange += room_CurrentSourceInfoChange;
|
||||
}
|
||||
|
||||
void room_CurrentSourceInfoChange(EssentialsRoomBase room, SourceListItem info, ChangeType type)
|
||||
void room_CurrentSourceInfoChange(SourceListItem info, ChangeType type)
|
||||
{
|
||||
if (type == ChangeType.WillChange && info == SourceItem)
|
||||
ClearFeedback();
|
||||
|
||||
@@ -733,7 +733,7 @@ namespace PepperDash.Essentials
|
||||
// Disconnect current room
|
||||
_CurrentRoom.CurrentVolumeDeviceChange -= this.CurrentRoom_CurrentAudioDeviceChange;
|
||||
ClearAudioDeviceConnections();
|
||||
_CurrentRoom.CurrentSingleSourceChange -= this.CurrentRoom_SourceInfoChange;
|
||||
_CurrentRoom.CurrentSourceChange -= this.CurrentRoom_SourceInfoChange;
|
||||
DisconnectSource(_CurrentRoom.CurrentSourceInfo);
|
||||
_CurrentRoom.ShutdownPromptTimer.HasStarted -= ShutdownPromptTimer_HasStarted;
|
||||
_CurrentRoom.ShutdownPromptTimer.HasFinished -= ShutdownPromptTimer_HasFinished;
|
||||
@@ -803,7 +803,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
_CurrentRoom.CurrentVolumeDeviceChange += CurrentRoom_CurrentAudioDeviceChange;
|
||||
RefreshAudioDeviceConnections();
|
||||
_CurrentRoom.CurrentSingleSourceChange += CurrentRoom_SourceInfoChange;
|
||||
_CurrentRoom.CurrentSourceChange += CurrentRoom_SourceInfoChange;
|
||||
RefreshSourceInfo();
|
||||
|
||||
(Parent as EssentialsPanelMainInterfaceDriver).HeaderDriver.SetupHeaderButtons(this, CurrentRoom);
|
||||
@@ -1064,8 +1064,7 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
/// Handles source change
|
||||
/// </summary>
|
||||
void CurrentRoom_SourceInfoChange(EssentialsRoomBase room,
|
||||
SourceListItem info, ChangeType change)
|
||||
void CurrentRoom_SourceInfoChange(SourceListItem info, ChangeType change)
|
||||
{
|
||||
if (change == ChangeType.WillChange)
|
||||
DisconnectSource(info);
|
||||
|
||||
@@ -885,7 +885,7 @@ namespace PepperDash.Essentials
|
||||
// Disconnect current room
|
||||
_CurrentRoom.CurrentVolumeDeviceChange -= this.CurrentRoom_CurrentAudioDeviceChange;
|
||||
ClearAudioDeviceConnections();
|
||||
_CurrentRoom.CurrentSingleSourceChange -= this.CurrentRoom_SourceInfoChange;
|
||||
_CurrentRoom.CurrentSourceChange -= this.CurrentRoom_SourceInfoChange;
|
||||
DisconnectSource(_CurrentRoom.CurrentSourceInfo);
|
||||
_CurrentRoom.ShutdownPromptTimer.HasStarted -= ShutdownPromptTimer_HasStarted;
|
||||
_CurrentRoom.ShutdownPromptTimer.HasFinished -= ShutdownPromptTimer_HasFinished;
|
||||
@@ -924,7 +924,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
_CurrentRoom.CurrentVolumeDeviceChange += CurrentRoom_CurrentAudioDeviceChange;
|
||||
RefreshAudioDeviceConnections();
|
||||
_CurrentRoom.CurrentSingleSourceChange += CurrentRoom_SourceInfoChange;
|
||||
_CurrentRoom.CurrentSourceChange += CurrentRoom_SourceInfoChange;
|
||||
RefreshSourceInfo();
|
||||
|
||||
if (_CurrentRoom.VideoCodec is IHasScheduleAwareness)
|
||||
@@ -939,7 +939,7 @@ namespace PepperDash.Essentials
|
||||
SetActiveCallListSharingContentStatus();
|
||||
|
||||
if (_CurrentRoom != null)
|
||||
_CurrentRoom.CurrentSingleSourceChange += new SourceInfoChangeHandler(CurrentRoom_CurrentSingleSourceChange);
|
||||
_CurrentRoom.CurrentSourceChange += new SourceInfoChangeHandler(CurrentRoom_CurrentSingleSourceChange);
|
||||
|
||||
TriList.SetSigFalseAction(UIBoolJoin.CallStopSharingPress, () => _CurrentRoom.RunRouteAction("codecOsd"));
|
||||
|
||||
@@ -1050,7 +1050,7 @@ namespace PepperDash.Essentials
|
||||
/// <param name="room"></param>
|
||||
/// <param name="info"></param>
|
||||
/// <param name="type"></param>
|
||||
void CurrentRoom_CurrentSingleSourceChange(EssentialsRoomBase room, SourceListItem info, ChangeType type)
|
||||
void CurrentRoom_CurrentSingleSourceChange(SourceListItem info, ChangeType type)
|
||||
{
|
||||
if (_CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue && _CurrentRoom.CurrentSourceInfo != null)
|
||||
TriList.StringInput[UIStringJoin.CallSharedSourceNameText].StringValue = _CurrentRoom.CurrentSourceInfo.PreferredName;
|
||||
@@ -1363,8 +1363,7 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
/// Handles source change
|
||||
/// </summary>
|
||||
void CurrentRoom_SourceInfoChange(EssentialsRoomBase room,
|
||||
SourceListItem info, ChangeType change)
|
||||
void CurrentRoom_SourceInfoChange(SourceListItem info, ChangeType change)
|
||||
{
|
||||
if (change == ChangeType.WillChange)
|
||||
DisconnectSource(info);
|
||||
|
||||
@@ -64,11 +64,11 @@ namespace PepperDash.Essentials
|
||||
parent.SetItemMainText(index, room.Name);
|
||||
UpdateItem(room.CurrentSourceInfo);
|
||||
// Watch for later changes
|
||||
room.CurrentSingleSourceChange += new SourceInfoChangeHandler(room_CurrentSourceInfoChange);
|
||||
room.CurrentSourceChange += new SourceInfoChangeHandler(room_CurrentSourceInfoChange);
|
||||
parent.SetItemButtonAction(index, buttonAction);
|
||||
}
|
||||
|
||||
void room_CurrentSourceInfoChange(EssentialsRoomBase room, SourceListItem info, ChangeType type)
|
||||
void room_CurrentSourceInfoChange(SourceListItem info, ChangeType type)
|
||||
{
|
||||
UpdateItem(info);
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
/// <summary>
|
||||
/// The handler type for a Room's SourceInfoChange
|
||||
/// </summary>
|
||||
public delegate void SourceInfoChangeHandler(EssentialsRoomBase room, SourceListItem info, ChangeType type);
|
||||
///// <summary>
|
||||
///// The handler type for a Room's SourceInfoChange
|
||||
///// </summary>
|
||||
//public delegate void SourceInfoChangeHandler(EssentialsRoomBase room, SourceListItem info, ChangeType type);
|
||||
}
|
||||
@@ -21,8 +21,6 @@ namespace PepperDash.Essentials.Core.Config
|
||||
public string TemplateUrl { get; set; }
|
||||
|
||||
|
||||
//public CotijaConfig Cotija { get; private set; }
|
||||
|
||||
[JsonProperty("systemUuid")]
|
||||
public string SystemUuid
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common
|
||||
namespace PepperDash.Essentials.Core.Devices
|
||||
{
|
||||
/// <summary>
|
||||
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
|
||||
@@ -7,7 +7,7 @@ using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Routing;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common
|
||||
namespace PepperDash.Essentials.Core.Devices
|
||||
{
|
||||
/// <summary>
|
||||
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
|
||||
@@ -95,6 +95,9 @@ namespace PepperDash.Essentials.Core
|
||||
[JsonProperty("disableRoutedSharing")]
|
||||
public bool DisableRoutedSharing { get; set; }
|
||||
|
||||
[JsonProperty("destinations")]
|
||||
public List<eSourceListItemDestinationTypes> Destinations { get; set; }
|
||||
|
||||
public SourceListItem()
|
||||
{
|
||||
Icon = "Blank";
|
||||
@@ -112,4 +115,16 @@ namespace PepperDash.Essentials.Core
|
||||
[JsonProperty("type")]
|
||||
public eRoutingSignalType Type { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the valid destination types for SourceListItems in a room
|
||||
/// </summary>
|
||||
public enum eSourceListItemDestinationTypes
|
||||
{
|
||||
defaultDisplay,
|
||||
leftDisplay,
|
||||
rightDisplay,
|
||||
programAudio,
|
||||
codecContent
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ using PepperDash.Essentials.Core.Routing;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IPower, IWarmingCooling, IRoutingSinkWithSwitching
|
||||
public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IPower, IWarmingCooling
|
||||
{
|
||||
public IrOutputPortController IrPort { get; private set; }
|
||||
public ushort IrPulseTime { get; set; }
|
||||
|
||||
@@ -18,6 +18,32 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public abstract class DisplayBase : Device, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
|
||||
{
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
|
||||
public string CurrentSourceInfoKey { get; set; }
|
||||
public SourceListItem CurrentSourceInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return _CurrentSourceInfo;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == _CurrentSourceInfo) return;
|
||||
|
||||
var handler = CurrentSourceChange;
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.WillChange);
|
||||
|
||||
_CurrentSourceInfo = value;
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
||||
}
|
||||
}
|
||||
SourceListItem _CurrentSourceInfo;
|
||||
|
||||
public BoolFeedback PowerIsOnFeedback { get; protected set; }
|
||||
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
|
||||
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
||||
|
||||
@@ -18,12 +18,10 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
using PepperDash.Essentials.Devices.Common.Occupancy;
|
||||
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Fusion
|
||||
namespace PepperDash.Essentials.Core.Fusion
|
||||
{
|
||||
public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupancyStatusProvider
|
||||
{
|
||||
@@ -330,11 +328,11 @@ namespace PepperDash.Essentials.Fusion
|
||||
// Moved to
|
||||
CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(84, "Display 1 - Current Source", eSigIoMask.InputSigOnly);
|
||||
// Don't think we need to get current status of this as nothing should be alive yet.
|
||||
(Room as EssentialsHuddleSpaceRoom).CurrentSingleSourceChange += new SourceInfoChangeHandler(Room_CurrentSourceInfoChange);
|
||||
(Room as IHasCurrentSourceInfoChange).CurrentSourceChange += new SourceInfoChangeHandler(Room_CurrentSourceInfoChange);
|
||||
|
||||
|
||||
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsHuddleSpaceRoom).PowerOnToDefaultOrLastSource);
|
||||
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff"));
|
||||
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsRoomBase).PowerOnToDefaultOrLastSource);
|
||||
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as IRunRouteAction).RunRouteAction("roomOff"));
|
||||
// NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
|
||||
FusionRoom.ErrorMessage.InputSig.StringValue =
|
||||
"3: 7 Errors: This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;";
|
||||
@@ -990,7 +988,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
protected virtual void SetUpSources()
|
||||
{
|
||||
// Sources
|
||||
var dict = ConfigReader.ConfigObject.GetSourceListForKey((Room as EssentialsHuddleSpaceRoom).SourceListKey);
|
||||
var dict = ConfigReader.ConfigObject.GetSourceListForKey((Room as EssentialsRoomBase).SourceListKey);
|
||||
if (dict != null)
|
||||
{
|
||||
// NEW PROCESS:
|
||||
@@ -1015,7 +1013,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
break;
|
||||
}
|
||||
|
||||
var laptops = dict.Where(d => d.Value.SourceDevice is Laptop);
|
||||
var laptops = dict.Where(d => d.Value.SourceDevice is Devices.Laptop);
|
||||
i = 1;
|
||||
foreach (var kvp in laptops)
|
||||
{
|
||||
@@ -1041,7 +1039,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
else
|
||||
{
|
||||
Debug.Console(1, this, "WARNING: Config source list '{0}' not found for room '{1}'",
|
||||
(Room as EssentialsHuddleSpaceRoom).SourceListKey, Room.Key);
|
||||
(Room as EssentialsRoomBase).SourceListKey, Room.Key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1088,7 +1086,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
SourceToFeedbackSigs.Add(pSrc, sigD.InputSig);
|
||||
|
||||
// And respond to selection in Fusion
|
||||
sigD.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleSpaceRoom).RunRouteAction(routeKey));
|
||||
sigD.OutputSig.SetSigFalseAction(() => (Room as IRunRouteAction).RunRouteAction(routeKey));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -1125,7 +1123,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
//uint attrNum = Convert.ToUInt32(keyNum);
|
||||
|
||||
// Check for UI devices
|
||||
var uiDev = dev as EssentialsTouchpanelController;
|
||||
var uiDev = dev as IHasBasicTriListWithSmartObject;
|
||||
if (uiDev != null)
|
||||
{
|
||||
if (uiDev.Panel is Crestron.SimplSharpPro.UI.XpanelForSmartGraphics)
|
||||
@@ -1206,7 +1204,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
display.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
|
||||
}
|
||||
|
||||
var defaultDisplay = (Room as EssentialsHuddleSpaceRoom).DefaultDisplay as DisplayBase;
|
||||
var defaultDisplay = (Room as IHasDefaultDisplay).DefaultDisplay as DisplayBase;
|
||||
if (defaultDisplay == null)
|
||||
{
|
||||
Debug.Console(1, this, "Cannot link null display to Fusion because default display is null");
|
||||
@@ -1271,7 +1269,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
string displayName = string.Format("Display {0} - ", displayIndex);
|
||||
|
||||
|
||||
if (display == (Room as EssentialsHuddleSpaceRoom).DefaultDisplay)
|
||||
if (display == (Room as IHasDefaultDisplay).DefaultDisplay)
|
||||
{
|
||||
// Display volume
|
||||
var defaultDisplayVolume = FusionRoom.CreateOffsetUshortSig(50, "Volume - Fader01", eSigIoMask.InputOutputSig);
|
||||
@@ -1290,7 +1288,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
|
||||
// Current Source
|
||||
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
|
||||
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff"); }); ;
|
||||
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as IRunRouteAction).RunRouteAction("roomOff"); }); ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1389,7 +1387,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
/// <summary>
|
||||
/// Event handler for when room source changes
|
||||
/// </summary>
|
||||
protected void Room_CurrentSourceInfoChange(EssentialsRoomBase room, SourceListItem info, ChangeType type)
|
||||
protected void Room_CurrentSourceInfoChange(SourceListItem info, ChangeType type)
|
||||
{
|
||||
// Handle null. Nothing to do when switching from or to null
|
||||
if (info == null || info.SourceDevice == null)
|
||||
@@ -1405,7 +1403,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
{
|
||||
if (SourceToFeedbackSigs.ContainsKey(dev))
|
||||
SourceToFeedbackSigs[dev].BoolValue = true;
|
||||
var name = (room == null ? "" : room.Name);
|
||||
//var name = (room == null ? "" : room.Name);
|
||||
CurrentRoomSourceNameSig.InputSig.StringValue = info.SourceDevice.Name;
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,8 @@ using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.Devices;
|
||||
using PepperDash.Essentials.Room.Behaviours;
|
||||
|
||||
namespace PepperDash.Essentials.Fusion
|
||||
namespace PepperDash.Essentials.Core.Fusion
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles mapping Fusion Custom Property values to system properties
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Fusion
|
||||
namespace PepperDash.Essentials.Core.Fusion
|
||||
{
|
||||
public class ScheduleChangeEventArgs : EventArgs
|
||||
{
|
||||
@@ -4,9 +4,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Fusion
|
||||
namespace PepperDash.Essentials.Core.Fusion
|
||||
{
|
||||
/// <summary>
|
||||
/// When created, runs progcomments on every slot and stores the program names in a list
|
||||
@@ -7,7 +7,7 @@ using Crestron.SimplSharpPro.Fusion;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Fusion
|
||||
namespace PepperDash.Essentials.Core.Fusion
|
||||
{
|
||||
// Helper Classes for GUIDs
|
||||
|
||||
@@ -1,377 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
|
||||
//using Crestron.SimplSharp;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
//using Crestron.SimplSharpPro.Fusion;
|
||||
//using PepperDash.Essentials.Core;
|
||||
|
||||
//using PepperDash.Core;
|
||||
|
||||
|
||||
//namespace PepperDash.Essentials.Core.Fusion
|
||||
//{
|
||||
// public class EssentialsHuddleSpaceFusionSystemController : Device
|
||||
// {
|
||||
// FusionRoom FusionRoom;
|
||||
// Room Room;
|
||||
// Dictionary<IPresentationSource, BoolInputSig> SourceToFeedbackSigs = new Dictionary<IPresentationSource, BoolInputSig>();
|
||||
|
||||
// StatusMonitorCollection ErrorMessageRollUp;
|
||||
|
||||
// public EssentialsHuddleSpaceFusionSystemController(HuddleSpaceRoom room, uint ipId)
|
||||
// : base(room.Key + "-fusion")
|
||||
// {
|
||||
// Room = room;
|
||||
|
||||
// FusionRoom = new FusionRoom(ipId, Global.ControlSystem, room.Name, "awesomeGuid-" + room.Key);
|
||||
// FusionRoom.Register();
|
||||
|
||||
// FusionRoom.FusionStateChange += new FusionStateEventHandler(FusionRoom_FusionStateChange);
|
||||
|
||||
// // Room to fusion room
|
||||
// room.RoomIsOn.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
|
||||
// var srcName = FusionRoom.CreateOffsetStringSig(50, "Source - Name", eSigIoMask.InputSigOnly);
|
||||
// room.CurrentSourceName.LinkInputSig(srcName.InputSig);
|
||||
|
||||
// FusionRoom.SystemPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (b) room.RoomOn(null); });
|
||||
// FusionRoom.SystemPowerOff.OutputSig.UserObject = new Action<bool>(b => { if (b) room.RoomOff(); });
|
||||
// // NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
|
||||
// FusionRoom.ErrorMessage.InputSig.StringValue = "3: 7 Errors: This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;";
|
||||
|
||||
// // Sources
|
||||
// foreach (var src in room.Sources)
|
||||
// {
|
||||
// var srcNum = src.Key;
|
||||
// var pSrc = src.Value as IPresentationSource;
|
||||
// var keyNum = ExtractNumberFromKey(pSrc.Key);
|
||||
// if (keyNum == -1)
|
||||
// {
|
||||
// Debug.Console(1, this, "WARNING: Cannot link source '{0}' to numbered Fusion attributes", pSrc.Key);
|
||||
// continue;
|
||||
// }
|
||||
// string attrName = null;
|
||||
// uint attrNum = Convert.ToUInt32(keyNum);
|
||||
// switch (pSrc.Type)
|
||||
// {
|
||||
// case PresentationSourceType.None:
|
||||
// break;
|
||||
// case PresentationSourceType.SetTopBox:
|
||||
// attrName = "Source - TV " + keyNum;
|
||||
// attrNum += 115; // TV starts at 116
|
||||
// break;
|
||||
// case PresentationSourceType.Dvd:
|
||||
// attrName = "Source - DVD " + keyNum;
|
||||
// attrNum += 120; // DVD starts at 121
|
||||
// break;
|
||||
// case PresentationSourceType.PC:
|
||||
// attrName = "Source - PC " + keyNum;
|
||||
// attrNum += 110; // PC starts at 111
|
||||
// break;
|
||||
// case PresentationSourceType.Laptop:
|
||||
// attrName = "Source - Laptop " + keyNum;
|
||||
// attrNum += 100; // Laptops start at 101
|
||||
// break;
|
||||
// case PresentationSourceType.VCR:
|
||||
// attrName = "Source - VCR " + keyNum;
|
||||
// attrNum += 125; // VCRs start at 126
|
||||
// break;
|
||||
// }
|
||||
// if (attrName == null)
|
||||
// {
|
||||
// Debug.Console(1, this, "Source type {0} does not have corresponsing Fusion attribute type, skipping", pSrc.Type);
|
||||
// continue;
|
||||
// }
|
||||
// Debug.Console(2, this, "Creating attribute '{0}' with join {1} for source {2}", attrName, attrNum, pSrc.Key);
|
||||
// var sigD = FusionRoom.CreateOffsetBoolSig(attrNum, attrName, eSigIoMask.InputOutputSig);
|
||||
// // Need feedback when this source is selected
|
||||
// // Event handler, added below, will compare source changes with this sig dict
|
||||
// SourceToFeedbackSigs.Add(pSrc, sigD.InputSig);
|
||||
|
||||
// // And respond to selection in Fusion
|
||||
// sigD.OutputSig.UserObject = new Action<bool>(b => { if(b) room.SelectSource(pSrc); });
|
||||
// }
|
||||
|
||||
// // Attach to all room's devices with monitors.
|
||||
// //foreach (var dev in DeviceManager.Devices)
|
||||
// foreach (var dev in DeviceManager.GetDevices())
|
||||
// {
|
||||
// if (!(dev is ICommunicationMonitor))
|
||||
// continue;
|
||||
|
||||
// var keyNum = ExtractNumberFromKey(dev.Key);
|
||||
// if (keyNum == -1)
|
||||
// {
|
||||
// Debug.Console(1, this, "WARNING: Cannot link device '{0}' to numbered Fusion monitoring attributes", dev.Key);
|
||||
// continue;
|
||||
// }
|
||||
// string attrName = null;
|
||||
// uint attrNum = Convert.ToUInt32(keyNum);
|
||||
|
||||
// //if (dev is SmartGraphicsTouchpanelControllerBase)
|
||||
// //{
|
||||
// // if (attrNum > 10)
|
||||
// // continue;
|
||||
// // attrName = "Device Ok - Touch Panel " + attrNum;
|
||||
// // attrNum += 200;
|
||||
// //}
|
||||
// //// add xpanel here
|
||||
|
||||
// //else
|
||||
// if (dev is DisplayBase)
|
||||
// {
|
||||
// if (attrNum > 10)
|
||||
// continue;
|
||||
// attrName = "Device Ok - Display " + attrNum;
|
||||
// attrNum += 240;
|
||||
// }
|
||||
// //else if (dev is DvdDeviceBase)
|
||||
// //{
|
||||
// // if (attrNum > 5)
|
||||
// // continue;
|
||||
// // attrName = "Device Ok - DVD " + attrNum;
|
||||
// // attrNum += 260;
|
||||
// //}
|
||||
// // add set top box
|
||||
|
||||
// // add Cresnet roll-up
|
||||
|
||||
// // add DM-devices roll-up
|
||||
|
||||
// if (attrName != null)
|
||||
// {
|
||||
// // Link comm status to sig and update
|
||||
// var sigD = FusionRoom.CreateOffsetBoolSig(attrNum, attrName, eSigIoMask.InputSigOnly);
|
||||
// var smd = dev as ICommunicationMonitor;
|
||||
// sigD.InputSig.BoolValue = smd.CommunicationMonitor.Status == MonitorStatus.IsOk;
|
||||
// smd.CommunicationMonitor.StatusChange += (o, a) => { sigD.InputSig.BoolValue = a.Status == MonitorStatus.IsOk; };
|
||||
// Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", dev.Key, attrName);
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Don't think we need to get current status of this as nothing should be alive yet.
|
||||
// room.PresentationSourceChange += Room_PresentationSourceChange;
|
||||
|
||||
// // these get used in multiple places
|
||||
// var display = room.Display;
|
||||
// var dispPowerOnAction = new Action<bool>(b => { if (!b) display.PowerOn(); });
|
||||
// var dispPowerOffAction = new Action<bool>(b => { if (!b) display.PowerOff(); });
|
||||
|
||||
// // Display to fusion room sigs
|
||||
// FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||
// FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||
// display.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
||||
// if (display is IDisplayUsage)
|
||||
// (display as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||
|
||||
// // Roll up ALL device errors
|
||||
// ErrorMessageRollUp = new StatusMonitorCollection(this);
|
||||
// foreach (var dev in DeviceManager.GetDevices())
|
||||
// {
|
||||
// var md = dev as ICommunicationMonitor;
|
||||
// if (md != null)
|
||||
// {
|
||||
// ErrorMessageRollUp.AddMonitor(md.CommunicationMonitor);
|
||||
// Debug.Console(2, this, "Adding '{0}' to room's overall error monitor", md.CommunicationMonitor.Parent.Key);
|
||||
// }
|
||||
// }
|
||||
// ErrorMessageRollUp.Start();
|
||||
// FusionRoom.ErrorMessage.InputSig.StringValue = ErrorMessageRollUp.Message;
|
||||
// ErrorMessageRollUp.StatusChange += (o, a) => {
|
||||
// FusionRoom.ErrorMessage.InputSig.StringValue = ErrorMessageRollUp.Message; };
|
||||
|
||||
|
||||
// // static assets --------------- testing
|
||||
|
||||
// // test assets --- THESE ARE BOTH WIRED TO AssetUsage somewhere internally.
|
||||
// var ta1 = FusionRoom.CreateStaticAsset(1, "Test asset 1", "Awesome Asset", "Awesome123");
|
||||
// ta1.AssetError.InputSig.StringValue = "This should be error";
|
||||
|
||||
|
||||
// var ta2 = FusionRoom.CreateStaticAsset(2, "Test asset 2", "Awesome Asset", "Awesome1232");
|
||||
// ta2.AssetUsage.InputSig.StringValue = "This should be usage";
|
||||
|
||||
|
||||
// // Make a display asset
|
||||
// var dispAsset = FusionRoom.CreateStaticAsset(3, display.Name, "Display", "awesomeDisplayId" + room.Key);
|
||||
// dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||
// dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||
// display.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
||||
// // NO!! display.PowerIsOn.LinkComplementInputSig(dispAsset.PowerOff.InputSig);
|
||||
// // Use extension methods
|
||||
// dispAsset.TrySetMakeModel(display);
|
||||
// dispAsset.TryLinkAssetErrorToCommunication(display);
|
||||
|
||||
|
||||
// // Make it so!
|
||||
// FusionRVI.GenerateFileForAllFusionDevices();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Helper to get the number from the end of a device's key string
|
||||
// /// </summary>
|
||||
// /// <returns>-1 if no number matched</returns>
|
||||
// int ExtractNumberFromKey(string key)
|
||||
// {
|
||||
// var capture = System.Text.RegularExpressions.Regex.Match(key, @"\D+(\d+)");
|
||||
// if (!capture.Success)
|
||||
// return -1;
|
||||
// else return Convert.ToInt32(capture.Groups[1].Value);
|
||||
// }
|
||||
|
||||
// void Room_PresentationSourceChange(object sender, EssentialsRoomSourceChangeEventArgs e)
|
||||
// {
|
||||
// if (e.OldSource != null)
|
||||
// {
|
||||
// if (SourceToFeedbackSigs.ContainsKey(e.OldSource))
|
||||
// SourceToFeedbackSigs[e.OldSource].BoolValue = false;
|
||||
// }
|
||||
// if (e.NewSource != null)
|
||||
// {
|
||||
// if (SourceToFeedbackSigs.ContainsKey(e.NewSource))
|
||||
// SourceToFeedbackSigs[e.NewSource].BoolValue = true;
|
||||
// }
|
||||
// }
|
||||
|
||||
// void FusionRoom_FusionStateChange(FusionBase device, FusionStateEventArgs args)
|
||||
// {
|
||||
|
||||
// // The sig/UO method: Need separate handlers for fixed and user sigs, all flavors,
|
||||
// // even though they all contain sigs.
|
||||
|
||||
// var sigData = (args.UserConfiguredSigDetail as BooleanSigDataFixedName);
|
||||
// if (sigData != null)
|
||||
// {
|
||||
// var outSig = sigData.OutputSig;
|
||||
// if (outSig.UserObject is Action<bool>)
|
||||
// (outSig.UserObject as Action<bool>).Invoke(outSig.BoolValue);
|
||||
// else if (outSig.UserObject is Action<ushort>)
|
||||
// (outSig.UserObject as Action<ushort>).Invoke(outSig.UShortValue);
|
||||
// else if (outSig.UserObject is Action<string>)
|
||||
// (outSig.UserObject as Action<string>).Invoke(outSig.StringValue);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// var attrData = (args.UserConfiguredSigDetail as BooleanSigData);
|
||||
// if (attrData != null)
|
||||
// {
|
||||
// var outSig = attrData.OutputSig;
|
||||
// if (outSig.UserObject is Action<bool>)
|
||||
// (outSig.UserObject as Action<bool>).Invoke(outSig.BoolValue);
|
||||
// else if (outSig.UserObject is Action<ushort>)
|
||||
// (outSig.UserObject as Action<ushort>).Invoke(outSig.UShortValue);
|
||||
// else if (outSig.UserObject is Action<string>)
|
||||
// (outSig.UserObject as Action<string>).Invoke(outSig.StringValue);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// public static class FusionRoomExtensions
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// Creates and returns a fusion attribute. The join number will match the established Simpl
|
||||
// /// standard of 50+, and will generate a 50+ join in the RVI. It calls
|
||||
// /// FusionRoom.AddSig with join number - 49
|
||||
// /// </summary>
|
||||
// /// <returns>The new attribute</returns>
|
||||
// public static BooleanSigData CreateOffsetBoolSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
|
||||
// {
|
||||
// if (number < 50) throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
|
||||
// number -= 49;
|
||||
// fr.AddSig(eSigType.Bool, number, name, mask);
|
||||
// return fr.UserDefinedBooleanSigDetails[number];
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Creates and returns a fusion attribute. The join number will match the established Simpl
|
||||
// /// standard of 50+, and will generate a 50+ join in the RVI. It calls
|
||||
// /// FusionRoom.AddSig with join number - 49
|
||||
// /// </summary>
|
||||
// /// <returns>The new attribute</returns>
|
||||
// public static UShortSigData CreateOffsetUshortSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
|
||||
// {
|
||||
// if (number < 50) throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
|
||||
// number -= 49;
|
||||
// fr.AddSig(eSigType.UShort, number, name, mask);
|
||||
// return fr.UserDefinedUShortSigDetails[number];
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Creates and returns a fusion attribute. The join number will match the established Simpl
|
||||
// /// standard of 50+, and will generate a 50+ join in the RVI. It calls
|
||||
// /// FusionRoom.AddSig with join number - 49
|
||||
// /// </summary>
|
||||
// /// <returns>The new attribute</returns>
|
||||
// public static StringSigData CreateOffsetStringSig(this FusionRoom fr, uint number, string name, eSigIoMask mask)
|
||||
// {
|
||||
// if (number < 50) throw new ArgumentOutOfRangeException("number", "Cannot be less than 50");
|
||||
// number -= 49;
|
||||
// fr.AddSig(eSigType.String, number, name, mask);
|
||||
// return fr.UserDefinedStringSigDetails[number];
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Creates and returns a static asset
|
||||
// /// </summary>
|
||||
// /// <returns>the new asset</returns>
|
||||
// public static FusionStaticAsset CreateStaticAsset(this FusionRoom fr, uint number, string name, string type, string instanceId)
|
||||
// {
|
||||
// fr.AddAsset(eAssetType.StaticAsset, number, name, type, instanceId);
|
||||
// return fr.UserConfigurableAssetDetails[number].Asset as FusionStaticAsset;
|
||||
// }
|
||||
// }
|
||||
|
||||
// //************************************************************************************************
|
||||
// /// <summary>
|
||||
// /// Extensions to enhance Fusion room, asset and signal creation.
|
||||
// /// </summary>
|
||||
// public static class FusionStaticAssetExtensions
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// Tries to set a Fusion asset with the make and model of a device.
|
||||
// /// If the provided Device is IMakeModel, will set the corresponding parameters on the fusion static asset.
|
||||
// /// Otherwise, does nothing.
|
||||
// /// </summary>
|
||||
// public static void TrySetMakeModel(this FusionStaticAsset asset, Device device)
|
||||
// {
|
||||
// var mm = device as IMakeModel;
|
||||
// if (mm != null)
|
||||
// {
|
||||
// asset.ParamMake.Value = mm.DeviceMake;
|
||||
// asset.ParamModel.Value = mm.DeviceModel;
|
||||
// }
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Tries to attach the AssetError input on a Fusion asset to a Device's
|
||||
// /// CommunicationMonitor.StatusChange event. Does nothing if the device is not
|
||||
// /// IStatusMonitor
|
||||
// /// </summary>
|
||||
// /// <param name="asset"></param>
|
||||
// /// <param name="device"></param>
|
||||
// public static void TryLinkAssetErrorToCommunication(this FusionStaticAsset asset, Device device)
|
||||
// {
|
||||
// if (device is ICommunicationMonitor)
|
||||
// {
|
||||
// var monitor = (device as ICommunicationMonitor).CommunicationMonitor;
|
||||
// monitor.StatusChange += (o, a) =>
|
||||
// {
|
||||
// // Link connected and error inputs on asset
|
||||
// asset.Connected.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
|
||||
// asset.AssetError.InputSig.StringValue = a.Status.ToString();
|
||||
// };
|
||||
// // set current value
|
||||
// asset.Connected.InputSig.BoolValue = monitor.Status == MonitorStatus.IsOk;
|
||||
// asset.AssetError.InputSig.StringValue = monitor.Status.ToString();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
@@ -9,7 +9,7 @@ using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Microphones
|
||||
namespace PepperDash.Essentials.Core.Privacy
|
||||
{
|
||||
/// <summary>
|
||||
/// Used for applications where one or more microphones with momentary contact closure outputs are used to
|
||||
@@ -87,7 +87,11 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
|
||||
else
|
||||
Debug.Console(0, this, "Unable to add Red LED device");
|
||||
|
||||
CheckPrivacyMode();
|
||||
AddPostActivationAction(() => {
|
||||
CheckPrivacyMode();
|
||||
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange -= PrivacyModeIsOnFeedback_OutputChange;
|
||||
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
|
||||
});
|
||||
|
||||
initialized = true;
|
||||
|
||||
@@ -97,8 +101,6 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
|
||||
public void SetPrivacyDevice(IPrivacy privacyDevice)
|
||||
{
|
||||
PrivacyDevice = privacyDevice;
|
||||
|
||||
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
|
||||
}
|
||||
|
||||
void PrivacyModeIsOnFeedback_OutputChange(object sender, EventArgs e)
|
||||
@@ -6,7 +6,7 @@ using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Microphones
|
||||
namespace PepperDash.Essentials.Core.Privacy
|
||||
{
|
||||
public class MicrophonePrivacyControllerConfig
|
||||
{
|
||||
@@ -123,6 +123,8 @@
|
||||
<Compile Include="Devices\CodecInterfaces.cs" />
|
||||
<Compile Include="Devices\CrestronProcessor.cs" />
|
||||
<Compile Include="Devices\DeviceApiBase.cs" />
|
||||
<Compile Include="Devices\PC\InRoomPc.cs" />
|
||||
<Compile Include="Devices\PC\Laptop.cs" />
|
||||
<Compile Include="Devices\ReconfigurableDevice.cs" />
|
||||
<Compile Include="Devices\VolumeDeviceChangeEventArgs.cs" />
|
||||
<Compile Include="Factory\DeviceFactory.cs" />
|
||||
@@ -132,12 +134,19 @@
|
||||
<Compile Include="Feedbacks\IntFeedback.cs" />
|
||||
<Compile Include="Feedbacks\SerialFeedback.cs" />
|
||||
<Compile Include="Feedbacks\StringFeedback.cs" />
|
||||
<Compile Include="Fusion\EssentialsHuddleSpaceFusionSystemControllerBase.cs" />
|
||||
<Compile Include="Fusion\FusionCustomPropertiesBridge.cs" />
|
||||
<Compile Include="Fusion\FusionEventHandlers.cs" />
|
||||
<Compile Include="Fusion\FusionProcessorQueries.cs" />
|
||||
<Compile Include="Fusion\FusionRviDataClasses.cs" />
|
||||
<Compile Include="Global\JobTimer.cs" />
|
||||
<Compile Include="Global\Scheduler.cs" />
|
||||
<Compile Include="JoinMaps\JoinMapBase.cs" />
|
||||
<Compile Include="Lighting\Lighting Interfaces.cs" />
|
||||
<Compile Include="Lighting\LightingBase.cs" />
|
||||
<Compile Include="Monitoring\SystemMonitorController.cs" />
|
||||
<Compile Include="Microphone Privacy\MicrophonePrivacyController.cs" />
|
||||
<Compile Include="Microphone Privacy\MicrophonePrivacyControllerConfig.cs" />
|
||||
<Compile Include="Ramps and Increments\ActionIncrementer.cs" />
|
||||
<Compile Include="Comm and IR\CommFactory.cs" />
|
||||
<Compile Include="Comm and IR\CommunicationExtras.cs" />
|
||||
@@ -173,6 +182,10 @@
|
||||
<Compile Include="Feedbacks\BoolFeedbackOneShot.cs" />
|
||||
<Compile Include="Ramps and Increments\NumericalHelpers.cs" />
|
||||
<Compile Include="Ramps and Increments\UshortSigIncrementer.cs" />
|
||||
<Compile Include="Room\Behaviours\RoomOnToDefaultSourceWhenOccupied.cs" />
|
||||
<Compile Include="Room\EssentialsRoomBase.cs" />
|
||||
<Compile Include="Room\Interfaces.cs" />
|
||||
<Compile Include="Room\iOccupancyStatusProvider.cs" />
|
||||
<Compile Include="Routing\DummyRoutingInputsDevice.cs" />
|
||||
<Compile Include="Routing\ICardPortsDevice.cs" />
|
||||
<Compile Include="InUseTracking\IInUseTracking.cs" />
|
||||
@@ -191,7 +204,6 @@
|
||||
<Compile Include="Display\DELETE IRDisplayBase.cs" />
|
||||
<Compile Include="Display\MockDisplay.cs" />
|
||||
<Compile Include="Ethernet\EthernetStatistics.cs" />
|
||||
<Compile Include="Fusion\MOVED FusionSystemController.cs" />
|
||||
<Compile Include="Global\Global.cs" />
|
||||
<Compile Include="License\EssentialsLicenseManager.cs" />
|
||||
<Compile Include="Feedbacks\BoolOutputLogicals.cs" />
|
||||
@@ -217,6 +229,7 @@
|
||||
<Compile Include="Routing\TieLine.cs" />
|
||||
<Compile Include="Timers\CountdownTimer.cs" />
|
||||
<Compile Include="Touchpanels\CrestronTouchpanelPropertiesConfig.cs" />
|
||||
<Compile Include="Touchpanels\Interfaces.cs" />
|
||||
<Compile Include="Touchpanels\Keyboards\HabaneroKeyboardController.cs" />
|
||||
<Compile Include="Touchpanels\MOVED LargeTouchpanelControllerBase.cs" />
|
||||
<Compile Include="Touchpanels\TriListExtensions.cs" />
|
||||
@@ -238,7 +251,6 @@
|
||||
<Compile Include="Feedbacks\FeedbackBase.cs" />
|
||||
<Compile Include="Room\Room.cs" />
|
||||
<Compile Include="Room\RoomCues.cs" />
|
||||
<Compile Include="Room\MOVED RoomEventArgs.cs" />
|
||||
<Compile Include="SmartObjects\SubpageReferencList\SourceListSubpageReferenceList.cs" />
|
||||
<Compile Include="Touchpanels\ModalDialog.cs" />
|
||||
<Compile Include="Touchpanels\SmartGraphicsTouchpanelControllerBase.cs" />
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,297 +1,311 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.Scheduler;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.Devices;
|
||||
using PepperDash.Essentials.Devices.Common.Occupancy;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class EssentialsRoomBase : ReconfigurableDevice
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public BoolFeedback OnFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fires when the RoomOccupancy object is set
|
||||
/// </summary>
|
||||
public event EventHandler<EventArgs> RoomOccupancyIsSet;
|
||||
|
||||
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
||||
public BoolFeedback IsCoolingDownFeedback { get; private set; }
|
||||
|
||||
public IOccupancyStatusProvider RoomOccupancy { get; private set; }
|
||||
|
||||
public bool OccupancyStatusProviderIsRemote { get; private set; }
|
||||
|
||||
protected abstract Func<bool> IsWarmingFeedbackFunc { get; }
|
||||
protected abstract Func<bool> IsCoolingFeedbackFunc { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Timer used for informing the UIs of a shutdown
|
||||
/// </summary>
|
||||
public SecondsCountdownTimer ShutdownPromptTimer { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int ShutdownPromptSeconds { get; set; }
|
||||
public int ShutdownVacancySeconds { get; set; }
|
||||
public eShutdownType ShutdownType { get; private set; }
|
||||
|
||||
public PepperDash.Essentials.Room.EssentialsRoomEmergencyBase Emergency { get; set; }
|
||||
|
||||
public PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController MicrophonePrivacy { get; set; }
|
||||
|
||||
public string LogoUrl { get; set; }
|
||||
|
||||
protected SecondsCountdownTimer RoomVacancyShutdownTimer { get; private set; }
|
||||
|
||||
public eVacancyMode VacancyMode { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Seconds after vacancy prompt is displayed until shutdown
|
||||
/// </summary>
|
||||
protected int RoomVacancyShutdownSeconds;
|
||||
|
||||
/// <summary>
|
||||
/// Seconds after vacancy detected until prompt is displayed
|
||||
/// </summary>
|
||||
protected int RoomVacancyShutdownPromptSeconds;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
protected abstract Func<bool> OnFeedbackFunc { get; }
|
||||
|
||||
protected Dictionary<IBasicVolumeWithFeedback, uint> SavedVolumeLevels = new Dictionary<IBasicVolumeWithFeedback, uint>();
|
||||
|
||||
/// <summary>
|
||||
/// When volume control devices change, should we zero the one that we are leaving?
|
||||
/// </summary>
|
||||
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; private set; }
|
||||
|
||||
|
||||
public EssentialsRoomBase(DeviceConfig config)
|
||||
: base(config)
|
||||
{
|
||||
// Setup the ShutdownPromptTimer
|
||||
ShutdownPromptTimer = new SecondsCountdownTimer(Key + "-offTimer");
|
||||
ShutdownPromptTimer.IsRunningFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (!ShutdownPromptTimer.IsRunningFeedback.BoolValue)
|
||||
ShutdownType = eShutdownType.None;
|
||||
};
|
||||
ShutdownPromptTimer.HasFinished += (o, a) => Shutdown(); // Shutdown is triggered
|
||||
|
||||
ShutdownPromptSeconds = 60;
|
||||
ShutdownVacancySeconds = 120;
|
||||
ShutdownType = eShutdownType.None;
|
||||
|
||||
RoomVacancyShutdownTimer = new SecondsCountdownTimer(Key + "-vacancyOffTimer");
|
||||
//RoomVacancyShutdownTimer.IsRunningFeedback.OutputChange += (o, a) =>
|
||||
//{
|
||||
// if (!RoomVacancyShutdownTimer.IsRunningFeedback.BoolValue)
|
||||
// ShutdownType = ShutdownType.Vacancy;
|
||||
//};
|
||||
RoomVacancyShutdownTimer.HasFinished += new EventHandler<EventArgs>(RoomVacancyShutdownPromptTimer_HasFinished); // Shutdown is triggered
|
||||
|
||||
RoomVacancyShutdownPromptSeconds = 1500; // 25 min to prompt warning
|
||||
RoomVacancyShutdownSeconds = 240; // 4 min after prompt will trigger shutdown prompt
|
||||
VacancyMode = eVacancyMode.None;
|
||||
|
||||
OnFeedback = new BoolFeedback(OnFeedbackFunc);
|
||||
|
||||
IsWarmingUpFeedback = new BoolFeedback(IsWarmingFeedbackFunc);
|
||||
IsCoolingDownFeedback = new BoolFeedback(IsCoolingFeedbackFunc);
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
if (RoomOccupancy != null)
|
||||
OnRoomOccupancyIsSet();
|
||||
});
|
||||
}
|
||||
|
||||
void RoomVacancyShutdownPromptTimer_HasFinished(object sender, EventArgs e)
|
||||
{
|
||||
switch (VacancyMode)
|
||||
{
|
||||
case eVacancyMode.None:
|
||||
StartRoomVacancyTimer(eVacancyMode.InInitialVacancy);
|
||||
break;
|
||||
case eVacancyMode.InInitialVacancy:
|
||||
StartRoomVacancyTimer(eVacancyMode.InShutdownWarning);
|
||||
break;
|
||||
case eVacancyMode.InShutdownWarning:
|
||||
{
|
||||
StartShutdown(eShutdownType.Vacancy);
|
||||
Debug.Console(0, this, "Shutting Down due to vacancy.");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
public void StartShutdown(eShutdownType type)
|
||||
{
|
||||
// Check for shutdowns running. Manual should override other shutdowns
|
||||
|
||||
if (type == eShutdownType.Manual)
|
||||
ShutdownPromptTimer.SecondsToCount = ShutdownPromptSeconds;
|
||||
else if (type == eShutdownType.Vacancy)
|
||||
ShutdownPromptTimer.SecondsToCount = ShutdownVacancySeconds;
|
||||
ShutdownType = type;
|
||||
ShutdownPromptTimer.Start();
|
||||
|
||||
Debug.Console(0, this, "ShutdwonPromptTimer Started. Type: {0}. Seconds: {1}", ShutdownType, ShutdownPromptTimer.SecondsToCount);
|
||||
}
|
||||
|
||||
public void StartRoomVacancyTimer(eVacancyMode mode)
|
||||
{
|
||||
if (mode == eVacancyMode.None)
|
||||
RoomVacancyShutdownTimer.SecondsToCount = RoomVacancyShutdownPromptSeconds;
|
||||
else if (mode == eVacancyMode.InInitialVacancy)
|
||||
RoomVacancyShutdownTimer.SecondsToCount = RoomVacancyShutdownSeconds;
|
||||
VacancyMode = mode;
|
||||
RoomVacancyShutdownTimer.Start();
|
||||
|
||||
Debug.Console(0, this, "Vacancy Timer Started. Mode: {0}. Seconds: {1}", VacancyMode, RoomVacancyShutdownTimer.SecondsToCount);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the vacancy mode and shutsdwon the room
|
||||
/// </summary>
|
||||
public void Shutdown()
|
||||
{
|
||||
VacancyMode = eVacancyMode.None;
|
||||
EndShutdown();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is for the derived class to define it's specific shutdown
|
||||
/// requirements but should not be called directly. It is called by Shutdown()
|
||||
/// </summary>
|
||||
protected abstract void EndShutdown();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Override this to implement a default volume level(s) method
|
||||
/// </summary>
|
||||
public abstract void SetDefaultLevels();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the object to be used as the IOccupancyStatusProvider for the room. Can be an Occupancy Aggregator or a specific device
|
||||
/// </summary>
|
||||
/// <param name="statusProvider"></param>
|
||||
public void SetRoomOccupancy(IOccupancyStatusProvider statusProvider, int timeoutMinutes)
|
||||
{
|
||||
if (statusProvider == null)
|
||||
{
|
||||
Debug.Console(0, this, "ERROR: Occupancy sensor device is null");
|
||||
return;
|
||||
}
|
||||
|
||||
// If status provider is fusion, set flag to remote
|
||||
if (statusProvider is PepperDash.Essentials.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase)
|
||||
OccupancyStatusProviderIsRemote = true;
|
||||
|
||||
if(timeoutMinutes > 0)
|
||||
RoomVacancyShutdownSeconds = timeoutMinutes * 60;
|
||||
|
||||
Debug.Console(1, this, "RoomVacancyShutdownSeconds set to {0}", RoomVacancyShutdownSeconds);
|
||||
|
||||
RoomOccupancy = statusProvider;
|
||||
|
||||
OnRoomOccupancyIsSet();
|
||||
|
||||
RoomOccupancy.RoomIsOccupiedFeedback.OutputChange -= RoomIsOccupiedFeedback_OutputChange;
|
||||
RoomOccupancy.RoomIsOccupiedFeedback.OutputChange += RoomIsOccupiedFeedback_OutputChange;
|
||||
|
||||
Debug.Console(0, this, "Room Occupancy set to device: '{0}'", (statusProvider as Device).Key);
|
||||
}
|
||||
|
||||
void OnRoomOccupancyIsSet()
|
||||
{
|
||||
var handler = RoomOccupancyIsSet;
|
||||
if (handler != null)
|
||||
handler(this, new EventArgs());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To allow base class to power room on to last source
|
||||
/// </summary>
|
||||
public abstract void PowerOnToDefaultOrLastSource();
|
||||
|
||||
/// <summary>
|
||||
/// To allow base class to power room on to default source
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public abstract bool RunDefaultPresentRoute();
|
||||
|
||||
void RoomIsOccupiedFeedback_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
if (RoomOccupancy.RoomIsOccupiedFeedback.BoolValue == false)
|
||||
{
|
||||
Debug.Console(1, this, "Notice: Vacancy Detected");
|
||||
// Trigger the timer when the room is vacant
|
||||
StartRoomVacancyTimer(eVacancyMode.InInitialVacancy);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, this, "Notice: Occupancy Detected");
|
||||
// Reset the timer when the room is occupied
|
||||
RoomVacancyShutdownTimer.Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes when RoomVacancyShutdownTimer expires. Used to trigger specific room actions as needed. Must nullify the timer object when executed
|
||||
/// </summary>
|
||||
/// <param name="o"></param>
|
||||
public abstract void RoomVacatedForTimeoutPeriod(object o);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To describe the various ways a room may be shutting down
|
||||
/// </summary>
|
||||
public enum eShutdownType
|
||||
{
|
||||
None = 0,
|
||||
External,
|
||||
Manual,
|
||||
Vacancy
|
||||
}
|
||||
|
||||
public enum eVacancyMode
|
||||
{
|
||||
None = 0,
|
||||
InInitialVacancy,
|
||||
InShutdownWarning
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum eWarmingCoolingMode
|
||||
{
|
||||
None,
|
||||
Warming,
|
||||
Cooling
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.Scheduler;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.Devices;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class EssentialsRoomBase : ReconfigurableDevice
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public BoolFeedback OnFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fires when the RoomOccupancy object is set
|
||||
/// </summary>
|
||||
public event EventHandler<EventArgs> RoomOccupancyIsSet;
|
||||
|
||||
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
||||
public BoolFeedback IsCoolingDownFeedback { get; private set; }
|
||||
|
||||
public IOccupancyStatusProvider RoomOccupancy { get; private set; }
|
||||
|
||||
public bool OccupancyStatusProviderIsRemote { get; private set; }
|
||||
|
||||
protected abstract Func<bool> IsWarmingFeedbackFunc { get; }
|
||||
protected abstract Func<bool> IsCoolingFeedbackFunc { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The config name of the source list
|
||||
/// </summary>
|
||||
public string SourceListKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Timer used for informing the UIs of a shutdown
|
||||
/// </summary>
|
||||
public SecondsCountdownTimer ShutdownPromptTimer { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int ShutdownPromptSeconds { get; set; }
|
||||
public int ShutdownVacancySeconds { get; set; }
|
||||
public eShutdownType ShutdownType { get; private set; }
|
||||
|
||||
public EssentialsRoomEmergencyBase Emergency { get; set; }
|
||||
|
||||
public Core.Privacy.MicrophonePrivacyController MicrophonePrivacy { get; set; }
|
||||
|
||||
public string LogoUrl { get; set; }
|
||||
|
||||
protected SecondsCountdownTimer RoomVacancyShutdownTimer { get; private set; }
|
||||
|
||||
public eVacancyMode VacancyMode { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Seconds after vacancy prompt is displayed until shutdown
|
||||
/// </summary>
|
||||
protected int RoomVacancyShutdownSeconds;
|
||||
|
||||
/// <summary>
|
||||
/// Seconds after vacancy detected until prompt is displayed
|
||||
/// </summary>
|
||||
protected int RoomVacancyShutdownPromptSeconds;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
protected abstract Func<bool> OnFeedbackFunc { get; }
|
||||
|
||||
protected Dictionary<IBasicVolumeWithFeedback, uint> SavedVolumeLevels = new Dictionary<IBasicVolumeWithFeedback, uint>();
|
||||
|
||||
/// <summary>
|
||||
/// When volume control devices change, should we zero the one that we are leaving?
|
||||
/// </summary>
|
||||
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; private set; }
|
||||
|
||||
|
||||
public EssentialsRoomBase(DeviceConfig config)
|
||||
: base(config)
|
||||
{
|
||||
// Setup the ShutdownPromptTimer
|
||||
ShutdownPromptTimer = new SecondsCountdownTimer(Key + "-offTimer");
|
||||
ShutdownPromptTimer.IsRunningFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (!ShutdownPromptTimer.IsRunningFeedback.BoolValue)
|
||||
ShutdownType = eShutdownType.None;
|
||||
};
|
||||
ShutdownPromptTimer.HasFinished += (o, a) => Shutdown(); // Shutdown is triggered
|
||||
|
||||
ShutdownPromptSeconds = 60;
|
||||
ShutdownVacancySeconds = 120;
|
||||
ShutdownType = eShutdownType.None;
|
||||
|
||||
RoomVacancyShutdownTimer = new SecondsCountdownTimer(Key + "-vacancyOffTimer");
|
||||
//RoomVacancyShutdownTimer.IsRunningFeedback.OutputChange += (o, a) =>
|
||||
//{
|
||||
// if (!RoomVacancyShutdownTimer.IsRunningFeedback.BoolValue)
|
||||
// ShutdownType = ShutdownType.Vacancy;
|
||||
//};
|
||||
RoomVacancyShutdownTimer.HasFinished += new EventHandler<EventArgs>(RoomVacancyShutdownPromptTimer_HasFinished); // Shutdown is triggered
|
||||
|
||||
RoomVacancyShutdownPromptSeconds = 1500; // 25 min to prompt warning
|
||||
RoomVacancyShutdownSeconds = 240; // 4 min after prompt will trigger shutdown prompt
|
||||
VacancyMode = eVacancyMode.None;
|
||||
|
||||
OnFeedback = new BoolFeedback(OnFeedbackFunc);
|
||||
|
||||
IsWarmingUpFeedback = new BoolFeedback(IsWarmingFeedbackFunc);
|
||||
IsCoolingDownFeedback = new BoolFeedback(IsCoolingFeedbackFunc);
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
if (RoomOccupancy != null)
|
||||
OnRoomOccupancyIsSet();
|
||||
});
|
||||
}
|
||||
|
||||
void RoomVacancyShutdownPromptTimer_HasFinished(object sender, EventArgs e)
|
||||
{
|
||||
switch (VacancyMode)
|
||||
{
|
||||
case eVacancyMode.None:
|
||||
StartRoomVacancyTimer(eVacancyMode.InInitialVacancy);
|
||||
break;
|
||||
case eVacancyMode.InInitialVacancy:
|
||||
StartRoomVacancyTimer(eVacancyMode.InShutdownWarning);
|
||||
break;
|
||||
case eVacancyMode.InShutdownWarning:
|
||||
{
|
||||
StartShutdown(eShutdownType.Vacancy);
|
||||
Debug.Console(0, this, "Shutting Down due to vacancy.");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
public void StartShutdown(eShutdownType type)
|
||||
{
|
||||
// Check for shutdowns running. Manual should override other shutdowns
|
||||
|
||||
if (type == eShutdownType.Manual)
|
||||
ShutdownPromptTimer.SecondsToCount = ShutdownPromptSeconds;
|
||||
else if (type == eShutdownType.Vacancy)
|
||||
ShutdownPromptTimer.SecondsToCount = ShutdownVacancySeconds;
|
||||
ShutdownType = type;
|
||||
ShutdownPromptTimer.Start();
|
||||
|
||||
Debug.Console(0, this, "ShutdwonPromptTimer Started. Type: {0}. Seconds: {1}", ShutdownType, ShutdownPromptTimer.SecondsToCount);
|
||||
}
|
||||
|
||||
public void StartRoomVacancyTimer(eVacancyMode mode)
|
||||
{
|
||||
if (mode == eVacancyMode.None)
|
||||
RoomVacancyShutdownTimer.SecondsToCount = RoomVacancyShutdownPromptSeconds;
|
||||
else if (mode == eVacancyMode.InInitialVacancy)
|
||||
RoomVacancyShutdownTimer.SecondsToCount = RoomVacancyShutdownSeconds;
|
||||
VacancyMode = mode;
|
||||
RoomVacancyShutdownTimer.Start();
|
||||
|
||||
Debug.Console(0, this, "Vacancy Timer Started. Mode: {0}. Seconds: {1}", VacancyMode, RoomVacancyShutdownTimer.SecondsToCount);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the vacancy mode and shutsdwon the room
|
||||
/// </summary>
|
||||
public void Shutdown()
|
||||
{
|
||||
VacancyMode = eVacancyMode.None;
|
||||
EndShutdown();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is for the derived class to define it's specific shutdown
|
||||
/// requirements but should not be called directly. It is called by Shutdown()
|
||||
/// </summary>
|
||||
protected abstract void EndShutdown();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Override this to implement a default volume level(s) method
|
||||
/// </summary>
|
||||
public abstract void SetDefaultLevels();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the object to be used as the IOccupancyStatusProvider for the room. Can be an Occupancy Aggregator or a specific device
|
||||
/// </summary>
|
||||
/// <param name="statusProvider"></param>
|
||||
public void SetRoomOccupancy(IOccupancyStatusProvider statusProvider, int timeoutMinutes)
|
||||
{
|
||||
if (statusProvider == null)
|
||||
{
|
||||
Debug.Console(0, this, "ERROR: Occupancy sensor device is null");
|
||||
return;
|
||||
}
|
||||
|
||||
// If status provider is fusion, set flag to remote
|
||||
if (statusProvider is Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase)
|
||||
OccupancyStatusProviderIsRemote = true;
|
||||
|
||||
if(timeoutMinutes > 0)
|
||||
RoomVacancyShutdownSeconds = timeoutMinutes * 60;
|
||||
|
||||
Debug.Console(1, this, "RoomVacancyShutdownSeconds set to {0}", RoomVacancyShutdownSeconds);
|
||||
|
||||
RoomOccupancy = statusProvider;
|
||||
|
||||
OnRoomOccupancyIsSet();
|
||||
|
||||
RoomOccupancy.RoomIsOccupiedFeedback.OutputChange -= RoomIsOccupiedFeedback_OutputChange;
|
||||
RoomOccupancy.RoomIsOccupiedFeedback.OutputChange += RoomIsOccupiedFeedback_OutputChange;
|
||||
|
||||
Debug.Console(0, this, "Room Occupancy set to device: '{0}'", (statusProvider as Device).Key);
|
||||
}
|
||||
|
||||
void OnRoomOccupancyIsSet()
|
||||
{
|
||||
var handler = RoomOccupancyIsSet;
|
||||
if (handler != null)
|
||||
handler(this, new EventArgs());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To allow base class to power room on to last source
|
||||
/// </summary>
|
||||
public abstract void PowerOnToDefaultOrLastSource();
|
||||
|
||||
/// <summary>
|
||||
/// To allow base class to power room on to default source
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public abstract bool RunDefaultPresentRoute();
|
||||
|
||||
void RoomIsOccupiedFeedback_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
if (RoomOccupancy.RoomIsOccupiedFeedback.BoolValue == false)
|
||||
{
|
||||
Debug.Console(1, this, "Notice: Vacancy Detected");
|
||||
// Trigger the timer when the room is vacant
|
||||
StartRoomVacancyTimer(eVacancyMode.InInitialVacancy);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, this, "Notice: Occupancy Detected");
|
||||
// Reset the timer when the room is occupied
|
||||
RoomVacancyShutdownTimer.Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes when RoomVacancyShutdownTimer expires. Used to trigger specific room actions as needed. Must nullify the timer object when executed
|
||||
/// </summary>
|
||||
/// <param name="o"></param>
|
||||
public abstract void RoomVacatedForTimeoutPeriod(object o);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To describe the various ways a room may be shutting down
|
||||
/// </summary>
|
||||
public enum eShutdownType
|
||||
{
|
||||
None = 0,
|
||||
External,
|
||||
Manual,
|
||||
Vacancy
|
||||
}
|
||||
|
||||
public enum eVacancyMode
|
||||
{
|
||||
None = 0,
|
||||
InInitialVacancy,
|
||||
InShutdownWarning
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public enum eWarmingCoolingMode
|
||||
{
|
||||
None,
|
||||
Warming,
|
||||
Cooling
|
||||
}
|
||||
|
||||
public abstract class EssentialsRoomEmergencyBase : IKeyed
|
||||
{
|
||||
public string Key { get; private set; }
|
||||
|
||||
public EssentialsRoomEmergencyBase(string key)
|
||||
{
|
||||
Key = key;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// For rooms with in call feedback
|
||||
/// </summary>
|
||||
public interface IHasInCallFeedback
|
||||
{
|
||||
BoolFeedback InCallFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with a single display
|
||||
/// </summary>
|
||||
public interface IHasDefaultDisplay
|
||||
{
|
||||
IRoutingSinkWithSwitching DefaultDisplay { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with multiple displays
|
||||
/// </summary>
|
||||
public interface IHasMultipleDisplays
|
||||
{
|
||||
Dictionary<eSourceListItemDestinationTypes, IRoutingSinkWithSwitching> Displays { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with routing
|
||||
/// </summary>
|
||||
public interface IRunRouteAction
|
||||
{
|
||||
void RunRouteAction(string routeKey);
|
||||
|
||||
void RunRouteAction(string routeKey, Action successCallback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms that default presentation only routing
|
||||
/// </summary>
|
||||
public interface IRunDefaultPresentRoute
|
||||
{
|
||||
bool RunDefaultPresentRoute();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms that have default presentation and calling routes
|
||||
/// </summary>
|
||||
public interface IRunDefaultCallRoute : IRunDefaultPresentRoute
|
||||
{
|
||||
bool RunDefaultCallRoute();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
|
||||
//namespace PepperDash.Essentials.Core
|
||||
//{
|
||||
// public class EssentialsRoomSourceChangeEventArgs : EventArgs
|
||||
// {
|
||||
// public EssentialsRoom Room { get; private set; }
|
||||
// public IPresentationSource OldSource { get; private set; }
|
||||
// public IPresentationSource NewSource { get; private set; }
|
||||
|
||||
// public EssentialsRoomSourceChangeEventArgs(EssentialsRoom room,
|
||||
// IPresentationSource oldSource, IPresentationSource newSource)
|
||||
// {
|
||||
// Room = room;
|
||||
// OldSource = oldSource;
|
||||
// NewSource = newSource;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// public class EssentialsRoomAudioDeviceChangeEventArgs : EventArgs
|
||||
// {
|
||||
// public EssentialsRoom Room { get; private set; }
|
||||
// public IBasicVolumeControls OldDevice { get; private set; }
|
||||
// public IBasicVolumeControls NewDevice { get; private set; }
|
||||
|
||||
// public EssentialsRoomAudioDeviceChangeEventArgs(EssentialsRoom room,
|
||||
// IBasicVolumeControls oldDevice, IBasicVolumeControls newDevice)
|
||||
// {
|
||||
// Room = room;
|
||||
// OldDevice = oldDevice;
|
||||
// NewDevice = newDevice;
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
@@ -6,7 +6,7 @@ using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Occupancy
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public interface IOccupancyStatusProvider
|
||||
{
|
||||
@@ -11,9 +11,25 @@ using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The handler type for a Room's SourceInfoChange
|
||||
/// </summary>
|
||||
public delegate void SourceInfoChangeHandler(/*EssentialsRoomBase room,*/ SourceListItem info, ChangeType type);
|
||||
|
||||
|
||||
//*******************************************************************************************
|
||||
// Interfaces
|
||||
|
||||
/// <summary>
|
||||
/// For rooms with a single presentation source, change event
|
||||
/// </summary>
|
||||
public interface IHasCurrentSourceInfoChange
|
||||
{
|
||||
string CurrentSourceInfoKey { get; set; }
|
||||
SourceListItem CurrentSourceInfo { get; set; }
|
||||
event SourceInfoChangeHandler CurrentSourceChange;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines a class that has a collection of RoutingInputPorts
|
||||
@@ -35,7 +51,7 @@ namespace PepperDash.Essentials.Core
|
||||
/// <summary>
|
||||
/// For fixed-source endpoint devices
|
||||
/// </summary>
|
||||
public interface IRoutingSinkNoSwitching : IRoutingInputs
|
||||
public interface IRoutingSinkNoSwitching : IRoutingInputs, IHasCurrentSourceInfoChange
|
||||
{
|
||||
|
||||
}
|
||||
@@ -43,7 +59,7 @@ namespace PepperDash.Essentials.Core
|
||||
/// <summary>
|
||||
/// Endpoint device like a display, that selects inputs
|
||||
/// </summary>
|
||||
public interface IRoutingSinkWithSwitching : IRoutingSinkNoSwitching
|
||||
public interface IRoutingSinkWithSwitching : IRoutingSinkNoSwitching, IHasCurrentSourceInfoChange
|
||||
{
|
||||
//void ClearRoute();
|
||||
void ExecuteSwitch(object inputSelector);
|
||||
|
||||
@@ -33,9 +33,9 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
Audio = 1,
|
||||
Video = 2,
|
||||
//AudioVideo = 4,
|
||||
UsbOutput = 4,
|
||||
UsbInput = 8
|
||||
AudioVideo = 4,
|
||||
UsbOutput = 8,
|
||||
UsbInput = 16
|
||||
}
|
||||
|
||||
public enum eRoutingPortConnectionType
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace PepperDash.Essentials.Core
|
||||
public ushort Count
|
||||
{
|
||||
get { return SetNumberOfItemsSig.UShortValue; }
|
||||
set { SetNumberOfItemsSig.UShortValue = value; }
|
||||
set { SetNumberOfItemsSig.UShortValue = value; }
|
||||
}
|
||||
public ushort MaxDefinedItems { get; private set; }
|
||||
|
||||
@@ -100,8 +100,9 @@ namespace PepperDash.Essentials.Core
|
||||
// Empty the list
|
||||
Items.Clear();
|
||||
// Clean up the SRL
|
||||
Count = 0;
|
||||
ScrollToItemSig.UShortValue = 1;
|
||||
Count = 1;
|
||||
|
||||
ScrollToItemSig.UShortValue = 1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public interface IHasBasicTriListWithSmartObject
|
||||
{
|
||||
BasicTriListWithSmartObject Panel { get; }
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,32 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
/// </summary>
|
||||
public class GenericAudioOut : Device, IRoutingSinkNoSwitching
|
||||
{
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
|
||||
public string CurrentSourceInfoKey { get; set; }
|
||||
public SourceListItem CurrentSourceInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return _CurrentSourceInfo;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == _CurrentSourceInfo) return;
|
||||
|
||||
var handler = CurrentSourceChange;
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.WillChange);
|
||||
|
||||
_CurrentSourceInfo = value;
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
||||
}
|
||||
}
|
||||
SourceListItem _CurrentSourceInfo;
|
||||
|
||||
public RoutingInputPort AnyAudioIn { get; private set; }
|
||||
|
||||
public GenericAudioOut(string key, string name)
|
||||
|
||||
@@ -150,13 +150,8 @@
|
||||
<Compile Include="Environment\Somfy\RelayControlledShade.cs" />
|
||||
<Compile Include="Factory\DeviceFactory.cs" />
|
||||
<Compile Include="Generic\GenericSource.cs" />
|
||||
<Compile Include="Microphone\MicrophonePrivacyController.cs" />
|
||||
<Compile Include="Microphone\MicrophonePrivacyControllerConfig.cs" />
|
||||
<Compile Include="Occupancy\GlsOccupancySensorBaseController.cs" />
|
||||
<Compile Include="Occupancy\IOccupancyStatusProviderAggregator.cs" />
|
||||
<Compile Include="Occupancy\iOccupancyStatusProvider.cs" />
|
||||
<Compile Include="PC\InRoomPc.cs" />
|
||||
<Compile Include="PC\Laptop.cs" />
|
||||
<Compile Include="SetTopBox\SetTopBoxPropertiesConfig.cs" />
|
||||
<Compile Include="Streaming\AppleTV.cs" />
|
||||
<Compile Include="Audio\GenericAudioOut.cs" />
|
||||
|
||||
@@ -136,12 +136,12 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
|
||||
else if (typeName == "inroompc")
|
||||
{
|
||||
return new InRoomPc(key, name);
|
||||
return new Core.Devices.InRoomPc(key, name);
|
||||
}
|
||||
|
||||
else if (typeName == "laptop")
|
||||
{
|
||||
return new Laptop(key, name);
|
||||
return new Core.Devices.Laptop(key, name);
|
||||
}
|
||||
|
||||
else if (typeName == "mockvc")
|
||||
@@ -292,6 +292,10 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
else
|
||||
Debug.Console(0, "Attempt to register relay {0} on device with key '{1}' failed.", props.PortNumber, props.PortDeviceKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new GenericRelayDevice(key, relay);
|
||||
}
|
||||
|
||||
// Future: Check if portDevice is 3-series card or other non control system that supports versiports
|
||||
}
|
||||
@@ -299,9 +303,9 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
|
||||
else if (typeName == "microphoneprivacycontroller")
|
||||
{
|
||||
var props = JsonConvert.DeserializeObject<Microphones.MicrophonePrivacyControllerConfig>(properties.ToString());
|
||||
var props = JsonConvert.DeserializeObject<Core.Privacy.MicrophonePrivacyControllerConfig>(properties.ToString());
|
||||
|
||||
return new Microphones.MicrophonePrivacyController(key, props);
|
||||
return new Core.Privacy.MicrophonePrivacyController(key, props);
|
||||
}
|
||||
else if (typeName == "roku")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user