public void Execute(LedStrip strip)
 {
     int highlight = (strip.GetNumLeds() - 1) * Cursor.Position.X / width;
     Pixel[] pixels = strip.GetPixelArray();
     effect.Apply(pixels);
     pixels[119 - highlight] = effect.CreatePixel(new StaticColor(Color.White));
     strip.OutputPixels(pixels);
 }
        public ProgramContext(MainForm form)
        {
            mainForm = form;
            mainForm.SetContext(this);
            form.FormClosed += new FormClosedEventHandler(this.Exit);

            LibMpsse.Init();
            spiOutput = new SPIOutput();
            ledStrip = new LedStrip(spiOutput, 120);
            Debug.WriteLine("Initialized");

            timer = new Timer();
            timer.Interval = 25;
            timer.Tick += new EventHandler(this.Tick);
            timer.Start();

            form.SetLedStrip(ledStrip);
            form.Show();
        }
Ejemplo n.º 3
0
 public void Execute(LedStrip strip)
 {
     Pixel[] array = strip.GetPixelArray();
     effect.Apply(array);
     strip.OutputPixels(array);
 }
Ejemplo n.º 4
0
 public void SetLedStrip(LedStrip strip)
 {
     solidColor = new SolidColor();
     mouseFollower = new MouseFollower();
 }