1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 01:58:30 +00:00

Fixed code issues

This commit is contained in:
Darth Affe 2021-08-01 16:40:13 +02:00
parent 59e11e5b82
commit 7c0a216ccd
64 changed files with 278 additions and 34 deletions

View File

@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Asus
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusDramRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusDramRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by Asus for the DRAM.</param> /// <param name="info">The specific information provided by Asus for the DRAM.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal AsusDramRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) internal AsusDramRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger) : base(info, updateTrigger)
{ {

View File

@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Asus
/// Initializes a new instance of the <see cref="AsusRGBDevice{TDeviceInfo}"/> class. /// Initializes a new instance of the <see cref="AsusRGBDevice{TDeviceInfo}"/> class.
/// </summary> /// </summary>
/// <param name="info">The generic information provided by Asus for the device.</param> /// <param name="info">The generic information provided by Asus for the device.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
protected AsusRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger) protected AsusRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, new AsusUpdateQueue(updateTrigger, info.Device)) : base(info, new AsusUpdateQueue(updateTrigger, info.Device))
{ } { }

View File

@ -23,8 +23,12 @@ namespace RGB.NET.Devices.Asus
/// <inheritdoc /> /// <inheritdoc />
public string Model { get; } public string Model { get; }
/// <inheritdoc />
public object? LayoutMetadata { get; set; } public object? LayoutMetadata { get; set; }
/// <summary>
/// Gets the SDK-aura-device this device represents.
/// </summary>
public IAuraSyncDevice Device { get; } public IAuraSyncDevice Device { get; }
#endregion #endregion

View File

