1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-12 17:48:31 +00:00

Added initial implementation of the Asus Aura SDK

This commit is contained in:
Darth Affe 2017-10-07 15:08:12 +02:00
parent 011460fa87
commit 54c3e92a72
25 changed files with 1528 additions and 3 deletions

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>RGB.NET.Devices.Aura</id>
<title>RGB.NET.Devices.Aura</title>
<version>1.0.0.0</version>
<authors>Darth Affe</authors>
<owners>Darth Affe</owners>
<projectUrl>https://github.com/DarthAffe/RGB.NET</projectUrl>
<licenseUrl>https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE</licenseUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Aura-Device-Implementations of RGB.NET</description>
<releaseNotes></releaseNotes>
<summary>Aura-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals</summary>
<copyright>Copyright © Wyrez 2017</copyright>
<language>en-US</language>
<dependencies>
<dependency id="RGB.NET.Core" version="1.0" />
<dependency id="System.ValueTuple" version="4.3.1" />
</dependencies>
</metadata>
<files>
<file src="..\bin\RGB.NET.Devices.Aura.dll" target="lib\net45\RGB.NET.Devices.Aura.dll" />
<file src="..\bin\RGB.NET.Devices.Aura.pdb" target="lib\net45\RGB.NET.Devices.Aura.pdb" />
<file src="..\bin\RGB.NET.Devices.Aura.xml" target="lib\net45\RGB.NET.Devices.Aura.xml" />
<file src="..\RGB.NET.Devices.Aura\**\*.cs" target="src" exclude="..\RGB.NET.Devices.Aura\obj\**\*.*" />
<file src="..\RGB.NET.Devices.Aura\Images\**\*.*" target="build\net45\resources\Images\" />
<file src="..\RGB.NET.Devices.Aura\Layouts\**\*.*" target="build\net45\resources\Layouts\" />
<file src="..\RGB.NET.Devices.Aura\libs\**\*.*" target="build\net45\libs\" />
<file src="..\RGB.NET.Devices.Aura\targets\*.targets" target="build\net45\" />
</files>
</package>

View File

@ -39,8 +39,18 @@ namespace RGB.NET.Core
LedStripe = 1 << 4,
/// <summary>
/// Represents a LED-matrix
/// Represents a LED-matrix.
/// </summary>
LedMatrix = 1 << 5
LedMatrix = 1 << 5,
/// <summary>
/// Represents a Mainboard.
/// </summary>
Mainboard = 1 << 6,
/// <summary>
/// Represents a Graphics card
/// </summary>
GraphicsCard = 1 << 7
}
}

View File

@ -0,0 +1,184 @@
// 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.Aura.Native;
namespace RGB.NET.Devices.Aura
{
/// <inheritdoc />
/// <summary>
/// Represents a device provider responsible for Cooler Master devices.
/// </summary>
public class AuraDeviceProvider : IRGBDeviceProvider
{
#region Properties & Fields
private static AuraDeviceProvider _instance;
/// <summary>
/// Gets the singleton <see cref="AuraDeviceProvider"/> instance.
/// </summary>
public static AuraDeviceProvider Instance => _instance ?? new AuraDeviceProvider();
/// <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 => _AuraSDK.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>
public Func<CultureInfo> GetCulture { get; set; } = CultureHelper.GetCurrentCulture;
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="AuraDeviceProvider"/> class.
/// </summary>
/// <exception cref="InvalidOperationException">Thrown if this constructor is called even if there is already an instance of this class.</exception>
public AuraDeviceProvider()
{
if (_instance != null) throw new InvalidOperationException($"There can be only one instanc of type {nameof(AuraDeviceProvider)}");
_instance = this;
}
#endregion
#region Methods
/// <inheritdoc />
public bool Initialize(bool exclusiveAccessIfPossible = false, bool throwExceptions = false)
{
IsInitialized = false;
try
{
_AuraSDK.Reload();
IList<IRGBDevice> devices = new List<IRGBDevice>();
#region Mainboard
int mainboardCount = _AuraSDK.EnumerateMbController(IntPtr.Zero, 0);
if (mainboardCount > 0)
{
IntPtr mainboardHandles = Marshal.AllocHGlobal(mainboardCount * IntPtr.Size);
_AuraSDK.EnumerateMbController(mainboardHandles, mainboardCount);
for (int i = 0; i < mainboardCount; i++)
{
IntPtr handle = Marshal.ReadIntPtr(mainboardHandles, i);
_AuraSDK.SetMbMode(handle, 1);
AuraMainboardRGBDevice device = new AuraMainboardRGBDevice(new AuraMainboardRGBDeviceInfo(RGBDeviceType.Mainboard, handle));
device.Initialize();
devices.Add(device);
}
}
#endregion
#region Graphics cards
//TODO DarthAffe 07.10.2017: GPU works but causes huge lags on update
//int graphicCardCount = _AuraSDK.EnumerateGPU(IntPtr.Zero, 0);
//if (graphicCardCount > 0)
//{
// IntPtr grapicsCardHandles = Marshal.AllocHGlobal(graphicCardCount * IntPtr.Size);
// _AuraSDK.EnumerateGPU(grapicsCardHandles, graphicCardCount);
// for (int i = 0; i < graphicCardCount; i++)
// {
// IntPtr handle = Marshal.ReadIntPtr(grapicsCardHandles, i);
// _AuraSDK.SetGPUMode(handle, 1);
// AuraGraphicsCardRGBDevice device = new AuraGraphicsCardRGBDevice(new AuraGraphicsCardRGBDeviceInfo(RGBDeviceType.GraphicsCard, handle));
// device.Initialize();
// devices.Add(device);
// }
//}
#endregion
#region Keyboard
IntPtr keyboardHandle = Marshal.AllocHGlobal(IntPtr.Size);
if (_AuraSDK.CreateClaymoreKeyboard(keyboardHandle))
{
_AuraSDK.SetClaymoreKeyboardMode(keyboardHandle, 1);
AuraKeyboardRGBDevice device = new AuraKeyboardRGBDevice(new AuraKeyboardRGBDeviceInfo(RGBDeviceType.Keyboard, keyboardHandle, GetCulture()));
device.Initialize();
devices.Add(device);
}
#endregion
#region Mouse
IntPtr mouseHandle = Marshal.AllocHGlobal(IntPtr.Size);
if (_AuraSDK.CreateRogMouse(mouseHandle))
{
_AuraSDK.SetRogMouseMode(mouseHandle, 1);
AuraMouseRGBDevice device = new AuraMouseRGBDevice(new AuraMouseRGBDeviceInfo(RGBDeviceType.Mouse, mouseHandle));
device.Initialize();
devices.Add(device);
}
#endregion
Devices = new ReadOnlyCollection<IRGBDevice>(devices);
}
catch
{
if (throwExceptions)
throw;
else
return false;
}
IsInitialized = true;
return true;
}
/// <inheritdoc />
public void ResetDevices()
{
//TODO DarthAffe 07.10.2017: This seems to be impossible right now
}
#endregion
}
}

