mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-12 17:48:31 +00:00
Removed legacy Asus-Project
This commit is contained in:
parent
0907a78efc
commit
074fcc8203
@ -1,280 +0,0 @@
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using System.Runtime.InteropServices;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Devices.Asus.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a device provider responsible for Cooler Master devices.
|
||||
/// </summary>
|
||||
[Obsolete("Use this only if you need syncback-capability")]
|
||||
public class AsusDeviceProvider : IRGBDeviceProvider
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private static AsusDeviceProvider _instance;
|
||||
/// <summary>
|
||||
/// Gets the singleton <see cref="AsusDeviceProvider"/> instance.
|
||||
/// </summary>
|
||||
public static AsusDeviceProvider Instance => _instance ?? new AsusDeviceProvider();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a modifiable list of paths used to find the native SDK-dlls for x86 applications.
|
||||
/// The first match will be used.
|
||||
/// </summary>
|
||||
public static List<string> PossibleX86NativePaths { get; } = new List<string> { "x86/AURA_SDK.dll" };
|
||||
|
||||
/// <summary>
|
||||
/// Gets a modifiable list of paths used to find the native SDK-dlls for x64 applications.
|
||||
/// The first match will be used.
|
||||
/// </summary>
|
||||
public static List<string> PossibleX64NativePaths { get; } = new List<string> { };
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Indicates if the SDK is initialized and ready to use.
|
||||
/// </summary>
|
||||
public bool IsInitialized { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the loaded architecture (x64/x86).
|
||||
/// </summary>
|
||||
public string LoadedArchitecture => _AsusSDK.LoadedArchitecture;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets whether the application has exclusive access to the SDK or not.
|
||||
/// </summary>
|
||||
public bool HasExclusiveAccess { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<IRGBDevice> Devices { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a function to get the culture for a specific device.
|
||||
/// </summary>
|
||||
// ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global
|
||||
public Func<CultureInfo> GetCulture { get; set; } = CultureHelper.GetCurrentCulture;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="DeviceUpdateTrigger"/> used to trigger the updates for asus devices.
|
||||
/// </summary>
|
||||
public DeviceUpdateTrigger UpdateTrigger { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AsusDeviceProvider"/> class.
|
||||
/// </summary>
|
||||
/// <exception cref="InvalidOperationException">Thrown if this constructor is called even if there is already an instance of this class.</exception>
|
||||
public AsusDeviceProvider()
|
||||
{
|
||||
if (_instance != null) throw new InvalidOperationException($"There can be only one instance of type {nameof(AsusDeviceProvider)}");
|
||||
_instance = this;
|
||||
|
||||
UpdateTrigger = new DeviceUpdateTrigger();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Initialize(RGBDeviceType loadFilter = RGBDeviceType.All, bool exclusiveAccessIfPossible = false, bool throwExceptions = false)
|
||||
{
|
||||
IsInitialized = false;
|
||||
|
||||
try
|
||||
{
|
||||
UpdateTrigger?.Stop();
|
||||
|
||||
_AsusSDK.Reload();
|
||||
|
||||
IList<IRGBDevice> devices = new List<IRGBDevice>();
|
||||
|
||||
#region Mainboard
|
||||
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Mainboard))
|
||||
try
|
||||
{
|
||||
//TODO DarthAffe 26.11.2017: This is not a fix! There might really be a second controller on the mainboard, but for now this should prevent the random crash for some guys.
|
||||
// DarthAffe 26.11.2017: https://rog.asus.com/forum/showthread.php?97754-Access-Violation-Wrong-EnumerateMB-Result&p=688901#post688901
|
||||
int mainboardCount = Math.Min(1, _AsusSDK.EnumerateMbController(IntPtr.Zero, 0));
|
||||
if (mainboardCount > 0)
|
||||
{
|
||||
IntPtr mainboardHandles = Marshal.AllocHGlobal(mainboardCount * IntPtr.Size);
|
||||
_AsusSDK.EnumerateMbController(mainboardHandles, mainboardCount);
|
||||
|
||||
for (int i = 0; i < mainboardCount; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
IntPtr handle = Marshal.ReadIntPtr(mainboardHandles, i);
|
||||
_AsusSDK.SetMbMode(handle, 1);
|
||||
AsusMainboardRGBDevice device = new AsusMainboardRGBDevice(new AsusMainboardRGBDeviceInfo(RGBDeviceType.Mainboard, handle));
|
||||
device.Initialize(UpdateTrigger);
|
||||
devices.Add(device);
|
||||
}
|
||||
catch { if (throwExceptions) throw; }
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { if (throwExceptions) throw; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Graphics cards
|
||||
|
||||
//TODO DarthAffe 21.10.2017: This somehow returns non-existant gpus (at least for me) which cause huge lags (if a real asus-ready gpu is connected this doesn't happen)
|
||||
|
||||
if (loadFilter.HasFlag(RGBDeviceType.GraphicsCard))
|
||||
try
|
||||
{
|
||||
int graphicCardCount = _AsusSDK.EnumerateGPU(IntPtr.Zero, 0);
|
||||
if (graphicCardCount > 0)
|
||||
{
|
||||
IntPtr grapicsCardHandles = Marshal.AllocHGlobal(graphicCardCount * IntPtr.Size);
|
||||
_AsusSDK.EnumerateGPU(grapicsCardHandles, graphicCardCount);
|
||||
|
||||
for (int i = 0; i < graphicCardCount; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
IntPtr handle = Marshal.ReadIntPtr(grapicsCardHandles, i);
|
||||
_AsusSDK.SetGPUMode(handle, 1);
|
||||
AsusGraphicsCardRGBDevice device = new AsusGraphicsCardRGBDevice(new AsusGraphicsCardRGBDeviceInfo(RGBDeviceType.GraphicsCard, handle));
|
||||
device.Initialize(UpdateTrigger);
|
||||
devices.Add(device);
|
||||
}
|
||||
catch { if (throwExceptions) throw; }
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { if (throwExceptions) throw; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region DRAM
|
||||
|
||||
//TODO DarthAffe 29.10.2017: I don't know why they are even documented, but the asus guy said they aren't in the SDK right now.
|
||||
//try
|
||||
//{
|
||||
//int dramCount = _AsusSDK.EnumerateDram(IntPtr.Zero, 0);
|
||||
//if (dramCount > 0)
|
||||
//{
|
||||
// IntPtr dramHandles = Marshal.AllocHGlobal(dramCount * IntPtr.Size);
|
||||
// _AsusSDK.EnumerateDram(dramHandles, dramCount);
|
||||
|
||||
// for (int i = 0; i < dramCount; i++)
|
||||
// {
|
||||
//try
|
||||
//{
|
||||
// IntPtr handle = Marshal.ReadIntPtr(dramHandles, i);
|
||||
// _AsusSDK.SetDramMode(handle, 1);
|
||||
// AsusDramRGBDevice device = new AsusDramRGBDevice(new AsusDramRGBDeviceInfo(RGBDeviceType.DRAM, handle));
|
||||
// device.Initialize(UpdateTrigger);
|
||||
// devices.Add(device);
|
||||
// }
|
||||
//catch { if (throwExceptions) throw; }
|
||||
// }
|
||||
//}
|
||||
//}
|
||||
// catch { if (throwExceptions) throw; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Keyboard
|
||||
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Keyboard))
|
||||
try
|
||||
{
|
||||
IntPtr keyboardHandle = Marshal.AllocHGlobal(IntPtr.Size);
|
||||
if (_AsusSDK.CreateClaymoreKeyboard(keyboardHandle))
|
||||
{
|
||||
_AsusSDK.SetClaymoreKeyboardMode(keyboardHandle, 1);
|
||||
AsusKeyboardRGBDevice device = new AsusKeyboardRGBDevice(new AsusKeyboardRGBDeviceInfo(RGBDeviceType.Keyboard, keyboardHandle, GetCulture()));
|
||||
device.Initialize(UpdateTrigger);
|
||||
devices.Add(device);
|
||||
}
|
||||
}
|
||||
catch { if (throwExceptions) throw; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mouse
|
||||
|
||||
if (loadFilter.HasFlag(RGBDeviceType.Mouse))
|
||||
try
|
||||
{
|
||||
IntPtr mouseHandle = Marshal.AllocHGlobal(IntPtr.Size);
|
||||
if (_AsusSDK.CreateRogMouse(mouseHandle))
|
||||
{
|
||||
_AsusSDK.SetRogMouseMode(mouseHandle, 1);
|
||||
AsusMouseRGBDevice device = new AsusMouseRGBDevice(new AsusMouseRGBDeviceInfo(RGBDeviceType.Mouse, mouseHandle));
|
||||
device.Initialize(UpdateTrigger);
|
||||
devices.Add(device);
|
||||
}
|
||||
}
|
||||
catch { if (throwExceptions) throw; }
|
||||
|
||||
#endregion
|
||||
|
||||
UpdateTrigger?.Start();
|
||||
|
||||
Devices = new ReadOnlyCollection<IRGBDevice>(devices);
|
||||
IsInitialized = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (throwExceptions)
|
||||
throw;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void ResetDevices()
|
||||
{
|
||||
foreach (IRGBDevice device in Devices)
|
||||
{
|
||||
AsusRGBDeviceInfo deviceInfo = (AsusRGBDeviceInfo)device.DeviceInfo;
|
||||
switch (deviceInfo.DeviceType)
|
||||
{
|
||||
case RGBDeviceType.Mainboard:
|
||||
_AsusSDK.SetMbMode(deviceInfo.Handle, 0);
|
||||
break;
|
||||
case RGBDeviceType.GraphicsCard:
|
||||
_AsusSDK.SetGPUMode(deviceInfo.Handle, 0);
|
||||
break;
|
||||
//case RGBDeviceType.DRAM:
|
||||
// _AsusSDK.SetDramMode(deviceInfo.Handle, 0);
|
||||
// break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
try { UpdateTrigger?.Dispose(); }
|
||||
catch { /* at least we tried */ }
|
||||
|
||||
try { _AsusSDK.UnloadAsusSDK(); }
|
||||
catch { /* at least we tried */ }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a device provider loaded used to dynamically load asus devices into an application.
|
||||
/// </summary>
|
||||
public class AsusDeviceProviderLoader : IRGBDeviceProviderLoader
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool RequiresInitialization => false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public IRGBDeviceProvider GetDeviceProvider() => AsusDeviceProvider.Instance;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
//using RGB.NET.Core;
|
||||
//using RGB.NET.Devices.Asus.Native;
|
||||
|
||||
//namespace RGB.NET.Devices.Asus
|
||||
//{
|
||||
// /// <inheritdoc />
|
||||
// /// <summary>
|
||||
// /// Represents a Asus dram.
|
||||
// /// </summary>
|
||||
// public class AsusDramRGBDevice : AsusRGBDevice
|
||||
// {
|
||||
// #region Properties & Fields
|
||||
|
||||
// /// <summary>
|
||||
// /// Gets information about the <see cref="AsusDramRGBDevice"/>.
|
||||
// /// </summary>
|
||||
// public AsusDramRGBDeviceInfo DramDeviceInfo { get; }
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Constructors
|
||||
|
||||
// /// <inheritdoc />
|
||||
// /// <summary>
|
||||
// /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusDramRGBDevice" /> class.
|
||||
// /// </summary>
|
||||
// /// <param name="info">The specific information provided by Asus for the DRAM.</param>
|
||||
// internal AsusDramRGBDevice(AsusDramRGBDeviceInfo info)
|
||||
// : base(info)
|
||||
// {
|
||||
// this.DramDeviceInfo = info;
|
||||
// }
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Methods
|
||||
|
||||
// /// <inheritdoc />
|
||||
// protected override void InitializeLayout()
|
||||
// {
|
||||
// //TODO DarthAffe 21.10.2017: Look for a good default layout
|
||||
// int ledCount = _AsusSDK.GetGPULedCount(DramDeviceInfo.Handle);
|
||||
// for (int i = 0; i < ledCount; i++)
|
||||
// InitializeLed(new AsusLedId(this, AsusLedIds.DramLed1 + i, i), new Rectangle(i * 10, 0, 10, 10));
|
||||
|
||||
// //TODO DarthAffe 21.10.2017: We don't know the model, how to save layouts and images?
|
||||
// ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Drams\{DramDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
|
||||
// null, PathHelper.GetAbsolutePath(@"Images\Asus\Drams"));
|
||||
// }
|
||||
|
||||
// /// <inheritdoc />
|
||||
// protected override void ApplyColorData() => _AsusSDK.SetDramColor(DramDeviceInfo.Handle, ColorData);
|
||||
|
||||
// #endregion
|
||||
// }
|
||||
//}
|
||||
@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Asus.AsusDramRGBDevice" />.
|
||||
/// </summary>
|
||||
public class AsusDramRGBDeviceInfo : AsusRGBDeviceInfo
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool SupportsSyncBack => true;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Asus.AsusDramRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
|
||||
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
|
||||
internal AsusDramRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
|
||||
: base(deviceType, handle)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains list of available logical layouts for asus keyboards.
|
||||
/// </summary>
|
||||
public enum AsusLogicalKeyboardLayout
|
||||
{
|
||||
TODO
|
||||
};
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains list of available physical layouts for asus keyboards.
|
||||
/// </summary>
|
||||
public enum AsusPhysicalKeyboardLayout
|
||||
{
|
||||
TODO
|
||||
}
|
||||
}
|
||||
@ -1,94 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc cref="AbstractRGBDevice{TDeviceInfo}" />
|
||||
/// <inheritdoc cref="IAsusRGBDevice" />
|
||||
/// <summary>
|
||||
/// Represents a generic Asus-device. (keyboard, mouse, headset, mousepad).
|
||||
/// </summary>
|
||||
public abstract class AsusRGBDevice<TDeviceInfo> : AbstractRGBDevice<TDeviceInfo>, IAsusRGBDevice
|
||||
where TDeviceInfo : AsusRGBDeviceInfo
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets information about the <see cref="T:RGB.NET.Devices.Asus.AsusRGBDevice" />.
|
||||
/// </summary>
|
||||
public override TDeviceInfo DeviceInfo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the update queue performing updates for this device.
|
||||
/// </summary>
|
||||
// ReSharper disable once MemberCanBePrivate.Global
|
||||
protected AsusUpdateQueue UpdateQueue { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AsusRGBDevice{TDeviceInfo}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The generic information provided by Asus for the device.</param>
|
||||
protected AsusRGBDevice(TDeviceInfo info)
|
||||
{
|
||||
this.DeviceInfo = info;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the device.
|
||||
/// </summary>
|
||||
public void Initialize(IDeviceUpdateTrigger updateTrigger)
|
||||
{
|
||||
InitializeLayout();
|
||||
|
||||
if (Size == Size.Invalid)
|
||||
{
|
||||
Rectangle ledRectangle = new Rectangle(this.Select(x => x.LedRectangle));
|
||||
Size = ledRectangle.Size + new Size(ledRectangle.Location.X, ledRectangle.Location.Y);
|
||||
}
|
||||
|
||||
UpdateQueue = new AsusUpdateQueue(updateTrigger);
|
||||
UpdateQueue.Initialize(GetUpdateColorAction(), DeviceInfo.Handle, LedMapping.Count);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the <see cref="Led"/> and <see cref="Size"/> of the device.
|
||||
/// </summary>
|
||||
protected abstract void InitializeLayout();
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void UpdateLeds(IEnumerable<Led> ledsToUpdate) => UpdateQueue.SetData(ledsToUpdate.Where(x => x.Color.A > 0));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a action to update the physical device.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected abstract Action<IntPtr, byte[]> GetUpdateColorAction();
|
||||
|
||||
/// <inheritdoc cref="IDisposable.Dispose" />
|
||||
/// <inheritdoc cref="AbstractRGBDevice{TDeviceInfo}.Dispose" />
|
||||
public override void Dispose()
|
||||
{
|
||||
try { UpdateQueue?.Dispose(); }
|
||||
catch { /* at least we tried */ }
|
||||
|
||||
if ((DeviceInfo is AsusRGBDeviceInfo deviceInfo) && (deviceInfo.Handle != IntPtr.Zero))
|
||||
Marshal.FreeHGlobal(deviceInfo.Handle);
|
||||
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,63 +0,0 @@
|
||||
using System;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a Corsair-<see cref="T:RGB.NET.Core.IRGBDevice" />.
|
||||
/// </summary>
|
||||
public abstract class AsusRGBDeviceInfo : IRGBDeviceInfo
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
public RGBDeviceType DeviceType { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public string DeviceName { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Manufacturer { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Model { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public Uri Image { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public RGBDeviceLighting Lighting => RGBDeviceLighting.Key;
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract bool SupportsSyncBack { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the index of the <see cref="AsusRGBDevice{TDeviceInfo}"/>.
|
||||
/// </summary>
|
||||
internal IntPtr Handle { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="AsusRGBDeviceInfo"/>.
|
||||
/// </summary>
|
||||
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
|
||||
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
|
||||
/// <param name="manufacturer">The manufacturer-name of the <see cref="IRGBDevice"/>.</param>
|
||||
/// <param name="model">The model-name of the <see cref="IRGBDevice"/>.</param>
|
||||
internal AsusRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle, string model = "Generic Asus-Device", string manufacturer = "Asus")
|
||||
{
|
||||
this.DeviceType = deviceType;
|
||||
this.Handle = handle;
|
||||
this.Model = model;
|
||||
this.Manufacturer = manufacturer;
|
||||
|
||||
DeviceName = $"{Manufacturer} {Model}";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,70 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the update-queue performing updates for asus devices.
|
||||
/// </summary>
|
||||
public class AsusUpdateQueue : UpdateQueue
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the internal color-data cache.
|
||||
/// </summary>
|
||||
// ReSharper disable once MemberCanBePrivate.Global
|
||||
protected byte[] ColorData { get; private set; }
|
||||
|
||||
private Action<IntPtr, byte[]> _updateAction;
|
||||
private IntPtr _handle;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AsusUpdateQueue"/> class.
|
||||
/// </summary>
|
||||
/// <param name="updateTrigger">The update trigger used by this queue.</param>
|
||||
public AsusUpdateQueue(IDeviceUpdateTrigger updateTrigger)
|
||||
: base(updateTrigger)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the queue.
|
||||
/// </summary>
|
||||
/// <param name="updateAction">The update-action called by the queue to perform updates.</param>
|
||||
/// <param name="handle">The handle of the device this queue performs updates for.</param>
|
||||
/// <param name="ledCount">The amount of leds of the device this queue performs updates for.</param>
|
||||
public void Initialize(Action<IntPtr, byte[]> updateAction, IntPtr handle, int ledCount)
|
||||
{
|
||||
_updateAction = updateAction;
|
||||
_handle = handle;
|
||||
|
||||
ColorData = new byte[ledCount * 3];
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Update(Dictionary<object, Color> dataSet)
|
||||
{
|
||||
foreach (KeyValuePair<object, Color> data in dataSet)
|
||||
{
|
||||
int index = ((int)data.Key) * 3;
|
||||
ColorData[index] = data.Value.GetR();
|
||||
ColorData[index + 1] = data.Value.GetB();
|
||||
ColorData[index + 2] = data.Value.GetG();
|
||||
}
|
||||
|
||||
_updateAction(_handle, ColorData);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a asus RGB-device.
|
||||
/// </summary>
|
||||
internal interface IAsusRGBDevice : IRGBDevice
|
||||
{
|
||||
void Initialize(IDeviceUpdateTrigger updateTrigger);
|
||||
}
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
using System;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Devices.Asus.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc cref="AsusRGBDevice{TDeviceInfo}" />
|
||||
/// <summary>
|
||||
/// Represents a Asus graphicsCard.
|
||||
/// </summary>
|
||||
public class AsusGraphicsCardRGBDevice : AsusRGBDevice<AsusGraphicsCardRGBDeviceInfo>, IGraphicsCard
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusGraphicsCardRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by Asus for the graphics card.</param>
|
||||
internal AsusGraphicsCardRGBDevice(AsusGraphicsCardRGBDeviceInfo info)
|
||||
: base(info)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void InitializeLayout()
|
||||
{
|
||||
//TODO DarthAffe 07.10.2017: Look for a good default layout
|
||||
int ledCount = _AsusSDK.GetGPULedCount(DeviceInfo.Handle);
|
||||
for (int i = 0; i < ledCount; i++)
|
||||
InitializeLed(LedId.GraphicsCard1 + i, new Rectangle(i * 10, 0, 10, 10));
|
||||
|
||||
//TODO DarthAffe 07.10.2017: We don't know the model, how to save layouts and images?
|
||||
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(this, @"Layouts\Asus\GraphicsCards", $"{ DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.GraphicsCard1;
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override Action<IntPtr, byte[]> GetUpdateColorAction() => _AsusSDK.SetGPUColor;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Asus.AsusGraphicsCardRGBDevice" />.
|
||||
/// </summary>
|
||||
public class AsusGraphicsCardRGBDeviceInfo : AsusRGBDeviceInfo
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool SupportsSyncBack => false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Asus.AsusGraphicsCardRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
|
||||
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
|
||||
internal AsusGraphicsCardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
|
||||
: base(deviceType, handle, WMIHelper.GetGraphicsCardsInfo() ?? "Generic Asus-Device")
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,63 +0,0 @@
|
||||
#if NETFULL
|
||||
using System.Management;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
// ReSharper disable once InconsistentNaming
|
||||
internal static class WMIHelper
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private static ManagementObjectSearcher _mainboardSearcher = new ManagementObjectSearcher(@"root\CIMV2", "SELECT Manufacturer,Product FROM Win32_BaseBoard");
|
||||
private static ManagementObjectSearcher _graphicsCardSearcher = new ManagementObjectSearcher(@"root\CIMV2", "SELECT Name FROM Win32_VideoController");
|
||||
|
||||
private static (string manufacturer, string model)? _mainboardInfo;
|
||||
private static string _graphicsCardInfo;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
internal static (string manufacturer, string model)? GetMainboardInfo()
|
||||
{
|
||||
if (!_mainboardInfo.HasValue)
|
||||
foreach (ManagementBaseObject managementBaseObject in _mainboardSearcher.Get())
|
||||
{
|
||||
_mainboardInfo = (managementBaseObject["Manufacturer"]?.ToString(), managementBaseObject["Product"]?.ToString());
|
||||
break;
|
||||
}
|
||||
|
||||
return _mainboardInfo;
|
||||
}
|
||||
|
||||
internal static string GetGraphicsCardsInfo()
|
||||
{
|
||||
if (_graphicsCardInfo == null)
|
||||
foreach (ManagementBaseObject managementBaseObject in _graphicsCardSearcher.Get())
|
||||
{
|
||||
_graphicsCardInfo = managementBaseObject["Name"]?.ToString();
|
||||
break;
|
||||
}
|
||||
|
||||
return _graphicsCardInfo;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#else
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
// ReSharper disable once InconsistentNaming
|
||||
internal static class WMIHelper
|
||||
{
|
||||
#region Methods
|
||||
|
||||
internal static (string manufacturer, string model)? GetMainboardInfo() => null;
|
||||
|
||||
internal static string GetGraphicsCardsInfo() => null;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -1,48 +0,0 @@
|
||||
using System;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Devices.Asus.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc cref="AsusRGBDevice{TDeviceInfo}" />
|
||||
/// <summary>
|
||||
/// Represents a Asus keyboard.
|
||||
/// </summary>
|
||||
public class AsusKeyboardRGBDevice : AsusRGBDevice<AsusKeyboardRGBDeviceInfo>, IKeyboard
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusKeyboardRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by Asus for the keyboard.</param>
|
||||
internal AsusKeyboardRGBDevice(AsusKeyboardRGBDeviceInfo info)
|
||||
: base(info)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void InitializeLayout()
|
||||
{
|
||||
//TODO DarthAffe 07.10.2017: This doesn't make sense at all ... Find someone with such a keyboard!
|
||||
int ledCount = _AsusSDK.GetClaymoreKeyboardLedCount(DeviceInfo.Handle);
|
||||
for (int i = 0; i < ledCount; i++)
|
||||
InitializeLed(LedId.Keyboard_Escape + i, new Rectangle(i * 19, 0, 19, 19));
|
||||
|
||||
string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
|
||||
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(this, $@"Layouts\Asus\Keyboards\{model}", $"{DeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"), DeviceInfo.LogicalLayout.ToString());
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Keyboard_Escape;
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override Action<IntPtr, byte[]> GetUpdateColorAction() => _AsusSDK.SetClaymoreKeyboardColor;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,63 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Asus.AsusKeyboardRGBDevice" />.
|
||||
/// </summary>
|
||||
public class AsusKeyboardRGBDeviceInfo : AsusRGBDeviceInfo
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool SupportsSyncBack => false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the physical layout of the keyboard.
|
||||
/// </summary>
|
||||
public AsusPhysicalKeyboardLayout PhysicalLayout { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the logical layout of the keyboard.
|
||||
/// </summary>
|
||||
public AsusLogicalKeyboardLayout LogicalLayout { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Asus.AsusKeyboardRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
|
||||
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
|
||||
/// <param name="culture">The <see cref="T:System.Globalization.CultureInfo" /> of the layout this keyboard is using.</param>
|
||||
internal AsusKeyboardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle, CultureInfo culture)
|
||||
: base(deviceType, handle, "Claymore")
|
||||
{
|
||||
SetLayouts(culture.KeyboardLayoutId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
private void SetLayouts(int keyboardLayoutId)
|
||||
{
|
||||
switch (keyboardLayoutId)
|
||||
{
|
||||
//TODO DarthAffe 07.10.2017: Implement
|
||||
default:
|
||||
PhysicalLayout = AsusPhysicalKeyboardLayout.TODO;
|
||||
LogicalLayout = AsusLogicalKeyboardLayout.TODO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
using System;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Devices.Asus.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc cref="AsusRGBDevice{TDeviceInfo}" />
|
||||
/// <summary>
|
||||
/// Represents a Asus mainboard.
|
||||
/// </summary>
|
||||
public class AsusMainboardRGBDevice : AsusRGBDevice<AsusMainboardRGBDeviceInfo>, IMainboard
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusMainboardRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by Asus for the mainboard.</param>
|
||||
internal AsusMainboardRGBDevice(AsusMainboardRGBDeviceInfo info)
|
||||
: base(info)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void InitializeLayout()
|
||||
{
|
||||
//TODO DarthAffe 07.10.2017: Look for a good default layout
|
||||
int ledCount = _AsusSDK.GetMbLedCount(DeviceInfo.Handle);
|
||||
for (int i = 0; i < ledCount; i++)
|
||||
InitializeLed(LedId.Mainboard1 + i, new Rectangle(i * 40, 0, 40, 8));
|
||||
|
||||
//TODO DarthAffe 07.10.2017: We don't know the model, how to save layouts and images?
|
||||
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(this, @"Layouts\Asus\Mainboards", $"{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Mainboard1;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void SyncBack()
|
||||
{
|
||||
byte[] colorData = _AsusSDK.GetMbColor(DeviceInfo.Handle);
|
||||
for (int i = 0; i < LedMapping.Count; i++)
|
||||
SetLedColorWithoutRequest(LedMapping[LedId.Mainboard1 + i], new Color(colorData[(i * 3)], colorData[(i * 3) + 2], colorData[(i * 3) + 1]));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override Action<IntPtr, byte[]> GetUpdateColorAction() => _AsusSDK.SetMbColor;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Asus.AsusMainboardRGBDevice" />.
|
||||
/// </summary>
|
||||
public class AsusMainboardRGBDeviceInfo : AsusRGBDeviceInfo
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool SupportsSyncBack => true;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Asus.AsusMainboardRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
|
||||
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
|
||||
internal AsusMainboardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
|
||||
: base(deviceType, handle, WMIHelper.GetMainboardInfo()?.model ?? "Generic Asus-Device")
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,47 +0,0 @@
|
||||
using System;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Devices.Asus.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc cref="AsusRGBDevice{TDeviceInfo}" />
|
||||
/// <summary>
|
||||
/// Represents a Asus mouse.
|
||||
/// </summary>
|
||||
public class AsusMouseRGBDevice : AsusRGBDevice<AsusMouseRGBDeviceInfo>, IMouse
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusMouseRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by Asus for the mouse.</param>
|
||||
internal AsusMouseRGBDevice(AsusMouseRGBDeviceInfo info)
|
||||
: base(info)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void InitializeLayout()
|
||||
{
|
||||
//TODO DarthAffe 07.10.2017: Look for a good default layout
|
||||
int ledCount = _AsusSDK.GetRogMouseLedCount(DeviceInfo.Handle);
|
||||
for (int i = 0; i < ledCount; i++)
|
||||
InitializeLed(LedId.Mouse1 + i, new Rectangle(i * 10, 0, 10, 10));
|
||||
|
||||
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(this, @"Layouts\Asus\Mouses", $"{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Mouse1;
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override Action<IntPtr, byte[]> GetUpdateColorAction() => _AsusSDK.SetRogMouseColor;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Asus.AsusMouseRGBDevice" />.
|
||||
/// </summary>
|
||||
public class AsusMouseRGBDeviceInfo : AsusRGBDeviceInfo
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool SupportsSyncBack => false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Asus.AsusMouseRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
|
||||
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
|
||||
internal AsusMouseRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
|
||||
: base(deviceType, handle, "Rog")
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,341 +0,0 @@
|
||||
// ReSharper disable UnusedMethodReturnValue.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus.Native
|
||||
{
|
||||
// ReSharper disable once InconsistentNaming
|
||||
internal static class _AsusSDK
|
||||
{
|
||||
#region Libary Management
|
||||
|
||||
private static IntPtr _dllHandle = IntPtr.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the loaded architecture (x64/x86).
|
||||
/// </summary>
|
||||
internal static string LoadedArchitecture { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reloads the SDK.
|
||||
/// </summary>
|
||||
internal static void Reload()
|
||||
{
|
||||
UnloadAsusSDK();
|
||||
LoadAsusSDK();
|
||||
}
|
||||
|
||||
private static void LoadAsusSDK()
|
||||
{
|
||||
if (_dllHandle != IntPtr.Zero) return;
|
||||
|
||||
// HACK: Load library at runtime to support both, x86 and x64 with one managed dll
|
||||
List<string> possiblePathList = Environment.Is64BitProcess ? AsusDeviceProvider.PossibleX64NativePaths : AsusDeviceProvider.PossibleX86NativePaths;
|
||||
string dllPath = possiblePathList.FirstOrDefault(File.Exists);
|
||||
if (dllPath == null) throw new RGBDeviceException($"Can't find the Asus-SDK at one of the expected locations:\r\n '{string.Join("\r\n", possiblePathList.Select(Path.GetFullPath))}'");
|
||||
|
||||
SetDllDirectory(Path.GetDirectoryName(Path.GetFullPath(dllPath)));
|
||||
|
||||
_dllHandle = LoadLibrary(dllPath);
|
||||
|
||||
_enumerateMbControllerPointer = (EnumerateMbControllerPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "EnumerateMbController"), typeof(EnumerateMbControllerPointer));
|
||||
_getMbLedCountPointer = (GetMbLedCountPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "GetMbLedCount"), typeof(GetMbLedCountPointer));
|
||||
_setMbModePointer = (SetMbModePointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetMbMode"), typeof(SetMbModePointer));
|
||||
_setMbColorPointer = (SetMbColorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetMbColor"), typeof(SetMbColorPointer));
|
||||
_getMbColorPointer = (GetMbColorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "GetMbColor"), typeof(GetMbColorPointer));
|
||||
|
||||
_enumerateGPUPointer = (EnumerateGPUPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "EnumerateGPU"), typeof(EnumerateGPUPointer));
|
||||
_getGPULedCountPointer = (GetGPULedCountPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "GetGPULedCount"), typeof(GetGPULedCountPointer));
|
||||
_setGPUModePointer = (SetGPUModePointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetGPUMode"), typeof(SetGPUModePointer));
|
||||
_setGPUColorPointer = (SetGPUColorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetGPUColor"), typeof(SetGPUColorPointer));
|
||||
|
||||
_createClaymoreKeyboardPointer = (CreateClaymoreKeyboardPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "CreateClaymoreKeyboard"), typeof(CreateClaymoreKeyboardPointer));
|
||||
_getClaymoreKeyboardLedCountPointer = (GetClaymoreKeyboardLedCountPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "GetClaymoreKeyboardLedCount"), typeof(GetClaymoreKeyboardLedCountPointer));
|
||||
_setClaymoreKeyboardModePointer = (SetClaymoreKeyboardModePointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetClaymoreKeyboardMode"), typeof(SetClaymoreKeyboardModePointer));
|
||||
_setClaymoreKeyboardColorPointer = (SetClaymoreKeyboardColorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetClaymoreKeyboardColor"), typeof(SetClaymoreKeyboardColorPointer));
|
||||
|
||||
_enumerateRogMousePointer = (CreateRogMousePointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "CreateRogMouse"), typeof(CreateRogMousePointer));
|
||||
_getRogMouseLedCountPointer = (GetRogMouseLedCountPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "RogMouseLedCount"), typeof(GetRogMouseLedCountPointer)); // DarthAffe 07.10.2017: Be careful with the naming here - i don't know why but there is no 'Get'!
|
||||
_setRogMouseModePointer = (SetRogMouseModePointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetRogMouseMode"), typeof(SetRogMouseModePointer));
|
||||
_setRogMouseColorPointer = (SetRogMouseColorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetRogMouseColor"), typeof(SetRogMouseColorPointer));
|
||||
|
||||
//TODO DarthAffe 29.10.2017: I don't know why they are even documented, but the asus guy said they aren't in the SDK right now.
|
||||
//_enumerateDramPointer = (EnumerateDramPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "EnumerateDram"), typeof(EnumerateDramPointer));
|
||||
//_getDramLedCountPointer = (GetDramLedCountPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "GetDramLedCount"), typeof(GetDramLedCountPointer));
|
||||
//_setDramModePointer = (SetDramModePointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetDramMode"), typeof(SetDramModePointer));
|
||||
//_setDramColorPointer = (SetDramColorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetDramColor"), typeof(SetDramColorPointer));
|
||||
//_getDramColorPointer = (GetDramColorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "GetDramColor"), typeof(GetDramColorPointer));
|
||||
}
|
||||
|
||||
internal static void UnloadAsusSDK()
|
||||
{
|
||||
if (_dllHandle == IntPtr.Zero) return;
|
||||
|
||||
// ReSharper disable once EmptyEmbeddedStatement - DarthAffe 07.10.2017: We might need to reduce the internal reference counter more than once to set the library free
|
||||
while (FreeLibrary(_dllHandle)) ;
|
||||
_dllHandle = IntPtr.Zero;
|
||||
}
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
private static extern bool SetDllDirectory(string lpPathName);
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
private static extern IntPtr LoadLibrary(string dllToLoad);
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
private static extern bool FreeLibrary(IntPtr dllHandle);
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
private static extern IntPtr GetProcAddress(IntPtr dllHandle, string name);
|
||||
|
||||
#endregion
|
||||
|
||||
#region SDK-METHODS
|
||||
|
||||
#region Pointers
|
||||
|
||||
private static EnumerateMbControllerPointer _enumerateMbControllerPointer;
|
||||
private static GetMbLedCountPointer _getMbLedCountPointer;
|
||||
private static SetMbModePointer _setMbModePointer;
|
||||
private static SetMbColorPointer _setMbColorPointer;
|
||||
private static GetMbColorPointer _getMbColorPointer;
|
||||
|
||||
private static EnumerateGPUPointer _enumerateGPUPointer;
|
||||
private static GetGPULedCountPointer _getGPULedCountPointer;
|
||||
private static SetGPUModePointer _setGPUModePointer;
|
||||
private static SetGPUColorPointer _setGPUColorPointer;
|
||||
|
||||
private static CreateClaymoreKeyboardPointer _createClaymoreKeyboardPointer;
|
||||
private static GetClaymoreKeyboardLedCountPointer _getClaymoreKeyboardLedCountPointer;
|
||||
private static SetClaymoreKeyboardModePointer _setClaymoreKeyboardModePointer;
|
||||
private static SetClaymoreKeyboardColorPointer _setClaymoreKeyboardColorPointer;
|
||||
|
||||
private static CreateRogMousePointer _enumerateRogMousePointer;
|
||||
private static GetRogMouseLedCountPointer _getRogMouseLedCountPointer;
|
||||
private static SetRogMouseModePointer _setRogMouseModePointer;
|
||||
private static SetRogMouseColorPointer _setRogMouseColorPointer;
|
||||
|
||||
//private static EnumerateDramPointer _enumerateDramPointer;
|
||||
//private static SetDramModePointer _setDramModePointer;
|
||||
//private static GetDramLedCountPointer _getDramLedCountPointer;
|
||||
//private static SetDramColorPointer _setDramColorPointer;
|
||||
//private static GetDramColorPointer _getDramColorPointer;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Delegates
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int EnumerateMbControllerPointer(IntPtr handles, int size);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int GetMbLedCountPointer(IntPtr handle);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void SetMbModePointer(IntPtr handle, int mode);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void SetMbColorPointer(IntPtr handle, byte[] colors, int size);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int GetMbColorPointer(IntPtr handle, IntPtr colors, int size);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int EnumerateGPUPointer(IntPtr handles, int size);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int GetGPULedCountPointer(IntPtr handle);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void SetGPUModePointer(IntPtr handle, int mode);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void SetGPUColorPointer(IntPtr handle, byte[] colors, int size);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate bool CreateClaymoreKeyboardPointer(IntPtr handle);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int GetClaymoreKeyboardLedCountPointer(IntPtr handle);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void SetClaymoreKeyboardModePointer(IntPtr handle, int mode);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void SetClaymoreKeyboardColorPointer(IntPtr handle, byte[] colors, int size);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate bool CreateRogMousePointer(IntPtr handle);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate int GetRogMouseLedCountPointer(IntPtr handle);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void SetRogMouseModePointer(IntPtr handle, int mode);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void SetRogMouseColorPointer(IntPtr handle, byte[] colors, int size);
|
||||
|
||||
//[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
//private delegate int EnumerateDramPointer(IntPtr handles, int size);
|
||||
//[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
//private delegate int GetDramLedCountPointer(IntPtr handle);
|
||||
//[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
//private delegate void SetDramModePointer(IntPtr handle, int mode);
|
||||
//[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
//private delegate void SetDramColorPointer(IntPtr handle, byte[] colors, int size);
|
||||
//[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
//private delegate int GetDramColorPointer(IntPtr handle, IntPtr colors, int size);
|
||||
|
||||
#endregion
|
||||
|
||||
// ReSharper disable EventExceptionNotDocumented
|
||||
|
||||
//HACK DarthAffe 12.05.2019: Using HandleProcessCorruptedStateExceptions and SecurityCritical allows to capture AccessViolationExceptions
|
||||
// which is used here to prevent hard crashes on wrong pointers.
|
||||
// Since this might cause isntabilities in the running application it's only a workaround and should be fixed in depth.
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static int EnumerateMbController(IntPtr handles, int size)
|
||||
{
|
||||
try { return _enumerateMbControllerPointer(handles, size); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static int GetMbLedCount(IntPtr handle)
|
||||
{
|
||||
try { return _getMbLedCountPointer(handle); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static void SetMbMode(IntPtr handle, int mode)
|
||||
{
|
||||
try { _setMbModePointer(handle, mode); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static void SetMbColor(IntPtr handle, byte[] colors)
|
||||
{
|
||||
try { _setMbColorPointer(handle, colors, colors.Length); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static byte[] GetMbColor(IntPtr handle)
|
||||
{
|
||||
int count = _getMbColorPointer(handle, IntPtr.Zero, 0);
|
||||
byte[] colors = new byte[count];
|
||||
IntPtr readColorsPtr = Marshal.AllocHGlobal(colors.Length);
|
||||
_getMbColorPointer(handle, readColorsPtr, colors.Length);
|
||||
Marshal.Copy(readColorsPtr, colors, 0, colors.Length);
|
||||
Marshal.FreeHGlobal(readColorsPtr);
|
||||
return colors;
|
||||
}
|
||||
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static int EnumerateGPU(IntPtr handles, int size)
|
||||
{
|
||||
try { return _enumerateGPUPointer(handles, size); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static int GetGPULedCount(IntPtr handle)
|
||||
{
|
||||
try { return _getGPULedCountPointer(handle); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static void SetGPUMode(IntPtr handle, int mode)
|
||||
{
|
||||
try { _setGPUModePointer(handle, mode); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static void SetGPUColor(IntPtr handle, byte[] colors)
|
||||
{
|
||||
try { _setGPUColorPointer(handle, colors, colors.Length); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static bool CreateClaymoreKeyboard(IntPtr handle)
|
||||
{
|
||||
try { return _createClaymoreKeyboardPointer(handle); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static int GetClaymoreKeyboardLedCount(IntPtr handle)
|
||||
{
|
||||
try { return _getClaymoreKeyboardLedCountPointer(handle); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static void SetClaymoreKeyboardMode(IntPtr handle, int mode)
|
||||
{
|
||||
try { _setClaymoreKeyboardModePointer(handle, mode); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static void SetClaymoreKeyboardColor(IntPtr handle, byte[] colors)
|
||||
{
|
||||
try { _setClaymoreKeyboardColorPointer(handle, colors, colors.Length); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static bool CreateRogMouse(IntPtr handle)
|
||||
{
|
||||
try { return _enumerateRogMousePointer(handle); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static int GetRogMouseLedCount(IntPtr handle)
|
||||
{
|
||||
try { return _getRogMouseLedCountPointer(handle); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static void SetRogMouseMode(IntPtr handle, int mode)
|
||||
{
|
||||
try { _setRogMouseModePointer(handle, mode); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
internal static void SetRogMouseColor(IntPtr handle, byte[] colors)
|
||||
{
|
||||
try { _setRogMouseColorPointer(handle, colors, colors.Length); } catch (Exception ex) { throw new RGBDeviceException(ex.Message); };
|
||||
}
|
||||
|
||||
//internal static int EnumerateDram(IntPtr handles, int size) => _enumerateDramPointer(handles, size);
|
||||
//internal static int GetDramLedCount(IntPtr handle) => _getDramLedCountPointer(handle);
|
||||
//internal static void SetDramMode(IntPtr handle, int mode) => _setDramModePointer(handle, mode);
|
||||
//internal static void SetDramColor(IntPtr handle, byte[] colors) => _setDramColorPointer(handle, colors, colors.Length);
|
||||
|
||||
//internal static byte[] GetDramColor(IntPtr handle)
|
||||
//{
|
||||
// int count = _getDramColorPointer(handle, IntPtr.Zero, 0);
|
||||
// byte[] colors = new byte[count];
|
||||
// IntPtr readColorsPtr = Marshal.AllocHGlobal(colors.Length);
|
||||
// _getDramColorPointer(handle, readColorsPtr, colors.Length);
|
||||
// Marshal.Copy(readColorsPtr, colors, 0, colors.Length);
|
||||
// Marshal.FreeHGlobal(readColorsPtr);
|
||||
// return colors;
|
||||
//}
|
||||
|
||||
// ReSharper restore EventExceptionNotDocumented
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net5.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<Authors>Darth Affe</Authors>
|
||||
<Company>Wyrez</Company>
|
||||
<Language>en-US</Language>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<Title>RGB.NET.Devices.Asus</Title>
|
||||
<AssemblyName>RGB.NET.Devices.Asus_Legacy</AssemblyName>
|
||||
<AssemblyTitle>RGB.NET.Devices.Asus</AssemblyTitle>
|
||||
<PackageId>RGB.NET.Devices.Asus_Legacy</PackageId>
|
||||
<RootNamespace>RGB.NET.Devices.Asus</RootNamespace>
|
||||
<Description>Asus-Device-Implementations of RGB.NET based on the v2-SDK</Description>
|
||||
<Summary>Asus-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals</Summary>
|
||||
<Copyright>Copyright © Darth Affe 2020</Copyright>
|
||||
<PackageCopyright>Copyright © Darth Affe 2020</PackageCopyright>
|
||||
<PackageIconUrl>http://lib.arge.be/icon.png</PackageIconUrl>
|
||||
<PackageProjectUrl>https://github.com/DarthAffe/RGB.NET</PackageProjectUrl>
|
||||
<PackageLicenseUrl>https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE</PackageLicenseUrl>
|
||||
<RepositoryType>Github</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/DarthAffe/RGB.NET</RepositoryUrl>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
|
||||
<PackageReleaseNotes></PackageReleaseNotes>
|
||||
|
||||
<Version>0.0.1</Version>
|
||||
<AssemblyVersion>0.0.1</AssemblyVersion>
|
||||
<FileVersion>0.0.1</FileVersion>
|
||||
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<IncludeSource>True</IncludeSource>
|
||||
<IncludeSymbols>True</IncludeSymbols>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<DefineConstants>$(DefineConstants);TRACE;DEBUG</DefineConstants>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>$(NoWarn);CS1591;CS1572;CS1573</NoWarn>
|
||||
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\RGB.NET.Core\RGB.NET.Core.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@ -1,10 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=dram/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=enum/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=generic/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=generic_005Cupdate/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=graphicscard/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=keyboard/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=mainboard/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=mouse/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=helper/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
@ -9,8 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Presets", "Presets", "{EBC3
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Core", "RGB.NET.Core\RGB.NET.Core.csproj", "{F3ED5768-7251-4347-8D8F-2866313DA658}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.Asus_Legacy", "RGB.NET.Devices.Asus_Legacy\RGB.NET.Devices.Asus_Legacy.csproj", "{105FD573-D165-49D1-B8EC-937570616F29}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.CoolerMaster", "RGB.NET.Devices.CoolerMaster\RGB.NET.Devices.CoolerMaster.csproj", "{E8F927F5-E7CF-464A-B9AE-824C2B29A7D1}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.Corsair", "RGB.NET.Devices.Corsair\RGB.NET.Devices.Corsair.csproj", "{BDE3DAD5-75C9-4C50-848D-1E766E916006}"
|
||||
@ -59,10 +57,6 @@ Global
|
||||
{F3ED5768-7251-4347-8D8F-2866313DA658}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F3ED5768-7251-4347-8D8F-2866313DA658}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F3ED5768-7251-4347-8D8F-2866313DA658}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{105FD573-D165-49D1-B8EC-937570616F29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{105FD573-D165-49D1-B8EC-937570616F29}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{105FD573-D165-49D1-B8EC-937570616F29}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{105FD573-D165-49D1-B8EC-937570616F29}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E8F927F5-E7CF-464A-B9AE-824C2B29A7D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E8F927F5-E7CF-464A-B9AE-824C2B29A7D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E8F927F5-E7CF-464A-B9AE-824C2B29A7D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@ -140,7 +134,6 @@ Global
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{105FD573-D165-49D1-B8EC-937570616F29} = {D13032C6-432E-4F43-8A32-071133C22B16}
|
||||
{E8F927F5-E7CF-464A-B9AE-824C2B29A7D1} = {D13032C6-432E-4F43-8A32-071133C22B16}
|
||||
{BDE3DAD5-75C9-4C50-848D-1E766E916006} = {D13032C6-432E-4F43-8A32-071133C22B16}
|
||||
{8496134D-16F5-43E6-B847-604964B240AD} = {D13032C6-432E-4F43-8A32-071133C22B16}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user