1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 10:08:31 +00:00

Compare commits

...

35 Commits

Author SHA1 Message Date
35d61e1496 Merge 2 2021-11-23 23:23:05 +01:00
02c4be2fa4 Merge 2021-11-23 23:22:54 +01:00
bf7b80d85e
Merge pull request #246 from DarthAffe/MultiTarget
Multi target
2021-11-13 23:29:27 +01:00
f6102bcf43 Fixed weird line brakes 2021-11-13 23:29:02 +01:00
eccf27f359 Fixed some code issues 2021-11-13 23:24:57 +01:00
bee329ff4f Added .NET 5 as second build target since it still compiles fine 2021-11-13 23:22:06 +01:00
4afa46f25d
Merge pull request #245 from DarthAffe/Core/CustomUpdateData
Improved custom update data to be easier to use
2021-11-13 23:02:29 +01:00
9a5fe75b60 Improved custom update data to be easier to use 2021-11-13 19:53:13 +01:00
dc34535cea
Merge pull request #244 from DarthAffe/NET6
Net6
2021-11-13 18:45:46 +01:00
71981a5cf3 Merge 2 2021-11-13 18:00:48 +01:00
f69560224d Merge 2021-11-13 17:57:09 +01:00
30624035f1 Changed all namespaces to file-scope 2021-11-13 17:35:08 +01:00
a0c6ccebea Fixed some code issues 2021-11-13 00:56:52 +01:00
07fde6e31b Updated to .NET 6 2021-11-13 00:54:30 +01:00
Diogo Trindade
2b64773c47
Merge pull request #242 from diogotr7/SDK/razer-mouse-id
Added device definitions
2021-10-18 21:39:15 +01:00
edc4094e21
Merge pull request #239 from diogotr7/SDK/Wooting
Added wooting layout detection
2021-10-18 20:59:11 +02:00
Diogo Trindade
8280b99f0c Fixed steelseries device type 2021-10-13 17:50:17 +01:00
Diogo Trindade
fb9c98269f Added one more Pid 2021-10-13 17:46:45 +01:00
Diogo Trindade
7b52e9e3ee Added more device definitions 2021-10-13 17:25:39 +01:00
Diogo Trindade
39e3a1d11b Razer - Added basilisk V2 PID 2021-10-13 17:16:40 +01:00
11c31d07df
Merge pull request #238 from diogotr7/logitech-wireless-detection
Logitech - Added wireless device detection
2021-10-07 23:25:59 +02:00
f4522f7bdc
Merge pull request #241 from DarthAffe/SDK/SteelseriesKeypard5
Fixed keypad-5 issues for steelseries keyboards
2021-10-07 23:17:40 +02:00
293343a7ed Added a workaround for a SDK-issue with keypad-5 2021-10-07 23:14:21 +02:00
RobertBeekman
02843705a8
Merge pull request #226 from DarthAffe/SDK/ASUS
ASUS - Keep local arrays of lights in an attempt to fix crashes
2021-09-27 19:57:18 +02:00
Diogo Trindade
4b6c341185 Moved G733 definition to PerDevice 2021-09-26 21:24:58 +01:00
afb68f1277 Refactorings to better fit general code-style; Fix for device-loading 2021-09-26 20:30:31 +02:00
Diogo Trindade
a04018fef1 Use explicit types instad of var 2021-09-23 22:04:54 +01:00
Diogo Trindade
4074b015ef Added wooting layout detection 2021-09-22 17:59:48 +01:00
Diogo Trindade
e06857e236 Removed wireless POWERPLAY definition 2021-09-22 17:56:53 +01:00
Diogo Trindade
412dc9785c Logitech - Added wireless device detection 2021-09-22 17:08:33 +01:00
Robert
21b2f774c4 Merge branch 'Development' into SDK/ASUS 2021-09-19 09:47:08 +02:00
Robert
ecf880d297 ASUS - Only keep local arrays of lights in an attempt to fix crashes 2021-09-03 21:57:11 +02:00
Robert
e73fb45503 Merge remote-tracking branch 'origin/SDK/ASUS' into SDK/ASUS 2021-09-01 20:18:53 +02:00
Robert
06f46811f4 ASUS - Keep local arrays of keys and lights in an attempt to fix crashes 2021-09-01 20:18:44 +02:00
Robert
7520147ff8 ASUS - Keep local arrays of keys and lights in an attempt to fix crashes 2021-07-26 09:12:29 +02:00
374 changed files with 35977 additions and 35861 deletions

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents the default-behavior for the work with colors.
@ -58,4 +58,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,5 +1,5 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a behavior of a color for base operations.
/// </summary>
@ -33,4 +33,3 @@
/// <param name="blendColor">The <see cref="Color"/> to blend.</param>
Color Blend(in Color baseColor, in Color blendColor);
}
}

