Added rudimentary Wooting support

This commit is contained in:
SpoinkyNL committed 2019-12-13 09:59:50 +01:00
1 parent 4b805399c8
commit 41fe2a5ea2
13 files changed
+822 -5

No files matched your search

@@ -0,0 +1,40 @@
using System.IO;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Models;
using Artemis.Core.Services.Interfaces;
using RGB.NET.Core;
using RGB.NET.Devices.Wooting.Generic;
namespace Artemis.Plugins.Devices.Wooting
{
// ReSharper disable once UnusedMember.Global
public class WootingDeviceProvider : DeviceProvider
{
private readonly IRgbService _rgbService;
public WootingDeviceProvider(PluginInfo pluginInfo, IRgbService rgbService) : base(pluginInfo, RGB.NET.Devices.Wooting.WootingDeviceProvider.Instance)
{
_rgbService = rgbService;
}
public override void EnablePlugin()
{
PathHelper.ResolvingAbsolutePath += (sender, args) => ResolveAbsolutePath(typeof(WootingRGBDevice<>), sender, args);
RGB.NET.Devices.Wooting.WootingDeviceProvider.PossibleX64NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x64", "wooting-rgb-sdk64.dll"));
RGB.NET.Devices.Wooting.WootingDeviceProvider.PossibleX86NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x86", "wooting-rgb-sdk.dll"));
_rgbService.AddDeviceProvider(RgbDeviceProvider);
}
public override void DisablePlugin()
{
// TODO: Remove the device provider from the surface
}
public override void Dispose()
{
// TODO: This will probably not go well without first removing the device provider
// WootingDeviceProvider.Instance.ResetDevices();
// WootingDeviceProvider.Instance.Dispose();
}
}
}