示例#1
0
    private void Start()
    {
        _host = EyeXHost.GetInstance();
        _host.Start();

        _originalRunInBackgroundState = Application.runInBackground;
    }
示例#2
0
        private void setupMainWindow()
        {
            DataContext = this;
            InitializeComponent();
            eyeXHost = new EyeXHost();
            eyeXHost.Start();

            var fixationData = eyeXHost.CreateFixationDataStream(FixationDataMode.Sensitive);
            var gazeData     = eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);

            fixationData.Next += fixTrack;
            gazeData.Next     += trackDot;

            if (ReceiverOn)
            {
                IPHostEntry ipHostInfo = Dns.GetHostByName(Dns.GetHostName());
                IPAddress   ipAddress  = ipHostInfo.AddressList[0];
                Receive_Status_Text.Text       = "Receiving Data at\nIP:" + ipAddress.ToString();
                Receive_Status_Text.Visibility = Visibility.Visible;
            }
            if (SenderOn)
            {
                SenderIP = defaultSenderIP;
                Share_Status_Text.Text       = "Sharing Data to\nIP:" + SenderIP.ToString();
                Share_Status_Text.Visibility = Visibility.Visible;
                communication_started_Sender = false;
            }
            setupTimer();
            //setupTask();
        }
示例#3
0
    private void Start()
    {
        _host = EyeXHost.GetInstance();
        _host.Start();

        _originalRunInBackgroundState = Application.runInBackground;
    }
 public void StartTobiiEyex()
 {
     eyexHost = new EyeXHost();
     eyexHost.Start();
     AddVisionDataListener();
     SetDisplaySizeByScreen();
 }
示例#5
0
 public TobiiGazeSource()
 {
     EyeXHost                  = new EyeXHost();
     GazePointDataStream       = EyeXHost.CreateGazePointDataStream(GazePointDataMode.Unfiltered);
     GazePointDataStream.Next += GazeData;
     EyeXHost.Start();
 }
示例#6
0
文件: Gaze.cs 项目: feugy/alfred
        /// <summary>
        /// Detect EyeX engine presence, and starts it to get gaze positions
        /// </summary>
        /// <param name="fps">Number of gaze positions expected per second</param>
        /// <exception cref="Exception">If EyeX engine is not installed or running</exception>
        public Gaze(int fps)
        {
            this.interpolated = duration * fps / 1000;
            this.Position     = Cursor.Position;
            positions         = new Queue <Point>(interpolated);

            // simple check of EyeX presence
            switch (EyeXHost.EyeXAvailability)
            {
            case EyeXAvailability.NotAvailable:
                throw new Exception("Please install the EyeX Engine");

            case EyeXAvailability.NotRunning:
                throw new Exception("Please make sure that the EyeX Engine is started");
            }

            Engine = new EyeXHost();
            // track display size
            Engine.ScreenBoundsChanged += (object s, EngineStateValue <Rect> e) => displaySize = e.Value;;
            // track gaze position to set cursor on it
            gazeStream       = Engine.CreateFixationDataStream(FixationDataMode.Sensitive);
            gazeStream.Next += OnGazeChange;
            // start the EyeX engine
            Engine.Start();
            displaySize = Engine.ScreenBounds.Value;

            // start timer
            timer          = new System.Timers.Timer(duration / interpolated);
            timer.Enabled  = true;
            timer.Elapsed += OnTick;
        }
示例#7
0
        public void Start()         //menyalakan Eyetracker dan mulai tracking
        {
            Host       = new EyeXHost();
            DataStream = Host.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);

            Host.Start();                               //mulai tracking mata
            DataStream.Next += SimpanPosisiMata;        //menyimpan data mata
        }
示例#8
0
        public void Start()
        {
            Host       = new EyeXHost();
            DataStream = Host.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);

            Host.Start();
            DataStream.Next += SimpanPosisiMata;
        }
示例#9
0
 public TobiiStreamPlayer()
 {
     eyeXHost = new EyeXHost();
     eyeXHost.Start();
     gazePoints   = new ConcurrentQueue <GazePointEventArgs>();
     fixations    = new ConcurrentQueue <FixationEventArgs>();
     eyePositions = new ConcurrentQueue <EyePositionEventArgs>();
 }