View File

@ -5,8 +5,8 @@
using System;
using System.Diagnostics;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents an ARGB (alpha, red, green, blue) color.
/// </summary>
@ -281,4 +281,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -2,8 +2,8 @@
// ReSharper disable UnusedMember.Global
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the HSV color space.
/// </summary>
@ -226,4 +226,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -2,8 +2,8 @@
// ReSharper disable UnusedMember.Global
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the Hcl color space.
/// </summary>
@ -209,4 +209,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -2,8 +2,8 @@
// ReSharper disable UnusedMember.Global
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the Lab color space.
/// </summary>
@ -225,4 +225,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -2,8 +2,8 @@
// ReSharper disable UnusedMember.Global
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the RGB color space.
/// </summary>
@ -293,4 +293,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -2,8 +2,8 @@
// ReSharper disable UnusedMember.Global
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the XYZ color space.
/// </summary>
@ -205,4 +205,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
// ReSharper disable UnusedMember.Global
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a generic color-correction.
/// </summary>
@ -13,4 +13,3 @@ namespace RGB.NET.Core
/// <param name="color">The <see cref="Color"/> to correct.</param>
void ApplyTo(ref Color color);
}
}

View File

@ -2,8 +2,8 @@
using System.Collections.ObjectModel;
using System.Linq;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc cref="AbstractBindable" />
/// <inheritdoc cref="IDecoratable{T}" />
public abstract class AbstractDecoratable<T> : AbstractBindable, IDecoratable<T>
@ -67,4 +67,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.Linq;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc cref="AbstractBindable" />
/// <inheritdoc cref="IDecorator" />
public abstract class AbstractDecorator : AbstractBindable, IDecorator
@ -59,4 +59,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,5 +1,5 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents a basic decorator which is aware of the <see cref="E:RGB.NET.Core.RGBSurface.Updating" /> event.
@ -69,4 +69,3 @@
#endregion
}
}

View File

@ -1,5 +1,5 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents a <see cref="T:RGB.NET.Core.IDecorator" /> decorating a <see cref="T:RGB.NET.Core.IBrush" />.
@ -14,4 +14,3 @@
/// <param name="color">The <see cref="Color"/> to be modified.</param>
void ManipulateColor(in Rectangle rectangle, in RenderTarget renderTarget, ref Color color);
}
}

View File

@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.ComponentModel;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a basic decoratable.
/// </summary>
@ -39,4 +39,3 @@ namespace RGB.NET.Core
/// </summary>
void RemoveAllDecorators();
}
}

View File

@ -1,5 +1,5 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a basic decorator.
/// </summary>
@ -36,4 +36,3 @@
#endregion
}
}

View File

@ -1,9 +1,8 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents a basic decorator decorating a <see cref="T:RGB.NET.Core.ILedGroup" />.
/// </summary>
public interface ILedGroupDecorator : IDecorator
{ }
}

View File

@ -6,8 +6,8 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc cref="AbstractBindable" />
/// <inheritdoc cref="IRGBDevice{TDeviceInfo}" />
/// <summary>
@ -236,4 +236,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -3,8 +3,8 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents the abstract base implementation for a <see cref="IRGBDeviceProvider"/>.
/// </summary>
@ -204,4 +204,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc cref="IEnumerable{Led}" />
/// <inheritdoc cref="IBindable" />
/// <inheritdoc cref="IDisposable" />
@ -96,4 +96,3 @@ namespace RGB.NET.Core
/// </summary>
new TDeviceInfo DeviceInfo { get; }
}
}