@ -21,6 +21,8 @@ namespace RGB.NET.Devices.Asus
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusHeadsetRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusHeadsetRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by Asus for the headset.</param> /// <param name="info">The specific information provided by Asus for the headset.</param>
/// <param name="baseLedId">The ledId of the first led of this device. All other leds are created by incrementing this base-id by 1.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal AsusUnspecifiedRGBDevice(AsusRGBDeviceInfo info, LedId baseLedId, IDeviceUpdateTrigger updateTrigger) internal AsusUnspecifiedRGBDevice(AsusRGBDeviceInfo info, LedId baseLedId, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger) : base(info, updateTrigger)
{ {

View File

@ -25,6 +25,7 @@ namespace RGB.NET.Devices.Asus
/// Initializes a new instance of the <see cref="AsusUpdateQueue"/> class. /// Initializes a new instance of the <see cref="AsusUpdateQueue"/> class.
/// </summary> /// </summary>
/// <param name="updateTrigger">The update trigger used by this queue.</param> /// <param name="updateTrigger">The update trigger used by this queue.</param>
/// <param name="device">The SDK-aura-device this device represents.</param>
public AsusUpdateQueue(IDeviceUpdateTrigger updateTrigger, IAuraSyncDevice device) public AsusUpdateQueue(IDeviceUpdateTrigger updateTrigger, IAuraSyncDevice device)
: base(updateTrigger) : base(updateTrigger)
{ {

View File

@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Asus
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusGraphicsCardRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusGraphicsCardRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by Asus for the graphics card.</param> /// <param name="info">The specific information provided by Asus for the graphics card.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal AsusGraphicsCardRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) internal AsusGraphicsCardRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger) : base(info, updateTrigger)
{ {

View File

@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Asus
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusHeadsetRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusHeadsetRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by Asus for the headset.</param> /// <param name="info">The specific information provided by Asus for the headset.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal AsusHeadsetRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) internal AsusHeadsetRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger) : base(info, updateTrigger)
{ {

View File

@ -31,9 +31,10 @@ namespace RGB.NET.Devices.Asus
IKeyboardDeviceInfo IKeyboard.DeviceInfo => DeviceInfo; IKeyboardDeviceInfo IKeyboard.DeviceInfo => DeviceInfo;
/// <summary> /// <summary>
/// Gets or sets a list of extra LED mappings to apply to modes that match the provided regex /// Gets or sets a list of extra LED mappings to apply to modes that match the provided regex.
/// <para>Note: These LED mappings should be based on light indexes</para> /// <para>Note: These LED mappings should be based on light indexes.</para>
/// </summary> /// </summary>
// ReSharper disable once InconsistentNaming
public static readonly List<AsusKeyboardExtraMapping> ExtraLedMappings = new() public static readonly List<AsusKeyboardExtraMapping> ExtraLedMappings = new()
{ {
new AsusKeyboardExtraMapping(new Regex("(ROG Zephyrus Duo 15).*?"), LedMappings.ROGZephyrusDuo15) new AsusKeyboardExtraMapping(new Regex("(ROG Zephyrus Duo 15).*?"), LedMappings.ROGZephyrusDuo15)
@ -48,6 +49,8 @@ namespace RGB.NET.Devices.Asus
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusKeyboardRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusKeyboardRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by Asus for the keyboard.</param> /// <param name="info">The specific information provided by Asus for the keyboard.</param>
/// <param name="ledMapping">A mapping of leds this device is initialized with.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal AsusKeyboardRGBDevice(AsusKeyboardRGBDeviceInfo info, LedMapping<AsusLedId>? ledMapping, IDeviceUpdateTrigger updateTrigger) internal AsusKeyboardRGBDevice(AsusKeyboardRGBDeviceInfo info, LedMapping<AsusLedId>? ledMapping, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger) : base(info, updateTrigger)
{ {

View File

@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Asus
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusMainboardRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusMainboardRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by Asus for the mainboard.</param> /// <param name="info">The specific information provided by Asus for the mainboard.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal AsusMainboardRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) internal AsusMainboardRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger) : base(info, updateTrigger)
{ {

View File

@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Asus
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusMouseRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Asus.AsusMouseRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by Asus for the mouse.</param> /// <param name="info">The specific information provided by Asus for the mouse.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal AsusMouseRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) internal AsusMouseRGBDevice(AsusRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger) : base(info, updateTrigger)
{ {

View File

@ -53,12 +53,14 @@ namespace RGB.NET.Devices.CoolerMaster
#region Methods #region Methods
/// <inheritdoc />
protected override void InitializeSDK() protected override void InitializeSDK()
{ {
_CoolerMasterSDK.Reload(); _CoolerMasterSDK.Reload();
if (_CoolerMasterSDK.GetSDKVersion() <= 0) Throw(new RGBDeviceException("Failed to initialize CoolerMaster-SDK"), true); if (_CoolerMasterSDK.GetSDKVersion() <= 0) Throw(new RGBDeviceException("Failed to initialize CoolerMaster-SDK"), true);
} }
/// <inheritdoc />
protected override IEnumerable<IRGBDevice> LoadDevices() protected override IEnumerable<IRGBDevice> LoadDevices()
{ {
foreach (CoolerMasterDevicesIndexes index in Enum.GetValues(typeof(CoolerMasterDevicesIndexes))) foreach (CoolerMasterDevicesIndexes index in Enum.GetValues(typeof(CoolerMasterDevicesIndexes)))

View File

@ -17,6 +17,7 @@ namespace RGB.NET.Devices.CoolerMaster
/// Initializes a new instance of the <see cref="CoolerMasterRGBDevice{TDeviceInfo}"/> class. /// Initializes a new instance of the <see cref="CoolerMasterRGBDevice{TDeviceInfo}"/> class.
/// </summary> /// </summary>
/// <param name="info">The generic information provided by CoolerMaster for the device.</param> /// <param name="info">The generic information provided by CoolerMaster for the device.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
protected CoolerMasterRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger) protected CoolerMasterRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, new CoolerMasterUpdateQueue(updateTrigger, info.DeviceIndex)) : base(info, new CoolerMasterUpdateQueue(updateTrigger, info.DeviceIndex))
{ } { }

View File

@ -22,6 +22,7 @@ namespace RGB.NET.Devices.CoolerMaster
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterKeyboardRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterKeyboardRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by CoolerMaster for the keyboard</param> /// <param name="info">The specific information provided by CoolerMaster for the keyboard</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal CoolerMasterKeyboardRGBDevice(CoolerMasterKeyboardRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) internal CoolerMasterKeyboardRGBDevice(CoolerMasterKeyboardRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger) : base(info, updateTrigger)
{ {

View File

@ -63,6 +63,7 @@ namespace RGB.NET.Devices.Corsair
#region Methods #region Methods
/// <inheritdoc />
protected override void InitializeSDK() protected override void InitializeSDK()
{ {
_CUESDK.Reload(); _CUESDK.Reload();
@ -193,6 +194,7 @@ namespace RGB.NET.Devices.Corsair
}; };
} }
/// <inheritdoc />
protected override void Reset() protected override void Reset()
{ {
ProtocolDetails = null; ProtocolDetails = null;

View File

@ -17,8 +17,19 @@ namespace RGB.NET.Devices.Corsair
{ {
#region Properties & Fields #region Properties & Fields
/// <summary>
/// Gets the corsair-id of the first LED of this device.
/// </summary>
public CorsairLedId ReferenceCorsairLed { get; } public CorsairLedId ReferenceCorsairLed { get; }
/// <summary>
/// Gets the amount of LEDs this device contains.
/// </summary>
public int LedCount { get; } public int LedCount { get; }
/// <summary>
/// Gets the offset used to access the LEDs of this device.
/// </summary>
internal int LedOffset { get; } internal int LedOffset { get; }
#endregion #endregion
@ -33,7 +44,8 @@ namespace RGB.NET.Devices.Corsair
/// <param name="deviceIndex">The index of the <see cref="T:RGB.NET.Devices.Corsair._CorsairChannelDeviceInfo" />.</param> /// <param name="deviceIndex">The index of the <see cref="T:RGB.NET.Devices.Corsair._CorsairChannelDeviceInfo" />.</param>
/// <param name="nativeInfo">The native <see cref="T:RGB.NET.Devices.Corsair.Native._CorsairDeviceInfo" />-struct</param> /// <param name="nativeInfo">The native <see cref="T:RGB.NET.Devices.Corsair.Native._CorsairDeviceInfo" />-struct</param>
/// <param name="channelDeviceInfo">The native <see cref="T:RGB.NET.Devices.Corsair.Native._CorsairChannelDeviceInfo"/> representing this device.</param> /// <param name="channelDeviceInfo">The native <see cref="T:RGB.NET.Devices.Corsair.Native._CorsairChannelDeviceInfo"/> representing this device.</param>
/// <param name="referenceCorsairLed">The id of the first led of this device.</param> /// <param name="referenceCorsairLed">The id of the first LED of this device.</param>
/// <param name="ledOffset">The offset used to find the LEDs of this device.</param>
internal CorsairCustomRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo, _CorsairChannelDeviceInfo channelDeviceInfo, CorsairLedId referenceCorsairLed, int ledOffset) internal CorsairCustomRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo, _CorsairChannelDeviceInfo channelDeviceInfo, CorsairLedId referenceCorsairLed, int ledOffset)
: base(deviceIndex, GetDeviceType(channelDeviceInfo.type), nativeInfo, : base(deviceIndex, GetDeviceType(channelDeviceInfo.type), nativeInfo,
GetModelName(nativeInfo.model == IntPtr.Zero ? string.Empty : Regex.Replace(Marshal.PtrToStringAnsi(nativeInfo.model) ?? string.Empty, " ?DEMO", string.Empty, RegexOptions.IgnoreCase), channelDeviceInfo)) GetModelName(nativeInfo.model == IntPtr.Zero ? string.Empty : Regex.Replace(Marshal.PtrToStringAnsi(nativeInfo.model) ?? string.Empty, " ?DEMO", string.Empty, RegexOptions.IgnoreCase), channelDeviceInfo))

View File

@ -14,6 +14,9 @@ namespace RGB.NET.Devices.Corsair
{ {
#region Properties & Fields #region Properties & Fields
/// <summary>
/// Gets the mapping of <see cref="LedId"/> to <see cref="CorsairLedId"/> used to update the LEDs of this device.
/// </summary>
protected LedMapping<CorsairLedId> Mapping { get; } protected LedMapping<CorsairLedId> Mapping { get; }
#endregion #endregion
@ -24,6 +27,8 @@ namespace RGB.NET.Devices.Corsair
/// Initializes a new instance of the <see cref="CorsairRGBDevice{TDeviceInfo}"/> class. /// Initializes a new instance of the <see cref="CorsairRGBDevice{TDeviceInfo}"/> class.
/// </summary> /// </summary>
/// <param name="info">The generic information provided by CUE for the device.</param> /// <param name="info">The generic information provided by CUE for the device.</param>
/// <param name="mapping">The mapping <see cref="LedId"/> to <see cref="CorsairLedId"/> used to update the LEDs of this device.</param>
/// <param name="updateQueue">The queue used to update this device.</param>
protected CorsairRGBDevice(TDeviceInfo info, LedMapping<CorsairLedId> mapping, CorsairDeviceUpdateQueue updateQueue) protected CorsairRGBDevice(TDeviceInfo info, LedMapping<CorsairLedId> mapping, CorsairDeviceUpdateQueue updateQueue)
: base(info, updateQueue) : base(info, updateQueue)
{ {
@ -36,6 +41,9 @@ namespace RGB.NET.Devices.Corsair
void ICorsairRGBDevice.Initialize() => InitializeLayout(); void ICorsairRGBDevice.Initialize() => InitializeLayout();
/// <summary>
/// Initializes the LEDs of the device based on the data provided by the SDK.
/// </summary>
protected virtual void InitializeLayout() protected virtual void InitializeLayout()
{ {
_CorsairLedPositions? nativeLedPositions = (_CorsairLedPositions?)Marshal.PtrToStructure(_CUESDK.CorsairGetLedPositionsByDeviceIndex(DeviceInfo.CorsairDeviceIndex), typeof(_CorsairLedPositions)); _CorsairLedPositions? nativeLedPositions = (_CorsairLedPositions?)Marshal.PtrToStructure(_CUESDK.CorsairGetLedPositionsByDeviceIndex(DeviceInfo.CorsairDeviceIndex), typeof(_CorsairLedPositions));

View File

@ -23,7 +23,7 @@ namespace RGB.NET.Devices.Corsair
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Corsair.CorsairKeyboardRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Corsair.CorsairKeyboardRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by CUE for the keyboard</param> /// <param name="info">The specific information provided by CUE for the keyboard.</param>
/// <param name="updateQueue">The queue used to update this device.</param> /// <param name="updateQueue">The queue used to update this device.</param>
internal CorsairKeyboardRGBDevice(CorsairKeyboardRGBDeviceInfo info, CorsairDeviceUpdateQueue updateQueue) internal CorsairKeyboardRGBDevice(CorsairKeyboardRGBDeviceInfo info, CorsairDeviceUpdateQueue updateQueue)
: base(info, LedMappings.Keyboard, updateQueue) : base(info, LedMappings.Keyboard, updateQueue)

View File

@ -51,8 +51,10 @@ namespace RGB.NET.Devices.DMX
/// <param name="deviceDefinition">The <see cref="IDMXDeviceDefinition"/> to add.</param> /// <param name="deviceDefinition">The <see cref="IDMXDeviceDefinition"/> to add.</param>
public void AddDeviceDefinition(IDMXDeviceDefinition deviceDefinition) => DeviceDefinitions.Add(deviceDefinition); public void AddDeviceDefinition(IDMXDeviceDefinition deviceDefinition) => DeviceDefinitions.Add(deviceDefinition);
/// <inheritdoc />
protected override void InitializeSDK() { } protected override void InitializeSDK() { }
/// <inheritdoc />
protected override IEnumerable<IRGBDevice> LoadDevices() protected override IEnumerable<IRGBDevice> LoadDevices()
{ {
foreach (IDMXDeviceDefinition dmxDeviceDefinition in DeviceDefinitions) foreach (IDMXDeviceDefinition dmxDeviceDefinition in DeviceDefinitions)

View File

@ -33,6 +33,7 @@ namespace RGB.NET.Devices.DMX.E131
/// <inheritdoc /> /// <inheritdoc />
public string Model { get; } public string Model { get; }
/// <inheritdoc />
public object? LayoutMetadata { get; set; } public object? LayoutMetadata { get; set; }
/// <summary> /// <summary>

View File

@ -55,8 +55,10 @@ namespace RGB.NET.Devices.Debug
/// </summary> /// </summary>
public void ClearFakeDeviceDefinitions() => _fakeDeviceDefinitions.Clear(); public void ClearFakeDeviceDefinitions() => _fakeDeviceDefinitions.Clear();
/// <inheritdoc />
protected override void InitializeSDK() { } protected override void InitializeSDK() { }
/// <inheritdoc />
protected override IEnumerable<IRGBDevice> LoadDevices() protected override IEnumerable<IRGBDevice> LoadDevices()
{ {
foreach ((IDeviceLayout layout, Action<IEnumerable<Led>>? updateLedsAction) in _fakeDeviceDefinitions) foreach ((IDeviceLayout layout, Action<IEnumerable<Led>>? updateLedsAction) in _fakeDeviceDefinitions)

View File

@ -13,6 +13,9 @@ namespace RGB.NET.Devices.Debug
{ {
#region Properties & Fields #region Properties & Fields
/// <summary>
/// Gets the layour used to describe this debug device.
/// </summary>
public IDeviceLayout Layout { get; } public IDeviceLayout Layout { get; }
private Action<IEnumerable<Led>>? _updateLedsAction; private Action<IEnumerable<Led>>? _updateLedsAction;

View File

@ -22,6 +22,7 @@ namespace RGB.NET.Devices.Debug
/// <inheritdoc /> /// <inheritdoc />
public string Model { get; } public string Model { get; }
/// <inheritdoc />
public object? LayoutMetadata { get; set; } public object? LayoutMetadata { get; set; }
#endregion #endregion
@ -34,6 +35,7 @@ namespace RGB.NET.Devices.Debug
/// <param name="deviceType">The <see cref="RGBDeviceType"/> of the device.</param> /// <param name="deviceType">The <see cref="RGBDeviceType"/> of the device.</param>
/// <param name="manufacturer">The manufacturer of the device.</param> /// <param name="manufacturer">The manufacturer of the device.</param>
/// <param name="model">The model of the device.</param> /// <param name="model">The model of the device.</param>
/// <param name="customData">Some custom data for this device provided by the layout.</param>
internal DebugRGBDeviceInfo(RGBDeviceType deviceType, string manufacturer, string model, object? customData) internal DebugRGBDeviceInfo(RGBDeviceType deviceType, string manufacturer, string model, object? customData)
{ {
this.DeviceType = deviceType; this.DeviceType = deviceType;

View File

@ -1,4 +1,6 @@
namespace RGB.NET.Devices.Logitech #pragma warning disable 1591
namespace RGB.NET.Devices.Logitech
{ {
/// <summary> /// <summary>
/// Contains list of available logitech device types. /// Contains list of available logitech device types.

View File

@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Logitech
/// Initializes a new instance of the <see cref="LogitechRGBDevice{TDeviceInfo}"/> class. /// Initializes a new instance of the <see cref="LogitechRGBDevice{TDeviceInfo}"/> class.
/// </summary> /// </summary>
/// <param name="info">The generic information provided by Logitech for the device.</param> /// <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) protected LogitechRGBDevice(TDeviceInfo info, IUpdateQueue updateQueue)
: base(info, updateQueue) : base(info, updateQueue)
{ } { }

View File

@ -22,6 +22,7 @@ namespace RGB.NET.Devices.Logitech
/// <inheritdoc /> /// <inheritdoc />
public string Model { get; } public string Model { get; }
/// <inheritdoc />
public object? LayoutMetadata { get; set; } public object? LayoutMetadata { get; set; }
/// <summary> /// <summary>
@ -45,8 +46,6 @@ namespace RGB.NET.Devices.Logitech
/// <param name="model">The represented device model.</param> /// <param name="model">The represented device model.</param>
/// <param name="deviceCaps">The lighting-capabilities of the device.</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="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) internal LogitechRGBDeviceInfo(RGBDeviceType deviceType, string model, LogitechDeviceCaps deviceCaps, int zones)
{ {
this.DeviceType = deviceType; this.DeviceType = deviceType;

View File

@ -42,6 +42,9 @@ namespace RGB.NET.Devices.Logitech
private const int VENDOR_ID = 0x046D; 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) public static HIDLoader<LogitechLedId, int> PerKeyDeviceDefinitions { get; } = new(VENDOR_ID)
{ {
{ 0xC32B, RGBDeviceType.Keyboard, "G910", LedMappings.PerKey, 0 }, { 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 }, { 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) public static HIDLoader<int, (LogitechDeviceType deviceType, int zones)> PerZoneDeviceDefinitions { get; } = new(VENDOR_ID)
{ {
{ 0xC336, RGBDeviceType.Keyboard, "G213", LedMappings.ZoneKeyboard, (LogitechDeviceType.Keyboard, 2) }, { 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) }, { 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) public static HIDLoader<int, int> PerDeviceDeviceDefinitions { get; } = new(VENDOR_ID)
{ {
{ 0xC228, RGBDeviceType.Keyboard, "G19", LedMappings.Device, 0 }, { 0xC228, RGBDeviceType.Keyboard, "G19", LedMappings.Device, 0 },
@ -117,6 +126,7 @@ namespace RGB.NET.Devices.Logitech
#region Methods #region Methods
/// <inheritdoc />
protected override void InitializeSDK() protected override void InitializeSDK()
{ {
_perDeviceUpdateQueue = new LogitechPerDeviceUpdateQueue(GetUpdateTrigger()); _perDeviceUpdateQueue = new LogitechPerDeviceUpdateQueue(GetUpdateTrigger());
@ -128,6 +138,7 @@ namespace RGB.NET.Devices.Logitech
_LogitechGSDK.LogiLedSaveCurrentLighting(); _LogitechGSDK.LogiLedSaveCurrentLighting();
} }
/// <inheritdoc />
protected override IEnumerable<IRGBDevice> GetLoadedDevices(RGBDeviceType loadFilter) protected override IEnumerable<IRGBDevice> GetLoadedDevices(RGBDeviceType loadFilter)
{ {
PerKeyDeviceDefinitions.LoadFilter = loadFilter; PerKeyDeviceDefinitions.LoadFilter = loadFilter;
@ -137,7 +148,7 @@ namespace RGB.NET.Devices.Logitech
return base.GetLoadedDevices(loadFilter); return base.GetLoadedDevices(loadFilter);
} }
//TODO DarthAffe 04.03.2021: Rework device selection and configuration for HID-based providers /// <inheritdoc />
protected override IEnumerable<IRGBDevice> LoadDevices() protected override IEnumerable<IRGBDevice> LoadDevices()
{ {
(HIDDeviceDefinition<LogitechLedId, int> definition, HidDevice device) perKeyDevice = PerKeyDeviceDefinitions.GetConnectedDevices().FirstOrDefault(); (HIDDeviceDefinition<LogitechLedId, int> definition, HidDevice device) perKeyDevice = PerKeyDeviceDefinitions.GetConnectedDevices().FirstOrDefault();

View File

@ -15,6 +15,7 @@ namespace RGB.NET.Devices.Msi
/// Initializes a new instance of the <see cref="MsiRGBDevice{TDeviceInfo}"/> class. /// Initializes a new instance of the <see cref="MsiRGBDevice{TDeviceInfo}"/> class.
/// </summary> /// </summary>
/// <param name="info">The generic information provided by MSI for the device.</param> /// <param name="info">The generic information provided by MSI for the device.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
protected MsiRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger) protected MsiRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, new MsiDeviceUpdateQueue(updateTrigger, info.MsiDeviceType)) : base(info, new MsiDeviceUpdateQueue(updateTrigger, info.MsiDeviceType))
{ } { }

View File

@ -16,6 +16,8 @@ namespace RGB.NET.Devices.Msi
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Msi.MsiGraphicsCardRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Msi.MsiGraphicsCardRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by MSI for graphics cards.</param> /// <param name="info">The specific information provided by MSI for graphics cards.</param>
/// <param name="ledCount">The amount of leds on this device.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal MsiGraphicsCardRGBDevice(MsiRGBDeviceInfo info, int ledCount, IDeviceUpdateTrigger updateTrigger) internal MsiGraphicsCardRGBDevice(MsiRGBDeviceInfo info, int ledCount, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger) : base(info, updateTrigger)
{ {

View File

@ -16,6 +16,8 @@ namespace RGB.NET.Devices.Msi
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Msi.MsiMainboardRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Msi.MsiMainboardRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by MSI for the mainboard.</param> /// <param name="info">The specific information provided by MSI for the mainboard.</param>
/// <param name="ledCount">The amount of leds on this device.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal MsiMainboardRGBDevice(MsiRGBDeviceInfo info, int ledCount, IDeviceUpdateTrigger updateTrigger) internal MsiMainboardRGBDevice(MsiRGBDeviceInfo info, int ledCount, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger) : base(info, updateTrigger)
{ {

View File

@ -16,6 +16,8 @@ namespace RGB.NET.Devices.Msi
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Msi.MsiMouseRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Msi.MsiMouseRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by MSI for the mouse.</param> /// <param name="info">The specific information provided by MSI for the mouse.</param>
/// <param name="ledCount">The amount of leds on this device.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal MsiMouseRGBDevice(MsiRGBDeviceInfo info, int ledCount, IDeviceUpdateTrigger updateTrigger) internal MsiMouseRGBDevice(MsiRGBDeviceInfo info, int ledCount, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger) : base(info, updateTrigger)
{ {

View File

@ -53,6 +53,7 @@ namespace RGB.NET.Devices.Msi
#region Methods #region Methods
/// <inheritdoc />
protected override void InitializeSDK() protected override void InitializeSDK()
{ {
_MsiSDK.Reload(); _MsiSDK.Reload();
@ -62,6 +63,7 @@ namespace RGB.NET.Devices.Msi
ThrowMsiError(errorCode, true); ThrowMsiError(errorCode, true);
} }
/// <inheritdoc />
protected override IEnumerable<IRGBDevice> LoadDevices() protected override IEnumerable<IRGBDevice> LoadDevices()
{ {
int errorCode; int errorCode;

View File

@ -51,11 +51,11 @@ namespace RGB.NET.Devices.Novation
_outputDevice.SendShort(message.Message); _outputDevice.SendShort(message.Message);
} }
/// <summary> /// <summary>
/// Creates a update-message out of a specified data set. /// Creates a update-message out of a specified data set.
/// </summary> /// </summary>
/// <param name="data">The data set to create the message from.</param> /// <param name="key">The key used to identify the LED to update.</param>
/// <param name="color">The color to send.</param>
/// <returns>The message created out of the data set.</returns> /// <returns>The message created out of the data set.</returns>
protected abstract ShortMessage? CreateMessage(object key, in Color color); protected abstract ShortMessage? CreateMessage(object key, in Color color);

View File

@ -17,6 +17,7 @@ namespace RGB.NET.Devices.Novation
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Novation.NovationLaunchpadRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Novation.NovationLaunchpadRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by Novation for the launchpad</param> /// <param name="info">The specific information provided by Novation for the launchpad</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal NovationLaunchpadRGBDevice(NovationLaunchpadRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) internal NovationLaunchpadRGBDevice(NovationLaunchpadRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger) : base(info, updateTrigger)
{ {
@ -44,8 +45,13 @@ namespace RGB.NET.Devices.Novation
protected override object GetLedCustomData(LedId ledId) => GetDeviceMapping().TryGetValue(ledId, out (byte mode, byte id, int _, int __) data) ? (data.mode, data.id) : ((byte)0x00, (byte)0x00); protected override object GetLedCustomData(LedId ledId) => GetDeviceMapping().TryGetValue(ledId, out (byte mode, byte id, int _, int __) data) ? (data.mode, data.id) : ((byte)0x00, (byte)0x00);
// ReSharper restore RedundantCast // ReSharper restore RedundantCast
/// <summary>
/// Gets the mapping used to access the LEDs of the device based on <see cref="NovationLaunchpadRGBDeviceInfo.LedMapping"/>.
/// </summary>
/// <returns>The mapping of the device.</returns>
/// <exception cref="ArgumentOutOfRangeException">Thrown if the value of <see cref="NovationLaunchpadRGBDeviceInfo.LedMapping"/> is not known.</exception>
protected virtual Dictionary<LedId, (byte mode, byte id, int x, int y)> GetDeviceMapping() protected virtual Dictionary<LedId, (byte mode, byte id, int x, int y)> GetDeviceMapping()
=> DeviceInfo.LedIdMapping switch => DeviceInfo.LedMapping switch
{ {
LedIdMappings.Current => LaunchpadIdMapping.CURRENT, LedIdMappings.Current => LaunchpadIdMapping.CURRENT,
LedIdMappings.Legacy => LaunchpadIdMapping.LEGACY, LedIdMappings.Legacy => LaunchpadIdMapping.LEGACY,

View File

@ -10,7 +10,7 @@ namespace RGB.NET.Devices.Novation
{ {
#region Properties & Fields #region Properties & Fields
internal LedIdMappings LedIdMapping { get; } internal LedIdMappings LedMapping { get; }
#endregion #endregion
@ -23,11 +23,11 @@ namespace RGB.NET.Devices.Novation
/// <param name="model">The represented device model.</param> /// <param name="model">The represented device model.</param>
/// <param name="deviceId"></param> /// <param name="deviceId"></param>
/// <param name="colorCapabilities">The <see cref="T:RGB.NET.Devices.Novation.NovationColorCapabilities" /> of the <see cref="T:RGB.NET.Core.IRGBDevice" />.</param> /// <param name="colorCapabilities">The <see cref="T:RGB.NET.Devices.Novation.NovationColorCapabilities" /> of the <see cref="T:RGB.NET.Core.IRGBDevice" />.</param>
internal NovationLaunchpadRGBDeviceInfo(string model, int deviceId, NovationColorCapabilities colorCapabilities, /// <param name="ledMapping">A mapping of leds this device is initialized with.</param>
LedIdMappings ledIdMapping) internal NovationLaunchpadRGBDeviceInfo(string model, int deviceId, NovationColorCapabilities colorCapabilities, LedIdMappings ledMapping)
: base(RGBDeviceType.LedMatrix, model, deviceId, colorCapabilities) : base(RGBDeviceType.LedMatrix, model, deviceId, colorCapabilities)
{ {
this.LedIdMapping = ledIdMapping; this.LedMapping = ledMapping;
} }
#endregion #endregion

View File

@ -41,8 +41,10 @@ namespace RGB.NET.Devices.Novation
#region Methods #region Methods
/// <inheritdoc />
protected override void InitializeSDK() { } protected override void InitializeSDK() { }
/// <inheritdoc />
protected override IEnumerable<IRGBDevice> LoadDevices() protected override IEnumerable<IRGBDevice> LoadDevices()
{ {
for (int index = 0; index < OutputDeviceBase.DeviceCount; index++) for (int index = 0; index < OutputDeviceBase.DeviceCount; index++)

View File

@ -1,7 +1,11 @@
// ReSharper disable InconsistentNaming // ReSharper disable InconsistentNaming
#pragma warning disable 1591
namespace RGB.NET.Devices.PicoPi.Enum namespace RGB.NET.Devices.PicoPi.Enum
{ {
/// <summary>
/// Contains a list of possible ways of communication with the device.
/// </summary>
public enum UpdateMode public enum UpdateMode
{ {
Auto = 0x00, Auto = 0x00,

View File

@ -3,6 +3,13 @@ using RGB.NET.Core;
namespace RGB.NET.Devices.PicoPi namespace RGB.NET.Devices.PicoPi
{ {
/// <inheritdoc />
/// <summary>
/// Represents the update-queue performing updates for Pico-Pi bulk-devices.
/// </summary>
/// <remarks>
/// Using this requires the libusb driver to be installed!
/// </remarks>
public class PicoPiBulkUpdateQueue : UpdateQueue public class PicoPiBulkUpdateQueue : UpdateQueue
{ {
#region Properties & Fields #region Properties & Fields
@ -16,6 +23,13 @@ namespace RGB.NET.Devices.PicoPi
#region Constructors #region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="PicoPiBulkUpdateQueue"/> class.
/// </summary>
/// <param name="updateTrigger">The update trigger used by this queue.</param>
/// <param name="sdk">The sdk used to access the device.</param>
/// <param name="channel">The channel to update.</param>
/// <param name="ledCount">The maximum amount of leds to update.</param>
public PicoPiBulkUpdateQueue(IDeviceUpdateTrigger updateTrigger, PicoPiSDK sdk, int channel, int ledCount) public PicoPiBulkUpdateQueue(IDeviceUpdateTrigger updateTrigger, PicoPiSDK sdk, int channel, int ledCount)
: base(updateTrigger) : base(updateTrigger)
{ {
@ -29,6 +43,7 @@ namespace RGB.NET.Devices.PicoPi
#region Methods #region Methods
/// <inheritdoc />
protected override void Update(in ReadOnlySpan<(object key, Color color)> dataSet) protected override void Update(in ReadOnlySpan<(object key, Color color)> dataSet)
{ {
Span<byte> buffer = _dataBuffer; Span<byte> buffer = _dataBuffer;

View File

@ -3,6 +3,10 @@ using RGB.NET.Core;
namespace RGB.NET.Devices.PicoPi namespace RGB.NET.Devices.PicoPi
{ {
/// <inheritdoc />
/// <summary>
/// Represents the update-queue performing updates for Pico-Pi HID-devices.
/// </summary>
public class PicoPiHIDUpdateQueue : UpdateQueue public class PicoPiHIDUpdateQueue : UpdateQueue
{ {
#region Constants #region Constants
@ -22,6 +26,13 @@ namespace RGB.NET.Devices.PicoPi
#region Constructors #region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="PicoPiHIDUpdateQueue"/> class.
/// </summary>
/// <param name="updateTrigger">The update trigger used by this queue.</param>
/// <param name="sdk">The sdk used to access the device.</param>
/// <param name="channel">The channel to update.</param>
/// <param name="ledCount">The maximum amount of leds to update.</param>
public PicoPiHIDUpdateQueue(IDeviceUpdateTrigger updateTrigger, PicoPiSDK sdk, int channel, int ledCount) public PicoPiHIDUpdateQueue(IDeviceUpdateTrigger updateTrigger, PicoPiSDK sdk, int channel, int ledCount)
: base(updateTrigger) : base(updateTrigger)
{ {
@ -35,6 +46,7 @@ namespace RGB.NET.Devices.PicoPi
#region Methods #region Methods
/// <inheritdoc />
protected override void Update(in ReadOnlySpan<(object key, Color color)> dataSet) protected override void Update(in ReadOnlySpan<(object key, Color color)> dataSet)
{ {
Span<byte> buffer = _dataBuffer; Span<byte> buffer = _dataBuffer;

View File

@ -2,6 +2,10 @@
namespace RGB.NET.Devices.PicoPi namespace RGB.NET.Devices.PicoPi
{ {
/// <inheritdoc cref="AbstractRGBDevice{PicoPiRGBDeviceInfo}" />
/// <summary>
/// Represents a device based on an Raspberry Pi Pico.
/// </summary>
public class PicoPiRGBDevice : AbstractRGBDevice<PicoPiRGBDeviceInfo> public class PicoPiRGBDevice : AbstractRGBDevice<PicoPiRGBDeviceInfo>
{ {
#region Properties & Fields #region Properties & Fields
@ -12,6 +16,13 @@ namespace RGB.NET.Devices.PicoPi
#region Constructors #region Constructors
/// <inheritdoc />
/// <summary>
/// Initializes a new instance of the <see cref="PicoPiRGBDevice" /> class.
/// </summary>
/// <param name="deviceInfo">The device info of this device.</param>
/// <param name="updateQueue">The queue used to update this device.</param>
/// <param name="ledMapping">A mapping of leds this device is initialized with.</param>
public PicoPiRGBDevice(PicoPiRGBDeviceInfo deviceInfo, IUpdateQueue updateQueue, LedMapping<int> ledMapping) public PicoPiRGBDevice(PicoPiRGBDeviceInfo deviceInfo, IUpdateQueue updateQueue, LedMapping<int> ledMapping)
: base(deviceInfo, updateQueue) : base(deviceInfo, updateQueue)
{ {

View File

@ -2,19 +2,46 @@
namespace RGB.NET.Devices.PicoPi namespace RGB.NET.Devices.PicoPi
{ {
/// <summary>
/// Represents a generic information for a <see cref="PicoPiRGBDevice" />.
/// </summary>
public class PicoPiRGBDeviceInfo : IRGBDeviceInfo public class PicoPiRGBDeviceInfo : IRGBDeviceInfo
{ {
#region Properties & Fields #region Properties & Fields
/// <inheritdoc />
public RGBDeviceType DeviceType { get; } public RGBDeviceType DeviceType { get; }
/// <inheritdoc />
public string DeviceName { get; } public string DeviceName { get; }
/// <inheritdoc />
public string Manufacturer => "RGB.NET"; public string Manufacturer => "RGB.NET";
/// <inheritdoc />
public string Model { get; } public string Model { get; }
/// <inheritdoc />
public object? LayoutMetadata { get; set; } public object? LayoutMetadata { get; set; }
/// <summary>
/// Gets the Id of the device.
/// </summary>
public string Id { get; } public string Id { get; }
/// <summary>
/// Gets the version of the device firmware.
/// </summary>
public int Version { get; } public int Version { get; }
/// <summary>
/// Gets the channel this device is using.
/// </summary>
public int Channel { get; } public int Channel { get; }
/// <summary>
/// Gets the amount of LEDs on this device.
/// </summary>
public int LedCount { get; } public int LedCount { get; }
#endregion #endregion

View File

@ -9,6 +9,9 @@ using RGB.NET.Core;
namespace RGB.NET.Devices.PicoPi namespace RGB.NET.Devices.PicoPi
{ {
/// <summary>
/// Represents a SDK to access devices based on a Raspberry Pi Pico.
/// </summary>
public class PicoPiSDK : IDisposable public class PicoPiSDK : IDisposable
{ {
#region Constants #region Constants
@ -49,16 +52,34 @@ namespace RGB.NET.Devices.PicoPi
private int _bulkTransferLength; private int _bulkTransferLength;
/// <summary>
/// Gets if updates via the Bulk-Enbpoint are possible.
/// </summary>
public bool IsBulkSupported { get; private set; } public bool IsBulkSupported { get; private set; }
/// <summary>
/// Gets the Id of the device.
/// </summary>
public string Id { get; } public string Id { get; }
/// <summary>
/// Gets the version of the device firmware.
/// </summary>
public int Version { get; } public int Version { get; }
/// <summary>
/// Gets a collection of channels, led counts and pins that are available on this device.
/// </summary>
public IReadOnlyList<(int channel, int ledCount, int pin)> Channels { get; } public IReadOnlyList<(int channel, int ledCount, int pin)> Channels { get; }
#endregion #endregion
#region Constructors #region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="PicoPiSDK" /> class.
/// </summary>
/// <param name="device">The underlying hid device.</param>
public PicoPiSDK(HidDevice device) public PicoPiSDK(HidDevice device)
{ {
this._hidDevice = device; this._hidDevice = device;
@ -79,6 +100,11 @@ namespace RGB.NET.Devices.PicoPi
#region Methods #region Methods
/// <summary>
/// Configures the amount of leds to update on the specified channels.
/// </summary>
/// <remarks>This is a configuration function. The value is persistent on the device.</remarks>
/// <param name="ledCounts">The values to set on the device.</param>
public void SetLedCounts(params (int channel, int ledCount)[] ledCounts) public void SetLedCounts(params (int channel, int ledCount)[] ledCounts)
{ {
byte[] data = new byte[Channels.Count + 2]; byte[] data = new byte[Channels.Count + 2];
@ -92,6 +118,11 @@ namespace RGB.NET.Devices.PicoPi
SendHID(data); SendHID(data);
} }
/// <summary>
/// Configures the pins used by the specified channels.
/// </summary>
/// <remarks>This is a configuration function. The value is persistent on the device.</remarks>
/// <param name="pins">T values to set on the device.</param>
public void SetPins(params (int channel, int pin)[] pins) public void SetPins(params (int channel, int pin)[] pins)
{ {
byte[] data = new byte[Channels.Count + 2]; byte[] data = new byte[Channels.Count + 2];
@ -173,6 +204,13 @@ namespace RGB.NET.Devices.PicoPi
} }
} }
/// <summary>
/// Sends a update to the device using the HID-endpoint.
/// </summary>
/// <param name="data">The data packet to send.</param>
/// <param name="channel">The channel to update.</param>
/// <param name="chunk">The chunk id of the packet. (Required if packets are fragmented.)</param>
/// <param name="update">A value indicating if the device should update directly after receiving this packet. (If packets are fragmented this should only be true for the last chunk.)</param>
public void SendHidUpdate(in Span<byte> data, int channel, int chunk, bool update) public void SendHidUpdate(in Span<byte> data, int channel, int chunk, bool update)
{ {
if (data.Length == 0) return; if (data.Length == 0) return;
@ -186,6 +224,14 @@ namespace RGB.NET.Devices.PicoPi
SendHID(_hidSendBuffer); SendHID(_hidSendBuffer);
} }
/// <summary>
/// Sends a update to the device using the bulk-endpoint.
/// </summary>
/// <remarks>
/// Silently fails if not bulk-updates are supported. (Check <see cref="IsBulkSupported"/>)
/// </remarks>
/// <param name="data">The data packet to send.</param>
/// <param name="channel">The channel to update.</param>
public void SendBulkUpdate(in Span<byte> data, int channel) public void SendBulkUpdate(in Span<byte> data, int channel)
{ {
if ((data.Length == 0) || !IsBulkSupported) return; if ((data.Length == 0) || !IsBulkSupported) return;
@ -200,6 +246,9 @@ namespace RGB.NET.Devices.PicoPi
_bulkTransferLength += payloadSize; _bulkTransferLength += payloadSize;
} }
/// <summary>
/// Flushing the bulk endpoint, causing the device to update.
/// </summary>
public void FlushBulk() public void FlushBulk()
{ {
if (_bulkTransferLength == 0) return; if (_bulkTransferLength == 0) return;
@ -216,6 +265,7 @@ namespace RGB.NET.Devices.PicoPi
private byte[] Read() => _hidStream.Read(); private byte[] Read() => _hidStream.Read();
/// <inheritdoc />
public void Dispose() public void Dispose()
{ {
_hidStream.Dispose(); _hidStream.Dispose();

View File

@ -31,6 +31,9 @@ namespace RGB.NET.Devices.PicoPi
/// </summary> /// </summary>
public static PicoPiDeviceProvider Instance => _instance ?? new PicoPiDeviceProvider(); public static PicoPiDeviceProvider Instance => _instance ?? new PicoPiDeviceProvider();
/// <summary>
/// Gets the HID-definitions for PicoPi-devices.
/// </summary>
public static HIDLoader<int, int> DeviceDefinitions { get; } = new(PicoPiSDK.VENDOR_ID) public static HIDLoader<int, int> DeviceDefinitions { get; } = new(PicoPiSDK.VENDOR_ID)
{ {
{ PicoPiSDK.HID_BULK_CONTROLLER_PID, RGBDeviceType.LedStripe, "WS2812B-Controller", LedMappings.StripeMapping, 0 }, { PicoPiSDK.HID_BULK_CONTROLLER_PID, RGBDeviceType.LedStripe, "WS2812B-Controller", LedMappings.StripeMapping, 0 },
@ -38,6 +41,10 @@ namespace RGB.NET.Devices.PicoPi
private readonly List<PicoPiSDK> _sdks = new(); private readonly List<PicoPiSDK> _sdks = new();
/// <summary>
/// Gets or sets the endpoint used to update devices. (default <see cref="PicoPi.Enum.UpdateMode.Auto"/>).
/// If auto is set it automatically is using bulk-updates for devies with more than 40 LEDs if supported. Else HID is used.
/// </summary>
public UpdateMode UpdateMode { get; set; } = UpdateMode.Auto; public UpdateMode UpdateMode { get; set; } = UpdateMode.Auto;
#endregion #endregion
@ -58,6 +65,7 @@ namespace RGB.NET.Devices.PicoPi
#region Methods #region Methods
/// <inheritdoc />
protected override void InitializeSDK() { } protected override void InitializeSDK() { }
/// <inheritdoc /> /// <inheritdoc />
@ -108,6 +116,7 @@ namespace RGB.NET.Devices.PicoPi
} }
} }
/// <inheritdoc />
protected override void Reset() protected override void Reset()
{ {
base.Reset(); base.Reset();

View File

@ -19,6 +19,7 @@ namespace RGB.NET.Devices.Razer
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerChromaLinkRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerChromaLinkRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by CUE for the chroma link.</param> /// <param name="info">The specific information provided by CUE for the chroma link.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal RazerChromaLinkRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) internal RazerChromaLinkRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, new RazerChromaLinkUpdateQueue(updateTrigger)) : base(info, new RazerChromaLinkUpdateQueue(updateTrigger))
{ {

View File

@ -19,6 +19,7 @@ namespace RGB.NET.Devices.Razer
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerHeadsetRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerHeadsetRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by CUE for the headset.</param> /// <param name="info">The specific information provided by CUE for the headset.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal RazerHeadsetRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) internal RazerHeadsetRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, new RazerHeadsetUpdateQueue(updateTrigger)) : base(info, new RazerHeadsetUpdateQueue(updateTrigger))
{ {

View File

@ -27,6 +27,8 @@ namespace RGB.NET.Devices.Razer
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerKeyboardRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerKeyboardRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by CUE for the keyboard.</param> /// <param name="info">The specific information provided by CUE for the keyboard.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
/// <param name="ledMapping">A mapping of leds this device is initialized with.</param>
internal RazerKeyboardRGBDevice(RazerKeyboardRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger, LedMapping<int> ledMapping) internal RazerKeyboardRGBDevice(RazerKeyboardRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger, LedMapping<int> ledMapping)
: base(info, new RazerKeyboardUpdateQueue(updateTrigger)) : base(info, new RazerKeyboardUpdateQueue(updateTrigger))
{ {

View File

@ -19,6 +19,7 @@ namespace RGB.NET.Devices.Razer
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerKeypadRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerKeypadRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by CUE for the keypad.</param> /// <param name="info">The specific information provided by CUE for the keypad.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal RazerKeypadRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) internal RazerKeypadRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, new RazerKeypadUpdateQueue(updateTrigger)) : base(info, new RazerKeypadUpdateQueue(updateTrigger))
{ {

View File

@ -25,6 +25,8 @@ namespace RGB.NET.Devices.Razer
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerMouseRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerMouseRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by CUE for the mouse.</param> /// <param name="info">The specific information provided by CUE for the mouse.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
/// <param name="ledMapping">A mapping of leds this device is initialized with.</param>
internal RazerMouseRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger, LedMapping<int> ledMapping) internal RazerMouseRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger, LedMapping<int> ledMapping)
: base(info, new RazerMouseUpdateQueue(updateTrigger)) : base(info, new RazerMouseUpdateQueue(updateTrigger))
{ {

View File

@ -19,6 +19,7 @@ namespace RGB.NET.Devices.Razer
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerMousepadRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Razer.RazerMousepadRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by CUE for the mousepad.</param> /// <param name="info">The specific information provided by CUE for the mousepad.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal RazerMousepadRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) internal RazerMousepadRGBDevice(RazerRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, new RazerMousepadUpdateQueue(updateTrigger)) : base(info, new RazerMousepadUpdateQueue(updateTrigger))
{ {

View File

@ -44,6 +44,9 @@ namespace RGB.NET.Devices.Razer
private const int VENDOR_ID = 0x1532; private const int VENDOR_ID = 0x1532;
/// <summary>
/// Gets the HID-definitions for Razer-devices.
/// </summary>
public static HIDLoader<int, RazerEndpointType> DeviceDefinitions { get; } = new(VENDOR_ID) public static HIDLoader<int, RazerEndpointType> DeviceDefinitions { get; } = new(VENDOR_ID)
{ {
// Keyboards // Keyboards
@ -214,6 +217,7 @@ namespace RGB.NET.Devices.Razer
#region Methods #region Methods
/// <inheritdoc />
protected override void InitializeSDK() protected override void InitializeSDK()
{ {
TryUnInit(); TryUnInit();
@ -225,6 +229,7 @@ namespace RGB.NET.Devices.Razer
ThrowRazerError(error, true); ThrowRazerError(error, true);
} }
/// <inheritdoc />
protected override IEnumerable<IRGBDevice> GetLoadedDevices(RGBDeviceType loadFilter) protected override IEnumerable<IRGBDevice> GetLoadedDevices(RGBDeviceType loadFilter)
{ {
DeviceDefinitions.LoadFilter = loadFilter; DeviceDefinitions.LoadFilter = loadFilter;
@ -250,6 +255,7 @@ namespace RGB.NET.Devices.Razer
return devices; return devices;
} }
/// <inheritdoc />
protected override IEnumerable<IRGBDevice> LoadDevices() protected override IEnumerable<IRGBDevice> LoadDevices()
{ {
// Only take the first device of each endpoint type, the Razer SDK doesn't allow separate control over multiple devices using the same endpoint // Only take the first device of each endpoint type, the Razer SDK doesn't allow separate control over multiple devices using the same endpoint

View File

@ -1,4 +1,6 @@
namespace RGB.NET.Devices.SteelSeries #pragma warning disable 1591
namespace RGB.NET.Devices.SteelSeries
{ {
// DarthAffe 09.07.2020: Review the LISP-Handler in SteelSeriesSDK after adding new device-types! They need to be initialized. // DarthAffe 09.07.2020: Review the LISP-Handler in SteelSeriesSDK after adding new device-types! They need to be initialized.
public enum SteelSeriesDeviceType public enum SteelSeriesDeviceType

View File

@ -25,6 +25,9 @@ namespace RGB.NET.Devices.SteelSeries
/// <inheritdoc /> /// <inheritdoc />
public object? LayoutMetadata { get; set; } public object? LayoutMetadata { get; set; }
/// <summary>
/// Gets the type of this device used in the SDK.
/// </summary>
public SteelSeriesDeviceType SteelSeriesDeviceType { get; } public SteelSeriesDeviceType SteelSeriesDeviceType { get; }
#endregion #endregion
@ -36,9 +39,7 @@ namespace RGB.NET.Devices.SteelSeries
/// </summary> /// </summary>
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param> /// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
/// <param name="model">The represented device model.</param> /// <param name="model">The represented device model.</param>
/// <param name="deviceCaps">The lighting-capabilities of the device.</param> /// <param name="steelSeriesDeviceType">The type of this device used in the SDK.</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 SteelSeriesRGBDeviceInfo(RGBDeviceType deviceType, string model, SteelSeriesDeviceType steelSeriesDeviceType) internal SteelSeriesRGBDeviceInfo(RGBDeviceType deviceType, string model, SteelSeriesDeviceType steelSeriesDeviceType)
{ {
this.DeviceType = deviceType; this.DeviceType = deviceType;

View File

@ -22,6 +22,9 @@ namespace RGB.NET.Devices.SteelSeries
private const int VENDOR_ID = 0x1038; private const int VENDOR_ID = 0x1038;
/// <summary>
/// Gets the HID-definitions for SteelSeries-devices.
/// </summary>
public static HIDLoader<SteelSeriesLedId, SteelSeriesDeviceType> DeviceDefinitions { get; } = new(VENDOR_ID) public static HIDLoader<SteelSeriesLedId, SteelSeriesDeviceType> DeviceDefinitions { get; } = new(VENDOR_ID)
{ {
//Mice //Mice

View File

@ -26,9 +26,10 @@ namespace RGB.NET.Devices.WS281X.Arduino
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ArduinoWS2812USBDevice"/> class. /// Initializes a new instance of the <see cref="ArduinoWS2812USBDevice"/> class.
/// </summary> /// </summary>
/// <param name="deviceInfo">The update trigger used by this queue.</param> /// <param name="deviceInfo">The device info of this device.</param>
/// <param name="updateQueue">The update queue performing updates for this device.</param> /// <param name="updateQueue">The update queue performing updates for this device.</param>
/// <param name="channel">The channel (as defined in the arduino-sketch) this device is attached to.</param> /// <param name="channel">The channel (as defined in the arduino-sketch) this device is attached to.</param>
/// <param name="ledCount">The amount of leds on this device.</param>
public ArduinoWS2812USBDevice(ArduinoWS2812USBDeviceInfo deviceInfo, ArduinoWS2812USBUpdateQueue updateQueue, int channel, int ledCount) public ArduinoWS2812USBDevice(ArduinoWS2812USBDeviceInfo deviceInfo, ArduinoWS2812USBUpdateQueue updateQueue, int channel, int ledCount)
: base(deviceInfo, updateQueue) : base(deviceInfo, updateQueue)
{ {

View File

@ -31,8 +31,7 @@ namespace RGB.NET.Devices.WS281X.Arduino
/// Initializes a new instance of the <see cref="ArduinoWS2812USBUpdateQueue"/> class. /// Initializes a new instance of the <see cref="ArduinoWS2812USBUpdateQueue"/> class.
/// </summary> /// </summary>
/// <param name="updateTrigger">The update trigger used by this queue.</param> /// <param name="updateTrigger">The update trigger used by this queue.</param>
/// <param name="portName">The name of the serial-port to connect to.</param> /// <param name="serialConnection">The serial connection used to access the device.</param>
/// <param name="baudRate">The baud-rate used by the serial-connection.</param>
public ArduinoWS2812USBUpdateQueue(IDeviceUpdateTrigger updateTrigger, ISerialConnection serialConnection) public ArduinoWS2812USBUpdateQueue(IDeviceUpdateTrigger updateTrigger, ISerialConnection serialConnection)
: base(updateTrigger, serialConnection) : base(updateTrigger, serialConnection)
{ } { }

View File

@ -24,8 +24,10 @@ namespace RGB.NET.Devices.WS281X.Bitwizard
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="BitwizardWS2812USBDevice"/> class. /// Initializes a new instance of the <see cref="BitwizardWS2812USBDevice"/> class.
/// </summary> /// </summary>
/// <param name="deviceInfo">The update trigger used by this queue.</param> /// <param name="deviceInfo">The device info of this device.</param>
/// <param name="updateQueue">The update queue performing updates for this device.</param> /// <param name="updateQueue">The update queue performing updates for this device.</param>
/// <param name="ledOffset">The offset used to access the leds on this device.</param>
/// <param name="ledCount">The amount of leds on this device.</param>
public BitwizardWS2812USBDevice(BitwizardWS2812USBDeviceInfo deviceInfo, BitwizardWS2812USBUpdateQueue updateQueue, int ledOffset, int ledCount) public BitwizardWS2812USBDevice(BitwizardWS2812USBDeviceInfo deviceInfo, BitwizardWS2812USBUpdateQueue updateQueue, int ledOffset, int ledCount)
: base(deviceInfo, updateQueue) : base(deviceInfo, updateQueue)
{ {

View File

@ -17,8 +17,7 @@ namespace RGB.NET.Devices.WS281X.Bitwizard
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.WS281X.Bitwizard.BitwizardWS2812USBUpdateQueue" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.WS281X.Bitwizard.BitwizardWS2812USBUpdateQueue" /> class.
/// </summary> /// </summary>
/// <param name="updateTrigger">The update trigger used by this queue.</param> /// <param name="updateTrigger">The update trigger used by this queue.</param>
/// <param name="portName">The name of the serial-port to connect to.</param> /// <param name="serialConnection">The serial connection used to access the device.</param>
/// <param name="baudRate">The baud-rate used by the serial-connection.</param>
public BitwizardWS2812USBUpdateQueue(IDeviceUpdateTrigger updateTrigger, ISerialConnection serialConnection) public BitwizardWS2812USBUpdateQueue(IDeviceUpdateTrigger updateTrigger, ISerialConnection serialConnection)
: base(updateTrigger, serialConnection) : base(updateTrigger, serialConnection)
{ } { }

View File

@ -36,6 +36,9 @@ namespace RGB.NET.Devices.WS281X.Bitwizard
/// </summary> /// </summary>
public string? Name { get; set; } public string? Name { get; set; }
/// <summary>
/// Gets a list of LED-strips configured on this device.
/// </summary>
public List<(int pin, int stripLength)> Strips { get; } = new(); public List<(int pin, int stripLength)> Strips { get; } = new();
/// <summary> /// <summary>
@ -52,6 +55,7 @@ namespace RGB.NET.Devices.WS281X.Bitwizard
/// Initializes a new instance of the <see cref="BitwizardWS281XDeviceDefinition"/> class. /// Initializes a new instance of the <see cref="BitwizardWS281XDeviceDefinition"/> class.
/// </summary> /// </summary>
/// <param name="serialConnection">The serial connection used for the device.</param> /// <param name="serialConnection">The serial connection used for the device.</param>
/// <param name="strips">A list of LED-strips connected to this device.</param>
public BitwizardWS281XDeviceDefinition(ISerialConnection serialConnection, params (int pin, int stripLength)[] strips) public BitwizardWS281XDeviceDefinition(ISerialConnection serialConnection, params (int pin, int stripLength)[] strips)
{ {
this.SerialConnection = serialConnection; this.SerialConnection = serialConnection;
@ -64,6 +68,7 @@ namespace RGB.NET.Devices.WS281X.Bitwizard
/// </summary> /// </summary>
/// <param name="port">The name of the serial-port to connect to.</param> /// <param name="port">The name of the serial-port to connect to.</param>
/// <param name="baudRate">The baud-rate of the serial-connection.</param> /// <param name="baudRate">The baud-rate of the serial-connection.</param>
/// <param name="strips">A list of LED-strips connected to this device.</param>
public BitwizardWS281XDeviceDefinition(string port, int baudRate = 115200, params (int pin, int stripLength)[] strips) public BitwizardWS281XDeviceDefinition(string port, int baudRate = 115200, params (int pin, int stripLength)[] strips)
{ {
SerialConnection = new SerialPortConnection(port, baudRate); SerialConnection = new SerialPortConnection(port, baudRate);

View File

@ -28,6 +28,11 @@ namespace RGB.NET.Devices.WS281X
#region Constructors #region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="SerialPortConnection"/> class.
/// </summary>
/// <param name="port">The name of the serial-port to connect to.</param>
/// <param name="baudRate">The baud-rate used by the serial-connection.</param>
public SerialPortConnection(string port, int baudRate) public SerialPortConnection(string port, int baudRate)
{ {
SerialPort = new SerialPort(port, baudRate); SerialPort = new SerialPort(port, baudRate);

View File

@ -33,8 +33,7 @@ namespace RGB.NET.Devices.WS281X
/// Initializes a new instance of the <see cref="SerialConnectionUpdateQueue{TData}"/> class. /// Initializes a new instance of the <see cref="SerialConnectionUpdateQueue{TData}"/> class.
/// </summary> /// </summary>
/// <param name="updateTrigger">The update trigger used by this queue.</param> /// <param name="updateTrigger">The update trigger used by this queue.</param>
/// <param name="portName">The name of the serial-port to connect to.</param> /// <param name="serialConnection">The serial connection used to access the device.</param>
/// <param name="baudRate">The baud-rate used by the serial-connection.</param>
internal SerialConnectionUpdateQueue(IDeviceUpdateTrigger updateTrigger, ISerialConnection serialConnection) internal SerialConnectionUpdateQueue(IDeviceUpdateTrigger updateTrigger, ISerialConnection serialConnection)
: base(updateTrigger) : base(updateTrigger)
{ {

View File

@ -28,11 +28,12 @@ namespace RGB.NET.Devices.WS281X.NodeMCU
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="NodeMCUWS2812USBDevice"/> class. /// Initializes a new instance of the <see cref="NodeMCUWS2812USBDevice"/> class.
/// </summary> /// </summary>
/// <param name="deviceInfo">The update trigger used by this queue.</param> /// <param name="deviceInfo">The device info of this device.</param>
/// <param name="updateQueue">The update queue performing updates for this device.</param> /// <param name="updateQueue">The update queue performing updates for this device.</param>
/// <param name="channel">The channel (as defined in the NodeMCU-sketch) this device is attached to.</param> /// <param name="channel">The channel (as defined in the NodeMCU-sketch) this device is attached to.</param>
public NodeMCUWS2812USBDevice(NodeMCUWS2812USBDeviceInfo info, NodeMCUWS2812USBUpdateQueue updateQueue, int channel, int ledCount) /// <param name="ledCount">The amount of leds on this device.</param>
: base(info, updateQueue) public NodeMCUWS2812USBDevice(NodeMCUWS2812USBDeviceInfo deviceInfo, NodeMCUWS2812USBUpdateQueue updateQueue, int channel, int ledCount)
: base(deviceInfo, updateQueue)
{ {
this.Channel = channel; this.Channel = channel;

View File

@ -16,6 +16,7 @@ namespace RGB.NET.Devices.Wooting.Generic
/// Initializes a new instance of the <see cref="WootingRGBDevice{TDeviceInfo}"/> class. /// Initializes a new instance of the <see cref="WootingRGBDevice{TDeviceInfo}"/> class.
/// </summary> /// </summary>
/// <param name="info">The generic information provided by Wooting for the device.</param> /// <param name="info">The generic information provided by Wooting for the device.</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
protected WootingRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger) protected WootingRGBDevice(TDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, new WootingUpdateQueue(updateTrigger)) : base(info, new WootingUpdateQueue(updateTrigger))
{ } { }

View File

@ -24,6 +24,7 @@ namespace RGB.NET.Devices.Wooting.Keyboard
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Wooting.Keyboard.WootingKeyboardRGBDevice" /> class. /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Wooting.Keyboard.WootingKeyboardRGBDevice" /> class.
/// </summary> /// </summary>
/// <param name="info">The specific information provided by Wooting for the keyboard</param> /// <param name="info">The specific information provided by Wooting for the keyboard</param>
/// <param name="updateTrigger">The update trigger used to update this device.</param>
internal WootingKeyboardRGBDevice(WootingKeyboardRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger) internal WootingKeyboardRGBDevice(WootingKeyboardRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
: base(info, updateTrigger) : base(info, updateTrigger)
{ {

View File

@ -23,7 +23,6 @@ namespace RGB.NET.Devices.Wooting.Keyboard
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Wooting.WootingKeyboardRGBDeviceInfo" />. /// Internal constructor of managed <see cref="T:RGB.NET.Devices.Wooting.WootingKeyboardRGBDeviceInfo" />.
/// </summary> /// </summary>
/// <param name="deviceIndex">The index of the <see cref="T:RGB.NET.Devices.Wooting.WootingKeyboardRGBDevice" />.</param> /// <param name="deviceIndex">The index of the <see cref="T:RGB.NET.Devices.Wooting.WootingKeyboardRGBDevice" />.</param>
/// <param name="physicalKeyboardLayout">The <see cref="T:RGB.NET.Devices.Wooting.WootingPhysicalKeyboardLayout" /> of the <see cref="T:RGB.NET.Devices.Wooting.WootingKeyboardRGBDevice" />.</param>
internal WootingKeyboardRGBDeviceInfo(WootingDevicesIndexes deviceIndex) internal WootingKeyboardRGBDeviceInfo(WootingDevicesIndexes deviceIndex)
: base(RGBDeviceType.Keyboard, deviceIndex) : base(RGBDeviceType.Keyboard, deviceIndex)
{ } { }

View File

@ -53,6 +53,7 @@ namespace RGB.NET.Devices.Wooting
#region Methods #region Methods
/// <inheritdoc />
protected override void InitializeSDK() protected override void InitializeSDK()
{ {
lock (_WootingSDK.SdkLock) lock (_WootingSDK.SdkLock)
@ -61,6 +62,7 @@ namespace RGB.NET.Devices.Wooting
} }
} }
/// <inheritdoc />
protected override IEnumerable<IRGBDevice> LoadDevices() protected override IEnumerable<IRGBDevice> LoadDevices()
{ {
lock (_WootingSDK.SdkLock) lock (_WootingSDK.SdkLock)