示例#10
0
        private void canvasloaded(object sender, RoutedEventArgs e)
        {
            double          screenheight = this.ActualHeight - SystemParameters.WindowNonClientFrameThickness.Top - SystemParameters.WindowNonClientFrameThickness.Bottom;
            double          screenwidth  = this.ActualWidth - SystemParameters.WindowNonClientFrameThickness.Left - SystemParameters.WindowNonClientFrameThickness.Right;
            SolidColorBrush blankbg      = new SolidColorBrush(Colors.LightGray);
            SolidColorBrush handle       = new SolidColorBrush(Colors.Gray);

            #region vertical heatmap setup (N/A)
            List <byte[, ]> colors = new List <byte[, ]>(3);
            colors.Add(new byte[, ] {
                { 0, 0, 255 }
            });
            colors.Add(new byte[, ] {
                { 255, 0, 0 }
            });
            colors.Add(new byte[, ] {
                { 0, 255, 0 }
            });

            ImageBrush[]  verticalheatmaps = new ImageBrush[inputFile.Length];
            List <double> freqs            = new List <double>(inputFile.Length);

            /*
             * if (inputFile.Length > 0)
             * {
             *  for (int c = 0; c < (inputFile.Length > 3 ? 3 : inputFile.Length); c++)
             *  {
             *      Tuple<int, WriteableBitmap> vert = createVerticalHeatmap(200, 2 * (int)screenheight, yCoords[c], numCoords[c], 4330, 2 * 13, colors[c], 55);
             *      //Tuple<int, WriteableBitmap> vert = createMultiHeatmap(200, 2 * (int)screenheight, yCoords, numCoords, 4330, 2 * 13, colors, 55);
             *      verticalheatmaps[c] = new ImageBrush(vert.Item2);
             *      freqs.Add(vert.Item1);
             *  }
             *
             *  double maxfreq = freqs.Max();
             *  for (int c = 0; c < (inputFile.Length > 3 ? 3 : inputFile.Length); c++)
             *  {
             *      freqs[c] = freqs[c] / maxfreq;
             *  }
             * }
             */
            #endregion

            scrollbar = new Scrollbar(15, 150, screenheight, screenwidth, 0.9, 100, bg, blankbg, handle, verticalheatmaps, freqs, canv, 1, wb, heatmap, pixels3d, allColors);
            recorder  = new Recorder(20, 5, 100, canv, recordingpath);

            eyeXHost = new EyeXHost();
            eyeXHost.Start();
            var gazeData = eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);
            gazeData.Next += newGazePoint;

            /* Set up and start timer for recording gaze every 10 milliseconds */
            dispatcherTimer          = new System.Windows.Threading.DispatcherTimer(System.Windows.Threading.DispatcherPriority.Render);
            dispatcherTimer.Tick    += new EventHandler(update);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 10);
            dispatcherTimer.Start();
        }
示例#11
0
        public webBro()
        {
            InitializeComponent();
            InitBrowser();

            synth.SetOutputToDefaultAudioDevice();
            synth.SpeakCompleted += synth_SpeakCompleted;

            rgx = new Regex(pattern);

            try
            {
                defaultStyle    = File.ReadAllText(".\\Data\\style.css");
                monochromeStyle = File.ReadAllText(".\\Data\\monochrome.css");
                style           = defaultStyle;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }

            eyeXHost = new EyeXHost();
            eyeXHost.Start();
            stream       = eyeXHost.CreateGazePointDataStream(Tobii.EyeX.Framework.GazePointDataMode.Unfiltered);
            stream.Next += (s, e) =>
            {
                setPos((int)e.X, (int)e.Y);
            };
            position       = eyeXHost.CreateEyePositionDataStream();
            position.Next += (s, e) =>
            {
                leftClose  = e.LeftEye.X == 0 && e.LeftEye.Y == 0;
                rightClose = e.RightEye.X == 0 && e.RightEye.Y == 0;
            };

            controller = new Controller();
            listener   = new LeapEventListener(this);
            controller.AddListener(listener);

            if (File.Exists("parameters.cfg"))
            {
                StreamReader sr = new StreamReader("parameters.cfg");
                fingerMove.Checked = sr.ReadLine() == "1";
                keyCheck.Checked   = sr.ReadLine() == "1";
                borderLeft         = float.Parse(sr.ReadLine());
                borderUp           = float.Parse(sr.ReadLine());
                borderRight        = float.Parse(sr.ReadLine());
                borderDown         = float.Parse(sr.ReadLine());
                sr.Close();

                if (borderLeft != -200)
                {
                    firstLeap = false;
                }
            }
        }
        private void StartEyeStream()
        {
            _eyeXHost = new EyeXHost();
            _lightlyFilteredGazeDataStream = _eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);
            _eyeXHost.Start();

            // Write the data to the console.
            _lightlyFilteredGazeDataStream.Next += gazeDataStreamNext;
            Console.WriteLine("Eyex setup");
        }
    public TobiiInteractionEngineTracker()
    {
        _host = new EyeXHost();
        _host.Start();
        _lightlyFilteredGazePointDataProvider = _host.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);
        _lightlyFilteredGazePointDataProvider.Next += NewGazePoint;

        AspectRatio = 16f / 9f;
        IsHeadTracking = false;
    }
