1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 01:58:30 +00:00

Renamed asus SDK-integration from aura to asus for naming consistency

This commit is contained in:
Darth Affe 2017-11-11 22:01:22 +01:00
parent 22617845b0
commit 4f48c63ae2
35 changed files with 261 additions and 261 deletions

View File

@ -1,17 +1,17 @@
<?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>
<id>RGB.NET.Devices.Asus</id>
<title>RGB.NET.Devices.Asus</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>
<description>Asus-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>
<summary>Asus-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>
@ -20,13 +20,13 @@
</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\" />
<file src="..\bin\RGB.NET.Devices.Asus.dll" target="lib\net45\RGB.NET.Devices.Asus.dll" />
<file src="..\bin\RGB.NET.Devices.Asus.pdb" target="lib\net45\RGB.NET.Devices.Asus.pdb" />
<file src="..\bin\RGB.NET.Devices.Asus.xml" target="lib\net45\RGB.NET.Devices.Asus.xml" />
<file src="..\RGB.NET.Devices.Asus\**\*.cs" target="src" exclude="..\RGB.NET.Devices.Asus\obj\**\*.*" />
<file src="..\RGB.NET.Devices.Asus\Images\**\*.*" target="build\net45\resources\Images\" />
<file src="..\RGB.NET.Devices.Asus\Layouts\**\*.*" target="build\net45\resources\Layouts\" />
<file src="..\RGB.NET.Devices.Asus\libs\**\*.*" target="build\net45\libs\" />
<file src="..\RGB.NET.Devices.Asus\targets\*.targets" target="build\net45\" />
</files>
</package>

View File

