mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-31 09:44:21 +00:00
Compare commits
No commits in common. "6e313ea6a150fbb67fa7c05e571504661f233277" and "df73551497fef4ec87185f7b7c72689e779c942e" have entirely different histories.
6e313ea6a1
...
df73551497
@ -60,7 +60,6 @@ public class AsusDeviceProvider : AbstractRGBDeviceProvider
|
|||||||
for (int i = 0; i < _devices.Count; i++)
|
for (int i = 0; i < _devices.Count; i++)
|
||||||
{
|
{
|
||||||
IAuraSyncDevice device = _devices[i];
|
IAuraSyncDevice device = _devices[i];
|
||||||
|
|
||||||
yield return (AsusDeviceType)device.Type switch
|
yield return (AsusDeviceType)device.Type switch
|
||||||
{
|
{
|
||||||
AsusDeviceType.MB_RGB => new AsusMainboardRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.Mainboard, device, WMIHelper.GetMainboardInfo()?.model ?? device.Name), GetUpdateTrigger()),
|
AsusDeviceType.MB_RGB => new AsusMainboardRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.Mainboard, device, WMIHelper.GetMainboardInfo()?.model ?? device.Name), GetUpdateTrigger()),
|
||||||
@ -72,8 +71,7 @@ public class AsusDeviceProvider : AbstractRGBDeviceProvider
|
|||||||
AsusDeviceType.NB_KB_RGB => new AsusKeyboardRGBDevice(new AsusKeyboardRGBDeviceInfo(device), LedMappings.KeyboardMapping, GetUpdateTrigger()),
|
AsusDeviceType.NB_KB_RGB => new AsusKeyboardRGBDevice(new AsusKeyboardRGBDeviceInfo(device), LedMappings.KeyboardMapping, GetUpdateTrigger()),
|
||||||
AsusDeviceType.NB_KB_4ZONE_RGB => new AsusKeyboardRGBDevice(new AsusKeyboardRGBDeviceInfo(device), null, GetUpdateTrigger()),
|
AsusDeviceType.NB_KB_4ZONE_RGB => new AsusKeyboardRGBDevice(new AsusKeyboardRGBDeviceInfo(device), null, GetUpdateTrigger()),
|
||||||
AsusDeviceType.MOUSE_RGB => new AsusMouseRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.Mouse, device), GetUpdateTrigger()),
|
AsusDeviceType.MOUSE_RGB => new AsusMouseRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.Mouse, device), GetUpdateTrigger()),
|
||||||
AsusDeviceType.TERMINAL_RGB => new AsusUnspecifiedRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.LedController, device), LedId.Custom1, GetUpdateTrigger()),
|
_ => new AsusUnspecifiedRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.Unknown, device), LedId.Custom1, GetUpdateTrigger())
|
||||||
_ => new AsusUnspecifiedRGBDevice(new AsusRGBDeviceInfo(RGBDeviceType.Unknown, device), LedId.Unknown1, GetUpdateTrigger())
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,5 @@ internal enum AsusDeviceType : uint
|
|||||||
NB_KB_4ZONE_RGB = 0x81001,
|
NB_KB_4ZONE_RGB = 0x81001,
|
||||||
MOUSE_RGB = 0x90000,
|
MOUSE_RGB = 0x90000,
|
||||||
CHASSIS_RGB = 0xB0000,
|
CHASSIS_RGB = 0xB0000,
|
||||||
PROJECTOR_RGB = 0xC0000,
|
PROJECTOR_RGB = 0xC0000
|
||||||
TERMINAL_RGB = 0xE0000
|
|
||||||
}
|
}
|
||||||
@ -45,11 +45,6 @@ public class CorsairDeviceProvider : AbstractRGBDeviceProvider
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool ExclusiveAccess { get; set; } = false;
|
public static bool ExclusiveAccess { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the details for the current SDK-session.
|
|
||||||
/// </summary>
|
|
||||||
public CorsairSessionDetails SessionDetails { get; private set; } = new();
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
@ -86,17 +81,12 @@ public class CorsairDeviceProvider : AbstractRGBDeviceProvider
|
|||||||
_CUESDK.SessionStateChanged += OnSessionStateChanged;
|
_CUESDK.SessionStateChanged += OnSessionStateChanged;
|
||||||
|
|
||||||
CorsairError errorCode = _CUESDK.CorsairConnect();
|
CorsairError errorCode = _CUESDK.CorsairConnect();
|
||||||
|
|
||||||
if (errorCode != CorsairError.Success)
|
if (errorCode != CorsairError.Success)
|
||||||
Throw(new RGBDeviceException($"Failed to initialized Corsair-SDK. (ErrorCode: {errorCode})"));
|
Throw(new RGBDeviceException($"Failed to initialized Corsair-SDK. (ErrorCode: {errorCode})"));
|
||||||
|
|
||||||
if (!waitEvent.Wait(ConnectionTimeout))
|
if (!waitEvent.Wait(ConnectionTimeout))
|
||||||
Throw(new RGBDeviceException($"Failed to initialized Corsair-SDK. (Timeout - Current connection state: {_CUESDK.SesionState})"));
|
Throw(new RGBDeviceException($"Failed to initialized Corsair-SDK. (Timeout - Current connection state: {_CUESDK.SesionState})"));
|
||||||
|
|
||||||
_CUESDK.CorsairGetSessionDetails(out _CorsairSessionDetails? details);
|
|
||||||
if (errorCode != CorsairError.Success)
|
|
||||||
Throw(new RGBDeviceException($"Failed to get session details. (ErrorCode: {errorCode})"));
|
|
||||||
|
|
||||||
SessionDetails = new CorsairSessionDetails(details!);
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@ -130,6 +120,7 @@ public class CorsairDeviceProvider : AbstractRGBDeviceProvider
|
|||||||
|
|
||||||
CorsairDeviceUpdateQueue updateQueue = new(GetUpdateTrigger(), device);
|
CorsairDeviceUpdateQueue updateQueue = new(GetUpdateTrigger(), device);
|
||||||
|
|
||||||
|
Console.WriteLine("Loading " + device.model);
|
||||||
int channelLedCount = 0;
|
int channelLedCount = 0;
|
||||||
for (int i = 0; i < device.channelCount; i++)
|
for (int i = 0; i < device.channelCount; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,37 +0,0 @@
|
|||||||
// ReSharper disable MemberCanBePrivate.Global
|
|
||||||
|
|
||||||
using RGB.NET.Devices.Corsair.Native;
|
|
||||||
|
|
||||||
namespace RGB.NET.Devices.Corsair;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents version information for the Corsair-SDK
|
|
||||||
/// </summary>
|
|
||||||
public class CorsairSessionDetails
|
|
||||||
{
|
|
||||||
#region Properties & Fields
|
|
||||||
|
|
||||||
public string ClientVersion { get; }
|
|
||||||
public string ServerVersion { get; }
|
|
||||||
public string ServerHostVersion { get; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Constructors
|
|
||||||
|
|
||||||
internal CorsairSessionDetails()
|
|
||||||
{
|
|
||||||
ClientVersion = string.Empty;
|
|
||||||
ServerVersion = string.Empty;
|
|
||||||
ServerHostVersion = string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal CorsairSessionDetails(_CorsairSessionDetails nativeDetails)
|
|
||||||
{
|
|
||||||
this.ClientVersion = nativeDetails.clientVersion.ToString();
|
|
||||||
this.ServerVersion = nativeDetails.serverVersion.ToString();
|
|
||||||
this.ServerHostVersion = nativeDetails.serverHostVersion.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
@ -73,7 +73,6 @@ public class LogitechDeviceProvider : AbstractRGBDeviceProvider
|
|||||||
{
|
{
|
||||||
{ 0x407C, RGBDeviceType.Keyboard, "G915", LedMappings.PerKey, 0 },
|
{ 0x407C, RGBDeviceType.Keyboard, "G915", LedMappings.PerKey, 0 },
|
||||||
{ 0x408E, RGBDeviceType.Keyboard, "G915 TKL", LedMappings.PerKey, 0 },
|
{ 0x408E, RGBDeviceType.Keyboard, "G915 TKL", LedMappings.PerKey, 0 },
|
||||||
{ 0xC232, RGBDeviceType.Keyboard, "G915 TKL", LedMappings.PerKey, 0 },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user