示例#14
0
 public Form1()
 {
     eyeXHost.Start();
     fixation = eyeXHost.CreateFixationDataStream(FixationDataMode.Slow);
     InitializeComponent();
     pictureBox1.ImageLocation = @"..\a.png";
     pictureBox3.ImageLocation = @"..\c.png";
     pictureBox2.ImageLocation = @"..\b.png";
     fixation.Next            += fixationEventHandler;
 }
示例#15
0
        public EyeXDataCollector(DataType dataType, double instanceLength, String instanceClass)
        {
            this.dataType       = dataType;
            this.instanceLength = instanceLength;
            this.instanceClass  = instanceClass;

            collectedInstances = new List <Instance>();

            eyeXHost = new EyeXHost();
            eyeXHost.Start();
        }
示例#16
0
        private void InitEyeTracker()
        {
            // Initialize the EyeX Host
            _eyeXHost = new EyeXHost();
            _eyeXHost.Start();

            // Create a data stream object and listen to events.
            stream       = _eyeXHost.CreateGazePointDataStream(GazePointDataMode.Unfiltered);
            stream.Next += DrawCircleAtGazePoint;
            stream.Next += StoreGazePoint;
        }
示例#17
0
 public Form1()
 {
     //rec = new Record(true);
     InitializeComponent();
     comboBoxStimuli.SelectedItem = comboBoxStimuli.Items[0];
     speed       = 60000f / int.Parse(this.textBoxSpeed.Text);
     timer.Tick += new EventHandler(timer_Tick); // Everytime timer ticks, timer_Tick will be called
     eyeXHost.Start();
     bmpGaze = new Bitmap(pictureBoxGaze.Width, pictureBoxGaze.Height);
     comboBoxStimuli.SelectedItem  = comboBoxStimuli.Items[2];
     this.pictureBoxTexte.SizeMode = PictureBoxSizeMode.AutoSize;
 }
示例#18
0
        public Gta5EyeTracking()
        {
            _aspectRatio = 1;
            _host        = new EyeXHost();
            _host.Start();
            _lightlyFilteredGazePointDataProvider       = _host.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);
            _lightlyFilteredGazePointDataProvider.Next += NewGazePoint;

            _menuPool = new MenuPool();

            LoadSettings();
            _settingsMenu = new SettingsMenu(_menuPool, _settings);
            _settingsMenu.DeadzoneMenu.OnItemSelect += (m, item, indx) =>
            {
                if (indx == 0)
                {
                    _isDrawingDeadzone = true;
                }
                else
                {
                    _settings.Deadzones.RemoveAt(indx - 1);
                    _settingsMenu.DeadzoneMenu.RemoveItemAt(indx);
                    _settingsMenu.DeadzoneMenu.RefreshIndex();
                }
            };

            _gazeVisualization = new GazeVisualization();
            _debugOutput       = new DebugOutput();

            _aiming = new Aiming(_settings);

            _mouseEmulation      = new MouseEmulation();
            _controllerEmulation = new ControllerEmulation();
            _controllerEmulation.OnModifyState += OnModifyControllerState;
            _freelook = new Freelook(_controllerEmulation, _mouseEmulation, _settings);
            _pedestrianInteraction = new PedestrianInteraction();
            _radialMenu            = new RadialMenu(_controllerEmulation);

            _gazeStopwatch = new Stopwatch();
            _gazeStopwatch.Restart();

            _tickStopwatch = new Stopwatch();

            _foregroundWindowWatcher = new ForegroundWindowWatcher();
            _foregroundWindowWatcher.ForegroundWindowChanged += ForegroundWindowWatcherOnForegroundWindowChanged;
            _isWindowForeground = _foregroundWindowWatcher.IsWindowForeground();

            View.MenuTransitions = true;

            KeyDown += OnKeyDown;

            Tick += OnTick;
        }
