Fixed code issues

This commit is contained in:
DarthAffe committed 2021-08-01 16:40:13 +02:00
1 parent 59e11e5b82
commit 7c0a216ccd
64 files changed
+278 -34

No files matched your search

@@ -1,4 +1,6 @@
namespace RGB.NET.Devices.Logitech
#pragma warning disable 1591
namespace RGB.NET.Devices.Logitech
{
/// <summary>
/// Contains list of available logitech device types.
@@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Logitech
/// Initializes a new instance of the <see cref="LogitechRGBDevice{TDeviceInfo}"/> class.
/// </summary>
/// <param name="info">The generic information provided by Logitech for the device.</param>
/// <param name="updateQueue">The queue used to update this device.</param>
protected LogitechRGBDevice(TDeviceInfo info, IUpdateQueue updateQueue)
: base(info, updateQueue)
{ }
@@ -22,6 +22,7 @@ namespace RGB.NET.Devices.Logitech
/// <inheritdoc />
public string Model { get; }
/// <inheritdoc />
public object? LayoutMetadata { get; set; }
/// <summary>
@@ -45,8 +46,6 @@ namespace RGB.NET.Devices.Logitech
/// <param name="model">The represented device model.</param>
/// <param name="deviceCaps">The lighting-capabilities of the device.</param>
/// <param name="zones">The amount of zones the device is able to control.</param>
/// <param name="imageLayout">The layout used to decide which images to load.</param>
/// <param name="layoutPath">The path/name of the layout-file.</param>
internal LogitechRGBDeviceInfo(RGBDeviceType deviceType, string model, LogitechDeviceCaps deviceCaps, int zones)
{
this.DeviceType = deviceType;
@@ -42,6 +42,9 @@ namespace RGB.NET.Devices.Logitech
private const int VENDOR_ID = 0x046D;
/// <summary>
/// Gets the HID-definitions for per-key-devices.
/// </summary>
public static HIDLoader<LogitechLedId, int> PerKeyDeviceDefinitions { get; } = new(VENDOR_ID)
{
{ 0xC32B, RGBDeviceType.Keyboard, "G910", LedMappings.PerKey, 0 },
@@ -60,6 +63,9 @@ namespace RGB.NET.Devices.Logitech
{ 0xC545, RGBDeviceType.Keyboard, "Lightspeed Keyboard Dongle", LedMappings.PerKey, 0 },
};
/// <summary>
/// Gets the HID-definitions for per-zone-devices.
/// </summary>
public static HIDLoader<int, (LogitechDeviceType deviceType, int zones)> PerZoneDeviceDefinitions { get; } = new(VENDOR_ID)
{
{ 0xC336, RGBDeviceType.Keyboard, "G213", LedMappings.ZoneKeyboard, (LogitechDeviceType.Keyboard, 2) },
@@ -83,6 +89,9 @@ namespace RGB.NET.Devices.Logitech
{ 0xAB5, RGBDeviceType.Speaker, "G733", LedMappings.ZoneSpeaker, (LogitechDeviceType.Speaker, 2) },
};
/// <summary>
/// Gets the HID-definitions for per-device-devices.
/// </summary>
public static HIDLoader<int, int> PerDeviceDeviceDefinitions { get; } = new(VENDOR_ID)
{
{ 0xC228, RGBDeviceType.Keyboard, "G19", LedMappings.Device, 0 },
@@ -117,6 +126,7 @@ namespace RGB.NET.Devices.Logitech
#region Methods
/// <inheritdoc />
protected override void InitializeSDK()
{
_perDeviceUpdateQueue = new LogitechPerDeviceUpdateQueue(GetUpdateTrigger());
@@ -128,6 +138,7 @@ namespace RGB.NET.Devices.Logitech
_LogitechGSDK.LogiLedSaveCurrentLighting();
}
/// <inheritdoc />
protected override IEnumerable<IRGBDevice> GetLoadedDevices(RGBDeviceType loadFilter)
{
PerKeyDeviceDefinitions.LoadFilter = loadFilter;
@@ -136,8 +147,8 @@ namespace RGB.NET.Devices.Logitech
return base.GetLoadedDevices(loadFilter);
}
//TODO DarthAffe 04.03.2021: Rework device selection and configuration for HID-based providers
/// <inheritdoc />
protected override IEnumerable<IRGBDevice> LoadDevices()
{
(HIDDeviceDefinition<LogitechLedId, int> definition, HidDevice device) perKeyDevice = PerKeyDeviceDefinitions.GetConnectedDevices().FirstOrDefault();