private void OnProcessChanged(string name) { if (name == "League of Legends" && !(CurrentLEDModule is LeagueOfLegendsModule)) // TODO: Account for client disconnections { LEDModule lolModule = LeagueOfLegendsModule.Create(preferredMode, ledCount, ModuleOptions.ContainsKey("lol") ? ModuleOptions["lol"] : new Dictionary <string, string>()); lolModule.NewFrameReady += UpdateLEDDisplay; CurrentLEDModule = lolModule; } else if (name.Length == 0) { CurrentLEDModule = null; return; } }
/// <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> public LedManager(int ledCount, bool reverseOrder) { this.leds = new Led[ledCount]; for (int i = 0; i < this.leds.Length; i++) { this.leds[i] = new Led(); } this.reverseOrder = reverseOrder; LEDModule lolModule = LeagueOfLegendsModule.Create(ledCount); lolModule.NewFrameReady += UpdateLEDDisplay; UpdateLEDDisplay(this, this.leds); }
private void OnProcessChanged(string name, int pid) { if (name == "League of Legends" && !(CurrentLEDModule is LeagueOfLegendsModule)) // TODO: Account for client disconnections { LEDModule lolModule = LeagueOfLegendsModule.Create(ModuleOptions.ContainsKey("lol") ? ModuleOptions["lol"] : new Dictionary <string, string>()); lolModule.NewFrameReady += UpdateLEDDisplay; CurrentLEDModule = lolModule; } else if (name == "RocketLeague" && !(CurrentLEDModule is RocketLeagueModule)) // TODO: Account for client disconnections { LEDModule rlModule = RocketLeagueModule.Create(ModuleOptions.ContainsKey("rocketleague") ? ModuleOptions["rocketleague"] : new Dictionary <string, string>()); rlModule.NewFrameReady += UpdateLEDDisplay; CurrentLEDModule = rlModule; } else if (name.Length == 0) { if (!(CurrentLEDModule is BlinkWhiteModule)) // if we're not testing { CurrentLEDModule = null; } return; } }