示例#19
0
        public static void Main(string[] args)
        {
            var host = new EyeXHost();

            host.Start();
            Console.WriteLine("Current scale:" + GetWindowsScaling());
            Console.ReadKey();
            var gazePointDataStream = host.CreateGazePointDataStream(Tobii.EyeX.Framework.GazePointDataMode.Unfiltered);

            gazePointDataStream.Next += (s, e) => Console.WriteLine("X: {0} Y:{1}", e.X, e.Y);
            Console.ReadKey();
        }
示例#20
0
        public static void Main(string[] args)
        {
            switch (EyeXHost.EyeXAvailability)
            {
            case EyeXAvailability.NotAvailable:
                Console.WriteLine("This sample requires the EyeX Engine, but it isn't available.");
                Console.WriteLine("Please install the EyeX Engine and try again.");
                return;

            case EyeXAvailability.NotRunning:
                Console.WriteLine("This sample requires the EyeX Engine, but it isn't rnning.");
                Console.WriteLine("Please make sure that the EyeX Engine is started.");
                break;
            }

            using (var eyeXHost = new EyeXHost())
            {
                // Listen to state-changed events.
                eyeXHost.ScreenBoundsChanged            += (s, e) => Console.WriteLine("Screen Bounds in pixels (state-changed event): {0}", e);
                eyeXHost.DisplaySizeChanged             += (s, e) => Console.WriteLine("Display Size in millimeters (state-changed event): {0}", e);
                eyeXHost.EyeTrackingDeviceStatusChanged += (s, e) => Console.WriteLine("Eye tracking device status (state-changed event): {0}", e);
                eyeXHost.UserPresenceChanged            += (s, e) => Console.WriteLine("User presence (state-changed event): {0}", e);
                eyeXHost.UserProfileNameChanged         += (s, e) => Console.WriteLine("Active profile name (state-changed event): {0}", e);
                eyeXHost.ConfigurationStatusChanged     += (s, e) => Console.WriteLine("Configuration status is : {0}", e);

                // This state-changed event required EyeX Engine 1.4.
                eyeXHost.UserProfilesChanged += (s, e) => Console.WriteLine("User profile names (state-changed event): {0}", e);
                eyeXHost.GazeTrackingChanged += (s, e) => Console.WriteLine("Gaze tracking (state-changed event): {0}", e);

                // Start the EyeX host.
                eyeXHost.Start();
                eyeXHost.WaitUntilConnected(TimeSpan.FromSeconds(5));

                // First, let's display the current engine state. Because we're still in the
                // process of connecting to the engine, we might not get any valid state
                // information at this point.
                Console.WriteLine("Screen Bounds in pixels (initial value): {0}", eyeXHost.ScreenBounds);
                Console.WriteLine("Display Size in millimeters (initial value): {0}", eyeXHost.DisplaySize);
                Console.WriteLine("Eye tracking device status (initial value): {0}", eyeXHost.EyeTrackingDeviceStatus);
                Console.WriteLine("User presence (initial value): {0}", eyeXHost.UserPresence);
                Console.WriteLine("Active profile name (initial value): {0}", eyeXHost.UserProfileName);
                Console.WriteLine("Configuration status (initial value): {0}", eyeXHost.ConfigurationStatus);

                // This state requires EyeX Engine 1.4.
                Console.WriteLine("User profile names (initial value): {0}", eyeXHost.UserProfiles);
                Console.WriteLine("Gaze tracking (initial value): {0}", eyeXHost.GazeTracking);

                // Wait for the user to exit the application.
                Console.WriteLine("Listening for state changes, press any key to exit...");
                Console.ReadKey(true);
            }
        }
示例#21
0
 public Form1()
 {
     eyeXHost.Start();
     fixation = eyeXHost.CreateFixationDataStream(FixationDataMode.Slow);
     InitializeComponent();
     comboBox1.SelectedItem = comboBox1.Items[0];
     s.SelectVoice("Microsoft Zira Desktop");
     //bmp = new Bitmap(500, 500);
     //using (Graphics g = Graphics.FromImage(bmp))
     //{
     //    g.Clear(Color.White);
     //}
 }
