diff --git a/PepperDashEssentials/AppServer/RoomBridges/MobileControlEssentialsHuddleSpaceRoomBridge.cs b/PepperDashEssentials/AppServer/RoomBridges/MobileControlEssentialsHuddleSpaceRoomBridge.cs index 5c82d488..711f60a1 100644 --- a/PepperDashEssentials/AppServer/RoomBridges/MobileControlEssentialsHuddleSpaceRoomBridge.cs +++ b/PepperDashEssentials/AppServer/RoomBridges/MobileControlEssentialsHuddleSpaceRoomBridge.cs @@ -69,7 +69,45 @@ namespace PepperDash.Essentials var routeRoom = Room as IRunRouteAction; if(routeRoom != null) Parent.AddAction(string.Format(@"/room/{0}/source", Room.Key), new Action(c => - routeRoom.RunRouteAction(c.SourceListItem))); + { + if(string.IsNullOrEmpty(c.SourceListKey)) + routeRoom.RunRouteAction(c.SourceListItem, Room.SourceListKey); + else + { + routeRoom.RunRouteAction(c.SourceListItem, c.SourceListKey); + } + })); + + //****************Temp until testing complete. Then move to own messenger*********************** + + var routeDevice = DeviceManager.GetDeviceForKey("inRoomPc-1") as IRunRouteAction; + if (routeDevice != null) + { + Parent.AddAction(string.Format(@"/device/inRoomPc-1/source"), new Action(c => + { + routeDevice.RunRouteAction(c.SourceListItem, c.SourceListKey); + })); + + var sinkDevice = routeDevice as IRoutingSinkNoSwitching; + if(sinkDevice != null) + { + sinkDevice.CurrentSourceChange += new SourceInfoChangeHandler((o, a) => + { + var contentObject = new + { + selectedSourceKey = sinkDevice.CurrentSourceInfoKey + }; + + Parent.SendMessageToServer(JObject.FromObject(new + { + type = "/device/inRoomPc-1/status", + content = contentObject + })); + + }); + } + } + var defaultRoom = Room as IRunDefaultPresentRoute; if(defaultRoom != null) @@ -455,6 +493,7 @@ namespace PepperDash.Essentials public class SourceSelectMessageContent { public string SourceListItem { get; set; } + public string SourceListKey { get; set; } } /// diff --git a/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs b/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs index 8ec55881..c6c85d1a 100644 --- a/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs +++ b/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs @@ -186,7 +186,7 @@ namespace PepperDash.Essentials.Fusion FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource); - FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff")); + FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey)); // NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig); @@ -342,7 +342,7 @@ namespace PepperDash.Essentials.Fusion // Current Source var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig); - defaultDisplaySourceNone.OutputSig.UserObject = new Action(b => { if (!b) (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff"); }); ; + defaultDisplaySourceNone.OutputSig.UserObject = new Action(b => { if (!b) (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey); }); ; } } } diff --git a/PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs b/PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs index 44c88724..27539ebd 100644 --- a/PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs +++ b/PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs @@ -348,7 +348,7 @@ namespace PepperDash.Essentials CrestronEnvironment.Sleep(1000); - RunRouteAction("roomOff"); + RunRouteAction("roomOff", SourceListKey); } /// @@ -357,7 +357,7 @@ namespace PepperDash.Essentials public override bool RunDefaultPresentRoute() { if (DefaultSourceItem != null) - RunRouteAction(DefaultSourceItem); + RunRouteAction(DefaultSourceItem, SourceListKey); return DefaultSourceItem != null; } @@ -368,7 +368,7 @@ namespace PepperDash.Essentials /// public bool RunDefaultCallRoute() { - RunRouteAction(DefaultCodecRouteString); + RunRouteAction(DefaultCodecRouteString, SourceListKey); return true; } @@ -376,9 +376,9 @@ namespace PepperDash.Essentials /// /// /// - public void RunRouteAction(string routeKey) + public void RunRouteAction(string routeKey, string sourceListKey) { - RunRouteAction(routeKey, null); + RunRouteAction(routeKey, sourceListKey, null); } /// @@ -386,7 +386,7 @@ namespace PepperDash.Essentials /// route or commands /// /// - public void RunRouteAction(string routeKey, Action successCallback) + public void RunRouteAction(string routeKey, string sourceListKey, Action successCallback) { // Run this on a separate thread new CTimer(o => @@ -398,10 +398,10 @@ namespace PepperDash.Essentials { Debug.Console(1, this, "Run route action '{0}'", routeKey); - var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey); + var dict = ConfigReader.ConfigObject.GetSourceListForKey(sourceListKey); if (dict == null) { - Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey); + Debug.Console(1, this, "WARNING: Config source list '{0}' not found", sourceListKey); return; } @@ -619,7 +619,7 @@ namespace PepperDash.Essentials { if (!EnablePowerOnToLastSource || LastSourceKey == null) return; - RunRouteAction(LastSourceKey); + RunRouteAction(LastSourceKey, SourceListKey); } /// @@ -630,7 +630,7 @@ namespace PepperDash.Essentials var allRooms = DeviceManager.AllDevices.Where(d => d is EssentialsHuddleSpaceRoom && !(d as EssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions); foreach (var room in allRooms) - (room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff"); + (room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff", (room as EssentialsHuddleSpaceRoom).SourceListKey); } #region IPrivacy Members diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs index e4b503c3..9fd4b863 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs @@ -223,7 +223,7 @@ namespace PepperDash.Essentials CrestronEnvironment.Sleep(1000); - RunRouteAction("roomOff"); + RunRouteAction("roomOff", SourceListKey); } /// @@ -237,7 +237,7 @@ namespace PepperDash.Essentials return false; } - RunRouteAction(DefaultSourceItem); + RunRouteAction(DefaultSourceItem, SourceListKey); return true; } @@ -260,9 +260,9 @@ namespace PepperDash.Essentials /// /// /// - public void RunRouteAction(string routeKey) + public void RunRouteAction(string routeKey, string sourceListKey) { - RunRouteAction(routeKey, null); + RunRouteAction(routeKey, sourceListKey, null); } /// @@ -270,16 +270,16 @@ namespace PepperDash.Essentials /// route or commands /// /// - public void RunRouteAction(string routeKey, Action successCallback) + public void RunRouteAction(string routeKey, string sourceListKey, Action successCallback) { // Run this on a separate thread new CTimer(o => { Debug.Console(1, this, "Run route action '{0}'", routeKey); - var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey); + var dict = ConfigReader.ConfigObject.GetSourceListForKey(sourceListKey); if(dict == null) { - Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey); + Debug.Console(1, this, "WARNING: Config source list '{0}' not found", sourceListKey); return; } @@ -287,7 +287,7 @@ namespace PepperDash.Essentials if (!dict.ContainsKey(routeKey)) { Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'", - routeKey, SourceListKey); + routeKey, sourceListKey); return; } @@ -426,7 +426,7 @@ namespace PepperDash.Essentials { if (!EnablePowerOnToLastSource || LastSourceKey == null) return; - RunRouteAction(LastSourceKey); + RunRouteAction(LastSourceKey, SourceListKey); } /// @@ -494,7 +494,7 @@ namespace PepperDash.Essentials var allRooms = DeviceManager.AllDevices.Where(d => d is EssentialsHuddleSpaceRoom && !(d as EssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions); foreach (var room in allRooms) - (room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff"); + (room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff", (room as EssentialsHuddleSpaceRoom).SourceListKey); } } } \ No newline at end of file diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index c8e867a4..e1bdb6cf 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -348,7 +348,7 @@ namespace PepperDash.Essentials CrestronEnvironment.Sleep(1000); - RunRouteAction("roomOff"); + RunRouteAction("roomOff", SourceListKey); } /// @@ -357,7 +357,7 @@ namespace PepperDash.Essentials public override bool RunDefaultPresentRoute() { if (DefaultSourceItem != null) - RunRouteAction(DefaultSourceItem); + RunRouteAction(DefaultSourceItem, SourceListKey); return DefaultSourceItem != null; } @@ -368,7 +368,7 @@ namespace PepperDash.Essentials /// public bool RunDefaultCallRoute() { - RunRouteAction(DefaultCodecRouteString); + RunRouteAction(DefaultCodecRouteString, SourceListKey); return true; } @@ -376,9 +376,9 @@ namespace PepperDash.Essentials /// /// /// - public void RunRouteAction(string routeKey) + public void RunRouteAction(string routeKey, string sourceListKey) { - RunRouteAction(routeKey, null); + RunRouteAction(routeKey, sourceListKey, null); } /// @@ -386,7 +386,7 @@ namespace PepperDash.Essentials /// route or commands /// /// - public void RunRouteAction(string routeKey, Action successCallback) + public void RunRouteAction(string routeKey, string sourceListKey, Action successCallback) { // Run this on a separate thread new CTimer(o => @@ -398,10 +398,10 @@ namespace PepperDash.Essentials { Debug.Console(1, this, "Run route action '{0}'", routeKey); - var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey); + var dict = ConfigReader.ConfigObject.GetSourceListForKey(sourceListKey); if (dict == null) { - Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey); + Debug.Console(1, this, "WARNING: Config source list '{0}' not found", sourceListKey); return; } @@ -608,7 +608,7 @@ namespace PepperDash.Essentials { if (!EnablePowerOnToLastSource || LastSourceKey == null) return; - RunRouteAction(LastSourceKey); + RunRouteAction(LastSourceKey, SourceListKey); } /// @@ -619,7 +619,7 @@ namespace PepperDash.Essentials var allRooms = DeviceManager.AllDevices.Where(d => d is EssentialsHuddleSpaceRoom && !(d as EssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions); foreach (var room in allRooms) - (room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff"); + (room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff", (room as EssentialsHuddleSpaceRoom).SourceListKey); } #region IPrivacy Members diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs index 57e68010..fbc3f5b6 100644 --- a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs +++ b/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs @@ -941,7 +941,7 @@ namespace PepperDash.Essentials if (_CurrentRoom != null) _CurrentRoom.CurrentSourceChange += new SourceInfoChangeHandler(CurrentRoom_CurrentSingleSourceChange); - TriList.SetSigFalseAction(UIBoolJoin.CallStopSharingPress, () => _CurrentRoom.RunRouteAction("codecOsd")); + TriList.SetSigFalseAction(UIBoolJoin.CallStopSharingPress, () => _CurrentRoom.RunRouteAction("codecOsd", _CurrentRoom.SourceListKey)); (Parent as EssentialsPanelMainInterfaceDriver).HeaderDriver.SetupHeaderButtons(this, CurrentRoom); } @@ -987,7 +987,7 @@ namespace PepperDash.Essentials if (CurrentRoom.CurrentSourceInfo != null && CurrentRoom.CurrentSourceInfo.DisableCodecSharing) { Debug.Console(1, CurrentRoom, "Transitioning to in-call, cancelling non-sharable source"); - CurrentRoom.RunRouteAction("codecOsd"); + CurrentRoom.RunRouteAction("codecOsd", CurrentRoom.SourceListKey); } } diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/EssentialsHuddleSpaceFusionSystemControllerBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/EssentialsHuddleSpaceFusionSystemControllerBase.cs index ef5634aa..e8422f95 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/EssentialsHuddleSpaceFusionSystemControllerBase.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Fusion/EssentialsHuddleSpaceFusionSystemControllerBase.cs @@ -332,7 +332,7 @@ namespace PepperDash.Essentials.Core.Fusion FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsRoomBase).PowerOnToDefaultOrLastSource); - FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as IRunRouteAction).RunRouteAction("roomOff")); + FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as IRunRouteAction).RunRouteAction("roomOff", Room.SourceListKey)); // 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;"; @@ -1086,7 +1086,7 @@ namespace PepperDash.Essentials.Core.Fusion SourceToFeedbackSigs.Add(pSrc, sigD.InputSig); // And respond to selection in Fusion - sigD.OutputSig.SetSigFalseAction(() => (Room as IRunRouteAction).RunRouteAction(routeKey)); + sigD.OutputSig.SetSigFalseAction(() => (Room as IRunRouteAction).RunRouteAction(routeKey, Room.SourceListKey)); } catch (Exception) { @@ -1288,7 +1288,7 @@ namespace PepperDash.Essentials.Core.Fusion // Current Source var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig); - defaultDisplaySourceNone.OutputSig.UserObject = new Action(b => { if (!b) (Room as IRunRouteAction).RunRouteAction("roomOff"); }); ; + defaultDisplaySourceNone.OutputSig.UserObject = new Action(b => { if (!b) (Room as IRunRouteAction).RunRouteAction("roomOff", Room.SourceListKey); }); ; } } diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Interfaces.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Interfaces.cs index 36f390c3..1743bdaa 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Interfaces.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Interfaces.cs @@ -35,9 +35,10 @@ namespace PepperDash.Essentials.Core /// public interface IRunRouteAction { - void RunRouteAction(string routeKey); + void RunRouteAction(string routeKey, string sourceListKey); + + void RunRouteAction(string routeKey, string sourceListKey, Action successCallback); - void RunRouteAction(string routeKey, Action successCallback); } /// diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj index 38250dfc..a0ed40c9 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj @@ -120,6 +120,7 @@ + diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs index 671dec12..5fe89500 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Factory/DeviceFactory.cs @@ -144,22 +144,27 @@ namespace PepperDash.Essentials.Devices.Common return new Core.Devices.Laptop(key, name); } - else if (typeName == "mockvc") - { - return new VideoCodec.MockVC(dc); - } + else if (typeName == "bluejeanspc") + { + return new SoftCodec.BlueJeansPc(key, name); + } - else if (typeName == "mockac") - { - var props = JsonConvert.DeserializeObject(properties.ToString()); - return new AudioCodec.MockAC(key, name, props); - } + else if (typeName == "mockvc") + { + return new VideoCodec.MockVC(dc); + } - else if (typeName.StartsWith("ciscospark")) - { - var comm = CommFactory.CreateCommForDevice(dc); - return new VideoCodec.Cisco.CiscoSparkCodec(dc, comm); - } + else if (typeName == "mockac") + { + var props = JsonConvert.DeserializeObject(properties.ToString()); + return new AudioCodec.MockAC(key, name, props); + } + + else if (typeName.StartsWith("ciscospark")) + { + var comm = CommFactory.CreateCommForDevice(dc); + return new VideoCodec.Cisco.CiscoSparkCodec(dc, comm); + } else if (typeName == "zoomroom") { diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/SoftCodec/BlueJeansPc.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/SoftCodec/BlueJeansPc.cs new file mode 100644 index 00000000..462ae5cb --- /dev/null +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/SoftCodec/BlueJeansPc.cs @@ -0,0 +1,164 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +using PepperDash.Core; +using PepperDash.Essentials.Core; +using PepperDash.Essentials.Core.Routing; +using PepperDash.Essentials.Core.Devices; +using PepperDash.Essentials.Core.Config; + + +namespace PepperDash.Essentials.Devices.Common.SoftCodec +{ + public class BlueJeansPc : InRoomPc, IRoutingInputs, IRunRouteAction, IRoutingSinkNoSwitching + { + + public RoutingInputPort AnyVideoIn { get; private set; } + + #region IRoutingInputs Members + + public RoutingPortCollection InputPorts { get; private set; } + + #endregion + + public BlueJeansPc(string key, string name) + : base(key, name) + { + InputPorts = new RoutingPortCollection(); + InputPorts.Add(AnyVideoIn = new RoutingInputPort(RoutingPortNames.AnyVideoIn, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.None, 0, this)); + } + + #region IRunRouteAction Members + + public void RunRouteAction(string routeKey, string sourceListKey) + { + RunRouteAction(routeKey, sourceListKey, null); + } + + public void RunRouteAction(string routeKey, string sourceListKey, Action successCallback) + { + CrestronInvoke.BeginInvoke(o => + { + Debug.Console(1, this, "Run route action '{0}' on SourceList: {1}", routeKey, sourceListKey); + + 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; + } + + var item = dict[routeKey]; + + foreach (var route in item.RouteList) + { + DoRoute(route); + } + + // store the name and UI info for routes + if (item.SourceKey == "none") + { + CurrentSourceInfoKey = routeKey; + CurrentSourceInfo = null; + } + else if (item.SourceKey != null) + { + CurrentSourceInfoKey = routeKey; + CurrentSourceInfo = item; + } + + // report back when done + if (successCallback != null) + successCallback(); + }); + } + + #endregion + + /// + /// + /// + /// + /// + bool DoRoute(SourceRouteListItem route) + { + IRoutingSinkNoSwitching dest = null; + + 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); + } + return true; + } + + + + #region IHasCurrentSourceInfoChange Members + + public string CurrentSourceInfoKey { get; set; } + + /// + /// The SourceListItem last run - containing names and icons + /// + public SourceListItem CurrentSourceInfo + { + get { return _CurrentSourceInfo; } + set + { + if (value == _CurrentSourceInfo) return; + + 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(_CurrentSourceInfo, ChangeType.WillChange); + + _CurrentSourceInfo = value; + + // add to in-use tracking + if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking) + (_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control"); + if (handler != null) + handler(_CurrentSourceInfo, ChangeType.DidChange); + } + } + SourceListItem _CurrentSourceInfo; + + public event SourceInfoChangeHandler CurrentSourceChange; + + #endregion + } +} \ No newline at end of file