/// <summary> /// /// </summary> /// <param name="trilist"></param> /// <param name="parent"></param> public EssentialsHuddleTechPageDriver(BasicTriListWithSmartObject trilist, EssentialsRoomTechConfig config) : base(trilist) { Config = config; PagesInterlock = new JoinedSigInterlock(trilist); PagesInterlock.SetButDontShow(UIBoolJoin.TechSystemStatusVisible); trilist.SetSigFalseAction(UIBoolJoin.TechExitButton, Hide); MenuList = new SmartObjectDynamicList(trilist.SmartObjects[UISmartObjectJoin.TechMenuList], true, 3100); MenuList.SetFeedback(1, true); // initial fb ushort count = 0; MenuList.SetItemMainText(1, "System Status"); MenuList.SetItemButtonAction(1, b => { if (b) { PagesInterlock.ShowInterlocked(UIBoolJoin.TechSystemStatusVisible); } MenuList.SetFeedback(1, true); }); MenuList.SetItemMainText(2, "Display Controls"); MenuList.SetItemButtonAction(2, b => { if (b) { PagesInterlock.ShowInterlocked(UIBoolJoin.TechDisplayControlsVisible); } MenuList.SetFeedback(2, true); }); count = 2; // Don't show panel setup on iPad or xpanel if (TriList is Crestron.SimplSharpPro.DeviceSupport.TswFt5Button) { count++; MenuList.SetItemMainText(count, "Panel Setup"); MenuList.SetItemButtonAction(count, b => { if (b) { PagesInterlock.ShowInterlocked(UIBoolJoin.TechPanelSetupVisible); } MenuList.SetFeedback(count, true); }); } MenuList.Count = count; BuildStatusList(); BuildDisplayList(); SetupPinModal(); }
/// <summary> /// shows the appropriate keypad depending on mode and whether visible /// </summary> void ShowKeypad() { uint join = Codec.IsInCall ? UIBoolJoin.VCKeypadVisible : UIBoolJoin.VCKeypadWithFavoritesVisible; if (IsVisible) { VCControlsInterlock.ShowInterlocked(join); } else { VCControlsInterlock.SetButDontShow(join); } StagingButtonsFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingKeypadPress); }
/// <summary> /// /// </summary> /// <param name="triList"></param> /// <param name="codec"></param> public EssentialsVideoCodecUiDriver(BasicTriListWithSmartObject triList, IAVWithVCDriver parent, VideoCodecBase codec, EssentialsHeaderDriver headerDriver) : base(triList) { try { if (codec == null) { throw new ArgumentNullException("Codec cannot be null"); } Codec = codec; Parent = parent; HeaderDriver = headerDriver; SetupCallStagingPopover(); SetupDialKeypad(); ActiveCallsSRL = new SubpageReferenceList(triList, UISmartObjectJoin.CodecActiveCallsHeaderList, 5, 5, 5); SetupRecentCallsList(); SetupFavorites(); SetupLayoutControls(); codec.CallStatusChange += new EventHandler <CodecCallStatusItemChangeEventArgs>(Codec_CallStatusChange); // If the codec is ready, then get the values we want, otherwise wait if (Codec.IsReady) { Codec_IsReady(); } else { codec.IsReadyChange += (o, a) => Codec_IsReady(); } //InCall = new BoolFeedback(() => false); LocalPrivacyIsMuted = new BoolFeedback(() => false); VCControlsInterlock = new JoinedSigInterlock(triList); if (CodecHasFavorites) { VCControlsInterlock.SetButDontShow(UIBoolJoin.VCKeypadWithFavoritesVisible); } else { VCControlsInterlock.SetButDontShow(UIBoolJoin.VCKeypadVisible); } StagingBarsInterlock = new JoinedSigInterlock(triList); StagingBarsInterlock.SetButDontShow(UIBoolJoin.VCStagingInactivePopoverVisible); StagingButtonsFeedbackInterlock = new JoinedSigInterlock(triList); StagingButtonsFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingKeypadPress); // Return formatted when dialing, straight digits when in call DialStringFeedback = new StringFeedback(() => { if (KeypadMode == eKeypadMode.Dial) { return(GetFormattedDialString(DialStringBuilder.ToString())); } else { return(DialStringBuilder.ToString()); } }); DialStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CodecAddressEntryText]); DialStringBackspaceVisibleFeedback = new BoolFeedback(() => DialStringBuilder.Length > 0); DialStringBackspaceVisibleFeedback .LinkInputSig(triList.BooleanInput[UIBoolJoin.VCKeypadBackspaceVisible]); SearchStringFeedback = new StringFeedback(() => { if (SearchStringBuilder.Length > 0) { Parent.Keyboard.EnableGoButton(); return(SearchStringBuilder.ToString()); } else { Parent.Keyboard.DisableGoButton(); return("Tap for keyboard"); } }); SearchStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CodecDirectorySearchEntryText]); SetupDirectoryList(); SearchStringBackspaceVisibleFeedback = new BoolFeedback(() => SearchStringBuilder.Length > 0); SearchStringBackspaceVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.VCDirectoryBackspaceVisible]); triList.SetSigFalseAction(UIBoolJoin.VCDirectoryBackPress, GetDirectoryParentFolderContents); DirectoryBackButtonVisibleFeedback = (codec as IHasDirectory).CurrentDirectoryResultIsNotDirectoryRoot; DirectoryBackButtonVisibleFeedback .LinkInputSig(triList.BooleanInput[UIBoolJoin.VCDirectoryBackVisible]); triList.SetSigFalseAction(UIBoolJoin.VCKeypadTextPress, RevealKeyboard); triList.SetSigFalseAction(UIBoolJoin.VCDirectorySearchTextPress, RevealKeyboard); triList.SetSigHeldAction(UIBoolJoin.VCDirectoryBackspacePress, 500, StartSearchBackspaceRepeat, StopSearchBackspaceRepeat, SearchKeypadBackspacePress); } catch (Exception e) { Debug.Console(1, "Exception in VideoCodecUiDriver Constructor: {0}", e); } }
/// <summary> /// Handles status changes for calls /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void Codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e) { var call = e.CallItem; switch (e.CallItem.Status) { case eCodecCallStatus.Connected: // fire at SRL item KeypadMode = eKeypadMode.DTMF; DialStringBuilder.Remove(0, DialStringBuilder.Length); DialStringFeedback.FireUpdate(); DialStringTextCheckEnables(); Parent.ShowNotificationRibbon("Connected", 2000); StagingButtonsFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingKeypadPress); ShowKeypad(); ((Parent.CurrentRoom as IHasCurrentVolumeControls).CurrentVolumeControls as IBasicVolumeWithFeedback).MuteOff(); //VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCKeypadVisible); break; case eCodecCallStatus.Connecting: // fire at SRL item Parent.ShowNotificationRibbon("Connecting", 0); break; case eCodecCallStatus.Dialing: Parent.ShowNotificationRibbon("Connecting", 0); break; case eCodecCallStatus.Disconnected: if (IncomingCallModal != null) { IncomingCallModal.HideDialog(); } if (!Codec.IsInCall) { KeypadMode = eKeypadMode.Dial; // show keypad if we're in call UI mode ShowKeypad(); DialStringBuilder.Remove(0, DialStringBuilder.Length); DialStringFeedback.FireUpdate(); Parent.ShowNotificationRibbon("Disconnected", 2000); } break; case eCodecCallStatus.Disconnecting: break; case eCodecCallStatus.EarlyMedia: break; case eCodecCallStatus.Idle: break; case eCodecCallStatus.OnHold: break; case eCodecCallStatus.Preserved: break; case eCodecCallStatus.RemotePreserved: break; case eCodecCallStatus.Ringing: { // fire up a modal if (!Codec.CodecInfo.AutoAnswerEnabled && call.Direction == eCodecCallDirection.Incoming) { ShowIncomingModal(call); } break; } default: break; } TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue = (ushort)(Codec.IsInCall ? 1 : 0); uint stageJoin; if (Codec.IsInCall) { stageJoin = UIBoolJoin.VCStagingActivePopoverVisible; } else { stageJoin = UIBoolJoin.VCStagingInactivePopoverVisible; } if (IsVisible) { StagingBarsInterlock.ShowInterlocked(stageJoin); } else { StagingBarsInterlock.SetButDontShow(stageJoin); } HeaderDriver.ComputeHeaderCallStatus(Codec); // Update active call list UpdateHeaderActiveCallList(); }