示例#22
0
        /// <summary>
        /// Starts the EyeX host and waits for all profiles to become available.
        /// </summary>
        /// <param name="host">The host.</param>
        /// <param name="version">The engine version.</param>
        private static bool StartHost(EyeXHost host, out Version version)
        {
            // Start the host.
            host.Start();

            // Wait for the client to connect.
            if (!host.WaitUntilConnected(TimeSpan.FromSeconds(5)))
            {
                version = null;
                return(false);
            }

            // Get the engine version number.
            version = host.GetEngineVersion().Result;
            return(true);
        }
        void StartEyeTracking()
        {
            var eyeXHost = new EyeXHost();

            eyeXHost.Start();
            var stream = eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);

            Task.Run(async() =>
            {
                while (true)
                {
                    stream.Next += (s, t) => SetXY(t.X, t.Y);
                    await Task.Delay(1000);
                }
            });
        }
示例#24
0
    void Start()
    {
        _host = EyeXHost.GetInstance();
        _host.Start();

        _originalRunInBackgroundState = Application.runInBackground;

        // switch to external calibration tool
        timeCounter         = 0.0f;
        didStartCalibration = false;
        startingTime        = Time.deltaTime;

        this.textGO        = GameObject.Find("Text");
        this.textGOSkip    = GameObject.Find("Skip");
        this.textCountdown = GameObject.Find("Countdown");
    }
示例#25
0
        private void Eye()
        {
            using (var eyeXHost = new EyeXHost())
            {
                eyeXHost.Start();

                using (var stream = eyeXHost.CreateEyePositionDataStream())
                {
                    stream.Next += (s, e) =>
                    {
                        Console.SetCursorPosition(0, 0);

                        // Output information about the left eye.
                        Console.WriteLine("LEFT EYE");
                        Console.WriteLine("========");
                        Console.WriteLine("3D Position: ({0:0.0}, {1:0.0}, {2:0.0})                   ",
                                          e.LeftEye.X, e.LeftEye.Y, e.LeftEye.Z);
                        Console.WriteLine("Normalized : ({0:0.0}, {1:0.0}, {2:0.0})                   ",
                                          e.LeftEyeNormalized.X, e.LeftEyeNormalized.Y, e.LeftEyeNormalized.Z);

                        // Output information about the right eye.
                        Console.WriteLine();
                        Console.WriteLine("RIGHT EYE");
                        Console.WriteLine("=========");
                        Console.WriteLine("3D Position: {0:0.0}, {1:0.0}, {2:0.0}                   ",
                                          e.RightEye.X, e.RightEye.Y, e.RightEye.Z);
                        Console.WriteLine("Normalized : {0:0.0}, {1:0.0}, {2:0.0}                   ",
                                          e.RightEyeNormalized.X, e.RightEyeNormalized.Y, e.RightEyeNormalized.Z);
                    };

                    Console.SetCursorPosition(0, 12);
                    Console.WriteLine("");
                    Console.WriteLine("The 3D position consists of X,Y,Z coordinates expressed in millimeters");
                    Console.WriteLine("in relation to the center of the screen where the eye tracker is mounted.");
                    Console.WriteLine("\n");
                    Console.WriteLine("The normalized coordinates are expressed in relation to the track box,");
                    Console.WriteLine("i.e. the volume in which the eye tracker is theoretically able to track eyes.");
                    Console.WriteLine("- (0,0,0) represents the upper, right corner closest to the eye tracker.");
                    Console.WriteLine("- (1,1,1) represents the lower, left corner furthest away from the eye tracker.");
                    Console.WriteLine();
                    Console.WriteLine("---------------------------------------------------------");
                    Console.WriteLine("Listening for eye position data, press any key to exit...");

                    Console.In.Read();
                }
            }
        }
示例#26
0
        public bool Initialize()
        {
            if (_useFixationStream)
            {
                _eyeXHost.CreateFixationDataStream(FixationDataMode.Slow).Next += OnFixationPointNext;
            }
            else
            {
                _eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered).Next += OnGazePointNext;
            }

            _eyeXHost.Start();

            // TODO: Initialize needs to be replaced with an InitializeAsync to void
            // having to do this callback, waiting and semaphore dance.

            var initialized = false;

            var initialSemaphore = new SemaphoreSlim(0);

            void initialCallback(object s, EngineStateValue <EyeTrackingDeviceStatus> e)
            {
                switch (e.Value)
                {
                case EyeTrackingDeviceStatus.Configuring:
                case EyeTrackingDeviceStatus.Initializing:
                case EyeTrackingDeviceStatus.Tracking:
                case EyeTrackingDeviceStatus.TrackingPaused:
                    initialized = true;
                    initialSemaphore.Release();
                    break;

                case EyeTrackingDeviceStatus.DeviceNotConnected:
                    initialSemaphore.Release();
                    break;
                }
            }

            _eyeXHost.EyeTrackingDeviceStatusChanged += initialCallback;

            // Wait a bit for the tracking engine to initialize the device status
            initialSemaphore.Wait(1000);
            _eyeXHost.EyeTrackingDeviceStatusChanged -= initialCallback;

            return(initialized);
        }