View File

@ -1,5 +1,5 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a generic information for a <see cref="IRGBDevice"/>
/// </summary>
@ -34,4 +34,3 @@
#endregion
}
}

View File

@ -3,8 +3,8 @@
using System;
using System.Collections.Generic;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a generic device provider.
/// </summary>
@ -55,4 +55,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,8 +1,8 @@
// ReSharper disable InconsistentNaming
#pragma warning disable 1591
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Contains a list of available keyboard layout types.
/// </summary>
@ -15,4 +15,3 @@ namespace RGB.NET.Core
ABNT = 4,
KS = 5
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Contains a list of different types of device.
/// </summary>
@ -98,4 +98,3 @@ namespace RGB.NET.Core
/// </summary>
All = ~None
}
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a cooler-device
/// </summary>
public interface ICooler : IRGBDevice
{ }
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a DRAM-device
/// </summary>
public interface IDRAM : IRGBDevice
{ }
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// represents a fan-device
/// </summary>
public interface IFan : IRGBDevice
{ }
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a graphics-card-device
/// </summary>
public interface IGraphicsCard : IRGBDevice
{ }
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a headset-device
/// </summary>
public interface IHeadset : IRGBDevice
{ }
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a headset-stand-device
/// </summary>
public interface IHeadsetStand : IRGBDevice
{ }
}

View File

@ -1,5 +1,5 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a generic keyboard-device.
/// </summary>
@ -21,4 +21,3 @@
/// </summary>
KeyboardLayoutType Layout { get; }
}
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a keypad-device
/// </summary>
public interface IKeypad : IRGBDevice
{ }
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a led-matrix-device
/// </summary>
public interface ILedMatrix : IRGBDevice
{ }
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a led-stripe-device
/// </summary>
public interface ILedStripe : IRGBDevice
{ }
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a mainboard-device
/// </summary>
public interface IMainboard : IRGBDevice
{ }
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a mouse-device
/// </summary>
public interface IMouse : IRGBDevice
{ }
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a mousepad-device
/// </summary>
public interface IMousepad : IRGBDevice
{ }
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a speaker-device
/// </summary>
public interface ISpeaker : IRGBDevice
{ }
}

View File

@ -1,8 +1,7 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a device with unkown or not specified type.
/// </summary>
public interface IUnknownDevice : IRGBDevice
{ }
}

View File

@ -3,8 +3,8 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.Exception" />-event.
@ -48,4 +48,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -3,8 +3,8 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.SurfaceLayoutChanged" />-event.
@ -64,4 +64,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,11 +1,10 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.Updated" />-event.
/// </summary>
public class UpdatedEventArgs : EventArgs
{ }
}

View File

