mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-10 20:46:24 +00:00
Updated corsair-SDK to 2.18.127
This commit is contained in:
1 parent
83a3ea4e01
commit
86bc26233b
4 files changed
+52
-40
No files matched your search
@@ -43,6 +43,7 @@ namespace RGB.NET.Devices.Corsair.Native
|
||||
_dllHandle = LoadLibrary(dllPath);
|
||||
|
||||
_corsairSetLedsColorsPointer = (CorsairSetLedsColorsPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "CorsairSetLedsColors"), typeof(CorsairSetLedsColorsPointer));
|
||||
_corsairGetLedsColorsPointer = (CorsairGetLedsColorsPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "CorsairGetLedsColors"), typeof(CorsairGetLedsColorsPointer));
|
||||
_corsairGetDeviceCountPointer = (CorsairGetDeviceCountPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "CorsairGetDeviceCount"), typeof(CorsairGetDeviceCountPointer));
|
||||
_corsairGetDeviceInfoPointer = (CorsairGetDeviceInfoPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "CorsairGetDeviceInfo"), typeof(CorsairGetDeviceInfoPointer));
|
||||
_corsairGetLedPositionsPointer = (CorsairGetLedPositionsPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "CorsairGetLedPositions"), typeof(CorsairGetLedPositionsPointer));
|
||||
@@ -79,6 +80,7 @@ namespace RGB.NET.Devices.Corsair.Native
|
||||
#region Pointers
|
||||
|
||||
private static CorsairSetLedsColorsPointer _corsairSetLedsColorsPointer;
|
||||
private static CorsairGetLedsColorsPointer _corsairGetLedsColorsPointer;
|
||||
private static CorsairGetDeviceCountPointer _corsairGetDeviceCountPointer;
|
||||
private static CorsairGetDeviceInfoPointer _corsairGetDeviceInfoPointer;
|
||||
private static CorsairGetLedPositionsPointer _corsairGetLedPositionsPointer;
|
||||
@@ -96,6 +98,9 @@ namespace RGB.NET.Devices.Corsair.Native
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
private delegate bool CorsairSetLedsColorsPointer(int size, IntPtr ledsColors);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
private delegate bool CorsairGetLedsColorsPointer(int size, IntPtr ledsColors);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
private delegate int CorsairGetDeviceCountPointer();
|
||||
|
||||
@@ -130,83 +135,58 @@ namespace RGB.NET.Devices.Corsair.Native
|
||||
/// <summary>
|
||||
/// CUE-SDK: set specified leds to some colors. The color is retained until changed by successive calls. This function does not take logical layout into account.
|
||||
/// </summary>
|
||||
internal static bool CorsairSetLedsColors(int size, IntPtr ledsColors)
|
||||
{
|
||||
return _corsairSetLedsColorsPointer(size, ledsColors);
|
||||
}
|
||||
internal static bool CorsairSetLedsColors(int size, IntPtr ledsColors) => _corsairSetLedsColorsPointer(size, ledsColors);
|
||||
|
||||
/// <summary>
|
||||
/// CUE-SDK: get current color for the list of requested LEDs.
|
||||
/// </summary>
|
||||
internal static bool CorsairGetLedsColors(int size, IntPtr ledsColors) => _corsairGetLedsColorsPointer(size, ledsColors);
|
||||
|
||||
/// <summary>
|
||||
/// CUE-SDK: returns number of connected Corsair devices that support lighting control.
|
||||
/// </summary>
|
||||
internal static int CorsairGetDeviceCount()
|
||||
{
|
||||
return _corsairGetDeviceCountPointer();
|
||||
}
|
||||
internal static int CorsairGetDeviceCount() => _corsairGetDeviceCountPointer();
|
||||
|
||||
/// <summary>
|
||||
/// CUE-SDK: returns information about device at provided index.
|
||||
/// </summary>
|
||||
internal static IntPtr CorsairGetDeviceInfo(int deviceIndex)
|
||||
{
|
||||
return _corsairGetDeviceInfoPointer(deviceIndex);
|
||||
}
|
||||
internal static IntPtr CorsairGetDeviceInfo(int deviceIndex) => _corsairGetDeviceInfoPointer(deviceIndex);
|
||||
|
||||
/// <summary>
|
||||
/// CUE-SDK: provides list of keyboard LEDs with their physical positions.
|
||||
/// </summary>
|
||||
internal static IntPtr CorsairGetLedPositions()
|
||||
{
|
||||
return _corsairGetLedPositionsPointer();
|
||||
}
|
||||
internal static IntPtr CorsairGetLedPositions() => _corsairGetLedPositionsPointer();
|
||||
|
||||
/// <summary>
|
||||
/// CUE-SDK: provides list of keyboard or mousepad LEDs with their physical positions.
|
||||
/// </summary>
|
||||
internal static IntPtr CorsairGetLedPositionsByDeviceIndex(int deviceIndex)
|
||||
{
|
||||
return _corsairGetLedPositionsByDeviceIndexPointer(deviceIndex);
|
||||
}
|
||||
internal static IntPtr CorsairGetLedPositionsByDeviceIndex(int deviceIndex) => _corsairGetLedPositionsByDeviceIndexPointer(deviceIndex);
|
||||
|
||||
/// <summary>
|
||||
/// CUE-SDK: retrieves led id for key name taking logical layout into account.
|
||||
/// </summary>
|
||||
internal static CorsairLedIds CorsairGetLedIdForKeyName(char keyName)
|
||||
{
|
||||
return _corsairGetLedIdForKeyNamePointer(keyName);
|
||||
}
|
||||
internal static CorsairLedIds CorsairGetLedIdForKeyName(char keyName) => _corsairGetLedIdForKeyNamePointer(keyName);
|
||||
|
||||
/// <summary>
|
||||
/// CUE-SDK: requestes control using specified access mode.
|
||||
/// By default client has shared control over lighting so there is no need to call CorsairRequestControl unless client requires exclusive control.
|
||||
/// </summary>
|
||||
internal static bool CorsairRequestControl(CorsairAccessMode accessMode)
|
||||
{
|
||||
return _corsairRequestControlPointer(accessMode);
|
||||
}
|
||||
internal static bool CorsairRequestControl(CorsairAccessMode accessMode) => _corsairRequestControlPointer(accessMode);
|
||||
|
||||
/// <summary>
|
||||
/// CUE-SDK: releases previously requested control for specified access mode.
|
||||
/// </summary>
|
||||
internal static bool CorsairReleaseControl(CorsairAccessMode accessMode)
|
||||
{
|
||||
return _corsairReleaseControlPointer(accessMode);
|
||||
}
|
||||
internal static bool CorsairReleaseControl(CorsairAccessMode accessMode) => _corsairReleaseControlPointer(accessMode);
|
||||
|
||||
/// <summary>
|
||||
/// CUE-SDK: checks file and protocol version of CUE to understand which of SDK functions can be used with this version of CUE.
|
||||
/// </summary>
|
||||
internal static _CorsairProtocolDetails CorsairPerformProtocolHandshake()
|
||||
{
|
||||
return _corsairPerformProtocolHandshakePointer();
|
||||
}
|
||||
internal static _CorsairProtocolDetails CorsairPerformProtocolHandshake() => _corsairPerformProtocolHandshakePointer();
|
||||
|
||||
/// <summary>
|
||||
/// CUE-SDK: returns last error that occured while using any of Corsair* functions.
|
||||
/// </summary>
|
||||
internal static CorsairError CorsairGetLastError()
|
||||
{
|
||||
return _corsairGetLastErrorPointer();
|
||||
}
|
||||
internal static CorsairError CorsairGetLastError() => _corsairGetLastErrorPointer();
|
||||
|
||||
// ReSharper restore EventExceptionNotDocumented
|
||||
|
||||
|
||||
Reference in new issue
Block a user