View File

@ -0,0 +1,28 @@
// ReSharper disable InconsistentNaming
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
namespace RGB.NET.Devices.Aura
{
/// <summary>
/// Contains list of all LEDs available for all Aura devices.
/// </summary>
public enum AuraLedIds
{
Invalid = -1,
//TODO DarthAffe 07.10.2017: Create useful Ids for all devices
MainboardAudio1 = 0x01,
MainboardAudio2 = 0x02,
MainboardAudio3 = 0x03,
MainboardAudio4 = 0x04,
MainboardRGBStrip1 = 0x05,
GraphicsCardLed1 = 0x11,
MouseLed1 = 0x21,
KeyboardLed1 = 0x31,
}
}

View File

@ -0,0 +1,15 @@
// ReSharper disable InconsistentNaming
// ReSharper disable UnusedMember.Global
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
namespace RGB.NET.Devices.Aura
{
/// <summary>
/// Contains list of available logical layouts for aura keyboards.
/// </summary>
public enum AuraLogicalKeyboardLayout
{
TODO
};
}

View File

@ -0,0 +1,13 @@
// ReSharper disable UnusedMember.Global
// ReSharper disable InconsistentNaming
namespace RGB.NET.Devices.Aura
{
/// <summary>
/// Contains list of available physical layouts for aura keyboards.
/// </summary>
public enum AuraPhysicalKeyboardLayout
{
TODO
}
}

View File

@ -0,0 +1,111 @@
using System.Diagnostics;
using RGB.NET.Core;
namespace RGB.NET.Devices.Aura
{
/// <inheritdoc />
/// <summary>
/// Represents a Id of a <see cref="T:RGB.NET.Core.Led" /> on a <see cref="T:RGB.NET.Devices.Aura.AuraRGBDevice" />.
/// </summary>
[DebuggerDisplay("{" + nameof(LedId) + "}")]
public class AuraLedId : ILedId
{
#region Properties & Fields
internal readonly AuraLedIds LedId;
internal readonly int Index;
/// <inheritdoc />
public IRGBDevice Device { get; }
/// <inheritdoc />
public bool IsValid => LedId != AuraLedIds.Invalid;
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="AuraLedId"/> class.
/// </summary>
/// <param name="device">The <see cref="IRGBDevice"/> the <see cref="ILedId"/> belongs to.</param>
/// <param name="ledId">The <see cref="AuraLedId"/> of the represented <see cref="Led"/>.</param>
public AuraLedId(IRGBDevice device, AuraLedIds ledId)
{
this.Device = device;
this.LedId = ledId;
}
/// <summary>
/// Initializes a new instance of the <see cref="AuraLedId"/> class.
/// </summary>
/// <param name="device">The <see cref="IRGBDevice"/> the <see cref="ILedId"/> belongs to.</param>
/// <param name="ledId">The <see cref="AuraLedId"/> of the represented <see cref="Led"/>.</param>
/// <param name="index">The index in the mapping array of the device.</param>
public AuraLedId(IRGBDevice device, AuraLedIds ledId, int index)
{
this.Device = device;
this.LedId = ledId;
this.Index = index;
}
#endregion
#region Methods
/// <summary>
/// Converts the Id of this <see cref="AuraLedId"/> to a human-readable string.
/// </summary>
/// <returns>A string that contains the Id of this <see cref="AuraLedId"/>. For example "Enter".</returns>
public override string ToString() => LedId.ToString();
/// <summary>
/// Tests whether the specified object is a <see cref="AuraLedId" /> and is equivalent to this <see cref="AuraLedId" />.
/// </summary>
/// <param name="obj">The object to test.</param>
/// <returns><c>true</c> if <paramref name="obj" /> is a <see cref="AuraLedId" /> equivalent to this <see cref="AuraLedId" />; otherwise, <c>false</c>.</returns>
public override bool Equals(object obj)
{
AuraLedId compareLedId = obj as AuraLedId;
if (ReferenceEquals(compareLedId, null))
return false;
if (ReferenceEquals(this, compareLedId))
return true;
if (GetType() != compareLedId.GetType())
return false;
return compareLedId.LedId == LedId;
}
/// <summary>
/// Returns a hash code for this <see cref="AuraLedId" />.
/// </summary>
/// <returns>An integer value that specifies the hash code for this <see cref="AuraLedId" />.</returns>
public override int GetHashCode() => LedId.GetHashCode();
#endregion
#region Operators
/// <summary>
/// Returns a value that indicates whether two specified <see cref="AuraLedId" /> are equal.
/// </summary>
/// <param name="ledId1">The first <see cref="AuraLedId" /> to compare.</param>
/// <param name="ledId2">The second <see cref="AuraLedId" /> to compare.</param>
/// <returns><c>true</c> if <paramref name="ledId1" /> and <paramref name="ledId2" /> are equal; otherwise, <c>false</c>.</returns>
public static bool operator ==(AuraLedId ledId1, AuraLedId ledId2) => ReferenceEquals(ledId1, null) ? ReferenceEquals(ledId2, null) : ledId1.Equals(ledId2);
/// <summary>
/// Returns a value that indicates whether two specified <see cref="AuraLedId" /> are equal.
/// </summary>
/// <param name="ledId1">The first <see cref="AuraLedId" /> to compare.</param>
/// <param name="ledId2">The second <see cref="AuraLedId" /> to compare.</param>
/// <returns><c>true</c> if <paramref name="ledId1" /> and <paramref name="ledId2" /> are not equal; otherwise, <c>false</c>.</returns>
public static bool operator !=(AuraLedId ledId1, AuraLedId ledId2) => !(ledId1 == ledId2);
#endregion
}
}