@ -3,8 +3,8 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.Updating" />-event.
@ -48,4 +48,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents an exception thrown by a <see cref="IRGBDeviceProvider" />.
@ -32,4 +32,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents an exception thrown by an <see cref="T:RGB.NET.Core.IRGBDevice" />.
@ -22,4 +22,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents an exception thrown by an <see cref="T:RGB.NET.Core.RGBSurface" />.
@ -22,4 +22,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Offers some extensions and helper-methods for <see cref="Color"/> related things.
/// </summary>
@ -30,4 +30,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -0,0 +1,43 @@
namespace RGB.NET.Core;
/// <summary>
/// Offers some extensions for easier use of <see cref="CustomUpdateData"/>.
/// </summary>
public static class CustomUpdateDataExtension
{
/// <summary>
/// Sets the <see cref="CustomUpdateDataIndex.FLUSH_LEDS"/>-Parameter to the given value.
/// </summary>
/// <param name="customUpdateData">The update-data to modify.</param>
/// <param name="value">The value to set.</param>
/// <returns>The modified update-data.</returns>
public static CustomUpdateData FlushLeds(this CustomUpdateData customUpdateData, bool value = true)
{
customUpdateData[CustomUpdateDataIndex.FLUSH_LEDS] = value;
return customUpdateData;
}
/// <summary>
/// Sets the <see cref="CustomUpdateDataIndex.RENDER"/>-Parameter to the given value.
/// </summary>
/// <param name="customUpdateData">The update-data to modify.</param>
/// <param name="value">The value to set.</param>
/// <returns>The modified update-data.</returns>
public static CustomUpdateData Render(this CustomUpdateData customUpdateData, bool value = true)
{
customUpdateData[CustomUpdateDataIndex.RENDER] = value;
return customUpdateData;
}
/// <summary>
/// Sets the <see cref="CustomUpdateDataIndex.UPDATE_DEVICES"/>-Parameter to the given value.
/// </summary>
/// <param name="customUpdateData">The update-data to modify.</param>
/// <param name="value">The value to set.</param>
/// <returns>The modified update-data.</returns>
public static CustomUpdateData UpdateDevices(this CustomUpdateData customUpdateData, bool value = true)
{
customUpdateData[CustomUpdateDataIndex.UPDATE_DEVICES] = value;
return customUpdateData;
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.Runtime.CompilerServices;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Offers some extensions and helper-methods for the work with floats.
/// </summary>
@ -108,4 +108,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Offers some extensions and helper-methods for <see cref="Point"/> related things.
/// </summary>
@ -41,4 +41,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Offers some extensions and helper-methods for the work with rectangles.
/// </summary>
@ -174,4 +174,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -3,8 +3,8 @@
using System.Collections.Generic;
using System.Linq;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Offers some extensions and helper-methods for the work with the surface.
/// </summary>
@ -82,4 +82,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,8 +1,8 @@
using System.Collections;
using System.Collections.Generic;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc cref="AbstractDecoratable{T}" />
/// <inheritdoc cref="ILedGroup" />
/// <summary>
@ -59,4 +59,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -3,8 +3,8 @@
using System.Collections.Generic;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a generic ledgroup.
/// </summary>
@ -40,4 +40,3 @@ namespace RGB.NET.Core
/// </summary>
void OnDetach();
}
}

View File

@ -1,8 +1,8 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Offers some extensions and helper-methods for <see cref="ILedGroup"/> related things.
/// </summary>
@ -55,4 +55,3 @@ namespace RGB.NET.Core
/// <returns><c>true</c> if the <see cref="ILedGroup"/> could be detached; otherwise, <c>false</c>.</returns>
public static bool Detach(this ILedGroup ledGroup) => ledGroup.Surface?.Detach(ledGroup) ?? false;
}
}

View File

@ -3,8 +3,8 @@
using System.Collections.Generic;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents a ledgroup containing arbitrary <see cref="T:RGB.NET.Core.Led" />.
@ -130,4 +130,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Contains helper methods for converting things.
/// </summary>
@ -59,4 +59,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,8 +1,8 @@
using System.Reflection;
using System.Runtime.CompilerServices;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Offsers some helper methods for device creation.
/// </summary>
@ -24,4 +24,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -2,8 +2,8 @@
using System.Reflection;
using System.Runtime.CompilerServices;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Offers some methods to create and handle unique identifiers.
/// </summary>
@ -72,4 +72,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -2,8 +2,8 @@
using System.Diagnostics;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents a single LED of a RGB-device.
@ -173,4 +173,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -3,8 +3,8 @@
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
public enum LedId
{
Invalid = -1,
@ -8338,4 +8338,3 @@ namespace RGB.NET.Core
Unknown1023 = 0x0FF003FF,
Unknown1024 = 0x0FF00400,
}
}

View File

@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.Linq;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a mapping from <see cref="LedId"/> to a custom identifier.
/// </summary>
@ -146,4 +146,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,8 +1,8 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents a basic bindable class which notifies when a property value changes.
@ -59,4 +59,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,11 +1,10 @@
using System.ComponentModel;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a basic bindable class which notifies when a property value changes.
/// </summary>
public interface IBindable : INotifyPropertyChanged
{
}
}

View File

