diff --git a/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs b/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs index d048397..43a740c 100644 --- a/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs +++ b/RGB.NET.Devices.Corsair/CorsairDeviceProvider.cs @@ -227,7 +227,7 @@ namespace RGB.NET.Devices.Corsair { _CorsairChannelDeviceInfo channelDeviceInfo = (_CorsairChannelDeviceInfo)Marshal.PtrToStructure(channelDeviceInfoPtr, typeof(_CorsairChannelDeviceInfo)); - yield return new CorsairCustomRGBDevice(new CorsairCustomRGBDeviceInfo(info.CorsairDeviceIndex, nativeDeviceInfo, channelDeviceInfo, referenceLed, modelCounter)); + yield return new CorsairCustomRGBDevice(new CorsairCustomRGBDeviceInfo(info, nativeDeviceInfo, channelDeviceInfo, referenceLed, modelCounter)); referenceLed += channelDeviceInfo.deviceLedCount; channelDeviceInfoPtr = new IntPtr(channelDeviceInfoPtr.ToInt64() + channelDeviceInfoStructSize); diff --git a/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDeviceInfo.cs b/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDeviceInfo.cs index 4fa6b07..424776e 100644 --- a/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDeviceInfo.cs +++ b/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDeviceInfo.cs @@ -28,15 +28,16 @@ namespace RGB.NET.Devices.Corsair /// /// Internal constructor of managed . /// - /// The index of the . + /// The info describing the the . /// The native -struct /// The native representing this device. /// The id of the first led of this device. /// A dictionary containing counters to create unique names for equal devices models. - internal CorsairCustomRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo, _CorsairChannelDeviceInfo channelDeviceInfo, + internal CorsairCustomRGBDeviceInfo(CorsairRGBDeviceInfo info, _CorsairDeviceInfo nativeInfo, + _CorsairChannelDeviceInfo channelDeviceInfo, CorsairLedId referenceCorsairLed, Dictionary modelCounter) - : base(deviceIndex, GetDeviceType(channelDeviceInfo.type), nativeInfo, - GetModelName(channelDeviceInfo.type), modelCounter) + : base(info.CorsairDeviceIndex, GetDeviceType(channelDeviceInfo.type), nativeInfo, + GetModelName(info, channelDeviceInfo), modelCounter) { this.ReferenceCorsairLed = referenceCorsairLed; @@ -72,9 +73,9 @@ namespace RGB.NET.Devices.Corsair } } - private static string GetModelName(CorsairChannelDeviceType deviceType) + private static string GetModelName(IRGBDeviceInfo info, _CorsairChannelDeviceInfo channelDeviceInfo) { - switch (deviceType) + switch (channelDeviceInfo.type) { case CorsairChannelDeviceType.Invalid: return "Invalid"; @@ -92,7 +93,19 @@ namespace RGB.NET.Devices.Corsair return "ML Fan"; case CorsairChannelDeviceType.Strip: - return "Led Strip"; + // LS100 Led Strips are reported as one big strip if configured in monitor mode in iCUE, 138 LEDs for dual monitor, 84 for single + if ((info.Model == "LS100 Starter Kit") && (channelDeviceInfo.deviceLedCount == 138)) + return "LS100 Led Strip (dual monitor)"; + else if ((info.Model == "LS100 Starter Kit") && (channelDeviceInfo.deviceLedCount == 84)) + return "LS100 Led Strip (single monitor)"; + // Any other value means an "External LED Strip" in iCUE, these are reported per-strip, 15 for short strips, 27 for long + else if ((info.Model == "LS100 Starter Kit") && (channelDeviceInfo.deviceLedCount == 15)) + return "LS100 Led Strip (short)"; + else if ((info.Model == "LS100 Starter Kit") && (channelDeviceInfo.deviceLedCount == 27)) + return "LS100 Led Strip (long)"; + // Device model is "Commander Pro" for regular LED strips + else + return "Led Strip"; case CorsairChannelDeviceType.DAP: return "DAP Fan"; @@ -101,7 +114,7 @@ namespace RGB.NET.Devices.Corsair return "Pump"; default: - throw new ArgumentOutOfRangeException(nameof(deviceType), deviceType, null); + throw new ArgumentOutOfRangeException(nameof(channelDeviceInfo.type), channelDeviceInfo.type, null); } }