diff --git a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs index 2926110b..ae348e62 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs @@ -43,6 +43,11 @@ namespace PepperDash.Essentials /// public string DefaultRoomKey { get; set; } + /// + /// Indicates that the SetHeaderButtons method has completed successfully + /// + public bool HeaderButtonsAreSetUp { get; private set; } + /// /// /// @@ -954,6 +959,8 @@ namespace PepperDash.Essentials /// void SetupHeaderButtons() { + HeaderButtonsAreSetUp = false; + TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true); var roomConf = CurrentRoom.Config; @@ -1093,7 +1100,11 @@ namespace PepperDash.Essentials TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, true); TriList.SetBool(UIBoolJoin.HeaderCallStatusRightPositionVisible, false); } - + + + HeaderButtonsAreSetUp = true; + + ComputeHeaderCallStatus(CurrentRoom.VideoCodec); } /// @@ -1101,6 +1112,18 @@ namespace PepperDash.Essentials /// public void ComputeHeaderCallStatus(VideoCodecBase codec) { + if (codec == null) + { + Debug.Console(1, "ComputeHeaderCallStatus() cannot execute. codec is null"); + return; + } + + if(HeaderCallButtonIconSig == null) + { + Debug.Console(1, "ComputeHeaderCallStatus() cannot execute. HeaderCallButtonIconSig is null"); + return; + } + // Set mode of header button if (!codec.IsInCall) { @@ -1433,9 +1456,11 @@ namespace PepperDash.Essentials { PepperDash.Essentials.Core.Touchpanels.Keyboards.HabaneroKeyboardController Keyboard { get; } JoinedSigInterlock PopupInterlock { get; } + EssentialsHuddleVtc1Room CurrentRoom { get; } void ShowNotificationRibbon(string message, int timeout); void HideNotificationRibbon(); void ComputeHeaderCallStatus(VideoCodecBase codec); + bool HeaderButtonsAreSetUp { get; } SubpageReferenceList MeetingOrContactMethodModalSrl { get; } /// /// Exposes the ability to switch into call mode diff --git a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 0b9459db..c416914f 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -80,7 +80,7 @@ namespace PepperDash.Essentials.UIDrivers.VC BoolFeedback SearchStringBackspaceVisibleFeedback; BoolFeedback CallSharingInfoVisibleFeedback; - StringFeedback CallSharingInfoTextFeedback; + //StringFeedback CallSharingInfoTextFeedback; ModalDialog IncomingCallModal; @@ -183,28 +183,21 @@ namespace PepperDash.Essentials.UIDrivers.VC CallSharingInfoVisibleFeedback = new BoolFeedback(() => Codec.SharingContentIsOnFeedback.BoolValue); codec.SharingContentIsOnFeedback.OutputChange += new EventHandler(SharingContentIsOnFeedback_OutputChange); CallSharingInfoVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.CallSharedSourceInfoVisible]); - - CallSharingInfoTextFeedback = new StringFeedback(() => GetCurrentSourceName(Codec.SharingSourceFeedback.StringValue)); - CallSharingInfoTextFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CallSharedSourceNameText]); + Parent.CurrentRoom.CurrentSingleSourceChange += new SourceInfoChangeHandler(CurrentRoom_CurrentSingleSourceChange); TriList.SetSigFalseAction(UIBoolJoin.CallStopSharingPress, Codec.StopSharing); } /// - /// Returns the name of the source that matches the specified key + /// Updates the current shared source label on the call list when the source changes /// - /// - /// - string GetCurrentSourceName(string key) + /// + /// + /// + void CurrentRoom_CurrentSingleSourceChange(EssentialsRoomBase room, SourceListItem info, ChangeType type) { - Debug.Console(1, "GetCurrentSource: Attempting to get device with key: {0}", key); - - var device = DeviceManager.GetDeviceForKey(key); - - if (device != null) - return (device as SourceListItem).Name; - else - return "None"; + if (Codec.SharingContentIsOnFeedback.BoolValue) + TriList.StringInput[UIStringJoin.CallSharedSourceNameText].StringValue = Parent.CurrentRoom.CurrentSourceInfo.PreferredName; } /// @@ -215,7 +208,15 @@ namespace PepperDash.Essentials.UIDrivers.VC void SharingContentIsOnFeedback_OutputChange(object sender, EventArgs e) { CallSharingInfoVisibleFeedback.FireUpdate(); - CallSharingInfoTextFeedback.FireUpdate(); + + string callListSharedSourceLabel; + + if (Codec.SharingContentIsOnFeedback.BoolValue) + callListSharedSourceLabel = Parent.CurrentRoom.CurrentSourceInfo.PreferredName; + else + callListSharedSourceLabel = "None"; + + TriList.StringInput[UIStringJoin.CallSharedSourceNameText].StringValue = callListSharedSourceLabel; } /// @@ -228,7 +229,8 @@ namespace PepperDash.Essentials.UIDrivers.VC TriList.SetString(UIStringJoin.RoomPhoneText, Codec.CodecInfo.PhoneNumber); TriList.SetString(UIStringJoin.RoomSipText, Codec.CodecInfo.SipUri); - Parent.ComputeHeaderCallStatus(Codec); + if(Parent.HeaderButtonsAreSetUp) + Parent.ComputeHeaderCallStatus(Codec); } ///