@ -2,8 +2,8 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a generic placeable element.
/// </summary>
@ -90,4 +90,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a placeable element.
/// </summary>
@ -259,4 +259,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -4,8 +4,8 @@
using System;
using System.Diagnostics;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a point consisting of a X- and a Y-position.
/// </summary>
@ -152,4 +152,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -6,8 +6,8 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a rectangle defined by it's position and it's size.
/// </summary>
@ -239,4 +239,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -4,8 +4,8 @@
using System;
using System.Diagnostics;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents an angular rotation.
/// </summary>
@ -159,4 +159,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -3,8 +3,8 @@
using System.Diagnostics;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a scaling.
/// </summary>
@ -141,4 +141,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Contains a list of different shapes used to define the layout of a LED.
/// </summary>
@ -23,4 +23,3 @@ namespace RGB.NET.Core
/// </summary>
Circle = 2,
}
}

View File

@ -3,8 +3,8 @@
using System.Diagnostics;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a size consisting of a width and a height.
/// </summary>
@ -194,4 +194,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>

View File

@ -7,8 +7,8 @@ using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc cref="AbstractBindable" />
/// <inheritdoc cref="IDisposable" />
/// <summary>
@ -132,7 +132,7 @@ namespace RGB.NET.Core
/// Perform a full update for all devices. Updates only dirty <see cref="Led"/> by default, or all <see cref="Led"/>, if flushLeds is set to true.
/// </summary>
/// <param name="flushLeds">Specifies whether all <see cref="Led"/>, (including clean ones) should be updated.</param>
public void Update(bool flushLeds = false) => Update(null, new CustomUpdateData(("flushLeds", flushLeds)));
public void Update(bool flushLeds = false) => Update(null, new CustomUpdateData((CustomUpdateDataIndex.FLUSH_LEDS, flushLeds)));
private void Update(object? updateTrigger, CustomUpdateData customData) => Update(updateTrigger as IUpdateTrigger, customData);
@ -140,9 +140,9 @@ namespace RGB.NET.Core
{
try
{
bool flushLeds = customData["flushLeds"] as bool? ?? false;
bool render = customData["render"] as bool? ?? true;
bool updateDevices = customData["updateDevices"] as bool? ?? true;
bool flushLeds = customData[CustomUpdateDataIndex.FLUSH_LEDS] as bool? ?? false;
bool render = customData[CustomUpdateDataIndex.RENDER] as bool? ?? true;
bool updateDevices = customData[CustomUpdateDataIndex.UPDATE_DEVICES] as bool? ?? true;
lock (UpdateTriggers)
lock (Devices)
@ -383,4 +383,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -4,8 +4,8 @@
using System.Collections.Generic;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc cref="AbstractDecoratable{T}" />
/// <inheritdoc cref="IBrush" />
/// <summary>
@ -106,4 +106,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -4,8 +4,8 @@
using System.Collections.Generic;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a basic brush.
/// </summary>
@ -38,4 +38,3 @@ namespace RGB.NET.Core
/// <param name="renderTargets">The <see cref="RenderTarget"/> (keys/points) of which the color should be calculated.</param>
IEnumerable<(RenderTarget renderTarget, Color color)> Render(Rectangle rectangle, IEnumerable<RenderTarget> renderTargets);
}
}

View File

@ -1,8 +1,8 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents a brush drawing only a single color.
@ -59,4 +59,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,5 +1,5 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents a brush drawing a texture.
@ -44,4 +44,3 @@
#endregion
}
}

View File

@ -1,7 +1,7 @@
// ReSharper disable UnusedMember.Global
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Contains a list of all brush calculation modes.
/// </summary>
@ -17,4 +17,3 @@ namespace RGB.NET.Core
/// </summary>
Absolute
}
}

View File

@ -1,8 +1,8 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a single target of a brush render.
/// </summary>
@ -42,4 +42,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,5 +1,5 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
internal class EmptyTexture : ITexture
{
#region Properties & Fields
@ -10,4 +10,3 @@
#endregion
}
}

View File

