private void CreateSelectionProgressSubscription(SelectionModes mode) { Log.DebugFormat("Creating subscription to {0} SelectionTriggerSource for progress info.", SelectionMode); ITriggerSource selectionTriggerSource = null; switch (mode) { case SelectionModes.Key: selectionTriggerSource = keySelectionTriggerSource; break; case SelectionModes.Point: selectionTriggerSource = pointSelectionTriggerSource; break; } if (selectionTriggerSource != null) { selectionProgressSubscription = selectionTriggerSource.Sequence .Where(ts => ts.Progress != null) .DistinctUntilChanged() .ObserveOnDispatcher() .Subscribe(ts => { PublishSelectionProgress(new Tuple<PointAndKeyValue?, double>(ts.PointAndKeyValue, ts.Progress.Value)); }); } }
private void CreateSelectionProgressSubscription(SelectionModes mode) { Log.DebugFormat("Creating subscription to {0} SelectionTriggerSource for progress info.", SelectionMode); ITriggerSource selectionTriggerSource = null; switch (mode) { case SelectionModes.Key: selectionTriggerSource = keySelectionTriggerSource; break; case SelectionModes.Point: selectionTriggerSource = pointSelectionTriggerSource; break; } if (selectionTriggerSource != null) { selectionProgressSubscription = selectionTriggerSource.Sequence .Where(ts => ts.Progress != null) .DistinctUntilChanged() .ObserveOnDispatcher() .Subscribe(ts => { PublishSelectionProgress(new Tuple <PointAndKeyValue?, double>(ts.PointAndKeyValue, ts.Progress.Value)); }); } }
public InputService( IKeyStateService keyStateService, IDictionaryService dictionaryService, IAudioService audioService, ICapturingStateManager capturingStateManager, IPointSource pointSource, ITriggerSource keySelectionTriggerSource, ITriggerSource pointSelectionTriggerSource) { this.keyStateService = keyStateService; this.dictionaryService = dictionaryService; this.audioService = audioService; this.capturingStateManager = capturingStateManager; this.pointSource = pointSource; this.keySelectionTriggerSource = keySelectionTriggerSource; this.pointSelectionTriggerSource = pointSelectionTriggerSource; //Fixation key triggers also need the enabled state info var fixationTrigger = keySelectionTriggerSource as IFixationTriggerSource; if (fixationTrigger != null) { fixationTrigger.KeyEnabledStates = keyStateService.KeyEnabledStates; } }
private void CreateSelectionSubscriptions(SelectionModes mode) { Log.DebugFormat("Creating subscription to {0} SelectionTriggerSource for selections & results.", SelectionMode); switch (mode) { case SelectionModes.Key: selectionTriggerSource = keySelectionTriggerSource; break; case SelectionModes.Point: selectionTriggerSource = pointSelectionTriggerSource; break; } if (eyeGestureTriggerSource != null) { eyeGestureTriggerSubscription = eyeGestureTriggerSource.Sequence .ObserveOnDispatcher() .Subscribe(ProcessSelectionTrigger); } if (selectionTriggerSource != null) { selectionTriggerSubscription = selectionTriggerSource.Sequence .ObserveOnDispatcher() .Subscribe(ProcessSelectionTrigger); } }
public InputService( IKeyStateService keyStateService, IDictionaryService dictionaryService, IAudioService audioService, ICapturingStateManager capturingStateManager, IPointSource pointSource, ITriggerSource eyeGestureTriggerSource, ITriggerSource keySelectionTriggerSource, ITriggerSource pointSelectionTriggerSource) { this.keyStateService = keyStateService; this.dictionaryService = dictionaryService; this.audioService = audioService; this.capturingStateManager = capturingStateManager; this.pointSource = pointSource; this.eyeGestureTriggerSource = eyeGestureTriggerSource; this.keySelectionTriggerSource = keySelectionTriggerSource; this.pointSelectionTriggerSource = pointSelectionTriggerSource; //Fixation key triggers also need the enabled state info and override times if (keySelectionTriggerSource is IFixationTriggerSource fixationTrigger) { fixationTrigger.KeyEnabledStates = keyStateService.KeyEnabledStates; OverrideTimesByKey = fixationTrigger.OverrideTimesByKey; } }
public InputService( IPointSource pointSource, ITriggerSource keySelectionTriggerSource) { this.pointSource = pointSource; this.keySelectionTriggerSource = keySelectionTriggerSource; }
private void CreateSelectionSubscriptions(SelectionModes mode) { Log.DebugFormat("Creating subscription to {0} SelectionTriggerSource for selections & results.", SelectionMode); switch (mode) { case SelectionModes.Key: selectionTriggerSource = keySelectionTriggerSource; break; case SelectionModes.Point: selectionTriggerSource = pointSelectionTriggerSource; break; } if (selectionTriggerSource != null) { selectionTriggerSubscription = selectionTriggerSource.Sequence .ObserveOnDispatcher() .Subscribe(ProcessSelectionTrigger); } }