View File

@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using RGB.NET.Core;
using RGB.NET.Core.Layout;
namespace RGB.NET.Devices.Aura
{
/// <inheritdoc />
/// <summary>
/// Represents a generic Aura-device. (keyboard, mouse, headset, mousepad).
/// </summary>
public abstract class AuraRGBDevice : AbstractRGBDevice
{
#region Properties & Fields
/// <summary>
/// Gets or sets the internal color-data cache.
/// </summary>
protected byte[] ColorData { get; private set; }
/// <inheritdoc />
/// <summary>
/// Gets information about the <see cref="T:RGB.NET.Devices.Aura.AuraRGBDevice" />.
/// </summary>
public override IRGBDeviceInfo DeviceInfo { get; }
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="AuraRGBDevice"/> class.
/// </summary>
/// <param name="info">The generic information provided by Aura for the device.</param>
protected AuraRGBDevice(IRGBDeviceInfo info)
{
this.DeviceInfo = info;
}
#endregion
#region Methods
/// <summary>
/// Initializes the device.
/// </summary>
internal void Initialize()
{
InitializeLayout();
if (InternalSize == null)
{
Rectangle ledRectangle = new Rectangle(this.Select(x => x.LedRectangle));
InternalSize = ledRectangle.Size + new Size(ledRectangle.Location.X, ledRectangle.Location.Y);
}
ColorData = new byte[LedMapping.Count * 3];
}
/// <summary>
/// Initializes the <see cref="Led"/> and <see cref="Size"/> of the device.
/// </summary>
protected abstract void InitializeLayout();
/// <summary>
/// Applies the given layout.
/// </summary>
/// <param name="layoutPath">The file containing the layout.</param>
/// <param name="imageLayout">The name of the layout used to get the images of the leds.</param>
/// <param name="imageBasePath">The path images for this device are collected in.</param>
protected void ApplyLayoutFromFile(string layoutPath, string imageLayout, string imageBasePath)
{
DeviceLayout layout = DeviceLayout.Load(layoutPath);
if (layout != null)
{
LedImageLayout ledImageLayout = layout.LedImageLayouts.FirstOrDefault(x => string.Equals(x.Layout, imageLayout, StringComparison.OrdinalIgnoreCase));
InternalSize = new Size(layout.Width, layout.Height);
if (layout.Leds != null)
foreach (LedLayout layoutLed in layout.Leds)
{
if (Enum.TryParse(layoutLed.Id, true, out AuraLedIds ledId))
{
if (LedMapping.TryGetValue(new AuraLedId(this, ledId), out Led led))
{
led.LedRectangle.Location.X = layoutLed.X;
led.LedRectangle.Location.Y = layoutLed.Y;
led.LedRectangle.Size.Width = layoutLed.Width;
led.LedRectangle.Size.Height = layoutLed.Height;
led.Shape = layoutLed.Shape;
led.ShapeData = layoutLed.ShapeData;
LedImage image = ledImageLayout?.LedImages.FirstOrDefault(x => x.Id == layoutLed.Id);
led.Image = (!string.IsNullOrEmpty(image?.Image))
? new Uri(Path.Combine(imageBasePath, image.Image), UriKind.Absolute)
: new Uri(Path.Combine(imageBasePath, "Missing.png"), UriKind.Absolute);
}
}
}
}
}
/// <inheritdoc />
protected override void UpdateLeds(IEnumerable<Led> ledsToUpdate)
{
List<Led> leds = ledsToUpdate.Where(x => x.Color.A > 0).ToList();
if (leds.Count > 0)
{
foreach (Led led in leds)
{
int index = (((AuraLedId)led.Id).Index) * 3;
ColorData[index] = led.Color.R;
ColorData[index + 1] = led.Color.G;
ColorData[index + 2] = led.Color.B;
}
ApplyColorData();
}
}
/// <summary>
/// Sends the color-data-cache to the device.
/// </summary>
protected abstract void ApplyColorData();
/// <inheritdoc />
public override void Dispose()
{
if ((DeviceInfo is AuraRGBDeviceInfo deviceInfo) && (deviceInfo.Handle != IntPtr.Zero))
Marshal.FreeHGlobal(deviceInfo.Handle);
ColorData = null;
base.Dispose();
}
#endregion
}
}