@ -1,5 +1,5 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a generic texture.
/// </summary>
@ -29,4 +29,3 @@
/// <returns>The sampled color.</returns>
Color this[in Rectangle rectangle] { get; }
}
}

View File

@ -2,8 +2,8 @@
using System.Buffers;
using System.Runtime.CompilerServices;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents a texture made of pixels (like a common image).
@ -226,4 +226,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a sampled that averages multiple color to a single color.
/// </summary>
@ -32,4 +32,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a generic sampler to combine multipel data entries to a single one.
/// </summary>
@ -15,4 +15,3 @@ namespace RGB.NET.Core
/// <param name="pixelData">The buffer used to write the resulting pixel to.</param>
void Sample(in SamplerInfo<T> info, in Span<T> pixelData);
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents the information used to sample data.
/// </summary>
@ -44,4 +44,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a generic update trigger.
/// </summary>
@ -45,4 +45,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,31 @@
using System.Collections.Generic;
namespace RGB.NET.Core
namespace RGB.NET.Core;
/// <summary>
/// Represents an index used to identify data in the <see cref="CustomUpdateData"/>.
/// </summary>
public static class CustomUpdateDataIndex
{
/// <summary>
/// Checked by the <see cref="RGBSurface"/> to see if all LEDs needs to be flushed even if they aren't changed in this update.
/// default: false
/// </summary>
public const string FLUSH_LEDS = "flushLeds";
/// <summary>
/// Checked by the <see cref="RGBSurface"/> to see if the surface should be rendered in this update.
/// default: true
/// </summary>
public const string RENDER = "render";
/// <summary>
/// Checked by the <see cref="RGBSurface"/> to see if devies should be updated after rendering.
/// default: true
/// </summary>
public const string UPDATE_DEVICES = "updateDevices";
}
/// <summary>
/// Represents a set of custom data, each indexed by a string-key.
/// </summary>
@ -48,4 +72,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -4,8 +4,8 @@ using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents an update-trigger used to update devices with a maximum update-rate.
/// </summary>
@ -178,4 +178,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,5 +1,5 @@
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents an update trigger used to trigger device-updates.
/// </summary>
@ -10,4 +10,3 @@
/// </summary>
void TriggerHasData();
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a generic update queue.
/// </summary>
@ -29,4 +29,3 @@ namespace RGB.NET.Core
/// </summary>
public interface IUpdateQueue : IUpdateQueue<object, Color>
{ }
}

View File

@ -3,8 +3,8 @@ using System.Buffers;
using System.Collections.Generic;
using System.Linq;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a generic update queue.
/// </summary>
@ -136,4 +136,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <summary>
/// Represents a trigger causing an update.
/// </summary>
@ -27,4 +27,3 @@ namespace RGB.NET.Core
/// </summary>
void Start();
}
}

View File

