Represents a ledgroup containing arbitrary LEDs.
Inheritance: AbstractLedGroup
Esempio n. 1
0
        public void Run()
        {
            CueSDK.UpdateMode = UpdateMode.Continuous;
            // Add a black background. We want this to be semi-transparent to add some sort of fade-effect - this will smooth everything out a bit
            // Note that this isn't a 'real effect' since it's update-rate dependent. A real effect would do always the same thing not mather how fast the keyboard updates.
            _keyboard.Brush = new SolidColorBrush(new CorsairColor(96, 0, 0, 0));
            // Add our song-beat-effect. Remember to uncomment the update in the spectrum effect if you want to remove this.
            ListLedGroup songBeatGroup = new ListLedGroup(_keyboard, _keyboard);
            songBeatGroup.Brush = new SolidColorBrush(new CorsairColor(127, 164, 164, 164));
            songBeatGroup.Brush.AddEffect(new SongBeatEffect(_soundDataProcessor));

            // Add our spectrum-effect using the soundDataProcessor and a rainbow from purple to red as gradient
            ListLedGroup spectrumGroup = new ListLedGroup(_keyboard, _keyboard);
            spectrumGroup.Brush = new AudioSpectrumBrush(_soundDataProcessor, new RainbowGradient(300, -14));

            // Hook onto the keyboard update and process data
            _keyboard.Updating += (sender, args) => _soundDataProcessor.Process();

            // If you don't like rainbows replace the gradient with anything you like. For example:
            //_keyboard.AttachEffect(new AudioSpectrumEffect(_soundDataProcessor, new LinearGradient(new GradientStop(0f, Color.Blue), new GradientStop(1f, Color.Red))));

            // We need something to block since the keyboard-effect-update-loop is running async and the console-app would exit otherwise.
            Console.WriteLine("Press any key to exit ...");
            Console.ReadKey();
        }
Esempio n. 2
0
        private static void AddTestBrush(ICueDevice device, IBrush brush)
        {
            if (device == null) return;

            device.Brush = (SolidColorBrush)Color.Black;
            ILedGroup leds = new ListLedGroup(device, device);
            leds.Brush = brush;
        }