Example #1
0
        public static int startTracker()
        {
            var status = Globs.NO_STATUS;

            if (Globs.tracker == null || !Globs.tracker.IsStarted)
            {
                if (Globs.tracker != null)
                {
                    Globs.tracker.Dispose();
                }

                Globs.tracker = new EyeXHost();
                status        = startHost(Globs.tracker);
            }

            if (status != Globs.TRACKER_ACTIVATED && status != Globs.TRACKER_ENGINE_OUTDATED)
            {
                return(status);
            }

            if (gazeStream != null)
            {
                gazeStream.Dispose();
            }

            gazeStream = Globs.tracker.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);
            var gazeListener = new GazeListener();

            gazeStream.Next += (s, e) => gazeListener.onGazeChanged(s, e);

            return(Globs.TRACKER_ACTIVATED);
        }
Example #2
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose();

            SaveSettings();

            if (_lightlyFilteredGazePointDataProvider != null)
            {
                _lightlyFilteredGazePointDataProvider.Next -= NewGazePoint;
                _lightlyFilteredGazePointDataProvider.Dispose();
            }

            if (_host != null)
            {
                _host.Dispose();
            }

            if (_controllerEmulation != null)
            {
                _controllerEmulation.OnModifyState -= OnModifyControllerState;
                _controllerEmulation.Dispose();
            }

            if (_gazeVisualization != null)
            {
                _gazeVisualization.Dispose();
            }

            if (_foregroundWindowWatcher != null)
            {
                _foregroundWindowWatcher.Dispose();
            }
        }
Example #3
0
        public override void Stop()
        {
            gazeDataStream.Next -= GazeDataStreamOnNext;
            eyeDataStream.Next  -= EyeDataStreamOnNext;
            gazeDataStream.Dispose();
            eyeDataStream.Dispose();

            host.DisplaySizeChanged             -= HostOnDisplaySizeChanged;
            host.UserProfileNameChanged         -= HostOnUserProfileNameChanged;
            host.EyeTrackingDeviceStatusChanged -= HostOnEyeTrackingDeviceStatusChanged;
            host.UserPresenceChanged            -= HostOnUserPresenceChanged;
            host.Dispose();
        }
Example #4
0
 public void StopAllGazeDataStream()
 {
     SetGazeDataRecording(false, false, false);
     GazePointEvent = null;
     gazePointDataStream.Dispose();
     gazePointDataStream = null;
     FixationEvent       = null;
     fixationDataStream.Dispose();
     fixationDataStream = null;
     EyePositionEvent   = null;
     eyePositionDataStream.Dispose();
     eyePositionDataStream = null;
 }
Example #5
0
 public void Dispose()
 {
     gazeDataStream.Dispose();
     EyeXHost.Dispose();
 }
Example #6
0
 internal void Dispose()
 {
     eyePosStream.Dispose();
     lightlyFilteredGazeDataStream.Dispose();
     eyeXHost.Dispose();
 }
 private void StopEyeStream()
 {
     _lightlyFilteredGazeDataStream.Dispose();
     _eyeXHost.Dispose();
 }
Example #8
0
        private void ShutDown()
        {
            _shutDownRequestFlag = true;
            KeyDown -= OnKeyDown;
            Tick    -= OnTick;

            _shutDownRequestedEvent.WaitOne(100);
            Util.Log("Begin ShutDown");
            _settingsStorage.SaveSettings(_settings);

            //General
            RecordGameSessionEnded();

            if (_controlsProcessor != null)
            {
                _controlsProcessor.Dispose();
                _controlsProcessor = null;
            }

            //Window
            if (_foregroundWindowWatcher != null)
            {
                _foregroundWindowWatcher.Dispose();
                _foregroundWindowWatcher = null;
            }

            //Menu
            if (_settingsMenu != null)
            {
                _settingsMenu.ShutDownRequested -= SettingsMenuOnShutDownRequested;
                _settingsMenu = null;
            }

            //Gaze
            if (_lightlyFilteredGazePointDataProvider != null)
            {
                _lightlyFilteredGazePointDataProvider.Next -= NewGazePoint;
                _lightlyFilteredGazePointDataProvider.Dispose();
                _lightlyFilteredGazePointDataProvider = null;
            }

            if (_host != null)
            {
                _host.Dispose();
                _host = null;
            }

            //Features
            if (_aiming != null)
            {
                _aiming.Dispose();
                _aiming = null;
            }

            if (_freelook != null)
            {
                _freelook.Dispose();
                _freelook = null;
            }

            //Hids
            if (_controllerEmulation != null)
            {
                _controllerEmulation.Enabled = false;
                _controllerEmulation.RemoveHooks();
                _controllerEmulation = null;
            }
            Util.Log("End ShutDown");
        }
 public void Close_EyeTracker_Management()
 {
     lightlyFilteredGazeDataStream.Dispose();
     eyeXHost.Dispose();
 }