@ -4,8 +4,8 @@ using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents an update trigger that is manully triggered by calling <see cref="TriggerUpdate"/>.
@ -19,6 +19,8 @@ namespace RGB.NET.Core
private CancellationTokenSource? UpdateTokenSource { get; set; }
private CancellationToken UpdateToken { get; set; }
private CustomUpdateData? _customUpdateData;
/// <summary>
/// Gets the time it took the last update-loop cycle to run.
/// </summary>
@ -71,7 +73,11 @@ namespace RGB.NET.Core
/// <summary>
/// Triggers an update.
/// </summary>
public void TriggerUpdate() => _mutex.Set();
public void TriggerUpdate(CustomUpdateData? updateData = null)
{
_customUpdateData = updateData;
_mutex.Set();
}
private void UpdateLoop()
{
@ -82,7 +88,7 @@ namespace RGB.NET.Core
if (_mutex.WaitOne(100))
{
long preUpdateTicks = Stopwatch.GetTimestamp();
OnUpdate();
OnUpdate(_customUpdateData);
LastUpdateTime = ((Stopwatch.GetTimestamp() - preUpdateTicks) / 10000.0);
}
}
@ -93,4 +99,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -5,8 +5,8 @@ using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
namespace RGB.NET.Core
{
namespace RGB.NET.Core;
/// <inheritdoc />
/// <summary>
/// Represents an update trigger that triggers in a set interval.
@ -17,6 +17,8 @@ namespace RGB.NET.Core
private readonly object _lock = new();
private readonly CustomUpdateData? _customUpdateData;
/// <summary>
/// Gets or sets the update loop of this trigger.
/// </summary>
@ -62,6 +64,20 @@ namespace RGB.NET.Core
Start();
}
/// <summary>
/// Initializes a new instance of the <see cref="TimerUpdateTrigger"/> class.
/// </summary>
/// <param name="customUpdateData">The update-data passed on each update triggered.</param>
/// <param name="autostart">A value indicating if the trigger should automatically <see cref="Start"/> right after construction.</param>
public TimerUpdateTrigger(CustomUpdateData? customUpdateData, bool autostart = true)
{
this._customUpdateData = customUpdateData;
if (autostart)
// ReSharper disable once VirtualMemberCallInConstructor - HACK DarthAffe 01.06.2021: I've no idea how to correctly handle that case, for now just disable it
Start();
}
#endregion
#region Methods
@ -118,7 +134,7 @@ namespace RGB.NET.Core
{
long preUpdateTicks = Stopwatch.GetTimestamp();
OnUpdate();
OnUpdate(_customUpdateData);
if (UpdateFrequency > 0)
{
@ -140,4 +156,3 @@ namespace RGB.NET.Core
#endregion
}
}

View File

@ -6,8 +6,8 @@ using System.Collections.Generic;
using AuraServiceLib;
using RGB.NET.Core;
namespace RGB.NET.Devices.Asus
{
namespace RGB.NET.Devices.Asus;
/// <inheritdoc />
/// <summary>
/// Represents a device provider responsible for Cooler Master devices.
@ -92,4 +92,3 @@ namespace RGB.NET.Devices.Asus
#endregion
}
}

View File

@ -1,7 +1,7 @@
using RGB.NET.Core;
namespace RGB.NET.Devices.Asus
{
namespace RGB.NET.Devices.Asus;
/// <inheritdoc cref="AsusRGBDevice{TDeviceInfo}" />
/// <summary>
/// Represents a Asus dram.
@ -38,4 +38,3 @@ namespace RGB.NET.Devices.Asus
#endregion
}
}

View File

@ -1,7 +1,7 @@
// ReSharper disable InconsistentNaming
namespace RGB.NET.Devices.Asus
{
namespace RGB.NET.Devices.Asus;
internal enum AsusDeviceType : uint
{
ALL = 0,
@ -22,4 +22,3 @@ namespace RGB.NET.Devices.Asus
CHASSIS_RGB = 0xB0000,
PROJECTOR_RGB = 0xC0000
}
}

View File

@ -1,8 +1,8 @@
// ReSharper disable InconsistentNaming
#pragma warning disable 1591
namespace RGB.NET.Devices.Asus
{
namespace RGB.NET.Devices.Asus;
/// <summary>
/// Represents a LED ID as they are known by the ASUS SDK
/// </summary>
@ -162,4 +162,3 @@ namespace RGB.NET.Devices.Asus
UNDOCUMENTED_5 = 0x103,
UNDOCUMENTED_6 = 0xDA, // Bottom-left function on the ROG Zephyrus Duo 15
}
}

View File

@ -1,5 +1,5 @@
namespace RGB.NET.Devices.Asus
{
namespace RGB.NET.Devices.Asus;
/// <summary>
/// Represents a type of ASUS LED as known by the ASUS SDK
/// </summary>
@ -15,4 +15,3 @@
/// </summary>
Light
}
}

View File

@ -1,7 +1,7 @@
using RGB.NET.Core;
namespace RGB.NET.Devices.Asus
{
namespace RGB.NET.Devices.Asus;
/// <inheritdoc cref="AbstractRGBDevice{TDeviceInfo}" />
/// <summary>
/// Represents a generic Asus-device. (keyboard, mouse, headset, mousepad).
@ -22,4 +22,3 @@ namespace RGB.NET.Devices.Asus
#endregion
}
}

Some files were not shown because too many files have changed in this diff Show More