public MainWindow()
        {
            try
            {
                InitializeComponent();
            }
            catch (Exception ex)
            {
            }


            AddScaleListItems();

            AudioChest.spawnChest();

            InstrumentChest.getChest().Instrument = new FingeredInstrument();
            InstrumentChest.getChest().NoteAndPlayListeners.Add(this);

            GraphicsChest.getChest().NetytarDrawer = new NetytarDrawer(this.scrlNetytar);
            GraphicsChest.getChest().NetytarDrawer.generateNetytar();
            GraphicsChest.getChest().NetytarDrawer.drawLines(Scales.Cmaj, Colors.Red);
            GraphicsChest.getChest().NetytarDrawer.drawEllipses(Scales.Cmaj);

            GraphicsChest.getChest().WickiEyedenDrawer = new WickiEyedenDrawer(this.scrlWickiEyeden);
            GraphicsChest.getChest().WickiEyedenDrawer.generateWickiEyeden();

            InstrumentChest.getChest().WickiEyedenPlayMode = new WickiEyedenPlayWithGaze();

            GraphicsChest.getChest().RhythmFlasher = new RhythmFlasher(this.scrlNetytar, Colors.Bisque);

            // WpfEyeXChest.getChest().getBlinkProcessor().Listeners.Add(new ScaleBlinker("min", "maj"));
            WpfEyeXChest.getChest().getBlinkProcessor().Listeners.Add(new RepeatNoteWithDouble());
            //WpfEyeXChest.getChest().getBlinkProcessor().Listeners.Add(new PauseWithOneEye(Eyes.Left));
            lblBpm.Text = GraphicsChest.getChest().RhythmFlasher.Bpm.ToString();
        }
Exemple #2
0
        public NetytarButton() : base()
        {
            occluder                 = new Polygon();
            occluder.Stroke          = Brushes.Black;
            occluder.Fill            = Brushes.LightBlue;
            occluder.StrokeThickness = 1;

            Behavior.SetGazeAware(Occluder, true);
            Behavior.SetGazeAwareDelay(Occluder, WpfEyeXChest.getChest().GazeDelay);
            Behavior.AddHasGazeChangedHandler(Occluder, OnGaze);
        }
Exemple #3
0
        public void setBehavior()
        {
            Behavior.SetGazeAware(Occluder, true);
            Behavior.SetGazeAwareDelay(Occluder, WpfEyeXChest.getChest().GazeDelay);
            Behavior.AddHasGazeChangedHandler(Occluder, OnGaze);

            if (WpfEyeXChest.getChest().MouseEmulation)
            {
                Occluder.MouseEnter += Occluder_MouseEnter;
            }
        }
Exemple #4
0
        private void ListenMouse(object sender, EventArgs e)
        {
            if (WpfEyeXChest.getChest().MouseEmulation&& isOn)
            {
                lastGazePoint.X = GetMousePos().X - basePosition.X;
                lastGazePoint.Y = GetMousePos().Y - basePosition.Y;

                filter.push(lastGazePoint);

                lastMean = filter.getMean();

                Scroll();
            }
        }
Exemple #5
0
        public void activate()
        {
            WickiEyedenButton[,] buttons = GraphicsChest.getChest().WickiEyedenDrawer.Buttons;

            foreach (WickiEyedenButton button in buttons)
            {
                if (button != null)
                {
                    #region Behavior
                    Behavior.SetGazeAware(button, true);
                    Behavior.SetGazeAwareDelay(button, WpfEyeXChest.getChest().GazeDelay);
                    Behavior.AddHasGazeChangedHandler(button, button_OnGaze);
                    #endregion
                }
            }
        }
Exemple #6
0
        public AutoScroller(ScrollViewer scrollViewer, IFilter filter, int proportional)
        {
            this.proportional = proportional;
            this.filter       = filter;
            this.scrollViewer = scrollViewer;

            lastGazePoint = new Point();

            WpfEyeXChest.getChest().GazePointListener = this;
            basePosition = scrollViewer.PointToScreen(new Point(0, 0));

            viewerDimX = scrollViewer.ActualWidth;
            viewerDimY = scrollViewer.ActualHeight;
            areaDimX   = scrollViewer.ScrollableWidth;
            areaDimY   = scrollViewer.ScrollableHeight;

            Xratio = viewerDimX / areaDimX;
            Yratio = viewerDimY / areaDimY;
        }
Exemple #7
0
        public AutoScrollerCentered(int radiusThreshold, ScrollViewer scrollViewer, IFilter filter, int proportional)
        {
            this.radiusThreshold = radiusThreshold;
            this.filter          = filter;
            this.scrollViewer    = scrollViewer;
            this.proportional    = proportional;

            lastGazePoint = new Point();

            WpfEyeXChest.getChest().GazePointListener = this;
            basePosition = scrollViewer.PointToScreen(new Point(0, 0));

            scrollCenter = new Point(scrollViewer.ActualWidth / 2, scrollViewer.ActualHeight / 2);

            Timer timer = new Timer();

            timer.Interval = 1;
            timer.Tick    += ListenMouse;
            timer.Enabled  = true;
        }
Exemple #8
0
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     WpfEyeXChest.getChest().getEyeXHost().Dispose();
 }
Exemple #9
0
 public App()
 {
     WpfEyeXChest.getChest().getEyeXHost().Start();
 }