diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index 754409a7..1440b82f 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -342,6 +342,7 @@ namespace PepperDash.Essentials this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight(); this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark(); + this.SourceListKey = PropertiesConfig.SourceListKey; this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem; this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100); diff --git a/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs b/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs index 5d9b9a2e..b7ce6b0b 100644 --- a/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs +++ b/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs @@ -162,9 +162,9 @@ namespace PepperDash.Essentials /// public const uint RoomMcUrl = 3908; /// - /// 3908 - The url for the mobile control QR Code image + /// 3909 - The url for the mobile control QR Code image /// - public const uint RoomMcWQrCodeUrl = 3909; + public const uint RoomMcQrCodeUrl = 3909; /// /// 3911 /// diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs b/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs index f7e1d5d4..635982d2 100644 --- a/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs +++ b/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs @@ -212,6 +212,7 @@ namespace PepperDash.Essentials "Tap Share to begin"; } + /// /// /// @@ -835,12 +836,22 @@ namespace PepperDash.Essentials if (_CurrentRoom == room) return; // Disconnect current (probably never called) + if (_CurrentRoom != null) + _CurrentRoom.ConfigChanged -= room_ConfigChanged; + room.ConfigChanged -= room_ConfigChanged; room.ConfigChanged += room_ConfigChanged; if (room.IsMobileControlEnabled) { StartPageVisibleJoin = UIBoolJoin.StartMCPageVisible; + UpdateMCJoins(room); + + if (_CurrentRoom != null) + _CurrentRoom.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged; + + room.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged; + room.MobileControlRoomBridge.UserCodeChanged += MobileControlRoomBridge_UserCodeChanged; } else { @@ -850,6 +861,18 @@ namespace PepperDash.Essentials RefreshCurrentRoom(room); } + void MobileControlRoomBridge_UserCodeChanged(object sender, EventArgs e) + { + UpdateMCJoins(_CurrentRoom); + } + + void UpdateMCJoins(EssentialsHuddleSpaceRoom room) + { + TriList.SetString(UIStringJoin.RoomMcUrl, room.MobileControlRoomBridge.McServerUrl); + TriList.SetString(UIStringJoin.RoomMcQrCodeUrl, room.MobileControlRoomBridge.QrCodeUrl); + TriList.SetString(UIStringJoin.RoomUserCode, room.MobileControlRoomBridge.UserCode); + } + /// /// Fires when room config of current room has changed. Meant to refresh room values to propegate any updates to UI /// diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs index a3919385..581d7e22 100644 --- a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs +++ b/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs @@ -969,12 +969,22 @@ namespace PepperDash.Essentials if (_CurrentRoom == room) return; // Disconnect current (probably never called) + if(_CurrentRoom != null) + _CurrentRoom.ConfigChanged -= room_ConfigChanged; + room.ConfigChanged -= room_ConfigChanged; room.ConfigChanged += room_ConfigChanged; if (room.IsMobileControlEnabled) { StartPageVisibleJoin = UIBoolJoin.StartMCPageVisible; + UpdateMCJoins(room); + + if (_CurrentRoom != null) + _CurrentRoom.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged; + + room.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged; + room.MobileControlRoomBridge.UserCodeChanged += MobileControlRoomBridge_UserCodeChanged; } else { @@ -984,6 +994,18 @@ namespace PepperDash.Essentials RefreshCurrentRoom(room); } + void MobileControlRoomBridge_UserCodeChanged(object sender, EventArgs e) + { + UpdateMCJoins(_CurrentRoom); + } + + void UpdateMCJoins(EssentialsHuddleVtc1Room room) + { + TriList.SetString(UIStringJoin.RoomMcUrl, room.MobileControlRoomBridge.McServerUrl); + TriList.SetString(UIStringJoin.RoomMcQrCodeUrl, room.MobileControlRoomBridge.QrCodeUrl); + TriList.SetString(UIStringJoin.RoomUserCode, room.MobileControlRoomBridge.UserCode); + } + /// /// Fires when room config of current room has changed. Meant to refresh room values to propegate any updates to UI /// diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs index 1d0f40ff..624d072f 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/EssentialsRoomBase.cs @@ -138,11 +138,16 @@ namespace PepperDash.Essentials.Core { if (RoomOccupancy != null) OnRoomOccupancyIsSet(); - - SetUpMobileControl(); }); } + public override bool CustomActivate() + { + SetUpMobileControl(); + + return base.CustomActivate(); + } + /// /// If mobile control is enabled, sets the appropriate properties /// @@ -152,12 +157,14 @@ namespace PepperDash.Essentials.Core var mcBridge = DeviceManager.GetDeviceForKey(mcBridgeKey); if (mcBridge == null) { - Debug.Console(1, this, "Mobile Control Bridge Not found for this room."); + Debug.Console(1, this, "*********************Mobile Control Bridge Not found for this room."); + IsMobileControlEnabled = false; return; } else { MobileControlRoomBridge = mcBridge as IMobileControlRoomBridge; + Debug.Console(1, this, "*********************Mobile Control Bridge found and enabled for this room"); IsMobileControlEnabled = true; } }