diff --git a/RGB.NET.Devices.Asus/AsusDeviceProvider.cs b/RGB.NET.Devices.Asus/AsusDeviceProvider.cs index 4d60169..f8e3834 100644 --- a/RGB.NET.Devices.Asus/AsusDeviceProvider.cs +++ b/RGB.NET.Devices.Asus/AsusDeviceProvider.cs @@ -5,9 +5,8 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Globalization; -using System.Runtime.InteropServices; +using AuraServiceLib; using RGB.NET.Core; -using RGB.NET.Devices.Asus.Native; namespace RGB.NET.Devices.Asus { @@ -25,29 +24,12 @@ namespace RGB.NET.Devices.Asus /// public static AsusDeviceProvider Instance => _instance ?? new AsusDeviceProvider(); - /// - /// Gets a modifiable list of paths used to find the native SDK-dlls for x86 applications. - /// The first match will be used. - /// - public static List PossibleX86NativePaths { get; } = new List { "x86/AURA_SDK.dll" }; - - /// - /// Gets a modifiable list of paths used to find the native SDK-dlls for x64 applications. - /// The first match will be used. - /// - public static List PossibleX64NativePaths { get; } = new List { }; - /// /// /// Indicates if the SDK is initialized and ready to use. /// public bool IsInitialized { get; private set; } - /// - /// Gets the loaded architecture (x64/x86). - /// - public string LoadedArchitecture => _AsusSDK.LoadedArchitecture; - /// /// /// Gets whether the application has exclusive access to the SDK or not. @@ -68,6 +50,8 @@ namespace RGB.NET.Devices.Asus /// public DeviceUpdateTrigger UpdateTrigger { get; private set; } + private IAuraSdk2 _sdk; + #endregion #region Constructors @@ -97,137 +81,73 @@ namespace RGB.NET.Devices.Asus { UpdateTrigger?.Stop(); - _AsusSDK.Reload(); + // ReSharper disable once SuspiciousTypeConversion.Global + _sdk = (IAuraSdk2)new AuraSdk(); + _sdk.SwitchMode(); IList devices = new List(); - - #region Mainboard - - if (loadFilter.HasFlag(RGBDeviceType.Mainboard)) + foreach (IAuraSyncDevice device in _sdk.Enumerate(0)) + { try { - //TODO DarthAffe 26.11.2017: This is not a fix! There might really be a second controller on the mainboard, but for now this should prevent the random crash for some guys. - // DarthAffe 26.11.2017: https://rog.asus.com/forum/showthread.php?97754-Access-Violation-Wrong-EnumerateMB-Result&p=688901#post688901 - int mainboardCount = Math.Min(1, _AsusSDK.EnumerateMbController(IntPtr.Zero, 0)); - if (mainboardCount > 0) + IAsusRGBDevice rgbDevice = null; + switch (device.Type) { - IntPtr mainboardHandles = Marshal.AllocHGlobal(mainboardCount * IntPtr.Size); - _AsusSDK.EnumerateMbController(mainboardHandles, mainboardCount); + case 0x00010000: //Motherboard + rgbDevice = new AsusMainboardRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.Mainboard, device, WMIHelper.GetMainboardInfo()?.model ?? device.Name)); + break; - for (int i = 0; i < mainboardCount; i++) - { - try - { - IntPtr handle = Marshal.ReadIntPtr(mainboardHandles, i); - _AsusSDK.SetMbMode(handle, 1); - AsusMainboardRGBDevice device = new AsusMainboardRGBDevice(new AsusMainboardRGBDeviceInfo(RGBDeviceType.Mainboard, handle)); - device.Initialize(UpdateTrigger); - devices.Add(device); - } - catch { if (throwExceptions) throw; } - } + case 0x00011000: //Motherboard LED Strip + rgbDevice = new AsusUnspecifiedRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.LedStripe, device), LedId.LedStripe1); + break; + + case 0x00020000: //VGA + rgbDevice = new AsusGraphicsCardRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.GraphicsCard, device)); + break; + + case 0x00040000: //Headset + rgbDevice = new AsusHeadsetRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.Headset, device)); + break; + + case 0x00070000: //DRAM + rgbDevice = new AsusDramRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.DRAM, device)); + break; + + case 0x00080000: //Keyboard + case 0x00081000: //Notebook Keyboard + case 0x00081001: //Notebook Keyboard(4 - zone type) + rgbDevice = new AsusKeyboardRGBDevice(new AsusKeyboardRGBDeviceInfo(device, CultureInfo.CurrentCulture)); + break; + + case 0x00090000: //Mouse + rgbDevice = new AsusMouseRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.Mouse, device)); + break; + + case 0x00000000: //All + case 0x00012000: //All - In - One PC + case 0x00030000: //Display + case 0x00050000: //Microphone + case 0x00060000: //External HDD + case 0x00061000: //External BD Drive + case 0x000B0000: //Chassis + case 0x000C0000: //Projector + rgbDevice = new AsusUnspecifiedRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.Unknown, device), LedId.Custom1); + break; + } + + if ((rgbDevice != null) && loadFilter.HasFlag(rgbDevice.DeviceInfo.DeviceType)) + { + rgbDevice.Initialize(UpdateTrigger); + devices.Add(rgbDevice); } } - catch { if (throwExceptions) throw; } - - #endregion - - #region Graphics cards - - //TODO DarthAffe 21.10.2017: This somehow returns non-existant gpus (at least for me) which cause huge lags (if a real asus-ready gpu is connected this doesn't happen) - - if (loadFilter.HasFlag(RGBDeviceType.GraphicsCard)) - try + catch { - int graphicCardCount = _AsusSDK.EnumerateGPU(IntPtr.Zero, 0); - if (graphicCardCount > 0) - { - IntPtr grapicsCardHandles = Marshal.AllocHGlobal(graphicCardCount * IntPtr.Size); - _AsusSDK.EnumerateGPU(grapicsCardHandles, graphicCardCount); - - for (int i = 0; i < graphicCardCount; i++) - { - try - { - IntPtr handle = Marshal.ReadIntPtr(grapicsCardHandles, i); - _AsusSDK.SetGPUMode(handle, 1); - AsusGraphicsCardRGBDevice device = new AsusGraphicsCardRGBDevice(new AsusGraphicsCardRGBDeviceInfo(RGBDeviceType.GraphicsCard, handle)); - device.Initialize(UpdateTrigger); - devices.Add(device); - } - catch { if (throwExceptions) throw; } - } - } + if (throwExceptions) + throw; } - catch { if (throwExceptions) throw; } + } - #endregion - - #region DRAM - - //TODO DarthAffe 29.10.2017: I don't know why they are even documented, but the asus guy said they aren't in the SDK right now. - //try - //{ - //int dramCount = _AsusSDK.EnumerateDram(IntPtr.Zero, 0); - //if (dramCount > 0) - //{ - // IntPtr dramHandles = Marshal.AllocHGlobal(dramCount * IntPtr.Size); - // _AsusSDK.EnumerateDram(dramHandles, dramCount); - - // for (int i = 0; i < dramCount; i++) - // { - //try - //{ - // IntPtr handle = Marshal.ReadIntPtr(dramHandles, i); - // _AsusSDK.SetDramMode(handle, 1); - // AsusDramRGBDevice device = new AsusDramRGBDevice(new AsusDramRGBDeviceInfo(RGBDeviceType.DRAM, handle)); - // device.Initialize(UpdateTrigger); - // devices.Add(device); - // } - //catch { if (throwExceptions) throw; } - // } - //} - //} - // catch { if (throwExceptions) throw; } - - #endregion - - #region Keyboard - - if (loadFilter.HasFlag(RGBDeviceType.Keyboard)) - try - { - IntPtr keyboardHandle = Marshal.AllocHGlobal(IntPtr.Size); - if (_AsusSDK.CreateClaymoreKeyboard(keyboardHandle)) - { - _AsusSDK.SetClaymoreKeyboardMode(keyboardHandle, 1); - AsusKeyboardRGBDevice device = new AsusKeyboardRGBDevice(new AsusKeyboardRGBDeviceInfo(RGBDeviceType.Keyboard, keyboardHandle, GetCulture())); - device.Initialize(UpdateTrigger); - devices.Add(device); - } - } - catch { if (throwExceptions) throw; } - - #endregion - - #region Mouse - - if (loadFilter.HasFlag(RGBDeviceType.Mouse)) - try - { - IntPtr mouseHandle = Marshal.AllocHGlobal(IntPtr.Size); - if (_AsusSDK.CreateRogMouse(mouseHandle)) - { - _AsusSDK.SetRogMouseMode(mouseHandle, 1); - AsusMouseRGBDevice device = new AsusMouseRGBDevice(new AsusMouseRGBDeviceInfo(RGBDeviceType.Mouse, mouseHandle)); - device.Initialize(UpdateTrigger); - devices.Add(device); - } - } - catch { if (throwExceptions) throw; } - - #endregion - UpdateTrigger?.Start(); Devices = new ReadOnlyCollection(devices); @@ -239,34 +159,22 @@ namespace RGB.NET.Devices.Asus throw; return false; } - return true; } /// public void ResetDevices() { - foreach (IRGBDevice device in Devices) - { - AsusRGBDeviceInfo deviceInfo = (AsusRGBDeviceInfo)device.DeviceInfo; - switch (deviceInfo.DeviceType) - { - case RGBDeviceType.Mainboard: - _AsusSDK.SetMbMode(deviceInfo.Handle, 0); - break; - case RGBDeviceType.GraphicsCard: - _AsusSDK.SetGPUMode(deviceInfo.Handle, 0); - break; - //case RGBDeviceType.DRAM: - // _AsusSDK.SetDramMode(deviceInfo.Handle, 0); - // break; - } - } + _sdk?.ReleaseControl(0); + _sdk?.SwitchMode(); } /// public void Dispose() - { } + { + _sdk?.ReleaseControl(0); + _sdk = null; + } #endregion } diff --git a/RGB.NET.Devices.Asus/Dram/AsusDramRGBDevice.cs b/RGB.NET.Devices.Asus/Dram/AsusDramRGBDevice.cs index 6cdc398..7e74550 100644 --- a/RGB.NET.Devices.Asus/Dram/AsusDramRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Dram/AsusDramRGBDevice.cs @@ -1,56 +1,44 @@ -//using RGB.NET.Core; -//using RGB.NET.Devices.Asus.Native; +using RGB.NET.Core; -//namespace RGB.NET.Devices.Asus -//{ -// /// -// /// -// /// Represents a Asus dram. -// /// -// public class AsusDramRGBDevice : AsusRGBDevice -// { -// #region Properties & Fields +namespace RGB.NET.Devices.Asus +{ + /// + /// + /// Represents a Asus dram. + /// + public class AsusDramRGBDevice : AsusRGBDevice + { + #region Constructors -// /// -// /// Gets information about the . -// /// -// public AsusDramRGBDeviceInfo DramDeviceInfo { get; } + /// + /// + /// Initializes a new instance of the class. + /// + /// The specific information provided by Asus for the DRAM. + internal AsusDramRGBDevice(AsusRGBDeviceInfo info) + : base(info) + { } -// #endregion + #endregion -// #region Constructors + #region Methods -// /// -// /// -// /// Initializes a new instance of the class. -// /// -// /// The specific information provided by Asus for the DRAM. -// internal AsusDramRGBDevice(AsusDramRGBDeviceInfo info) -// : base(info) -// { -// this.DramDeviceInfo = info; -// } + /// + protected override void InitializeLayout() + { + //TODO DarthAffe 07.10.2017: Look for a good default layout + int ledCount = DeviceInfo.Device.Lights.Count; + for (int i = 0; i < ledCount; i++) + InitializeLed(LedId.DRAM1 + i, new Rectangle(i * 10, 0, 10, 10)); -// #endregion + //TODO DarthAffe 21.10.2017: We don't know the model, how to save layouts and images? + //TODO DarthAffe 07.10.2017: We don't know the model, how to save layouts and images? + ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Drams\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null); + } -// #region Methods + /// + protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.DRAM1; -// /// -// protected override void InitializeLayout() -// { -// //TODO DarthAffe 21.10.2017: Look for a good default layout -// int ledCount = _AsusSDK.GetGPULedCount(DramDeviceInfo.Handle); -// for (int i = 0; i < ledCount; i++) -// InitializeLed(new AsusLedId(this, AsusLedIds.DramLed1 + i, i), new Rectangle(i * 10, 0, 10, 10)); - -// //TODO DarthAffe 21.10.2017: We don't know the model, how to save layouts and images? -// ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Drams\{DramDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), -// null, PathHelper.GetAbsolutePath(@"Images\Asus\Drams")); -// } - -// /// -// protected override void ApplyColorData() => _AsusSDK.SetDramColor(DramDeviceInfo.Handle, ColorData); - -// #endregion -// } -//} + #endregion + } +} diff --git a/RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs b/RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs index 083cafd..0241828 100644 --- a/RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Generic/AsusRGBDevice.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Runtime.InteropServices; using RGB.NET.Core; namespace RGB.NET.Devices.Asus @@ -59,7 +57,7 @@ namespace RGB.NET.Devices.Asus } UpdateQueue = new AsusUpdateQueue(updateTrigger); - UpdateQueue.Initialize(GetUpdateColorAction(), DeviceInfo.Handle, LedMapping.Count); + UpdateQueue.Initialize(DeviceInfo.Device); } /// @@ -70,20 +68,16 @@ namespace RGB.NET.Devices.Asus /// protected override void UpdateLeds(IEnumerable ledsToUpdate) => UpdateQueue.SetData(ledsToUpdate.Where(x => x.Color.A > 0)); - /// - /// Gets a action to update the physical device. - /// - /// - protected abstract Action GetUpdateColorAction(); - - /// - /// - public override void Dispose() + /// + public override void SyncBack() { - if ((DeviceInfo is AsusRGBDeviceInfo deviceInfo) && (deviceInfo.Handle != IntPtr.Zero)) - Marshal.FreeHGlobal(deviceInfo.Handle); - - base.Dispose(); + // DarthAffe 16.06.2019: This doesn't work since the SDK only returns the colors we set. + //foreach (Led led in LedMapping.Values) + //{ + // int index = (int)led.CustomData; + // IAuraRgbLight light = DeviceInfo.Device.Lights[index]; + // SetLedColorWithoutRequest(led, new Color(light.Red, light.Green, light.Blue)); + //} } #endregion diff --git a/RGB.NET.Devices.Asus/Generic/AsusRGBDeviceInfo.cs b/RGB.NET.Devices.Asus/Generic/AsusRGBDeviceInfo.cs index 7c6ff69..62c7ea9 100644 --- a/RGB.NET.Devices.Asus/Generic/AsusRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Asus/Generic/AsusRGBDeviceInfo.cs @@ -1,4 +1,5 @@ using System; +using AuraServiceLib; using RGB.NET.Core; namespace RGB.NET.Devices.Asus @@ -7,7 +8,7 @@ namespace RGB.NET.Devices.Asus /// /// Represents a generic information for a Corsair-. /// - public abstract class AsusRGBDeviceInfo : IRGBDeviceInfo + public class AsusRGBDeviceInfo : IRGBDeviceInfo { #region Properties & Fields @@ -30,12 +31,9 @@ namespace RGB.NET.Devices.Asus public RGBDeviceLighting Lighting => RGBDeviceLighting.Key; /// - public abstract bool SupportsSyncBack { get; } + public bool SupportsSyncBack => false; - /// - /// Gets the index of the . - /// - internal IntPtr Handle { get; } + public IAuraSyncDevice Device { get; } #endregion @@ -45,14 +43,14 @@ namespace RGB.NET.Devices.Asus /// Internal constructor of managed . /// /// The type of the . - /// The handle of the . + /// The backing this RGB.NET device. /// The manufacturer-name of the . /// The model-name of the . - internal AsusRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle, string model = "Generic Asus-Device", string manufacturer = "Asus") + internal AsusRGBDeviceInfo(RGBDeviceType deviceType, IAuraSyncDevice device, string model = null, string manufacturer = "Asus") { this.DeviceType = deviceType; - this.Handle = handle; - this.Model = model; + this.Device = device; + this.Model = model ?? device.Name; this.Manufacturer = manufacturer; DeviceName = $"{Manufacturer} {Model}"; diff --git a/RGB.NET.Devices.Asus/Generic/AsusUnspecifiedRGBDevice.cs b/RGB.NET.Devices.Asus/Generic/AsusUnspecifiedRGBDevice.cs new file mode 100644 index 0000000..3515596 --- /dev/null +++ b/RGB.NET.Devices.Asus/Generic/AsusUnspecifiedRGBDevice.cs @@ -0,0 +1,49 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.Asus +{ + /// + /// + /// Represents a Asus headset. + /// + public class AsusUnspecifiedRGBDevice : AsusRGBDevice + { + #region Properties & Fields + + private LedId _baseLedId; + + #endregion + + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The specific information provided by Asus for the headset. + internal AsusUnspecifiedRGBDevice(AsusRGBDeviceInfo info, LedId baseLedId) + : base(info) + { + this._baseLedId = baseLedId; + } + + #endregion + + #region Methods + + /// + protected override void InitializeLayout() + { + int ledCount = DeviceInfo.Device.Lights.Count; + for (int i = 0; i < ledCount; i++) + InitializeLed(_baseLedId + i, new Rectangle(i * 10, 0, 10, 10)); + + //TODO DarthAffe 19.05.2019: Add a way to define a layout for this kind of devies + } + + /// + protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)_baseLedId; + + #endregion + } +} diff --git a/RGB.NET.Devices.Asus/Generic/AsusUpdateQueue.cs b/RGB.NET.Devices.Asus/Generic/AsusUpdateQueue.cs index 28fa936..fb32a3e 100644 --- a/RGB.NET.Devices.Asus/Generic/AsusUpdateQueue.cs +++ b/RGB.NET.Devices.Asus/Generic/AsusUpdateQueue.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using AuraServiceLib; using RGB.NET.Core; namespace RGB.NET.Devices.Asus @@ -13,13 +14,9 @@ namespace RGB.NET.Devices.Asus #region Properties & Fields /// - /// Gets or sets the internal color-data cache. + /// The device to be updated. /// - // ReSharper disable once MemberCanBePrivate.Global - protected byte[] ColorData { get; private set; } - - private Action _updateAction; - private IntPtr _handle; + protected IAuraSyncDevice Device { get; private set; } #endregion @@ -40,29 +37,31 @@ namespace RGB.NET.Devices.Asus /// /// Initializes the queue. /// - /// The update-action called by the queue to perform updates. - /// The handle of the device this queue performs updates for. - /// The amount of leds of the device this queue performs updates for. - public void Initialize(Action updateAction, IntPtr handle, int ledCount) + /// The device to be updated. + public void Initialize(IAuraSyncDevice device) { - _updateAction = updateAction; - _handle = handle; - - ColorData = new byte[ledCount * 3]; + Device = device; } /// protected override void Update(Dictionary dataSet) { - foreach (KeyValuePair data in dataSet) + try { - int index = ((int)data.Key) * 3; - ColorData[index] = data.Value.GetR(); - ColorData[index + 1] = data.Value.GetB(); - ColorData[index + 2] = data.Value.GetG(); - } + foreach (KeyValuePair data in dataSet) + { + int index = (int)data.Key; + IAuraRgbLight light = Device.Lights[index]; + (_, byte r, byte g, byte b) = data.Value.GetRGBBytes(); + light.Red = r; + light.Green = g; + light.Blue = b; + } - _updateAction(_handle, ColorData); + Device.Apply(); + } + catch (Exception ex) + { /* "The server threw an exception." seems to be a thing here ... */ } } #endregion diff --git a/RGB.NET.Devices.Asus/GraphicsCard/AsusGraphicsCardRGBDevice.cs b/RGB.NET.Devices.Asus/GraphicsCard/AsusGraphicsCardRGBDevice.cs index 360fa38..679dd4a 100644 --- a/RGB.NET.Devices.Asus/GraphicsCard/AsusGraphicsCardRGBDevice.cs +++ b/RGB.NET.Devices.Asus/GraphicsCard/AsusGraphicsCardRGBDevice.cs @@ -1,6 +1,4 @@ -using System; -using RGB.NET.Core; -using RGB.NET.Devices.Asus.Native; +using RGB.NET.Core; namespace RGB.NET.Devices.Asus { @@ -8,7 +6,7 @@ namespace RGB.NET.Devices.Asus /// /// Represents a Asus graphicsCard. /// - public class AsusGraphicsCardRGBDevice : AsusRGBDevice + public class AsusGraphicsCardRGBDevice : AsusRGBDevice { #region Constructors @@ -17,7 +15,7 @@ namespace RGB.NET.Devices.Asus /// Initializes a new instance of the class. /// /// The specific information provided by Asus for the graphics card. - internal AsusGraphicsCardRGBDevice(AsusGraphicsCardRGBDeviceInfo info) + internal AsusGraphicsCardRGBDevice(AsusRGBDeviceInfo info) : base(info) { } @@ -29,7 +27,7 @@ namespace RGB.NET.Devices.Asus protected override void InitializeLayout() { //TODO DarthAffe 07.10.2017: Look for a good default layout - int ledCount = _AsusSDK.GetGPULedCount(DeviceInfo.Handle); + int ledCount = DeviceInfo.Device.Lights.Count; for (int i = 0; i < ledCount; i++) InitializeLed(LedId.GraphicsCard1 + i, new Rectangle(i * 10, 0, 10, 10)); @@ -40,9 +38,6 @@ namespace RGB.NET.Devices.Asus /// protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.GraphicsCard1; - /// - protected override Action GetUpdateColorAction() => _AsusSDK.SetGPUColor; - #endregion } } diff --git a/RGB.NET.Devices.Asus/Headset/AsusHeadsetRGBDevice.cs b/RGB.NET.Devices.Asus/Headset/AsusHeadsetRGBDevice.cs new file mode 100644 index 0000000..c221e1e --- /dev/null +++ b/RGB.NET.Devices.Asus/Headset/AsusHeadsetRGBDevice.cs @@ -0,0 +1,43 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.Asus +{ + /// + /// + /// Represents a Asus headset. + /// + public class AsusHeadsetRGBDevice : AsusRGBDevice + { + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The specific information provided by Asus for the headset. + internal AsusHeadsetRGBDevice(AsusRGBDeviceInfo info) + : base(info) + { } + + #endregion + + #region Methods + + /// + protected override void InitializeLayout() + { + //TODO DarthAffe 07.10.2017: Look for a good default layout + int ledCount = DeviceInfo.Device.Lights.Count; + for (int i = 0; i < ledCount; i++) + InitializeLed(LedId.Headset1 + 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\Asus\Headsets\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null); + } + + /// + protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Headset1; + + #endregion + } +} diff --git a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDevice.cs b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDevice.cs index 6ced56e..320f39a 100644 --- a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDevice.cs @@ -1,6 +1,4 @@ -using System; -using RGB.NET.Core; -using RGB.NET.Devices.Asus.Native; +using RGB.NET.Core; namespace RGB.NET.Devices.Asus { @@ -29,7 +27,7 @@ namespace RGB.NET.Devices.Asus protected override void InitializeLayout() { //TODO DarthAffe 07.10.2017: This doesn't make sense at all ... Find someone with such a keyboard! - int ledCount = _AsusSDK.GetClaymoreKeyboardLedCount(DeviceInfo.Handle); + int ledCount = DeviceInfo.Device.Lights.Count; for (int i = 0; i < ledCount; i++) InitializeLed(LedId.Keyboard_Escape + i, new Rectangle(i * 19, 0, 19, 19)); @@ -40,9 +38,6 @@ namespace RGB.NET.Devices.Asus /// protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Keyboard_Escape; - /// - protected override Action GetUpdateColorAction() => _AsusSDK.SetClaymoreKeyboardColor; - #endregion } } diff --git a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDeviceInfo.cs b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDeviceInfo.cs index db343c0..bf020a6 100644 --- a/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Asus/Keyboard/AsusKeyboardRGBDeviceInfo.cs @@ -1,5 +1,5 @@ -using System; -using System.Globalization; +using System.Globalization; +using AuraServiceLib; using RGB.NET.Core; namespace RGB.NET.Devices.Asus @@ -12,9 +12,6 @@ namespace RGB.NET.Devices.Asus { #region Properties & Fields - /// - public override bool SupportsSyncBack => false; - /// /// Gets the physical layout of the keyboard. /// @@ -33,11 +30,10 @@ namespace RGB.NET.Devices.Asus /// /// Internal constructor of managed . /// - /// The type of the . - /// The handle of the . + /// The backing this RGB.NET device. /// The of the layout this keyboard is using. - internal AsusKeyboardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle, CultureInfo culture) - : base(deviceType, handle, "Claymore") + internal AsusKeyboardRGBDeviceInfo(IAuraSyncDevice device, CultureInfo culture) + : base(RGBDeviceType.Keyboard, device, "Claymore") { SetLayouts(culture.KeyboardLayoutId); } diff --git a/RGB.NET.Devices.Asus/Layouts/Asus/Mainboards/PRIMEX370-PRO.xml b/RGB.NET.Devices.Asus/Layouts/Asus/Mainboards/PRIMEX370-PRO.xml deleted file mode 100644 index ad9c378..0000000 --- a/RGB.NET.Devices.Asus/Layouts/Asus/Mainboards/PRIMEX370-PRO.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - Asus Prime X370-PRO - Asus Prime X370-PRO Mainboard - Darth Affe - Mainboard - Key - Asus - Prime X370-PRO - 252 - 305 - Images\Asus\Mainboards - PRIMEX370-PRO.png - - - 0 - 131 - 35mm - 57mm - M 0,0 L 0,1 L 0.325,1 L 0.325,0 Z M 0.862,0 L 0.822,0.06 L 0.904,0.11 L 0.91,0.505 L 0.86,0.532 L 0.74,0.532 L 0.6575,0.485 L 0.54,0.485 L 0.425,0.55 L 0.425,0.64 L0.44,0.66 L0.44,0.755 L 0.4,0.78 L 0.4,1 L 0.5,1 L 0.5,0.805 L 0.53,0.785 L 0.53,0.6325 L 0.515,0.6225 L 0.515,0.575 L 0.575,0.543 L 0.6225,0.543 L 0.705,0.59 L 0.9,0.59 L 1,0.525 L 1,0.08 Z - - - 0 - + - 17mm - 40mm - M 0.83,0 L 0.83,1 L1,1 L 1,0 Z M 0,0 L 0,1 L 0.6691,1 L 0.6691,0 Z - - - 0 - + - 44mm - 41mm - - M 0,0 L 0,1 L 0.26,1 L 0.26,0 Z M 0.32,0 L 0.32,0.29 L 0.365,0.325 L 0.395,0.325 L 0.395,0.36 L 0.455,0.41 L 0.49,0.345 L 0.4675,0.32 L 0.455,0.2475 L 0.4675,0.26 L 0.395,0.2475 L 0.395,0 Z - M 0.935,0.715 L 0.935,0.84 L 0.865,0.915 L 0.865,1 L 0.9375,1 L 0.9375,0.95 L 1,0.88 L 1,0.715 Z - - - - 0 - + - 68mm - 35mm - M 0,0 L 0,1 L 0.94,1 L 0.94,0.95 L 0.206,0.95 Q 0.168,0.95 0.165,0.875 L 0.165,0 Z M 0.55,0.019 L 0.55,0.132 L 0.578,0.19 L 0.578,0.2078 L 0.612,0.271 L 0.612,0.6625 L 0.635,0.7125 L0.735,0.7125 L0.755,0.75 L 0.915,0.75 L 0.92,0.76 L 0.942,0.76 L 0.94,1 L 0.99,1 L 0.99,0.72 L 0.965,0.67 L 0.935,0.67 L 0.93,0.66 L 0.772,0.66 L 0.752,0.62 L 0.66,0.62 L 0.66,0.237 L 0.622,0.16 L 0.622,0.145 L 0.5975,0.095 L 0.5975,0.019 Z - - - 80 - 132 - 5mm - 13mm - - - \ No newline at end of file diff --git a/RGB.NET.Devices.Asus/Layouts/DeviceLayout.xsd b/RGB.NET.Devices.Asus/Layouts/DeviceLayout.xsd deleted file mode 100644 index 91ced39..0000000 --- a/RGB.NET.Devices.Asus/Layouts/DeviceLayout.xsd +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/RGB.NET.Devices.Asus/Mainboard/AsusMainboardRGBDevice.cs b/RGB.NET.Devices.Asus/Mainboard/AsusMainboardRGBDevice.cs index 26fecdb..907b704 100644 --- a/RGB.NET.Devices.Asus/Mainboard/AsusMainboardRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Mainboard/AsusMainboardRGBDevice.cs @@ -1,6 +1,4 @@ -using System; -using RGB.NET.Core; -using RGB.NET.Devices.Asus.Native; +using RGB.NET.Core; namespace RGB.NET.Devices.Asus { @@ -8,7 +6,7 @@ namespace RGB.NET.Devices.Asus /// /// Represents a Asus mainboard. /// - public class AsusMainboardRGBDevice : AsusRGBDevice + public class AsusMainboardRGBDevice : AsusRGBDevice { #region Constructors @@ -17,7 +15,7 @@ namespace RGB.NET.Devices.Asus /// Initializes a new instance of the class. /// /// The specific information provided by Asus for the mainboard. - internal AsusMainboardRGBDevice(AsusMainboardRGBDeviceInfo info) + internal AsusMainboardRGBDevice(AsusRGBDeviceInfo info) : base(info) { } @@ -29,7 +27,7 @@ namespace RGB.NET.Devices.Asus protected override void InitializeLayout() { //TODO DarthAffe 07.10.2017: Look for a good default layout - int ledCount = _AsusSDK.GetMbLedCount(DeviceInfo.Handle); + int ledCount = DeviceInfo.Device.Lights.Count; for (int i = 0; i < ledCount; i++) InitializeLed(LedId.Mainboard1 + i, new Rectangle(i * 40, 0, 40, 8)); @@ -40,17 +38,6 @@ namespace RGB.NET.Devices.Asus /// protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Mainboard1; - /// - public override void SyncBack() - { - byte[] colorData = _AsusSDK.GetMbColor(DeviceInfo.Handle); - for (int i = 0; i < LedMapping.Count; i++) - SetLedColorWithoutRequest(LedMapping[LedId.Mainboard1 + i], new Color(colorData[(i * 3)], colorData[(i * 3) + 2], colorData[(i * 3) + 1])); - } - - /// - protected override Action GetUpdateColorAction() => _AsusSDK.SetMbColor; - #endregion } } diff --git a/RGB.NET.Devices.Asus/Mouse/AsusMouseRGBDevice.cs b/RGB.NET.Devices.Asus/Mouse/AsusMouseRGBDevice.cs index 03db09c..bc9df80 100644 --- a/RGB.NET.Devices.Asus/Mouse/AsusMouseRGBDevice.cs +++ b/RGB.NET.Devices.Asus/Mouse/AsusMouseRGBDevice.cs @@ -1,6 +1,4 @@ -using System; -using RGB.NET.Core; -using RGB.NET.Devices.Asus.Native; +using RGB.NET.Core; namespace RGB.NET.Devices.Asus { @@ -8,7 +6,7 @@ namespace RGB.NET.Devices.Asus /// /// Represents a Asus mouse. /// - public class AsusMouseRGBDevice : AsusRGBDevice + public class AsusMouseRGBDevice : AsusRGBDevice { #region Constructors @@ -17,7 +15,7 @@ namespace RGB.NET.Devices.Asus /// Initializes a new instance of the class. /// /// The specific information provided by Asus for the mouse. - internal AsusMouseRGBDevice(AsusMouseRGBDeviceInfo info) + internal AsusMouseRGBDevice(AsusRGBDeviceInfo info) : base(info) { } @@ -29,7 +27,7 @@ namespace RGB.NET.Devices.Asus protected override void InitializeLayout() { //TODO DarthAffe 07.10.2017: Look for a good default layout - int ledCount = _AsusSDK.GetRogMouseLedCount(DeviceInfo.Handle); + int ledCount = DeviceInfo.Device.Lights.Count; for (int i = 0; i < ledCount; i++) InitializeLed(LedId.Mouse1 + i, new Rectangle(i * 10, 0, 10, 10)); @@ -39,9 +37,6 @@ namespace RGB.NET.Devices.Asus /// protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Mouse1; - /// - protected override Action GetUpdateColorAction() => _AsusSDK.SetRogMouseColor; - #endregion } } diff --git a/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj b/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj index 5172398..4ac5677 100644 --- a/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj +++ b/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj @@ -58,6 +58,31 @@ $(DefineConstants);RELEASE + + + f1aa5209-5217-4b82-ba7e-a68198999afa + 1 + 0 + tlbimp + 0 + false + + + + + <_PackageFiles Include="$(OutputPath)\net45\Interop.AuraServiceLib.dll"> + None + lib\net45\ + + + + + <_PackageFiles Include="$(OutputPath)\netstandard2.0\Interop.AuraServiceLib.dll"> + None + lib\netstandard2.0\ + + + diff --git a/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj.DotSettings b/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj.DotSettings index 3818a29..942f886 100644 --- a/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj.DotSettings +++ b/RGB.NET.Devices.Asus/RGB.NET.Devices.Asus.csproj.DotSettings @@ -4,6 +4,7 @@ True True True + True True True True diff --git a/RGB.NET.Devices.Asus_Legacy/AsusDeviceProvider.cs b/RGB.NET.Devices.Asus_Legacy/AsusDeviceProvider.cs new file mode 100644 index 0000000..4ca979a --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/AsusDeviceProvider.cs @@ -0,0 +1,274 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Globalization; +using System.Runtime.InteropServices; +using RGB.NET.Core; +using RGB.NET.Devices.Asus.Native; + +namespace RGB.NET.Devices.Asus +{ + /// + /// + /// Represents a device provider responsible for Cooler Master devices. + /// + [Obsolete("Use this only if you need syncback-capability")] + public class AsusDeviceProvider : IRGBDeviceProvider + { + #region Properties & Fields + + private static AsusDeviceProvider _instance; + /// + /// Gets the singleton instance. + /// + public static AsusDeviceProvider Instance => _instance ?? new AsusDeviceProvider(); + + /// + /// Gets a modifiable list of paths used to find the native SDK-dlls for x86 applications. + /// The first match will be used. + /// + public static List PossibleX86NativePaths { get; } = new List { "x86/AURA_SDK.dll" }; + + /// + /// Gets a modifiable list of paths used to find the native SDK-dlls for x64 applications. + /// The first match will be used. + /// + public static List PossibleX64NativePaths { get; } = new List { }; + + /// + /// + /// Indicates if the SDK is initialized and ready to use. + /// + public bool IsInitialized { get; private set; } + + /// + /// Gets the loaded architecture (x64/x86). + /// + public string LoadedArchitecture => _AsusSDK.LoadedArchitecture; + + /// + /// + /// Gets whether the application has exclusive access to the SDK or not. + /// + public bool HasExclusiveAccess { get; private set; } + + /// + public IEnumerable Devices { get; private set; } + + /// + /// Gets or sets a function to get the culture for a specific device. + /// + // ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global + public Func GetCulture { get; set; } = CultureHelper.GetCurrentCulture; + + /// + /// The used to trigger the updates for asus devices. + /// + public DeviceUpdateTrigger UpdateTrigger { get; private set; } + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// Thrown if this constructor is called even if there is already an instance of this class. + public AsusDeviceProvider() + { + if (_instance != null) throw new InvalidOperationException($"There can be only one instance of type {nameof(AsusDeviceProvider)}"); + _instance = this; + + UpdateTrigger = new DeviceUpdateTrigger(); + } + + #endregion + + #region Methods + + /// + public bool Initialize(RGBDeviceType loadFilter = RGBDeviceType.All, bool exclusiveAccessIfPossible = false, bool throwExceptions = false) + { + IsInitialized = false; + + try + { + UpdateTrigger?.Stop(); + + _AsusSDK.Reload(); + + IList devices = new List(); + + #region Mainboard + + if (loadFilter.HasFlag(RGBDeviceType.Mainboard)) + try + { + //TODO DarthAffe 26.11.2017: This is not a fix! There might really be a second controller on the mainboard, but for now this should prevent the random crash for some guys. + // DarthAffe 26.11.2017: https://rog.asus.com/forum/showthread.php?97754-Access-Violation-Wrong-EnumerateMB-Result&p=688901#post688901 + int mainboardCount = Math.Min(1, _AsusSDK.EnumerateMbController(IntPtr.Zero, 0)); + if (mainboardCount > 0) + { + IntPtr mainboardHandles = Marshal.AllocHGlobal(mainboardCount * IntPtr.Size); + _AsusSDK.EnumerateMbController(mainboardHandles, mainboardCount); + + for (int i = 0; i < mainboardCount; i++) + { + try + { + IntPtr handle = Marshal.ReadIntPtr(mainboardHandles, i); + _AsusSDK.SetMbMode(handle, 1); + AsusMainboardRGBDevice device = new AsusMainboardRGBDevice(new AsusMainboardRGBDeviceInfo(RGBDeviceType.Mainboard, handle)); + device.Initialize(UpdateTrigger); + devices.Add(device); + } + catch { if (throwExceptions) throw; } + } + } + } + catch { if (throwExceptions) throw; } + + #endregion + + #region Graphics cards + + //TODO DarthAffe 21.10.2017: This somehow returns non-existant gpus (at least for me) which cause huge lags (if a real asus-ready gpu is connected this doesn't happen) + + if (loadFilter.HasFlag(RGBDeviceType.GraphicsCard)) + try + { + int graphicCardCount = _AsusSDK.EnumerateGPU(IntPtr.Zero, 0); + if (graphicCardCount > 0) + { + IntPtr grapicsCardHandles = Marshal.AllocHGlobal(graphicCardCount * IntPtr.Size); + _AsusSDK.EnumerateGPU(grapicsCardHandles, graphicCardCount); + + for (int i = 0; i < graphicCardCount; i++) + { + try + { + IntPtr handle = Marshal.ReadIntPtr(grapicsCardHandles, i); + _AsusSDK.SetGPUMode(handle, 1); + AsusGraphicsCardRGBDevice device = new AsusGraphicsCardRGBDevice(new AsusGraphicsCardRGBDeviceInfo(RGBDeviceType.GraphicsCard, handle)); + device.Initialize(UpdateTrigger); + devices.Add(device); + } + catch { if (throwExceptions) throw; } + } + } + } + catch { if (throwExceptions) throw; } + + #endregion + + #region DRAM + + //TODO DarthAffe 29.10.2017: I don't know why they are even documented, but the asus guy said they aren't in the SDK right now. + //try + //{ + //int dramCount = _AsusSDK.EnumerateDram(IntPtr.Zero, 0); + //if (dramCount > 0) + //{ + // IntPtr dramHandles = Marshal.AllocHGlobal(dramCount * IntPtr.Size); + // _AsusSDK.EnumerateDram(dramHandles, dramCount); + + // for (int i = 0; i < dramCount; i++) + // { + //try + //{ + // IntPtr handle = Marshal.ReadIntPtr(dramHandles, i); + // _AsusSDK.SetDramMode(handle, 1); + // AsusDramRGBDevice device = new AsusDramRGBDevice(new AsusDramRGBDeviceInfo(RGBDeviceType.DRAM, handle)); + // device.Initialize(UpdateTrigger); + // devices.Add(device); + // } + //catch { if (throwExceptions) throw; } + // } + //} + //} + // catch { if (throwExceptions) throw; } + + #endregion + + #region Keyboard + + if (loadFilter.HasFlag(RGBDeviceType.Keyboard)) + try + { + IntPtr keyboardHandle = Marshal.AllocHGlobal(IntPtr.Size); + if (_AsusSDK.CreateClaymoreKeyboard(keyboardHandle)) + { + _AsusSDK.SetClaymoreKeyboardMode(keyboardHandle, 1); + AsusKeyboardRGBDevice device = new AsusKeyboardRGBDevice(new AsusKeyboardRGBDeviceInfo(RGBDeviceType.Keyboard, keyboardHandle, GetCulture())); + device.Initialize(UpdateTrigger); + devices.Add(device); + } + } + catch { if (throwExceptions) throw; } + + #endregion + + #region Mouse + + if (loadFilter.HasFlag(RGBDeviceType.Mouse)) + try + { + IntPtr mouseHandle = Marshal.AllocHGlobal(IntPtr.Size); + if (_AsusSDK.CreateRogMouse(mouseHandle)) + { + _AsusSDK.SetRogMouseMode(mouseHandle, 1); + AsusMouseRGBDevice device = new AsusMouseRGBDevice(new AsusMouseRGBDeviceInfo(RGBDeviceType.Mouse, mouseHandle)); + device.Initialize(UpdateTrigger); + devices.Add(device); + } + } + catch { if (throwExceptions) throw; } + + #endregion + + UpdateTrigger?.Start(); + + Devices = new ReadOnlyCollection(devices); + IsInitialized = true; + } + catch + { + if (throwExceptions) + throw; + return false; + } + + return true; + } + + /// + public void ResetDevices() + { + foreach (IRGBDevice device in Devices) + { + AsusRGBDeviceInfo deviceInfo = (AsusRGBDeviceInfo)device.DeviceInfo; + switch (deviceInfo.DeviceType) + { + case RGBDeviceType.Mainboard: + _AsusSDK.SetMbMode(deviceInfo.Handle, 0); + break; + case RGBDeviceType.GraphicsCard: + _AsusSDK.SetGPUMode(deviceInfo.Handle, 0); + break; + //case RGBDeviceType.DRAM: + // _AsusSDK.SetDramMode(deviceInfo.Handle, 0); + // break; + } + } + } + + /// + public void Dispose() + { } + + #endregion + } +} diff --git a/RGB.NET.Devices.Asus_Legacy/AsusDeviceProviderLoader.cs b/RGB.NET.Devices.Asus_Legacy/AsusDeviceProviderLoader.cs new file mode 100644 index 0000000..576dfb5 --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/AsusDeviceProviderLoader.cs @@ -0,0 +1,24 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.Asus +{ + /// + /// Represents a device provider loaded used to dynamically load asus devices into an application. + /// + public class AsusDeviceProviderLoader : IRGBDeviceProviderLoader + { + #region Properties & Fields + + /// + public bool RequiresInitialization => false; + + #endregion + + #region Methods + + /// + public IRGBDeviceProvider GetDeviceProvider() => AsusDeviceProvider.Instance; + + #endregion + } +} diff --git a/RGB.NET.Devices.Asus_Legacy/Dram/AsusDramRGBDevice.cs b/RGB.NET.Devices.Asus_Legacy/Dram/AsusDramRGBDevice.cs new file mode 100644 index 0000000..6cdc398 --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/Dram/AsusDramRGBDevice.cs @@ -0,0 +1,56 @@ +//using RGB.NET.Core; +//using RGB.NET.Devices.Asus.Native; + +//namespace RGB.NET.Devices.Asus +//{ +// /// +// /// +// /// Represents a Asus dram. +// /// +// public class AsusDramRGBDevice : AsusRGBDevice +// { +// #region Properties & Fields + +// /// +// /// Gets information about the . +// /// +// public AsusDramRGBDeviceInfo DramDeviceInfo { get; } + +// #endregion + +// #region Constructors + +// /// +// /// +// /// Initializes a new instance of the class. +// /// +// /// The specific information provided by Asus for the DRAM. +// internal AsusDramRGBDevice(AsusDramRGBDeviceInfo info) +// : base(info) +// { +// this.DramDeviceInfo = info; +// } + +// #endregion + +// #region Methods + +// /// +// protected override void InitializeLayout() +// { +// //TODO DarthAffe 21.10.2017: Look for a good default layout +// int ledCount = _AsusSDK.GetGPULedCount(DramDeviceInfo.Handle); +// for (int i = 0; i < ledCount; i++) +// InitializeLed(new AsusLedId(this, AsusLedIds.DramLed1 + i, i), new Rectangle(i * 10, 0, 10, 10)); + +// //TODO DarthAffe 21.10.2017: We don't know the model, how to save layouts and images? +// ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Drams\{DramDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), +// null, PathHelper.GetAbsolutePath(@"Images\Asus\Drams")); +// } + +// /// +// protected override void ApplyColorData() => _AsusSDK.SetDramColor(DramDeviceInfo.Handle, ColorData); + +// #endregion +// } +//} diff --git a/RGB.NET.Devices.Asus/Dram/AsusDramRGBDeviceInfo.cs b/RGB.NET.Devices.Asus_Legacy/Dram/AsusDramRGBDeviceInfo.cs similarity index 100% rename from RGB.NET.Devices.Asus/Dram/AsusDramRGBDeviceInfo.cs rename to RGB.NET.Devices.Asus_Legacy/Dram/AsusDramRGBDeviceInfo.cs diff --git a/RGB.NET.Devices.Asus_Legacy/Enum/AsusLogicalKeyboardLayout.cs b/RGB.NET.Devices.Asus_Legacy/Enum/AsusLogicalKeyboardLayout.cs new file mode 100644 index 0000000..60105e5 --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/Enum/AsusLogicalKeyboardLayout.cs @@ -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.Asus +{ + /// + /// Contains list of available logical layouts for asus keyboards. + /// + public enum AsusLogicalKeyboardLayout + { + TODO + }; +} diff --git a/RGB.NET.Devices.Asus_Legacy/Enum/AsusPhysicalKeyboardLayout.cs b/RGB.NET.Devices.Asus_Legacy/Enum/AsusPhysicalKeyboardLayout.cs new file mode 100644 index 0000000..b5e80de --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/Enum/AsusPhysicalKeyboardLayout.cs @@ -0,0 +1,15 @@ +// ReSharper disable UnusedMember.Global +// ReSharper disable InconsistentNaming + +#pragma warning disable 1591 // Missing XML comment for publicly visible type or member + +namespace RGB.NET.Devices.Asus +{ + /// + /// Contains list of available physical layouts for asus keyboards. + /// + public enum AsusPhysicalKeyboardLayout + { + TODO + } +} diff --git a/RGB.NET.Devices.Asus_Legacy/Generic/AsusRGBDevice.cs b/RGB.NET.Devices.Asus_Legacy/Generic/AsusRGBDevice.cs new file mode 100644 index 0000000..083cafd --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/Generic/AsusRGBDevice.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using RGB.NET.Core; + +namespace RGB.NET.Devices.Asus +{ + /// + /// + /// + /// Represents a generic Asus-device. (keyboard, mouse, headset, mousepad). + /// + public abstract class AsusRGBDevice : AbstractRGBDevice, IAsusRGBDevice + where TDeviceInfo : AsusRGBDeviceInfo + { + #region Properties & Fields + + /// + /// + /// Gets information about the . + /// + public override TDeviceInfo DeviceInfo { get; } + + /// + /// Gets or sets the update queue performing updates for this device. + /// + // ReSharper disable once MemberCanBePrivate.Global + protected AsusUpdateQueue UpdateQueue { get; set; } + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// The generic information provided by Asus for the device. + protected AsusRGBDevice(TDeviceInfo info) + { + this.DeviceInfo = info; + } + + #endregion + + #region Methods + + /// + /// Initializes the device. + /// + public void Initialize(IDeviceUpdateTrigger updateTrigger) + { + InitializeLayout(); + + if (Size == Size.Invalid) + { + Rectangle ledRectangle = new Rectangle(this.Select(x => x.LedRectangle)); + Size = ledRectangle.Size + new Size(ledRectangle.Location.X, ledRectangle.Location.Y); + } + + UpdateQueue = new AsusUpdateQueue(updateTrigger); + UpdateQueue.Initialize(GetUpdateColorAction(), DeviceInfo.Handle, LedMapping.Count); + } + + /// + /// Initializes the and of the device. + /// + protected abstract void InitializeLayout(); + + /// + protected override void UpdateLeds(IEnumerable ledsToUpdate) => UpdateQueue.SetData(ledsToUpdate.Where(x => x.Color.A > 0)); + + /// + /// Gets a action to update the physical device. + /// + /// + protected abstract Action GetUpdateColorAction(); + + /// + /// + public override void Dispose() + { + if ((DeviceInfo is AsusRGBDeviceInfo deviceInfo) && (deviceInfo.Handle != IntPtr.Zero)) + Marshal.FreeHGlobal(deviceInfo.Handle); + + base.Dispose(); + } + + #endregion + } +} diff --git a/RGB.NET.Devices.Asus_Legacy/Generic/AsusRGBDeviceInfo.cs b/RGB.NET.Devices.Asus_Legacy/Generic/AsusRGBDeviceInfo.cs new file mode 100644 index 0000000..7c6ff69 --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/Generic/AsusRGBDeviceInfo.cs @@ -0,0 +1,63 @@ +using System; +using RGB.NET.Core; + +namespace RGB.NET.Devices.Asus +{ + /// + /// + /// Represents a generic information for a Corsair-. + /// + public abstract class AsusRGBDeviceInfo : IRGBDeviceInfo + { + #region Properties & Fields + + /// + public RGBDeviceType DeviceType { get; } + + /// + public string DeviceName { get; } + + /// + public string Manufacturer { get; } + + /// + public string Model { get; } + + /// + public Uri Image { get; set; } + + /// + public RGBDeviceLighting Lighting => RGBDeviceLighting.Key; + + /// + public abstract bool SupportsSyncBack { get; } + + /// + /// Gets the index of the . + /// + internal IntPtr Handle { get; } + + #endregion + + #region Constructors + + /// + /// Internal constructor of managed . + /// + /// The type of the . + /// The handle of the . + /// The manufacturer-name of the . + /// The model-name of the . + internal AsusRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle, string model = "Generic Asus-Device", string manufacturer = "Asus") + { + this.DeviceType = deviceType; + this.Handle = handle; + this.Model = model; + this.Manufacturer = manufacturer; + + DeviceName = $"{Manufacturer} {Model}"; + } + + #endregion + } +} diff --git a/RGB.NET.Devices.Asus_Legacy/Generic/AsusUpdateQueue.cs b/RGB.NET.Devices.Asus_Legacy/Generic/AsusUpdateQueue.cs new file mode 100644 index 0000000..28fa936 --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/Generic/AsusUpdateQueue.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using RGB.NET.Core; + +namespace RGB.NET.Devices.Asus +{ + /// + /// + /// Represents the update-queue performing updates for asus devices. + /// + public class AsusUpdateQueue : UpdateQueue + { + #region Properties & Fields + + /// + /// Gets or sets the internal color-data cache. + /// + // ReSharper disable once MemberCanBePrivate.Global + protected byte[] ColorData { get; private set; } + + private Action _updateAction; + private IntPtr _handle; + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used by this queue. + public AsusUpdateQueue(IDeviceUpdateTrigger updateTrigger) + : base(updateTrigger) + { } + + #endregion + + #region Methods + + /// + /// Initializes the queue. + /// + /// The update-action called by the queue to perform updates. + /// The handle of the device this queue performs updates for. + /// The amount of leds of the device this queue performs updates for. + public void Initialize(Action updateAction, IntPtr handle, int ledCount) + { + _updateAction = updateAction; + _handle = handle; + + ColorData = new byte[ledCount * 3]; + } + + /// + protected override void Update(Dictionary dataSet) + { + foreach (KeyValuePair data in dataSet) + { + int index = ((int)data.Key) * 3; + ColorData[index] = data.Value.GetR(); + ColorData[index + 1] = data.Value.GetB(); + ColorData[index + 2] = data.Value.GetG(); + } + + _updateAction(_handle, ColorData); + } + + #endregion + } +} diff --git a/RGB.NET.Devices.Asus_Legacy/Generic/IAsusRGBDevice.cs b/RGB.NET.Devices.Asus_Legacy/Generic/IAsusRGBDevice.cs new file mode 100644 index 0000000..720fd3c --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/Generic/IAsusRGBDevice.cs @@ -0,0 +1,12 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.Asus +{ + /// + /// Represents a asus RGB-device. + /// + internal interface IAsusRGBDevice : IRGBDevice + { + void Initialize(IDeviceUpdateTrigger updateTrigger); + } +} diff --git a/RGB.NET.Devices.Asus_Legacy/GraphicsCard/AsusGraphicsCardRGBDevice.cs b/RGB.NET.Devices.Asus_Legacy/GraphicsCard/AsusGraphicsCardRGBDevice.cs new file mode 100644 index 0000000..360fa38 --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/GraphicsCard/AsusGraphicsCardRGBDevice.cs @@ -0,0 +1,48 @@ +using System; +using RGB.NET.Core; +using RGB.NET.Devices.Asus.Native; + +namespace RGB.NET.Devices.Asus +{ + /// + /// + /// Represents a Asus graphicsCard. + /// + public class AsusGraphicsCardRGBDevice : AsusRGBDevice + { + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The specific information provided by Asus for the graphics card. + internal AsusGraphicsCardRGBDevice(AsusGraphicsCardRGBDeviceInfo info) + : base(info) + { } + + #endregion + + #region Methods + + /// + protected override void InitializeLayout() + { + //TODO DarthAffe 07.10.2017: Look for a good default layout + int ledCount = _AsusSDK.GetGPULedCount(DeviceInfo.Handle); + for (int i = 0; i < ledCount; i++) + InitializeLed(LedId.GraphicsCard1 + i, new Rectangle(i * 10, 0, 10, 10)); + + //TODO DarthAffe 07.10.2017: We don't know the model, how to save layouts and images? + ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\GraphicsCards\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null); + } + + /// + protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.GraphicsCard1; + + /// + protected override Action GetUpdateColorAction() => _AsusSDK.SetGPUColor; + + #endregion + } +} diff --git a/RGB.NET.Devices.Asus/GraphicsCard/AsusGraphicsCardRGBDeviceInfo.cs b/RGB.NET.Devices.Asus_Legacy/GraphicsCard/AsusGraphicsCardRGBDeviceInfo.cs similarity index 100% rename from RGB.NET.Devices.Asus/GraphicsCard/AsusGraphicsCardRGBDeviceInfo.cs rename to RGB.NET.Devices.Asus_Legacy/GraphicsCard/AsusGraphicsCardRGBDeviceInfo.cs diff --git a/RGB.NET.Devices.Asus_Legacy/Helper/WMIHelper.cs b/RGB.NET.Devices.Asus_Legacy/Helper/WMIHelper.cs new file mode 100644 index 0000000..0ea746e --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/Helper/WMIHelper.cs @@ -0,0 +1,63 @@ +#if NETFULL +using System.Management; + +namespace RGB.NET.Devices.Asus +{ + // ReSharper disable once InconsistentNaming + internal static class WMIHelper + { + #region Properties & Fields + + private static ManagementObjectSearcher _mainboardSearcher = new ManagementObjectSearcher(@"root\CIMV2", "SELECT Manufacturer,Product FROM Win32_BaseBoard"); + private static ManagementObjectSearcher _graphicsCardSearcher = new ManagementObjectSearcher(@"root\CIMV2", "SELECT Name FROM Win32_VideoController"); + + private static (string manufacturer, string model)? _mainboardInfo; + private static string _graphicsCardInfo; + + #endregion + + #region Methods + + internal static (string manufacturer, string model)? GetMainboardInfo() + { + if (!_mainboardInfo.HasValue) + foreach (ManagementBaseObject managementBaseObject in _mainboardSearcher.Get()) + { + _mainboardInfo = (managementBaseObject["Manufacturer"]?.ToString(), managementBaseObject["Product"]?.ToString()); + break; + } + + return _mainboardInfo; + } + + internal static string GetGraphicsCardsInfo() + { + if (_graphicsCardInfo == null) + foreach (ManagementBaseObject managementBaseObject in _graphicsCardSearcher.Get()) + { + _graphicsCardInfo = managementBaseObject["Name"]?.ToString(); + break; + } + + return _graphicsCardInfo; + } + + #endregion + } +} +#else +namespace RGB.NET.Devices.Asus +{ + // ReSharper disable once InconsistentNaming + internal static class WMIHelper + { + #region Methods + + internal static (string manufacturer, string model)? GetMainboardInfo() => null; + + internal static string GetGraphicsCardsInfo() => null; + + #endregion + } +} +#endif diff --git a/RGB.NET.Devices.Asus_Legacy/Keyboard/AsusKeyboardRGBDevice.cs b/RGB.NET.Devices.Asus_Legacy/Keyboard/AsusKeyboardRGBDevice.cs new file mode 100644 index 0000000..6ced56e --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/Keyboard/AsusKeyboardRGBDevice.cs @@ -0,0 +1,48 @@ +using System; +using RGB.NET.Core; +using RGB.NET.Devices.Asus.Native; + +namespace RGB.NET.Devices.Asus +{ + /// + /// + /// Represents a Asus keyboard. + /// + public class AsusKeyboardRGBDevice : AsusRGBDevice + { + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The specific information provided by Asus for the keyboard. + internal AsusKeyboardRGBDevice(AsusKeyboardRGBDeviceInfo info) + : base(info) + { } + + #endregion + + #region Methods + + /// + protected override void InitializeLayout() + { + //TODO DarthAffe 07.10.2017: This doesn't make sense at all ... Find someone with such a keyboard! + int ledCount = _AsusSDK.GetClaymoreKeyboardLedCount(DeviceInfo.Handle); + for (int i = 0; i < ledCount; i++) + InitializeLed(LedId.Keyboard_Escape + i, new Rectangle(i * 19, 0, 19, 19)); + + string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper(); + ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Keyboards\{model}\{DeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"), DeviceInfo.LogicalLayout.ToString()); + } + + /// + protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Keyboard_Escape; + + /// + protected override Action GetUpdateColorAction() => _AsusSDK.SetClaymoreKeyboardColor; + + #endregion + } +} diff --git a/RGB.NET.Devices.Asus_Legacy/Keyboard/AsusKeyboardRGBDeviceInfo.cs b/RGB.NET.Devices.Asus_Legacy/Keyboard/AsusKeyboardRGBDeviceInfo.cs new file mode 100644 index 0000000..db343c0 --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/Keyboard/AsusKeyboardRGBDeviceInfo.cs @@ -0,0 +1,63 @@ +using System; +using System.Globalization; +using RGB.NET.Core; + +namespace RGB.NET.Devices.Asus +{ + /// + /// + /// Represents a generic information for a . + /// + public class AsusKeyboardRGBDeviceInfo : AsusRGBDeviceInfo + { + #region Properties & Fields + + /// + public override bool SupportsSyncBack => false; + + /// + /// Gets the physical layout of the keyboard. + /// + public AsusPhysicalKeyboardLayout PhysicalLayout { get; private set; } + + /// + /// Gets the logical layout of the keyboard. + /// + public AsusLogicalKeyboardLayout LogicalLayout { get; private set; } + + #endregion + + #region Constructors + + /// + /// + /// Internal constructor of managed . + /// + /// The type of the . + /// The handle of the . + /// The of the layout this keyboard is using. + internal AsusKeyboardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle, CultureInfo culture) + : base(deviceType, handle, "Claymore") + { + SetLayouts(culture.KeyboardLayoutId); + } + + #endregion + + #region Methods + + private void SetLayouts(int keyboardLayoutId) + { + switch (keyboardLayoutId) + { + //TODO DarthAffe 07.10.2017: Implement + default: + PhysicalLayout = AsusPhysicalKeyboardLayout.TODO; + LogicalLayout = AsusLogicalKeyboardLayout.TODO; + break; + } + } + + #endregion + } +} diff --git a/RGB.NET.Devices.Asus_Legacy/Mainboard/AsusMainboardRGBDevice.cs b/RGB.NET.Devices.Asus_Legacy/Mainboard/AsusMainboardRGBDevice.cs new file mode 100644 index 0000000..26fecdb --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/Mainboard/AsusMainboardRGBDevice.cs @@ -0,0 +1,56 @@ +using System; +using RGB.NET.Core; +using RGB.NET.Devices.Asus.Native; + +namespace RGB.NET.Devices.Asus +{ + /// + /// + /// Represents a Asus mainboard. + /// + public class AsusMainboardRGBDevice : AsusRGBDevice + { + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The specific information provided by Asus for the mainboard. + internal AsusMainboardRGBDevice(AsusMainboardRGBDeviceInfo info) + : base(info) + { } + + #endregion + + #region Methods + + /// + protected override void InitializeLayout() + { + //TODO DarthAffe 07.10.2017: Look for a good default layout + int ledCount = _AsusSDK.GetMbLedCount(DeviceInfo.Handle); + for (int i = 0; i < ledCount; i++) + InitializeLed(LedId.Mainboard1 + i, new Rectangle(i * 40, 0, 40, 8)); + + //TODO DarthAffe 07.10.2017: We don't know the model, how to save layouts and images? + ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Mainboards\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null); + } + + /// + protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Mainboard1; + + /// + public override void SyncBack() + { + byte[] colorData = _AsusSDK.GetMbColor(DeviceInfo.Handle); + for (int i = 0; i < LedMapping.Count; i++) + SetLedColorWithoutRequest(LedMapping[LedId.Mainboard1 + i], new Color(colorData[(i * 3)], colorData[(i * 3) + 2], colorData[(i * 3) + 1])); + } + + /// + protected override Action GetUpdateColorAction() => _AsusSDK.SetMbColor; + + #endregion + } +} diff --git a/RGB.NET.Devices.Asus/Mainboard/AsusMainboardRGBDeviceInfo.cs b/RGB.NET.Devices.Asus_Legacy/Mainboard/AsusMainboardRGBDeviceInfo.cs similarity index 100% rename from RGB.NET.Devices.Asus/Mainboard/AsusMainboardRGBDeviceInfo.cs rename to RGB.NET.Devices.Asus_Legacy/Mainboard/AsusMainboardRGBDeviceInfo.cs diff --git a/RGB.NET.Devices.Asus_Legacy/Mouse/AsusMouseRGBDevice.cs b/RGB.NET.Devices.Asus_Legacy/Mouse/AsusMouseRGBDevice.cs new file mode 100644 index 0000000..03db09c --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/Mouse/AsusMouseRGBDevice.cs @@ -0,0 +1,47 @@ +using System; +using RGB.NET.Core; +using RGB.NET.Devices.Asus.Native; + +namespace RGB.NET.Devices.Asus +{ + /// + /// + /// Represents a Asus mouse. + /// + public class AsusMouseRGBDevice : AsusRGBDevice + { + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The specific information provided by Asus for the mouse. + internal AsusMouseRGBDevice(AsusMouseRGBDeviceInfo info) + : base(info) + { } + + #endregion + + #region Methods + + /// + protected override void InitializeLayout() + { + //TODO DarthAffe 07.10.2017: Look for a good default layout + int ledCount = _AsusSDK.GetRogMouseLedCount(DeviceInfo.Handle); + for (int i = 0; i < ledCount; i++) + InitializeLed(LedId.Mouse1 + i, new Rectangle(i * 10, 0, 10, 10)); + + ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Mouses\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null); + } + + /// + protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Mouse1; + + /// + protected override Action GetUpdateColorAction() => _AsusSDK.SetRogMouseColor; + + #endregion + } +} diff --git a/RGB.NET.Devices.Asus/Mouse/AsusMouseRGBDeviceInfo.cs b/RGB.NET.Devices.Asus_Legacy/Mouse/AsusMouseRGBDeviceInfo.cs similarity index 100% rename from RGB.NET.Devices.Asus/Mouse/AsusMouseRGBDeviceInfo.cs rename to RGB.NET.Devices.Asus_Legacy/Mouse/AsusMouseRGBDeviceInfo.cs diff --git a/RGB.NET.Devices.Asus/Native/_AsusSDK.cs b/RGB.NET.Devices.Asus_Legacy/Native/_AsusSDK.cs similarity index 100% rename from RGB.NET.Devices.Asus/Native/_AsusSDK.cs rename to RGB.NET.Devices.Asus_Legacy/Native/_AsusSDK.cs diff --git a/RGB.NET.Devices.Asus_Legacy/RGB.NET.Devices.Asus_Legacy.csproj b/RGB.NET.Devices.Asus_Legacy/RGB.NET.Devices.Asus_Legacy.csproj new file mode 100644 index 0000000..3be7e47 --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/RGB.NET.Devices.Asus_Legacy.csproj @@ -0,0 +1,69 @@ + + + netstandard2.0;net45 + win7-x86;win7-x64 + + Darth Affe + Wyrez + en-US + en-US + RGB.NET.Devices.Asus + RGB.NET.Devices.Asus_Legacy + RGB.NET.Devices.Asus + RGB.NET.Devices.Asus_Legacy + RGB.NET.Devices.Asus + Asus-Device-Implementations of RGB.NET based on the v2-SDK + Asus-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals + Copyright © Wyrez 2017 + Copyright © Wyrez 2017 + http://lib.arge.be/icon.png + https://github.com/DarthAffe/RGB.NET + https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE + Github + https://github.com/DarthAffe/RGB.NET + True + + + + 0.0.1 + 0.0.1 + 0.0.1 + + ..\bin\ + true + True + True + latest + + + + NETCORE;NETSTANDARD;NETSTANDARD2_0 + + + + NET45;NETFULL + + + + $(DefineConstants);TRACE;DEBUG + true + full + false + + + + pdbonly + true + $(NoWarn);CS1591;CS1572;CS1573 + $(DefineConstants);RELEASE + + + + + + + + + + + \ No newline at end of file diff --git a/RGB.NET.Devices.Asus_Legacy/RGB.NET.Devices.Asus_Legacy.csproj.DotSettings b/RGB.NET.Devices.Asus_Legacy/RGB.NET.Devices.Asus_Legacy.csproj.DotSettings new file mode 100644 index 0000000..a88918e --- /dev/null +++ b/RGB.NET.Devices.Asus_Legacy/RGB.NET.Devices.Asus_Legacy.csproj.DotSettings @@ -0,0 +1,10 @@ + + True + True + True + True + True + True + True + True + True \ No newline at end of file diff --git a/RGB.NET.sln b/RGB.NET.sln index c61b57f..e3edb01 100644 --- a/RGB.NET.sln +++ b/RGB.NET.sln @@ -9,7 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Presets", "Presets", "{EBC3 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Core", "RGB.NET.Core\RGB.NET.Core.csproj", "{F3ED5768-7251-4347-8D8F-2866313DA658}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.Asus", "RGB.NET.Devices.Asus\RGB.NET.Devices.Asus.csproj", "{105FD573-D165-49D1-B8EC-937570616F29}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.Asus_Legacy", "RGB.NET.Devices.Asus_Legacy\RGB.NET.Devices.Asus_Legacy.csproj", "{105FD573-D165-49D1-B8EC-937570616F29}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.CoolerMaster", "RGB.NET.Devices.CoolerMaster\RGB.NET.Devices.CoolerMaster.csproj", "{E8F927F5-E7CF-464A-B9AE-824C2B29A7D1}" EndProject @@ -43,7 +43,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.SteelSeries EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{92D7C263-D4C9-4D26-93E2-93C1F9C2CD16}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Core.Tests", "Tests\RGB.NET.Core.Tests\RGB.NET.Core.Tests.csproj", "{A3FD5AD7-040A-47CA-A278-53493A25FF8A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Core.Tests", "Tests\RGB.NET.Core.Tests\RGB.NET.Core.Tests.csproj", "{A3FD5AD7-040A-47CA-A278-53493A25FF8A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.Asus", "RGB.NET.Devices.Asus\RGB.NET.Devices.Asus.csproj", "{E0732B34-3F96-4DD9-AFD5-0E34B833AD6D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -123,6 +125,10 @@ Global {A3FD5AD7-040A-47CA-A278-53493A25FF8A}.Debug|Any CPU.Build.0 = Debug|Any CPU {A3FD5AD7-040A-47CA-A278-53493A25FF8A}.Release|Any CPU.ActiveCfg = Release|Any CPU {A3FD5AD7-040A-47CA-A278-53493A25FF8A}.Release|Any CPU.Build.0 = Release|Any CPU + {E0732B34-3F96-4DD9-AFD5-0E34B833AD6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E0732B34-3F96-4DD9-AFD5-0E34B833AD6D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0732B34-3F96-4DD9-AFD5-0E34B833AD6D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E0732B34-3F96-4DD9-AFD5-0E34B833AD6D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -145,6 +151,7 @@ Global {0AD382DA-E999-4F74-9658-8D402EE9BF3F} = {D13032C6-432E-4F43-8A32-071133C22B16} {FFDE4387-60F2-47B6-9704-3A57D02B8C64} = {D13032C6-432E-4F43-8A32-071133C22B16} {A3FD5AD7-040A-47CA-A278-53493A25FF8A} = {92D7C263-D4C9-4D26-93E2-93C1F9C2CD16} + {E0732B34-3F96-4DD9-AFD5-0E34B833AD6D} = {D13032C6-432E-4F43-8A32-071133C22B16} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7F222AD4-1F9E-4AAB-9D69-D62372D4C1BA}