diff --git a/RGB.NET.Core/Devices/RGBDeviceType.cs b/RGB.NET.Core/Devices/RGBDeviceType.cs index 88e4f822..57be1067 100644 --- a/RGB.NET.Core/Devices/RGBDeviceType.cs +++ b/RGB.NET.Core/Devices/RGBDeviceType.cs @@ -93,6 +93,11 @@ public enum RGBDeviceType /// LedController = 1 << 15, + /// + /// Represents a game controller. + /// + GameController = 1 << 16, + /// /// Represents a device where the type is not known or not present in the list. /// diff --git a/RGB.NET.Core/Devices/TypeInterfaces/IGameController.cs b/RGB.NET.Core/Devices/TypeInterfaces/IGameController.cs new file mode 100644 index 00000000..d2c55076 --- /dev/null +++ b/RGB.NET.Core/Devices/TypeInterfaces/IGameController.cs @@ -0,0 +1,7 @@ +namespace RGB.NET.Core; + +/// +/// Represents a gamecontroller-device +/// +public interface IGameController: IRGBDevice +{ } \ No newline at end of file diff --git a/RGB.NET.Core/Leds/LedId.cs b/RGB.NET.Core/Leds/LedId.cs index 43a6a703..a0b12c9a 100644 --- a/RGB.NET.Core/Leds/LedId.cs +++ b/RGB.NET.Core/Leds/LedId.cs @@ -6294,6 +6294,136 @@ public enum LedId Cooler127 = 0x00D0007F, Cooler128 = 0x00D00080, + /*### GameController ###*/ + GameController1 = 0x00E00001, + GameController2 = 0x00E00002, + GameController3 = 0x00E00003, + GameController4 = 0x00E00004, + GameController5 = 0x00E00005, + GameController6 = 0x00E00006, + GameController7 = 0x00E00007, + GameController8 = 0x00E00008, + GameController9 = 0x00E00009, + GameController10 = 0x00E0000A, + GameController11 = 0x00E0000B, + GameController12 = 0x00E0000C, + GameController13 = 0x00E0000D, + GameController14 = 0x00E0000E, + GameController15 = 0x00E0000F, + GameController16 = 0x00E00010, + GameController17 = 0x00E00011, + GameController18 = 0x00E00012, + GameController19 = 0x00E00013, + GameController20 = 0x00E00014, + GameController21 = 0x00E00015, + GameController22 = 0x00E00016, + GameController23 = 0x00E00017, + GameController24 = 0x00E00018, + GameController25 = 0x00E00019, + GameController26 = 0x00E0001A, + GameController27 = 0x00E0001B, + GameController28 = 0x00E0001C, + GameController29 = 0x00E0001D, + GameController30 = 0x00E0001E, + GameController31 = 0x00E0001F, + GameController32 = 0x00E00020, + GameController33 = 0x00E00021, + GameController34 = 0x00E00022, + GameController35 = 0x00E00023, + GameController36 = 0x00E00024, + GameController37 = 0x00E00025, + GameController38 = 0x00E00026, + GameController39 = 0x00E00027, + GameController40 = 0x00E00028, + GameController41 = 0x00E00029, + GameController42 = 0x00E0002A, + GameController43 = 0x00E0002B, + GameController44 = 0x00E0002C, + GameController45 = 0x00E0002D, + GameController46 = 0x00E0002E, + GameController47 = 0x00E0002F, + GameController48 = 0x00E00030, + GameController49 = 0x00E00031, + GameController50 = 0x00E00032, + GameController51 = 0x00E00033, + GameController52 = 0x00E00034, + GameController53 = 0x00E00035, + GameController54 = 0x00E00036, + GameController55 = 0x00E00037, + GameController56 = 0x00E00038, + GameController57 = 0x00E00039, + GameController58 = 0x00E0003A, + GameController59 = 0x00E0003B, + GameController60 = 0x00E0003C, + GameController61 = 0x00E0003D, + GameController62 = 0x00E0003E, + GameController63 = 0x00E0003F, + GameController64 = 0x00E00040, + GameController65 = 0x00E00041, + GameController66 = 0x00E00042, + GameController67 = 0x00E00043, + GameController68 = 0x00E00044, + GameController69 = 0x00E00045, + GameController70 = 0x00E00046, + GameController71 = 0x00E00047, + GameController72 = 0x00E00048, + GameController73 = 0x00E00049, + GameController74 = 0x00E0004A, + GameController75 = 0x00E0004B, + GameController76 = 0x00E0004C, + GameController77 = 0x00E0004D, + GameController78 = 0x00E0004E, + GameController79 = 0x00E0004F, + GameController80 = 0x00E00050, + GameController81 = 0x00E00051, + GameController82 = 0x00E00052, + GameController83 = 0x00E00053, + GameController84 = 0x00E00054, + GameController85 = 0x00E00055, + GameController86 = 0x00E00056, + GameController87 = 0x00E00057, + GameController88 = 0x00E00058, + GameController89 = 0x00E00059, + GameController90 = 0x00E0005A, + GameController91 = 0x00E0005B, + GameController92 = 0x00E0005C, + GameController93 = 0x00E0005D, + GameController94 = 0x00E0005E, + GameController95 = 0x00E0005F, + GameController96 = 0x00E00060, + GameController97 = 0x00E00061, + GameController98 = 0x00E00062, + GameController99 = 0x00E00063, + GameController100 = 0x00E00064, + GameController101 = 0x00E00065, + GameController102 = 0x00E00066, + GameController103 = 0x00E00067, + GameController104 = 0x00E00068, + GameController105 = 0x00E00069, + GameController106 = 0x00E0006A, + GameController107 = 0x00E0006B, + GameController108 = 0x00E0006C, + GameController109 = 0x00E0006D, + GameController110 = 0x00E0006E, + GameController111 = 0x00E0006F, + GameController112 = 0x00E00070, + GameController113 = 0x00E00071, + GameController114 = 0x00E00072, + GameController115 = 0x00E00073, + GameController116 = 0x00E00074, + GameController117 = 0x00E00075, + GameController118 = 0x00E00076, + GameController119 = 0x00E00077, + GameController120 = 0x00E00078, + GameController121 = 0x00E00079, + GameController122 = 0x00E0007A, + GameController123 = 0x00E0007B, + GameController124 = 0x00E0007C, + GameController125 = 0x00E0007D, + GameController126 = 0x00E0007E, + GameController127 = 0x00E0007F, + GameController128 = 0x00E00080, + /*### Custom ###*/ Custom1 = 0x0FE00001, Custom2 = 0x0FE00002, diff --git a/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs b/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs index 89f46841..3a4a4dac 100644 --- a/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs +++ b/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs @@ -217,6 +217,10 @@ private IEnumerable LoadCorsairDevices() yield return new CorsairCoolerRGBDevice(new CorsairCoolerRGBDeviceInfo(device, deviceLedCount, 0), updateQueue); break; + case CorsairDeviceType.GameController: + yield return new CorsairGameControllerRGBDevice(new CorsairGameControllerRGBDeviceInfo(device, deviceLedCount, 0), updateQueue); + break; + case CorsairDeviceType.FanLedController: case CorsairDeviceType.LedController: case CorsairDeviceType.Unknown: @@ -264,6 +268,10 @@ private IEnumerable LoadCorsairDevices() yield return new CorsairFanRGBDevice(new CorsairFanRGBDeviceInfo(device, ledCount, offset, "QL Fan"), updateQueue); break; + case CorsairChannelDeviceType.FanQX: + yield return new CorsairFanRGBDevice(new CorsairFanRGBDeviceInfo(device, ledCount, offset, "QX Fan"), updateQueue); + break; + case CorsairChannelDeviceType.EightLedSeriesFan: yield return new CorsairFanRGBDevice(new CorsairFanRGBDeviceInfo(device, ledCount, offset, "8-Led-Series Fan Fan"), updateQueue); break; diff --git a/RGB.NET.Devices.Corsair/Enum/CorsairChannelDeviceType.cs b/RGB.NET.Devices.Corsair/Enum/CorsairChannelDeviceType.cs index 65a38fad..afadf303 100644 --- a/RGB.NET.Devices.Corsair/Enum/CorsairChannelDeviceType.cs +++ b/RGB.NET.Devices.Corsair/Enum/CorsairChannelDeviceType.cs @@ -20,4 +20,5 @@ public enum CorsairChannelDeviceType Pump = 9, DRAM = 10, WaterBlock = 11, + FanQX = 12, }; \ No newline at end of file diff --git a/RGB.NET.Devices.Corsair/Enum/CorsairDeviceType.cs b/RGB.NET.Devices.Corsair/Enum/CorsairDeviceType.cs index b41be141..9e784038 100644 --- a/RGB.NET.Devices.Corsair/Enum/CorsairDeviceType.cs +++ b/RGB.NET.Devices.Corsair/Enum/CorsairDeviceType.cs @@ -76,6 +76,11 @@ public enum CorsairDeviceType : uint /// Touchbar = 0x0800, + /// + /// iCUE-SDK: for game controllers + /// + GameController = 0x1000, + /// /// iCUE-SDK: for all devices /// diff --git a/RGB.NET.Devices.Corsair/Enum/CorsairLedGroup.cs b/RGB.NET.Devices.Corsair/Enum/CorsairLedGroup.cs index 3ec299da..58b7079d 100644 --- a/RGB.NET.Devices.Corsair/Enum/CorsairLedGroup.cs +++ b/RGB.NET.Devices.Corsair/Enum/CorsairLedGroup.cs @@ -80,5 +80,10 @@ public enum CorsairLedGroup /// /// iCUE-SDK: for touchbar leds /// - Touchbar = 14 + Touchbar = 14, + + /// + /// iCUE-SDK: for game controller leds + /// + GameController = 15 } \ No newline at end of file diff --git a/RGB.NET.Devices.Corsair/GameController/CorsairGameControllerRGBDevice.cs b/RGB.NET.Devices.Corsair/GameController/CorsairGameControllerRGBDevice.cs new file mode 100644 index 00000000..2c4234d4 --- /dev/null +++ b/RGB.NET.Devices.Corsair/GameController/CorsairGameControllerRGBDevice.cs @@ -0,0 +1,34 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using RGB.NET.Core; +using System.Collections.Generic; + +namespace RGB.NET.Devices.Corsair; + +/// +/// +/// Represents a corsair gamecontroller. +/// +public sealed class CorsairGameControllerRGBDevice : CorsairRGBDevice, IGameController +{ + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The specific information provided by CUE for the gamecontroller + /// The queue used to update this device. + internal CorsairGameControllerRGBDevice(CorsairGameControllerRGBDeviceInfo info, CorsairDeviceUpdateQueue updateQueue) + : base(info, updateQueue) + { } + + #endregion + + #region Methods + + protected override LedMapping CreateMapping(IEnumerable ids) => LedMappings.CreateGameControllerMapping(ids); + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.Corsair/GameController/CorsairGameControllerRGBDeviceInfo.cs b/RGB.NET.Devices.Corsair/GameController/CorsairGameControllerRGBDeviceInfo.cs new file mode 100644 index 00000000..5d968d7b --- /dev/null +++ b/RGB.NET.Devices.Corsair/GameController/CorsairGameControllerRGBDeviceInfo.cs @@ -0,0 +1,20 @@ +using RGB.NET.Core; +using RGB.NET.Devices.Corsair.Native; + +namespace RGB.NET.Devices.Corsair; + +/// +/// +/// Represents a generic information for a . +/// +public sealed class CorsairGameControllerRGBDeviceInfo : CorsairRGBDeviceInfo +{ + #region Constructors + + /// + internal CorsairGameControllerRGBDeviceInfo(_CorsairDeviceInfo nativeInfo, int ledCount, int ledOffset) + : base(RGBDeviceType.GameController, nativeInfo, ledCount, ledOffset) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.Corsair/Generic/LedMappings.cs b/RGB.NET.Devices.Corsair/Generic/LedMappings.cs index ffbfa0ff..f37ec876 100644 --- a/RGB.NET.Devices.Corsair/Generic/LedMappings.cs +++ b/RGB.NET.Devices.Corsair/Generic/LedMappings.cs @@ -160,6 +160,7 @@ internal static class LedMappings internal static LedMapping CreateMousepadMapping(IEnumerable ids) => CreateMapping(ids, LedId.Mousepad1); internal static LedMapping CreateHeadsetMapping(IEnumerable ids) => CreateMapping(ids, LedId.Headset1); internal static LedMapping CreateMouseMapping(IEnumerable ids) => CreateMapping(ids, LedId.Mouse1); + internal static LedMapping CreateGameControllerMapping(IEnumerable ids) => CreateMapping(ids, LedId.GameController1); internal static LedMapping CreateUnknownMapping(IEnumerable ids) => CreateMapping(ids, LedId.Unknown1); internal static LedMapping CreateMapping(IEnumerable ids, LedId referenceId) diff --git a/RGB.NET.Devices.Corsair/README.md b/RGB.NET.Devices.Corsair/README.md index c6c1803d..191ad602 100644 --- a/RGB.NET.Devices.Corsair/README.md +++ b/RGB.NET.Devices.Corsair/README.md @@ -11,7 +11,7 @@ surface.Load(CorsairDeviceProvider.Instance); This providers requires native SDK-dlls. You can get them directly from Corsair at [https://github.com/CorsairOfficial/cue-sdk/releases](https://github.com/CorsairOfficial/cue-sdk/releases) -(Developed and tested with iCUE SDK v4.0.48) +(Developed and tested with iCUE SDK v4.0.84) Since the SDK-dlls are native it's important to use the correct architecture you're building your application for. (If in doubt you can always include both.) @@ -20,7 +20,7 @@ Since the SDK-dlls are native it's important to use the correct architecture you You can use other, custom paths by adding them to `CorsairDeviceProvider.PossibleX64NativePaths`. -### x86 +### x86 (only SDKs before v4.0.84) `redist\i386\iCUESDK_2019.dll` from the SDK-zip needs to be distributed as `\x86\iCUESDK_2019.dll` (or simply named `iCUESDK.dll`) You can use other, custom paths by adding them to `CorsairDeviceProvider.PossibleX86NativePaths`. diff --git a/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj.DotSettings b/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj.DotSettings index 16defe6e..9eb538f8 100644 --- a/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj.DotSettings +++ b/RGB.NET.Devices.Corsair/RGB.NET.Devices.Corsair.csproj.DotSettings @@ -1,6 +1,7 @@  True True + True True True True