mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Plugins - Added optional configuration window
Plugins - Moved plugins to their own directory Device providers - Added all RGB.NET device providers
This commit is contained in:
1 parent
13943f86a7
commit
9b62ba5f3d
752 files changed
+2198
-73
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.Msi;
|
||||
|
||||
namespace Artemis.Plugins.Devices.Msi
|
||||
{
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class MsiDeviceProvider : DeviceProvider
|
||||
{
|
||||
private readonly IRgbService _rgbService;
|
||||
|
||||
public MsiDeviceProvider(PluginInfo pluginInfo, IRgbService rgbService) : base(pluginInfo, RGB.NET.Devices.Msi.MsiDeviceProvider.Instance)
|
||||
{
|
||||
_rgbService = rgbService;
|
||||
}
|
||||
|
||||
public override void EnablePlugin()
|
||||
{
|
||||
PathHelper.ResolvingAbsolutePath += (sender, args) => ResolveAbsolutePath(typeof(MsiRGBDevice<>), sender, args);
|
||||
RGB.NET.Devices.Msi.MsiDeviceProvider.PossibleX64NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x64", "MysticLight_SDK.dll"));
|
||||
RGB.NET.Devices.Msi.MsiDeviceProvider.PossibleX86NativePaths.Add(Path.Combine(PluginInfo.Directory.FullName, "x86", "MysticLight_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
|
||||
// MsiDeviceProvider.Instance.ResetDevices();
|
||||
// MsiDeviceProvider.Instance.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user