/// <summary> /// Starts the LED Manager in keyboard mode by default. Use <seealso cref="SetController"/> to further customize settings, especially for LED strips /// </summary> public LedManager() // by default starts in keyboard mode { lightController = RazerChromaController.Create(); InitLeds(LightingMode.Keyboard); KeyboardHookService.Init(); ProcessListenerService.ProcessInFocusChanged += OnProcessChanged; ProcessListenerService.Start(); ProcessListenerService.Register("League of Legends"); // Listen when league of legends is opened UpdateLEDDisplay(this, this.leds, preferredMode); }
/// <summary> /// Sets the light controller to be used /// </summary> public void SetController(LightControllerType type, int ledCount = 0, bool reverseOrder = false) { ((IDisposable)lightController).Dispose(); if (type == LightControllerType.LED_Strip) { lightController = SACNController.Create(); this.preferredMode = LightingMode.Line; } else if (type == LightControllerType.RazerChroma) { lightController = RazerChromaController.Create(); this.preferredMode = LightingMode.Keyboard; } RestartManager(this.preferredMode, ledCount, reverseOrder); }
/// <param name="ledCount">Number of lights in the LED strip</param> /// <param name="reverseOrder">Set to true if you want the lights to be reverse in order (i.e. Color for LED 0 will be applied to the last LED in the strip)</param> private void InitLeds(bool reverseOrder = false) { lightControllers.Add(RazerChromaController.Create()); lightControllers.Add(SACNController.Create(reverseOrder)); }