/// <summary> /// /// </summary> /// <param name="codec"></param> public VideoCodecBaseMessenger(string key, VideoCodecBase codec, string messagePath) : base(key, messagePath) { if (codec == null) { throw new ArgumentNullException("codec"); } Codec = codec; codec.CallStatusChange += new EventHandler <CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange); codec.IsReadyChange += new EventHandler <EventArgs>(codec_IsReadyChange); var dirCodec = codec as IHasDirectory; if (dirCodec != null) { dirCodec.DirectoryResultReturned += new EventHandler <DirectoryEventArgs>(dirCodec_DirectoryResultReturned); } var recCodec = codec as IHasCallHistory; if (recCodec != null) { recCodec.CallHistory.RecentCallsListHasChanged += new EventHandler <EventArgs>(CallHistory_RecentCallsListHasChanged); } }
public MockVCCamera(string key, string name, VideoCodecBase codec) : base(key, name) { Capabilities = eCameraCapabilities.Pan | eCameraCapabilities.Tilt | eCameraCapabilities.Zoom | eCameraCapabilities.Focus; ParentCodec = codec; }
/// <summary> /// Evaluates the call status and sets the icon mode and text label /// </summary> 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) { HeaderCallButtonIconSig.StringValue = "DND"; //HeaderCallButton.SetIcon(HeaderListButton.OnHook); } else if (codec.ActiveCalls.Any(c => c.Type == eCodecCallType.Video)) { HeaderCallButtonIconSig.StringValue = "Misc-06_Dark"; } //HeaderCallButton.SetIcon(HeaderListButton.Camera); //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 2); else { HeaderCallButtonIconSig.StringValue = "Misc-09_Dark"; } //HeaderCallButton.SetIcon(HeaderListButton.Phone); //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 1); // Set the call status text if (codec.ActiveCalls.Count > 0) { if (codec.ActiveCalls.Count == 1) { TriList.SetString(UIStringJoin.HeaderCallStatusLabel, "1 Active Call"); } else if (codec.ActiveCalls.Count > 1) { TriList.SetString(UIStringJoin.HeaderCallStatusLabel, string.Format("{0} Active Calls", codec.ActiveCalls.Count)); } } else { TriList.SetString(UIStringJoin.HeaderCallStatusLabel, "No Active Calls"); } }
/// <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); } }