示例#27
0
        public override Action Start()
        {
            host = new EyeXHost();
            host.Start();

            host.UserPresenceChanged            += HostOnUserPresenceChanged;
            host.EyeTrackingDeviceStatusChanged += HostOnEyeTrackingDeviceStatusChanged;
            host.UserProfileNameChanged         += HostOnUserProfileNameChanged;
            host.DisplaySizeChanged             += HostOnDisplaySizeChanged;

            gazeDataStream = host.CreateGazePointDataStream(GazePointDataMode.Unfiltered);
            eyeDataStream  = host.CreateEyePositionDataStream();

            gazeDataStream.Next += GazeDataStreamOnNext;
            eyeDataStream.Next  += EyeDataStreamOnNext;

            return(null);
        }
示例#28
0
 public Record(bool filteered, string filenameWithoutExtention, bool takeScreenshot)
 {
     this.takeScreenshot           = takeScreenshot;
     this.filenameWithoutExtention = filenameWithoutExtention;
     //Directory.CreateDirectory(filenameWithoutExtention + "_screenshots");
     eyeXHost.Start();
     if (filtered)
     {
         lightlyFilteredGazeDataStream = eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);
         gpdm = GazePointDataMode.LightlyFiltered;
     }
     else
     {
         gpdm = GazePointDataMode.Unfiltered;
         lightlyFilteredGazeDataStream = eyeXHost.CreateGazePointDataStream(GazePointDataMode.Unfiltered);
     }
     eyePosStream = eyeXHost.CreateEyePositionDataStream();
 }
示例#29
0
 private void Eyetracking()
 {
     Console.WriteLine("eyetracking");
     using (var eyeXHost = new EyeXHost())
     {
         eyeXHost.Start();
         using (var lightlyFilteredGazeDataStream = eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered))
         {
             lightlyFilteredGazeDataStream.Next += (s, e) =>
             {
                 Console.WriteLine("Gaze point at ({0:0.0}, {1:0.0}) @{2:0}", e.X, e.Y, e.Timestamp);
                 eyex = e.X;
                 eyey = e.Y;
             };
             Console.In.Read();
         }
     }
 }
示例#30
0
        public MainEngine()
        {
            sharedData     = SharedDataSingleton.Instance();
            _settingsList  = SettingsSingleton.Instance();
            inputSimulator = sharedData.inputSimulator;

            controlState = new ControlContext();
            controlState.changedState += StateChanged;
            controlState.ControlState  = new CommandState(inputSimulator, controlState);

            //System.Diagnostics.Process.Start("C:/Program Files (x86)/Nuance/NaturallySpeaking13/Program/natspeak.exe");

            SetupSpeechRecognition();

            //Instantiating and starting the eye tracker host
            eyex = new EyeXHost();
            eyex.CreateFixationDataStream(FixationDataMode.Sensitive).Next += (s, e) => Fixation(e.EventType, (int)e.X, (int)e.Y, e.Timestamp);
            eyex.Start();
        }
示例#31
0
        const int samplesHistorySize = sampleRate * 5; //keep most recent 5 second of gaze points

        public EyeXWarpPointer(int threshold)
        {
            samples        = new Point[samplesArraySize];
            samplesHistory = new List <Point>();
            warpThreshold  = threshold;


            if (!EyeXHost.IsStarted)
            {
                EyeXHost.Start(); // Start the EyeX host
            }

            //default is lightly filtered, just making it explicit
            gazeDataStream = EyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);
            if (gazeDataStream != null)
            {
                gazeDataStream.Next += UpdateGazePosition;
            }
        }
示例#32
0
        public MainWindow()
        {
            InitializeComponent();

            int    num      = 0;
            String currPath = path + name + num.ToString() + ext;

            while (File.Exists(currPath))
            {
                currPath = path + name + (num++).ToString() + ext;
            }
            tw = new StreamWriter(currPath);

            host = new EyeXHost();
            host.Start();
            var gazeData = host.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);

            gazeData.Next += newPoint;
        }
示例#33
0
 private void Start () 
 {
     _host = EyeXHost.GetInstance();
     _host.Start();
 }