mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Merge pull request #49 from DarthAffe/Fix/CorsairCooler
Fixed detection for corsair-cooler
This commit is contained in:
commit
5830adb11a
@ -215,7 +215,8 @@ namespace RGB.NET.Devices.Corsair
|
||||
|
||||
for (int channel = 0; channel < channelsInfo.channelsCount; channel++)
|
||||
{
|
||||
CorsairLedId referenceLed = channel == 0 ? CorsairLedId.CustomDeviceChannel1Led1 : CorsairLedId.CustomDeviceChannel2Led1;
|
||||
CorsairLedId referenceLed = GetChannelReferenceId(info.CorsairDeviceType, channel);
|
||||
if (referenceLed == CorsairLedId.Invalid) continue;
|
||||
|
||||
_CorsairChannelInfo channelInfo = (_CorsairChannelInfo)Marshal.PtrToStructure(channelInfoPtr, typeof(_CorsairChannelInfo));
|
||||
|
||||
@ -247,6 +248,23 @@ namespace RGB.NET.Devices.Corsair
|
||||
}
|
||||
}
|
||||
|
||||
private static CorsairLedId GetChannelReferenceId(CorsairDeviceType deviceType, int channel)
|
||||
{
|
||||
if (deviceType == CorsairDeviceType.Cooler)
|
||||
return CorsairLedId.CustomLiquidCoolerChannel1Led1;
|
||||
else
|
||||
{
|
||||
switch (channel)
|
||||
{
|
||||
case 0: return CorsairLedId.CustomDeviceChannel1Led1;
|
||||
case 1: return CorsairLedId.CustomDeviceChannel2Led1;
|
||||
case 2: return CorsairLedId.CustomDeviceChannel3Led1;
|
||||
}
|
||||
}
|
||||
|
||||
return CorsairLedId.Invalid;
|
||||
}
|
||||
|
||||
private void AddSpecialParts(ICorsairRGBDevice device)
|
||||
{
|
||||
if (device.DeviceInfo.Model.Equals("K95 RGB Platinum", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user