View File

@ -0,0 +1,55 @@
using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Aura
{
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a Corsair-<see cref="T:RGB.NET.Core.IRGBDevice" />.
/// </summary>
public class AuraRGBDeviceInfo : IRGBDeviceInfo
{
#region Properties & Fields
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }
/// <inheritdoc />
public string Manufacturer { get; }
/// <inheritdoc />
public string Model { get; }
/// <inheritdoc />
public Uri Image { get; protected set; }
/// <inheritdoc />
public RGBDeviceLighting Lighting => RGBDeviceLighting.Key;
/// <summary>
/// Gets the index of the <see cref="AuraRGBDevice"/>.
/// </summary>
internal IntPtr Handle { get; }
#endregion
#region Constructors
/// <summary>
/// Internal constructor of managed <see cref="AuraRGBDeviceInfo"/>.
/// </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 AuraRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle, string manufacturer = "Unknown", string model = "Generic Aura-Device")
{
this.DeviceType = deviceType;
this.Handle = handle;
this.Manufacturer = manufacturer;
this.Model = model;
}
#endregion
}
}

View File

@ -0,0 +1,56 @@
using RGB.NET.Core;
using RGB.NET.Devices.Aura.Native;
namespace RGB.NET.Devices.Aura
{
/// <inheritdoc />
/// <summary>
/// Represents a Aura graphicsCard.
/// </summary>
public class AuraGraphicsCardRGBDevice : AuraRGBDevice
{
#region Properties & Fields
/// <summary>
/// Gets information about the <see cref="AuraGraphicsCardRGBDevice"/>.
/// </summary>
public AuraGraphicsCardRGBDeviceInfo GraphicsCardDeviceInfo { get; }
#endregion
#region Constructors
/// <inheritdoc />
/// <summary>
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Aura.AuraGraphicsCardRGBDevice" /> class.
/// </summary>
/// <param name="info">The specific information provided by Aura for the graphics card.</param>
internal AuraGraphicsCardRGBDevice(AuraGraphicsCardRGBDeviceInfo info)
: base(info)
{
this.GraphicsCardDeviceInfo = info;
}
#endregion
#region Methods
/// <inheritdoc />
protected override void InitializeLayout()
{
//TODO DarthAffe 07.10.2017: Look for a good default layout
int ledCount = _AuraSDK.GetGPULedCount(GraphicsCardDeviceInfo.Handle);
for (int i = 0; i < ledCount; i++)
InitializeLed(new AuraLedId(this, AuraLedIds.GraphicsCardLed1 + i, 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($@"Layouts\Aura\GraphicsCards\{GraphicsCardDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
null, PathHelper.GetAbsolutePath(@"Images\Aura\GraphicsCards"));
}
/// <inheritdoc />
protected override void ApplyColorData() => _AuraSDK.SetGPUColor(GraphicsCardDeviceInfo.Handle, ColorData);
#endregion
}
}

View File

@ -0,0 +1,28 @@
using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Aura
{
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Aura.AuraGraphicsCardRGBDevice" />.
/// </summary>
public class AuraGraphicsCardRGBDeviceInfo : AuraRGBDeviceInfo
{
#region Constructors
/// <inheritdoc />
/// <summary>
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Aura.AuraGraphicsCardRGBDeviceInfo" />.
/// </summary>
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
internal AuraGraphicsCardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
: base(deviceType, handle)
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Aura\GraphicsCards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
#endregion
}
}

View File

@ -0,0 +1,56 @@
using RGB.NET.Core;
using RGB.NET.Devices.Aura.Native;
namespace RGB.NET.Devices.Aura
{
/// <inheritdoc />
/// <summary>
/// Represents a Aura keyboard.
/// </summary>
public class AuraKeyboardRGBDevice : AuraRGBDevice
{
#region Properties & Fields
/// <summary>
/// Gets information about the <see cref="AuraKeyboardRGBDevice"/>.
/// </summary>
public AuraKeyboardRGBDeviceInfo KeyboardDeviceInfo { get; }
#endregion
#region Constructors
/// <inheritdoc />
/// <summary>
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Aura.AuraKeyboardRGBDevice" /> class.
/// </summary>
/// <param name="info">The specific information provided by Aura for the keyboard.</param>
internal AuraKeyboardRGBDevice(AuraKeyboardRGBDeviceInfo info)
: base(info)
{
this.KeyboardDeviceInfo = info;
}
#endregion
#region Methods
/// <inheritdoc />
protected override void InitializeLayout()
{
//TODO DarthAffe 07.10.2017: Look for a good default layout
int ledCount = _AuraSDK.GetClaymoreKeyboardLedCount(KeyboardDeviceInfo.Handle);
for (int i = 0; i < ledCount; i++)
InitializeLed(new AuraLedId(this, AuraLedIds.KeyboardLed1 + i, i), new Rectangle(i * 19, 0, 19, 19));
string model = KeyboardDeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Aura\Keyboards\{model}\{KeyboardDeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"),
KeyboardDeviceInfo.LogicalLayout.ToString(), PathHelper.GetAbsolutePath(@"Images\Aura\Keyboards"));
}
/// <inheritdoc />
protected override void ApplyColorData() => _AuraSDK.SetClaymoreKeyboardColor(KeyboardDeviceInfo.Handle, ColorData);
#endregion
}
}

View File

@ -0,0 +1,62 @@
using System;
using System.Globalization;
using RGB.NET.Core;
namespace RGB.NET.Devices.Aura
{
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Aura.AuraKeyboardRGBDevice" />.
/// </summary>
public class AuraKeyboardRGBDeviceInfo : AuraRGBDeviceInfo
{
#region Properties & Fields
/// <summary>
/// Gets the physical layout of the keyboard.
/// </summary>
public AuraPhysicalKeyboardLayout PhysicalLayout { get; private set; }
/// <summary>
/// Gets the logical layout of the keyboard.
/// </summary>
public AuraLogicalKeyboardLayout LogicalLayout { get; private set; }
#endregion
#region Constructors
/// <inheritdoc />
/// <summary>
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Aura.AuraKeyboardRGBDeviceInfo" />.
/// </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 AuraKeyboardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle, CultureInfo culture)
: base(deviceType, handle, "Asus", "Claymore")
{
SetLayouts(culture.KeyboardLayoutId);
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Aura\Keyboards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
#endregion
#region Methods
private void SetLayouts(int keyboardLayoutId)
{
switch (keyboardLayoutId)
{
//TODO DarthAffe 07.10.2017: Implement
default:
PhysicalLayout = AuraPhysicalKeyboardLayout.TODO;
LogicalLayout = AuraLogicalKeyboardLayout.TODO;
break;
}
}
#endregion
}
}

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
<xsd:element name="Device">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" type="xsd:string" />
<xsd:element name="Description" type="xsd:string" />
<xsd:element name="Type" type="xsd:string" />
<xsd:element name="Lighting" type="xsd:string" />
<xsd:element name="Vendor" type="xsd:string" />
<xsd:element name="Model" type="xsd:string" />
<xsd:element name="Shape" type="xsd:string" />
<xsd:element name="Width" type="xsd:double" />
<xsd:element name="Height" type="xsd:double" />
<xsd:element name="LedUnitWidth" type="xsd:double" />
<xsd:element name="LedUnitHeight" type="xsd:double" />
<xsd:element name="Leds">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="Led">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Shape" type="xsd:string" />
<xsd:element name="X" type="xsd:string" />
<xsd:element name="Y" type="xsd:string" />
<xsd:element name="Width" type="xsd:string" />
<xsd:element name="Height" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="LedImageLayouts">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="LedImageLayout">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="LedImages">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="LedImage">
<xsd:complexType>
<xsd:attribute name="Id" type="xsd:string" use="required" />
<xsd:attribute name="Image" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="Layout" type="xsd:string" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xs:schema>

View File

@ -0,0 +1,56 @@
using RGB.NET.Core;
using RGB.NET.Devices.Aura.Native;
namespace RGB.NET.Devices.Aura
{
/// <inheritdoc />
/// <summary>
/// Represents a Aura mainboard.
/// </summary>
public class AuraMainboardRGBDevice : AuraRGBDevice
{
#region Properties & Fields
/// <summary>
/// Gets information about the <see cref="AuraMainboardRGBDevice"/>.
/// </summary>
public AuraMainboardRGBDeviceInfo MainboardDeviceInfo { get; }
#endregion
#region Constructors
/// <inheritdoc />
/// <summary>
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Aura.AuraMainboardRGBDevice" /> class.
/// </summary>
/// <param name="info">The specific information provided by Aura for the mainboard.</param>
internal AuraMainboardRGBDevice(AuraMainboardRGBDeviceInfo info)
: base(info)
{
this.MainboardDeviceInfo = info;
}
#endregion
#region Methods
/// <inheritdoc />
protected override void InitializeLayout()
{
//TODO DarthAffe 07.10.2017: Look for a good default layout
int ledCount = _AuraSDK.GetMbLedCount(MainboardDeviceInfo.Handle);
for (int i = 0; i < ledCount; i++)
InitializeLed(new AuraLedId(this, AuraLedIds.MainboardAudio1 + i, 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($@"Layouts\Aura\Mainboards\{MainboardDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
null, PathHelper.GetAbsolutePath(@"Images\Aura\Mainboards"));
}
/// <inheritdoc />
protected override void ApplyColorData() => _AuraSDK.SetMbColor(MainboardDeviceInfo.Handle, ColorData);
#endregion
}
}

View File

@ -0,0 +1,28 @@
using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Aura
{
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Aura.AuraMainboardRGBDevice" />.
/// </summary>
public class AuraMainboardRGBDeviceInfo : AuraRGBDeviceInfo
{
#region Constructors
/// <inheritdoc />
/// <summary>
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Aura.AuraMainboardRGBDeviceInfo" />.
/// </summary>
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
internal AuraMainboardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
: base(deviceType, handle)
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Aura\Mainboards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
#endregion
}
}

View File

@ -0,0 +1,55 @@
using RGB.NET.Core;
using RGB.NET.Devices.Aura.Native;
namespace RGB.NET.Devices.Aura
{
/// <inheritdoc />
/// <summary>
/// Represents a Aura mouse.
/// </summary>
public class AuraMouseRGBDevice : AuraRGBDevice
{
#region Properties & Fields
/// <summary>
/// Gets information about the <see cref="AuraMouseRGBDevice"/>.
/// </summary>
public AuraMouseRGBDeviceInfo MouseDeviceInfo { get; }
#endregion
#region Constructors
/// <inheritdoc />
/// <summary>
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Aura.AuraMouseRGBDevice" /> class.
/// </summary>
/// <param name="info">The specific information provided by Aura for the mouse.</param>
internal AuraMouseRGBDevice(AuraMouseRGBDeviceInfo info)
: base(info)
{
this.MouseDeviceInfo = info;
}
#endregion
#region Methods
/// <inheritdoc />
protected override void InitializeLayout()
{
//TODO DarthAffe 07.10.2017: Look for a good default layout
int ledCount = _AuraSDK.GetRogMouseLedCount(MouseDeviceInfo.Handle);
for (int i = 0; i < ledCount; i++)
InitializeLed(new AuraLedId(this, AuraLedIds.MouseLed1 + i, i), new Rectangle(i * 10, 0, 10, 10));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Aura\Mouses\{MouseDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
null, PathHelper.GetAbsolutePath(@"Images\Aura\Mouses"));
}
/// <inheritdoc />
protected override void ApplyColorData() => _AuraSDK.SetRogMouseColor(MouseDeviceInfo.Handle, ColorData);
#endregion
}
}

View File

@ -0,0 +1,28 @@
using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Aura
{
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Aura.AuraMouseRGBDevice" />.
/// </summary>
public class AuraMouseRGBDeviceInfo : AuraRGBDeviceInfo
{
#region Constructors
/// <inheritdoc />
/// <summary>
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Aura.AuraMouseRGBDeviceInfo" />.
/// </summary>
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
internal AuraMouseRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
: base(deviceType, handle, "Asus", "Rog")
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Aura\Mouses\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
#endregion
}
}

View File

@ -0,0 +1,199 @@
// ReSharper disable UnusedMethodReturnValue.Global
// ReSharper disable UnusedMember.Global
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using RGB.NET.Core.Exceptions;
namespace RGB.NET.Devices.Aura.Native
{
// ReSharper disable once InconsistentNaming
internal static class _AuraSDK
{
#region Libary Management
private static IntPtr _dllHandle = IntPtr.Zero;
private static List<IntPtr> _helperLibraries = new List<IntPtr>();
/// <summary>
/// Gets the loaded architecture (x64/x86).
/// </summary>
internal static string LoadedArchitecture { get; private set; }
/// <summary>
/// Reloads the SDK.
/// </summary>
internal static void Reload()
{
UnloadAuraSDK();
LoadAuraSDK();
}
private static void LoadAuraSDK()
{
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 ? AuraDeviceProvider.PossibleX64NativePaths : AuraDeviceProvider.PossibleX86NativePaths;
string dllPath = possiblePathList.FirstOrDefault(File.Exists);
if (dllPath == null) throw new RGBDeviceException($"Can't find the Aura-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));
_enumerateRogMouseControllerPointer = (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));
}
private static void UnloadAuraSDK()
{
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 _enumerateRogMouseControllerPointer;
private static GetRogMouseLedCountPointer _getRogMouseLedCountPointer;
private static SetRogMouseModePointer _setRogMouseModePointer;
private static SetRogMouseColorPointer _setRogMouseColorPointer;
#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 void 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);
#endregion
// ReSharper disable EventExceptionNotDocumented
internal static int EnumerateMbController(IntPtr handles, int size) => _enumerateMbControllerPointer(handles, size);
internal static int GetMbLedCount(IntPtr handle) => _getMbLedCountPointer(handle);
internal static void SetMbMode(IntPtr handle, int mode) => _setMbModePointer(handle, mode);
internal static void SetMbColor(IntPtr handle, byte[] colors) => _setMbColorPointer(handle, colors, colors.Length);
internal static byte[] GetMbColor(IntPtr handle, int ledCount)
{
byte[] colors = new byte[ledCount * 3];
IntPtr readColorsPtr = Marshal.AllocHGlobal(colors.Length);
_getMbColorPointer(handle, readColorsPtr, colors.Length);
Marshal.Copy(readColorsPtr, colors, 0, colors.Length);
Marshal.FreeHGlobal(readColorsPtr);
return colors;
}
internal static int EnumerateGPU(IntPtr handles, int size) => _enumerateGPUPointer(handles, size);
internal static int GetGPULedCount(IntPtr handle) => _getGPULedCountPointer(handle);
internal static void SetGPUMode(IntPtr handle, int mode) => _setGPUModePointer(handle, mode);
internal static void SetGPUColor(IntPtr handle, byte[] colors) => _setGPUColorPointer(handle, colors, colors.Length);
internal static bool CreateClaymoreKeyboard(IntPtr handle) => _createClaymoreKeyboardPointer(handle);
internal static int GetClaymoreKeyboardLedCount(IntPtr handle) => _getClaymoreKeyboardLedCountPointer(handle);
internal static void SetClaymoreKeyboardMode(IntPtr handle, int mode) => _setClaymoreKeyboardModePointer(handle, mode);
internal static void SetClaymoreKeyboardColor(IntPtr handle, byte[] colors) => _setClaymoreKeyboardColorPointer(handle, colors, colors.Length);
internal static bool CreateRogMouse(IntPtr handle) => _enumerateRogMouseControllerPointer(handle);
internal static int GetRogMouseLedCount(IntPtr handle) => _getRogMouseLedCountPointer(handle);
internal static void SetRogMouseMode(IntPtr handle, int mode) => _setRogMouseModePointer(handle, mode);
internal static void SetRogMouseColor(IntPtr handle, byte[] colors) => _setRogMouseColorPointer(handle, colors, colors.Length);
// ReSharper restore EventExceptionNotDocumented
#endregion
}
}

View File

@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RGB.NET.Devices.Aura")]
[assembly: AssemblyDescription("Aura-Device-Implementations of RGB.NET")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Wyrez")]
[assembly: AssemblyProduct("RGB.NET.Devices.Aura")]
[assembly: AssemblyCopyright("Copyright © Wyrez 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("dda8c4c2-8abf-4fa0-9af9-c47ad0bfe47d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RGB.NET.Devices.Aura</RootNamespace>
<AssemblyName>RGB.NET.Devices.Aura</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\bin\RGB.NET.Devices.Aura.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\bin\RGB.NET.Devices.Aura.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AuraDeviceProvider.cs" />
<Compile Include="Enum\AuraLedIds.cs" />
<Compile Include="Enum\AuraLogicalKeyboardLayout.cs" />
<Compile Include="Enum\AuraPhysicalKeyboardLayout.cs" />
<Compile Include="Generic\AuraRGBDevice.cs" />
<Compile Include="Generic\AuraLedId.cs" />
<Compile Include="Generic\AuraRGBDeviceInfo.cs" />
<Compile Include="GraphicsCard\AuraGraphicsCardRGBDevice.cs" />
<Compile Include="GraphicsCard\AuraGraphicsCardRGBDeviceInfo.cs" />
<Compile Include="Keyboard\AuraKeyboardRGBDevice.cs" />
<Compile Include="Keyboard\AuraKeyboardRGBDeviceInfo.cs" />
<Compile Include="Mainboard\AuraMainboardRGBDevice.cs" />
<Compile Include="Mainboard\AuraMainboardRGBDeviceInfo.cs" />
<Compile Include="Mouse\AuraMouseRGBDevice.cs" />
<Compile Include="Mouse\AuraMouseRGBDeviceInfo.cs" />
<Compile Include="Native\_AuraSDK.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Layouts\DeviceLayout.xsd">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
<None Include="targets\RGB.NET.Devices.Aura.targets" />
</ItemGroup>
<ItemGroup>
<Content Include="libs\x86\AURA_SDK.dll" />
<Content Include="libs\x86\ClaymoreProtocol.dll" />
<Content Include="libs\x86\EVOLVE SYNC Dll.dll" />
<Content Include="libs\x86\LED_DLL_forMB.dll" />
<Content Include="libs\x86\RogNewmouseProtocol.dll" />
<Content Include="libs\x86\SPATHA HID Library C++.dll" />
<Content Include="libs\x86\SPATHA SYNC Dll.dll" />
<Content Include="libs\x86\Vender.dll" />
<Content Include="libs\x86\VGA_Extra.dll" />
</ItemGroup>
<ItemGroup>
<Folder Include="Images\Aura\" />
<Folder Include="Layouts\Aura\" />
<Folder Include="libs\x64\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RGB.NET.Core\RGB.NET.Core.csproj">
<Project>{5a4f9a75-75fe-47cd-90e5-914d5b20d232}</Project>
<Name>RGB.NET.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,8 @@
<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/=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></wpf:ResourceDictionary>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.ValueTuple" version="4.4.0" targetFramework="net45" />
</packages>

View File

@ -0,0 +1,150 @@
<!--
* Build targets hacked from SQLite (thanks!)
* System.Data.SQLite.Core.targets -
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
******************************************************************************
** Build Items **
******************************************************************************
-->
<ItemGroup>
<AuraSDKFiles Condition="'$(MSBuildThisFileDirectory)' != '' And
HasTrailingSlash('$(MSBuildThisFileDirectory)')"
Include="$(MSBuildThisFileDirectory)libs\**\*.dll;$(MSBuildThisFileDirectory)resources\**\*.*" />
<AdditionalPublishFilex86 Include="$(MSBuildThisFileDirectory)libs\x86\*.dll">
<Visible>False</Visible>
</AdditionalPublishFilex86>
<AdditionalPublishFilex64 Include="$(MSBuildThisFileDirectory)libs\x64\*.dll">
<Visible>False</Visible>
</AdditionalPublishFilex64>
</ItemGroup>
<!--
******************************************************************************
** Content Items **
******************************************************************************
-->
<ItemGroup Condition="'$(ContentAuraSDKFiles)' != '' And
'$(ContentAuraSDKFiles)' != 'false' And
'@(AuraSDKFiles)' != ''">
<Content Include="@(AuraSDKFiles)">
<Link>%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<!--
******************************************************************************
** Build Targets* **
******************************************************************************
-->
<Target Name="CopyAuraSDKFiles"
Condition="'$(CopyAuraSDKFiles)' != 'false' And
'$(OutDir)' != '' And
HasTrailingSlash('$(OutDir)') And
Exists('$(OutDir)')"
Inputs="@(AuraSDKFiles)"
Outputs="@(AuraSDKFiles -> '$(OutDir)%(RecursiveDir)%(Filename)%(Extension)')">
<!--
NOTE: Copy "AURA_SDK.dll" and all related files, for every
architecture that we support, to the build output directory.
-->
<Message Text="Copying SDK files..." Importance="high" />
<Copy SourceFiles="@(AuraSDKFiles)"
DestinationFiles="@(AuraSDKFiles -> '$(OutDir)%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<!--
******************************************************************************
-->
<Target Name="CleanAuraSDKFiles"
Condition="'$(CleanAuraSDKFiles)' != 'false' And
'$(OutDir)' != '' And
HasTrailingSlash('$(OutDir)') And
Exists('$(OutDir)')">
<!--
NOTE: Delete "AuraSDK*.dll" and all related files, for every
architecture that we support, from the build output directory.
-->
<Message Text="this file $(MSBuildThisFileDirectory)" Importance="high"/>
<Message Text="Cleaning SDK files..." Importance="high" />
<Delete Files="@(AuraSDKFiles -> '$(OutDir)%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<!--
******************************************************************************
-->
<Target Name="CollectAuraSDKFiles"
Condition="'$(CollectAuraSDKFiles)' != 'false'">
<Message Text="Collecting SDK files..." Importance="high" />
<ItemGroup>
<FilesForPackagingFromProject Include="@(AuraSDKFiles)">
<DestinationRelativePath>bin\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
<!--
******************************************************************************
-->
<Target Name="BeforePublish">
<Touch Files="@(IntermediateAssembly)" />
</Target>
<Target Name="BeforeBuild">
<CreateItem Include="@(AdditionalPublishFilex86)" AdditionalMetadata="TargetPath=x86\%(FileName)%(Extension);IsDataFile=false">
<Output TaskParameter="Include" ItemName="_DeploymentManifestFiles" />
</CreateItem>
<CreateItem Include="@(AdditionalPublishFilex64)" AdditionalMetadata="TargetPath=x64\%(FileName)%(Extension);IsDataFile=false">
<Output TaskParameter="Include" ItemName="_DeploymentManifestFiles" />
</CreateItem>
</Target>
<!--
******************************************************************************
** Build Properties **
******************************************************************************
-->
<PropertyGroup>
<PostBuildEventDependsOn>
$(PostBuildEventDependsOn);
CopyAuraSDKFiles;
</PostBuildEventDependsOn>
<BuildDependsOn>
$(BuildDependsOn);
CopyAuraSDKFiles;
</BuildDependsOn>
<CleanDependsOn>
$(CleanDependsOn);
CleanAuraSDKFiles;
</CleanDependsOn>
</PropertyGroup>
<!--
******************************************************************************
** Publish Properties for Visual Studio 201x **
******************************************************************************
-->
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' Or
'$(VisualStudioVersion)' == '10.0' Or
'$(VisualStudioVersion)' == '11.0' Or
'$(VisualStudioVersion)' == '12.0'">
<PipelineCollectFilesPhaseDependsOn>
CollectAuraSDKFiles;
$(PipelineCollectFilesPhaseDependsOn);
</PipelineCollectFilesPhaseDependsOn>
</PropertyGroup>
</Project>

View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.12
VisualStudioVersion = 15.0.26730.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Core", "RGB.NET.Core\RGB.NET.Core.csproj", "{5A4F9A75-75FE-47CD-90E5-914D5B20D232}"
EndProject
@ -28,6 +28,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{06416566
NuGet\RGB.NET.Brushes.nuspec = NuGet\RGB.NET.Brushes.nuspec
NuGet\RGB.NET.Core.nuspec = NuGet\RGB.NET.Core.nuspec
NuGet\RGB.NET.Decorators.nuspec = NuGet\RGB.NET.Decorators.nuspec
NuGet\RGB.NET.Devices.Aura.nuspec = NuGet\RGB.NET.Devices.Aura.nuspec
NuGet\RGB.NET.Devices.CoolerMaster.nuspec = NuGet\RGB.NET.Devices.CoolerMaster.nuspec
NuGet\RGB.NET.Devices.Corsair.nuspec = NuGet\RGB.NET.Devices.Corsair.nuspec
NuGet\RGB.NET.Devices.Logitech.nuspec = NuGet\RGB.NET.Devices.Logitech.nuspec
@ -54,6 +55,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Decorators", "RGB.N
{5A4F9A75-75FE-47CD-90E5-914D5B20D232} = {5A4F9A75-75FE-47CD-90E5-914D5B20D232}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Devices.Aura", "RGB.NET.Devices.Aura\RGB.NET.Devices.Aura.csproj", "{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -104,6 +107,10 @@ Global
{7012C431-244A-453F-B7FD-59E030CDBC44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7012C431-244A-453F-B7FD-59E030CDBC44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7012C431-244A-453F-B7FD-59E030CDBC44}.Release|Any CPU.Build.0 = Release|Any CPU
{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -119,6 +126,7 @@ Global
{85609427-D433-44E2-A249-CE890B66D845} = {33D5E279-1C4E-4AB6-9D1E-6D18109A6C25}
{DB2911F6-404C-4BC8-B35F-232A7450755F} = {33D5E279-1C4E-4AB6-9D1E-6D18109A6C25}
{7012C431-244A-453F-B7FD-59E030CDBC44} = {FFBCAF88-6646-43EC-9F24-2D719D3779C8}
{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59} = {33D5E279-1C4E-4AB6-9D1E-6D18109A6C25}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CDECA6C7-8D18-4AF3-94F7-C70A69B8571B}