Added Corsair support as a plugin

This commit is contained in:
SpoinkyNL committed 2019-08-11 16:58:43 +02:00
1 parent 6e23c079b1
commit 8cd8b051f7
25 files changed
+302 -131

No files matched your search

@@ -19,6 +19,7 @@ namespace Artemis.Plugins.Modules.General
private readonly PluginSettings _settings;
private readonly RGBSurface _surface;
private Dictionary<Led, Color> _colors;
private double _circlePosition;
public GeneralModule(PluginInfo pluginInfo, IRgbService rgbService, PluginSettings settings) : base(pluginInfo)
{
@@ -28,8 +29,9 @@ namespace Artemis.Plugins.Modules.General
_surface = rgbService.Surface;
_colors = new Dictionary<Led, Color>();
rgbService.FinishedLoadedDevices += (sender, args) => PopulateColors();
rgbService.DeviceLoaded += (sender, args) => PopulateColors();
rgbService.DeviceReloaded += (sender, args) => PopulateColors();
var testSetting = _settings.GetSetting("TestSetting", DateTime.Now);
}
@@ -55,6 +57,14 @@ namespace Artemis.Plugins.Modules.General
public override void Render(double deltaTime, RGBSurface surface, Graphics graphics)
{
_circlePosition += deltaTime * 200;
if (_circlePosition > 500)
_circlePosition = -200;
var rect = new Rectangle((int) _circlePosition * 4, 0 , 200, 200);
graphics.FillEllipse(new SolidBrush(Color.Blue), rect);
return;
// Lets do this in the least performant way possible
foreach (var surfaceLed in _surface.Leds)
{
if (!_colors.ContainsKey(surfaceLed))