@ -7,23 +7,23 @@ using System.Collections.ObjectModel;
using System.Globalization;
using System.Runtime.InteropServices;
using RGB.NET.Core;
using RGB.NET.Devices.Aura.Native;
using RGB.NET.Devices.Asus.Native;
namespace RGB.NET.Devices.Aura
namespace RGB.NET.Devices.Asus
{
/// <inheritdoc />
/// <summary>
/// Represents a device provider responsible for Cooler Master devices.
/// </summary>
public class AuraDeviceProvider : IRGBDeviceProvider
public class AsusDeviceProvider : IRGBDeviceProvider
{
#region Properties & Fields
private static AuraDeviceProvider _instance;
private static AsusDeviceProvider _instance;
/// <summary>
/// Gets the singleton <see cref="AuraDeviceProvider"/> instance.
/// Gets the singleton <see cref="AsusDeviceProvider"/> instance.
/// </summary>
public static AuraDeviceProvider Instance => _instance ?? new AuraDeviceProvider();
public static AsusDeviceProvider Instance => _instance ?? new AsusDeviceProvider();
/// <summary>
/// Gets a modifiable list of paths used to find the native SDK-dlls for x86 applications.
@ -46,7 +46,7 @@ namespace RGB.NET.Devices.Aura
/// <summary>
/// Gets the loaded architecture (x64/x86).
/// </summary>
public string LoadedArchitecture => _AuraSDK.LoadedArchitecture;
public string LoadedArchitecture => _AsusSDK.LoadedArchitecture;
/// <inheritdoc />
/// <summary>
@ -67,12 +67,12 @@ namespace RGB.NET.Devices.Aura
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="AuraDeviceProvider"/> class.
/// 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 AuraDeviceProvider()
public AsusDeviceProvider()
{
if (_instance != null) throw new InvalidOperationException($"There can be only one instanc of type {nameof(AuraDeviceProvider)}");
if (_instance != null) throw new InvalidOperationException($"There can be only one instanc of type {nameof(AsusDeviceProvider)}");
_instance = this;
}
@ -87,24 +87,24 @@ namespace RGB.NET.Devices.Aura
try
{
_AuraSDK.Reload();
_AsusSDK.Reload();
IList<IRGBDevice> devices = new List<IRGBDevice>();
#region Mainboard
//TODO DarthAffe 21.10.2017: Requesting mainboards seems to fail if only a non mb-device (tested with only a gpu) is connected
int mainboardCount = _AuraSDK.EnumerateMbController(IntPtr.Zero, 0);
int mainboardCount = _AsusSDK.EnumerateMbController(IntPtr.Zero, 0);
if (mainboardCount > 0)
{
IntPtr mainboardHandles = Marshal.AllocHGlobal(mainboardCount * IntPtr.Size);
_AuraSDK.EnumerateMbController(mainboardHandles, mainboardCount);
_AsusSDK.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));
_AsusSDK.SetMbMode(handle, 1);
AsusMainboardRGBDevice device = new AsusMainboardRGBDevice(new AsusMainboardRGBDeviceInfo(RGBDeviceType.Mainboard, handle));
device.Initialize();
devices.Add(device);
}
@ -114,18 +114,18 @@ namespace RGB.NET.Devices.Aura
#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 aura-ready gpu is connected this doesn't happen)
int graphicCardCount = _AuraSDK.EnumerateGPU(IntPtr.Zero, 0);
//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)
int graphicCardCount = _AsusSDK.EnumerateGPU(IntPtr.Zero, 0);
if (graphicCardCount > 0)
{
IntPtr grapicsCardHandles = Marshal.AllocHGlobal(graphicCardCount * IntPtr.Size);
_AuraSDK.EnumerateGPU(grapicsCardHandles, graphicCardCount);
_AsusSDK.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));
_AsusSDK.SetGPUMode(handle, 1);
AsusGraphicsCardRGBDevice device = new AsusGraphicsCardRGBDevice(new AsusGraphicsCardRGBDeviceInfo(RGBDeviceType.GraphicsCard, handle));
device.Initialize();
devices.Add(device);
}
@ -136,17 +136,17 @@ namespace RGB.NET.Devices.Aura
#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.
//int dramCount = _AuraSDK.EnumerateDram(IntPtr.Zero, 0);
//int dramCount = _AsusSDK.EnumerateDram(IntPtr.Zero, 0);
//if (dramCount > 0)
//{
// IntPtr dramHandles = Marshal.AllocHGlobal(dramCount * IntPtr.Size);
// _AuraSDK.EnumerateDram(dramHandles, dramCount);
// _AsusSDK.EnumerateDram(dramHandles, dramCount);
// for (int i = 0; i < dramCount; i++)
// {
// IntPtr handle = Marshal.ReadIntPtr(dramHandles, i);
// _AuraSDK.SetDramMode(handle, 1);
// AuraDramRGBDevice device = new AuraDramRGBDevice(new AuraDramRGBDeviceInfo(RGBDeviceType.DRAM, handle));
// _AsusSDK.SetDramMode(handle, 1);
// AsusDramRGBDevice device = new AsusDramRGBDevice(new AsusDramRGBDeviceInfo(RGBDeviceType.DRAM, handle));
// device.Initialize();
// devices.Add(device);
// }
@ -157,10 +157,10 @@ namespace RGB.NET.Devices.Aura
#region Keyboard
IntPtr keyboardHandle = Marshal.AllocHGlobal(IntPtr.Size);
if (_AuraSDK.CreateClaymoreKeyboard(keyboardHandle))
if (_AsusSDK.CreateClaymoreKeyboard(keyboardHandle))
{
_AuraSDK.SetClaymoreKeyboardMode(keyboardHandle, 1);
AuraKeyboardRGBDevice device = new AuraKeyboardRGBDevice(new AuraKeyboardRGBDeviceInfo(RGBDeviceType.Keyboard, keyboardHandle, GetCulture()));
_AsusSDK.SetClaymoreKeyboardMode(keyboardHandle, 1);
AsusKeyboardRGBDevice device = new AsusKeyboardRGBDevice(new AsusKeyboardRGBDeviceInfo(RGBDeviceType.Keyboard, keyboardHandle, GetCulture()));
device.Initialize();
devices.Add(device);
}
@ -170,10 +170,10 @@ namespace RGB.NET.Devices.Aura
#region Mouse
IntPtr mouseHandle = Marshal.AllocHGlobal(IntPtr.Size);
if (_AuraSDK.CreateRogMouse(mouseHandle))
if (_AsusSDK.CreateRogMouse(mouseHandle))
{
_AuraSDK.SetRogMouseMode(mouseHandle, 1);
AuraMouseRGBDevice device = new AuraMouseRGBDevice(new AuraMouseRGBDeviceInfo(RGBDeviceType.Mouse, mouseHandle));
_AsusSDK.SetRogMouseMode(mouseHandle, 1);
AsusMouseRGBDevice device = new AsusMouseRGBDevice(new AsusMouseRGBDeviceInfo(RGBDeviceType.Mouse, mouseHandle));
device.Initialize();
devices.Add(device);
}
@ -200,17 +200,17 @@ namespace RGB.NET.Devices.Aura
{
foreach (IRGBDevice device in Devices)
{
AuraRGBDeviceInfo deviceInfo = (AuraRGBDeviceInfo)device.DeviceInfo;
AsusRGBDeviceInfo deviceInfo = (AsusRGBDeviceInfo)device.DeviceInfo;
switch (deviceInfo.DeviceType)
{
case RGBDeviceType.Mainboard:
_AuraSDK.SetMbMode(deviceInfo.Handle, 0);
_AsusSDK.SetMbMode(deviceInfo.Handle, 0);
break;
case RGBDeviceType.GraphicsCard:
_AuraSDK.SetGPUMode(deviceInfo.Handle, 0);
_AsusSDK.SetGPUMode(deviceInfo.Handle, 0);
break;
//case RGBDeviceType.DRAM:
// _AuraSDK.SetDramMode(deviceInfo.Handle, 0);
// _AsusSDK.SetDramMode(deviceInfo.Handle, 0);
// break;
}
}

View File

@ -1,20 +1,20 @@
//using RGB.NET.Core;
//using RGB.NET.Devices.Aura.Native;
//using RGB.NET.Devices.Asus.Native;
//namespace RGB.NET.Devices.Aura
//namespace RGB.NET.Devices.Asus
//{
// /// <inheritdoc />
// /// <summary>
// /// Represents a Aura dram.
// /// Represents a Asus dram.
// /// </summary>
// public class AuraDramRGBDevice : AuraRGBDevice
// public class AsusDramRGBDevice : AsusRGBDevice
// {
// #region Properties & Fields
// /// <summary>
// /// Gets information about the <see cref="AuraDramRGBDevice"/>.
// /// Gets information about the <see cref="AsusDramRGBDevice"/>.
// /// </summary>
// public AuraDramRGBDeviceInfo DramDeviceInfo { get; }
// public AsusDramRGBDeviceInfo DramDeviceInfo { get; }
// #endregion
@ -22,10 +22,10 @@
// /// <inheritdoc />
// /// <summary>
// /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Aura.AuraDramRGBDevice" /> class.
// /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusDramRGBDevice" /> class.
// /// </summary>
// /// <param name="info">The specific information provided by Aura for the DRAM.</param>
// internal AuraDramRGBDevice(AuraDramRGBDeviceInfo info)
// /// <param name="info">The specific information provided by Asus for the DRAM.</param>
// internal AsusDramRGBDevice(AsusDramRGBDeviceInfo info)
// : base(info)
// {
// this.DramDeviceInfo = info;
@ -39,17 +39,17 @@
// protected override void InitializeLayout()
// {
// //TODO DarthAffe 21.10.2017: Look for a good default layout
// int ledCount = _AuraSDK.GetGPULedCount(DramDeviceInfo.Handle);
// int ledCount = _AsusSDK.GetGPULedCount(DramDeviceInfo.Handle);
// for (int i = 0; i < ledCount; i++)
// InitializeLed(new AuraLedId(this, AuraLedIds.DramLed1 + i, i), new Rectangle(i * 10, 0, 10, 10));
// 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\Aura\Drams\{DramDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
// null, PathHelper.GetAbsolutePath(@"Images\Aura\Drams"));
// ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Drams\{DramDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
// null, PathHelper.GetAbsolutePath(@"Images\Asus\Drams"));
// }
// /// <inheritdoc />
// protected override void ApplyColorData() => _AuraSDK.SetDramColor(DramDeviceInfo.Handle, ColorData);
// protected override void ApplyColorData() => _AsusSDK.SetDramColor(DramDeviceInfo.Handle, ColorData);
// #endregion
// }

View File

@ -1,26 +1,26 @@
using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Aura
namespace RGB.NET.Devices.Asus
{
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Aura.AuraDramRGBDevice" />.
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Asus.AsusDramRGBDevice" />.
/// </summary>
public class AuraDramRGBDeviceInfo : AuraRGBDeviceInfo
public class AsusDramRGBDeviceInfo : AsusRGBDeviceInfo
{
#region Constructors
/// <inheritdoc />
/// <summary>
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Aura.AuraDramRGBDeviceInfo" />.
/// 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 AuraDramRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
internal AsusDramRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
: base(deviceType, handle)
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Aura\Drams\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Asus\Drams\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
#endregion

View File

@ -2,12 +2,12 @@
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
namespace RGB.NET.Devices.Aura
namespace RGB.NET.Devices.Asus
{
/// <summary>
/// Contains list of all LEDs available for all Aura devices.
/// Contains list of all LEDs available for all Asus devices.
/// </summary>
public enum AuraLedIds
public enum AsusLedIds
{
Invalid = -1,

View File

@ -3,12 +3,12 @@
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
namespace RGB.NET.Devices.Aura
namespace RGB.NET.Devices.Asus
{
/// <summary>
/// Contains list of available logical layouts for aura keyboards.
/// Contains list of available logical layouts for asus keyboards.
/// </summary>
public enum AuraLogicalKeyboardLayout
public enum AsusLogicalKeyboardLayout
{
TODO
};

View File

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

View File

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

View File

@ -6,13 +6,13 @@ using System.Runtime.InteropServices;
using RGB.NET.Core;
using RGB.NET.Core.Layout;
namespace RGB.NET.Devices.Aura
namespace RGB.NET.Devices.Asus
{
/// <inheritdoc />
/// <summary>
/// Represents a generic Aura-device. (keyboard, mouse, headset, mousepad).
/// Represents a generic Asus-device. (keyboard, mouse, headset, mousepad).
/// </summary>
public abstract class AuraRGBDevice : AbstractRGBDevice
public abstract class AsusRGBDevice : AbstractRGBDevice
{
#region Properties & Fields
@ -23,7 +23,7 @@ namespace RGB.NET.Devices.Aura
/// <inheritdoc />
/// <summary>
/// Gets information about the <see cref="T:RGB.NET.Devices.Aura.AuraRGBDevice" />.
/// Gets information about the <see cref="T:RGB.NET.Devices.Asus.AsusRGBDevice" />.
/// </summary>
public override IRGBDeviceInfo DeviceInfo { get; }
@ -32,10 +32,10 @@ namespace RGB.NET.Devices.Aura
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="AuraRGBDevice"/> class.
/// Initializes a new instance of the <see cref="AsusRGBDevice"/> class.
/// </summary>
/// <param name="info">The generic information provided by Aura for the device.</param>
protected AuraRGBDevice(IRGBDeviceInfo info)
/// <param name="info">The generic information provided by Asus for the device.</param>
protected AsusRGBDevice(IRGBDeviceInfo info)
{
this.DeviceInfo = info;
}
@ -83,9 +83,9 @@ namespace RGB.NET.Devices.Aura
if (layout.Leds != null)
foreach (LedLayout layoutLed in layout.Leds)
{
if (Enum.TryParse(layoutLed.Id, true, out AuraLedIds ledId))
if (Enum.TryParse(layoutLed.Id, true, out AsusLedIds ledId))
{
if (LedMapping.TryGetValue(new AuraLedId(this, ledId), out Led led))
if (LedMapping.TryGetValue(new AsusLedId(this, ledId), out Led led))
{
led.LedRectangle.Location.X = layoutLed.X;
led.LedRectangle.Location.Y = layoutLed.Y;
@ -114,7 +114,7 @@ namespace RGB.NET.Devices.Aura
{
foreach (Led led in leds)
{
int index = (((AuraLedId)led.Id).Index) * 3;
int index = (((AsusLedId)led.Id).Index) * 3;
ColorData[index] = led.Color.R;
ColorData[index + 1] = led.Color.G;
ColorData[index + 2] = led.Color.B;
@ -132,7 +132,7 @@ namespace RGB.NET.Devices.Aura
/// <inheritdoc />
public override void Dispose()
{
if ((DeviceInfo is AuraRGBDeviceInfo deviceInfo) && (deviceInfo.Handle != IntPtr.Zero))
if ((DeviceInfo is AsusRGBDeviceInfo deviceInfo) && (deviceInfo.Handle != IntPtr.Zero))
Marshal.FreeHGlobal(deviceInfo.Handle);
ColorData = null;

View File

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

View File

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

View File

@ -1,26 +1,26 @@
using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Aura
namespace RGB.NET.Devices.Asus
{
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Aura.AuraGraphicsCardRGBDevice" />.
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Asus.AsusGraphicsCardRGBDevice" />.
/// </summary>
public class AuraGraphicsCardRGBDeviceInfo : AuraRGBDeviceInfo
public class AsusGraphicsCardRGBDeviceInfo : AsusRGBDeviceInfo
{
#region Constructors
/// <inheritdoc />
/// <summary>
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Aura.AuraGraphicsCardRGBDeviceInfo" />.
/// 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 AuraGraphicsCardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
internal AsusGraphicsCardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
: base(deviceType, handle)
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Aura\GraphicsCards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Asus\GraphicsCards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
#endregion

View File

@ -1,20 +1,20 @@
using RGB.NET.Core;
using RGB.NET.Devices.Aura.Native;
using RGB.NET.Devices.Asus.Native;
namespace RGB.NET.Devices.Aura
namespace RGB.NET.Devices.Asus
{
/// <inheritdoc />
/// <summary>
/// Represents a Aura keyboard.
/// Represents a Asus keyboard.
/// </summary>
public class AuraKeyboardRGBDevice : AuraRGBDevice
public class AsusKeyboardRGBDevice : AsusRGBDevice
{
#region Properties & Fields
/// <summary>
/// Gets information about the <see cref="AuraKeyboardRGBDevice"/>.
/// Gets information about the <see cref="AsusKeyboardRGBDevice"/>.
/// </summary>
public AuraKeyboardRGBDeviceInfo KeyboardDeviceInfo { get; }
public AsusKeyboardRGBDeviceInfo KeyboardDeviceInfo { get; }
#endregion
@ -22,10 +22,10 @@ namespace RGB.NET.Devices.Aura
/// <inheritdoc />
/// <summary>
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Aura.AuraKeyboardRGBDevice" /> class.
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusKeyboardRGBDevice" /> class.
/// </summary>
/// <param name="info">The specific information provided by Aura for the keyboard.</param>
internal AuraKeyboardRGBDevice(AuraKeyboardRGBDeviceInfo info)
/// <param name="info">The specific information provided by Asus for the keyboard.</param>
internal AsusKeyboardRGBDevice(AsusKeyboardRGBDeviceInfo info)
: base(info)
{
this.KeyboardDeviceInfo = info;
@ -39,17 +39,17 @@ namespace RGB.NET.Devices.Aura
protected override void InitializeLayout()
{
//TODO DarthAffe 07.10.2017: Look for a good default layout
int ledCount = _AuraSDK.GetClaymoreKeyboardLedCount(KeyboardDeviceInfo.Handle);
int ledCount = _AsusSDK.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));
InitializeLed(new AsusLedId(this, AsusLedIds.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"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Keyboards\{model}\{KeyboardDeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"),
KeyboardDeviceInfo.LogicalLayout.ToString(), PathHelper.GetAbsolutePath(@"Images\Asus\Keyboards"));
}
/// <inheritdoc />
protected override void ApplyColorData() => _AuraSDK.SetClaymoreKeyboardColor(KeyboardDeviceInfo.Handle, ColorData);
protected override void ApplyColorData() => _AsusSDK.SetClaymoreKeyboardColor(KeyboardDeviceInfo.Handle, ColorData);
#endregion
}

View File

@ -2,25 +2,25 @@
using System.Globalization;
using RGB.NET.Core;
namespace RGB.NET.Devices.Aura
namespace RGB.NET.Devices.Asus
{
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Aura.AuraKeyboardRGBDevice" />.
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Asus.AsusKeyboardRGBDevice" />.
/// </summary>
public class AuraKeyboardRGBDeviceInfo : AuraRGBDeviceInfo
public class AsusKeyboardRGBDeviceInfo : AsusRGBDeviceInfo
{
#region Properties & Fields
/// <summary>
/// Gets the physical layout of the keyboard.
/// </summary>
public AuraPhysicalKeyboardLayout PhysicalLayout { get; private set; }
public AsusPhysicalKeyboardLayout PhysicalLayout { get; private set; }
/// <summary>
/// Gets the logical layout of the keyboard.
/// </summary>
public AuraLogicalKeyboardLayout LogicalLayout { get; private set; }
public AsusLogicalKeyboardLayout LogicalLayout { get; private set; }
#endregion
@ -28,17 +28,17 @@ namespace RGB.NET.Devices.Aura
/// <inheritdoc />
/// <summary>
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Aura.AuraKeyboardRGBDeviceInfo" />.
/// 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 AuraKeyboardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle, CultureInfo culture)
internal AsusKeyboardRGBDeviceInfo(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);
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Asus\Keyboards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
#endregion
@ -51,8 +51,8 @@ namespace RGB.NET.Devices.Aura
{
//TODO DarthAffe 07.10.2017: Implement
default:
PhysicalLayout = AuraPhysicalKeyboardLayout.TODO;
LogicalLayout = AuraLogicalKeyboardLayout.TODO;
PhysicalLayout = AsusPhysicalKeyboardLayout.TODO;
LogicalLayout = AsusLogicalKeyboardLayout.TODO;
break;
}
}

View File

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

View File

@ -1,26 +1,26 @@
using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Aura
namespace RGB.NET.Devices.Asus
{
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Aura.AuraMainboardRGBDevice" />.
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Asus.AsusMainboardRGBDevice" />.
/// </summary>
public class AuraMainboardRGBDeviceInfo : AuraRGBDeviceInfo
public class AsusMainboardRGBDeviceInfo : AsusRGBDeviceInfo
{
#region Constructors
/// <inheritdoc />
/// <summary>
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Aura.AuraMainboardRGBDeviceInfo" />.
/// 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 AuraMainboardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
internal AsusMainboardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
: base(deviceType, handle)
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Aura\Mainboards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Asus\Mainboards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
#endregion

View File

@ -1,20 +1,20 @@
using RGB.NET.Core;
using RGB.NET.Devices.Aura.Native;
using RGB.NET.Devices.Asus.Native;
namespace RGB.NET.Devices.Aura
namespace RGB.NET.Devices.Asus
{
/// <inheritdoc />
/// <summary>
/// Represents a Aura mouse.
/// Represents a Asus mouse.
/// </summary>
public class AuraMouseRGBDevice : AuraRGBDevice
public class AsusMouseRGBDevice : AsusRGBDevice
{
#region Properties & Fields
/// <summary>
/// Gets information about the <see cref="AuraMouseRGBDevice"/>.
/// Gets information about the <see cref="AsusMouseRGBDevice"/>.
/// </summary>
public AuraMouseRGBDeviceInfo MouseDeviceInfo { get; }
public AsusMouseRGBDeviceInfo MouseDeviceInfo { get; }
#endregion
@ -22,10 +22,10 @@ namespace RGB.NET.Devices.Aura
/// <inheritdoc />
/// <summary>
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Aura.AuraMouseRGBDevice" /> class.
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusMouseRGBDevice" /> class.
/// </summary>
/// <param name="info">The specific information provided by Aura for the mouse.</param>
internal AuraMouseRGBDevice(AuraMouseRGBDeviceInfo info)
/// <param name="info">The specific information provided by Asus for the mouse.</param>
internal AsusMouseRGBDevice(AsusMouseRGBDeviceInfo info)
: base(info)
{
this.MouseDeviceInfo = info;
@ -39,16 +39,16 @@ namespace RGB.NET.Devices.Aura
protected override void InitializeLayout()
{
//TODO DarthAffe 07.10.2017: Look for a good default layout
int ledCount = _AuraSDK.GetRogMouseLedCount(MouseDeviceInfo.Handle);
int ledCount = _AsusSDK.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));
InitializeLed(new AsusLedId(this, AsusLedIds.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"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Mouses\{MouseDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
null, PathHelper.GetAbsolutePath(@"Images\Asus\Mouses"));
}
/// <inheritdoc />
protected override void ApplyColorData() => _AuraSDK.SetRogMouseColor(MouseDeviceInfo.Handle, ColorData);
protected override void ApplyColorData() => _AsusSDK.SetRogMouseColor(MouseDeviceInfo.Handle, ColorData);
#endregion
}

View File

@ -1,26 +1,26 @@
using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Aura
namespace RGB.NET.Devices.Asus
{
/// <inheritdoc />
/// <summary>
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Aura.AuraMouseRGBDevice" />.
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Asus.AsusMouseRGBDevice" />.
/// </summary>
public class AuraMouseRGBDeviceInfo : AuraRGBDeviceInfo
public class AsusMouseRGBDeviceInfo : AsusRGBDeviceInfo
{
#region Constructors
/// <inheritdoc />
/// <summary>
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Aura.AuraMouseRGBDeviceInfo" />.
/// 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 AuraMouseRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
internal AsusMouseRGBDeviceInfo(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);
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Asus\Mouses\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
#endregion

View File

@ -8,10 +8,10 @@ using System.Linq;
using System.Runtime.InteropServices;
using RGB.NET.Core.Exceptions;
namespace RGB.NET.Devices.Aura.Native
namespace RGB.NET.Devices.Asus.Native
{
// ReSharper disable once InconsistentNaming
internal static class _AuraSDK
internal static class _AsusSDK
{
#region Libary Management
@ -27,18 +27,18 @@ namespace RGB.NET.Devices.Aura.Native
/// </summary>
internal static void Reload()
{
UnloadAuraSDK();
LoadAuraSDK();
UnloadAsusSDK();
LoadAsusSDK();
}
private static void LoadAuraSDK()
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 ? AuraDeviceProvider.PossibleX64NativePaths : AuraDeviceProvider.PossibleX86NativePaths;
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 Aura-SDK at one of the expected locations:\r\n '{string.Join("\r\n", possiblePathList.Select(Path.GetFullPath))}'");
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)));
@ -73,7 +73,7 @@ namespace RGB.NET.Devices.Aura.Native
//_getDramColorPointer = (GetDramColorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "GetDramColor"), typeof(GetDramColorPointer));
}
private static void UnloadAuraSDK()
private static void UnloadAsusSDK()
{
if (_dllHandle == IntPtr.Zero) return;

View File

@ -4,11 +4,11 @@ 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: AssemblyTitle("RGB.NET.Devices.Asus")]
[assembly: AssemblyDescription("Asus-Device-Implementations of RGB.NET")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Wyrez")]
[assembly: AssemblyProduct("RGB.NET.Devices.Aura")]
[assembly: AssemblyProduct("RGB.NET.Devices.Asus")]
[assembly: AssemblyCopyright("Copyright © Wyrez 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

View File

@ -7,8 +7,8 @@
<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>
<RootNamespace>RGB.NET.Devices.Asus</RootNamespace>
<AssemblyName>RGB.NET.Devices.Asus</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
@ -20,7 +20,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\bin\RGB.NET.Devices.Aura.xml</DocumentationFile>
<DocumentationFile>..\bin\RGB.NET.Devices.Asus.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@ -29,7 +29,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\bin\RGB.NET.Devices.Aura.xml</DocumentationFile>
<DocumentationFile>..\bin\RGB.NET.Devices.Asus.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@ -45,24 +45,24 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AuraDeviceProvider.cs" />
<Compile Include="Dram\AuraDramRGBDevice.cs" />
<Compile Include="Dram\AuraDramRGBDeviceInfo.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="AsusDeviceProvider.cs" />
<Compile Include="Dram\AsusDramRGBDevice.cs" />
<Compile Include="Dram\AsusDramRGBDeviceInfo.cs" />
<Compile Include="Enum\AsusLedIds.cs" />
<Compile Include="Enum\AsusLogicalKeyboardLayout.cs" />
<Compile Include="Enum\AsusPhysicalKeyboardLayout.cs" />
<Compile Include="Generic\AsusRGBDevice.cs" />
<Compile Include="Generic\AsusLedId.cs" />
<Compile Include="Generic\AsusRGBDeviceInfo.cs" />
<Compile Include="GraphicsCard\AsusGraphicsCardRGBDevice.cs" />
<Compile Include="GraphicsCard\AsusGraphicsCardRGBDeviceInfo.cs" />
<Compile Include="Keyboard\AsusKeyboardRGBDevice.cs" />
<Compile Include="Keyboard\AsusKeyboardRGBDeviceInfo.cs" />
<Compile Include="Mainboard\AsusMainboardRGBDevice.cs" />
<Compile Include="Mainboard\AsusMainboardRGBDeviceInfo.cs" />
<Compile Include="Mouse\AsusMouseRGBDevice.cs" />
<Compile Include="Mouse\AsusMouseRGBDeviceInfo.cs" />
<Compile Include="Native\_AsusSDK.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
@ -70,7 +70,7 @@
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
<None Include="targets\RGB.NET.Devices.Aura.targets" />
<None Include="targets\RGB.NET.Devices.Asus.targets" />
</ItemGroup>
<ItemGroup>
<Content Include="libs\x86\AURA_SDK.dll" />
@ -84,8 +84,8 @@
<Content Include="libs\x86\VGA_Extra.dll" />
</ItemGroup>
<ItemGroup>
<Folder Include="Images\Aura\" />
<Folder Include="Layouts\Aura\" />
<Folder Include="Images\Asus\" />
<Folder Include="Layouts\Asus\" />
<Folder Include="libs\x64\" />
</ItemGroup>
<ItemGroup>

View File

@ -12,7 +12,7 @@
-->
<ItemGroup>
<AuraSDKFiles Condition="'$(MSBuildThisFileDirectory)' != '' And
<AsusSDKFiles Condition="'$(MSBuildThisFileDirectory)' != '' And
HasTrailingSlash('$(MSBuildThisFileDirectory)')"
Include="$(MSBuildThisFileDirectory)libs\**\*.dll;$(MSBuildThisFileDirectory)resources\**\*.*" />
@ -30,10 +30,10 @@
******************************************************************************
-->
<ItemGroup Condition="'$(ContentAuraSDKFiles)' != '' And
'$(ContentAuraSDKFiles)' != 'false' And
'@(AuraSDKFiles)' != ''">
<Content Include="@(AuraSDKFiles)">
<ItemGroup Condition="'$(ContentAsusSDKFiles)' != '' And
'$(ContentAsusSDKFiles)' != 'false' And
'@(AsusSDKFiles)' != ''">
<Content Include="@(AsusSDKFiles)">
<Link>%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@ -45,51 +45,51 @@
******************************************************************************
-->
<Target Name="CopyAuraSDKFiles"
Condition="'$(CopyAuraSDKFiles)' != 'false' And
<Target Name="CopyAsusSDKFiles"
Condition="'$(CopyAsusSDKFiles)' != 'false' And
'$(OutDir)' != '' And
HasTrailingSlash('$(OutDir)') And
Exists('$(OutDir)')"
Inputs="@(AuraSDKFiles)"
Outputs="@(AuraSDKFiles -> '$(OutDir)%(RecursiveDir)%(Filename)%(Extension)')">
Inputs="@(AsusSDKFiles)"
Outputs="@(AsusSDKFiles -> '$(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)')" />
<Copy SourceFiles="@(AsusSDKFiles)"
DestinationFiles="@(AsusSDKFiles -> '$(OutDir)%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<!--
******************************************************************************
-->
<Target Name="CleanAuraSDKFiles"
Condition="'$(CleanAuraSDKFiles)' != 'false' And
<Target Name="CleanAsusSDKFiles"
Condition="'$(CleanAsusSDKFiles)' != 'false' And
'$(OutDir)' != '' And
HasTrailingSlash('$(OutDir)') And
Exists('$(OutDir)')">
<!--
NOTE: Delete "AuraSDK*.dll" and all related files, for every
NOTE: Delete "AsusSDK*.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)')" />
<Delete Files="@(AsusSDKFiles -> '$(OutDir)%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<!--
******************************************************************************
-->
<Target Name="CollectAuraSDKFiles"
Condition="'$(CollectAuraSDKFiles)' != 'false'">
<Target Name="CollectAsusSDKFiles"
Condition="'$(CollectAsusSDKFiles)' != 'false'">
<Message Text="Collecting SDK files..." Importance="high" />
<ItemGroup>
<FilesForPackagingFromProject Include="@(AuraSDKFiles)">
<FilesForPackagingFromProject Include="@(AsusSDKFiles)">
<DestinationRelativePath>bin\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
@ -120,15 +120,15 @@
<PropertyGroup>
<PostBuildEventDependsOn>
$(PostBuildEventDependsOn);
CopyAuraSDKFiles;
CopyAsusSDKFiles;
</PostBuildEventDependsOn>
<BuildDependsOn>
$(BuildDependsOn);
CopyAuraSDKFiles;
CopyAsusSDKFiles;
</BuildDependsOn>
<CleanDependsOn>
$(CleanDependsOn);
CleanAuraSDKFiles;
CleanAsusSDKFiles;
</CleanDependsOn>
</PropertyGroup>
@ -143,7 +143,7 @@
'$(VisualStudioVersion)' == '11.0' Or
'$(VisualStudioVersion)' == '12.0'">
<PipelineCollectFilesPhaseDependsOn>
CollectAuraSDKFiles;
CollectAsusSDKFiles;
$(PipelineCollectFilesPhaseDependsOn);
</PipelineCollectFilesPhaseDependsOn>
</PropertyGroup>

View File

@ -28,7 +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.Asus.nuspec = NuGet\RGB.NET.Devices.Asus.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
@ -56,7 +56,7 @@ 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}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Devices.Asus", "RGB.NET.Devices.Asus\RGB.NET.Devices.Asus.csproj", "{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Devices.Msi", "RGB.NET.Devices.Msi\RGB.NET.Devices.Msi.csproj", "{4EFD77C7-FDB4-4C6B-970C-0EF66D24BE09}"
EndProject