mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-01-02 02:33:39 +00:00
Compare commits
No commits in common. "4afa46f25d3601b9e72778de77e6892c58adea02" and "2b64773c479a83bb78e6792717e2f428731c4e2c" have entirely different histories.
4afa46f25d
...
2b64773c47
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the default-behavior for the work with colors.
|
||||
/// </summary>
|
||||
public class DefaultColorBehavior : IColorBehavior
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the default-behavior for the work with colors.
|
||||
/// </summary>
|
||||
public class DefaultColorBehavior : IColorBehavior
|
||||
{
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
@ -57,4 +57,5 @@ public class DefaultColorBehavior : IColorBehavior
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a behavior of a color for base operations.
|
||||
/// </summary>
|
||||
public interface IColorBehavior
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a behavior of a color for base operations.
|
||||
/// </summary>
|
||||
public interface IColorBehavior
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts the specified <see cref="Color"/> to a string representation.
|
||||
/// </summary>
|
||||
@ -32,4 +32,5 @@ public interface IColorBehavior
|
||||
/// <param name="baseColor">The <see cref="Color"/> to to blend over.</param>
|
||||
/// <param name="blendColor">The <see cref="Color"/> to blend.</param>
|
||||
Color Blend(in Color baseColor, in Color blendColor);
|
||||
}
|
||||
}
|
||||
@ -5,14 +5,14 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an ARGB (alpha, red, green, blue) color.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")]
|
||||
public readonly struct Color
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an ARGB (alpha, red, green, blue) color.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")]
|
||||
public readonly struct Color
|
||||
{
|
||||
#region Constants
|
||||
|
||||
private static readonly Color TRANSPARENT = new(0, 0, 0, 0);
|
||||
@ -280,4 +280,5 @@ public readonly struct Color
|
||||
public static implicit operator Color((float a, float r, float g, float b) components) => new(components.a, components.r, components.g, components.b);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -2,13 +2,13 @@
|
||||
// ReSharper disable UnusedMember.Global
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the HSV color space.
|
||||
/// </summary>
|
||||
public static class HSVColor
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the HSV color space.
|
||||
/// </summary>
|
||||
public static class HSVColor
|
||||
{
|
||||
#region Getter
|
||||
|
||||
/// <summary>
|
||||
@ -225,4 +225,5 @@ public static class HSVColor
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -2,13 +2,13 @@
|
||||
// ReSharper disable UnusedMember.Global
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the Hcl color space.
|
||||
/// </summary>
|
||||
public static class HclColor
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the Hcl color space.
|
||||
/// </summary>
|
||||
public static class HclColor
|
||||
{
|
||||
#region Getter
|
||||
|
||||
/// <summary>
|
||||
@ -208,4 +208,5 @@ public static class HclColor
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -2,13 +2,13 @@
|
||||
// ReSharper disable UnusedMember.Global
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the Lab color space.
|
||||
/// </summary>
|
||||
public static class LabColor
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the Lab color space.
|
||||
/// </summary>
|
||||
public static class LabColor
|
||||
{
|
||||
#region Getter
|
||||
|
||||
/// <summary>
|
||||
@ -224,4 +224,5 @@ public static class LabColor
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -2,13 +2,13 @@
|
||||
// ReSharper disable UnusedMember.Global
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the RGB color space.
|
||||
/// </summary>
|
||||
public static class RGBColor
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the RGB color space.
|
||||
/// </summary>
|
||||
public static class RGBColor
|
||||
{
|
||||
#region Getter
|
||||
|
||||
/// <summary>
|
||||
@ -292,4 +292,5 @@ public static class RGBColor
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -2,13 +2,13 @@
|
||||
// ReSharper disable UnusedMember.Global
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the XYZ color space.
|
||||
/// </summary>
|
||||
public static class XYZColor
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains helper-methods and extension for the <see cref="Color"/>-type to work in the XYZ color space.
|
||||
/// </summary>
|
||||
public static class XYZColor
|
||||
{
|
||||
#region Getter
|
||||
|
||||
/// <summary>
|
||||
@ -204,4 +204,5 @@ public static class XYZColor
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,16 @@
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic color-correction.
|
||||
/// </summary>
|
||||
public interface IColorCorrection
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic color-correction.
|
||||
/// </summary>
|
||||
public interface IColorCorrection
|
||||
{
|
||||
/// <summary>
|
||||
/// Applies the <see cref="IColorCorrection"/> to the specified <see cref="Color"/>.
|
||||
/// </summary>
|
||||
/// <param name="color">The <see cref="Color"/> to correct.</param>
|
||||
void ApplyTo(ref Color color);
|
||||
}
|
||||
}
|
||||
@ -2,13 +2,13 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc cref="AbstractBindable" />
|
||||
/// <inheritdoc cref="IDecoratable{T}" />
|
||||
public abstract class AbstractDecoratable<T> : AbstractBindable, IDecoratable<T>
|
||||
where T : IDecorator
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc cref="AbstractBindable" />
|
||||
/// <inheritdoc cref="IDecoratable{T}" />
|
||||
public abstract class AbstractDecoratable<T> : AbstractBindable, IDecoratable<T>
|
||||
where T : IDecorator
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private readonly List<T> _decorators = new();
|
||||
@ -66,4 +66,5 @@ public abstract class AbstractDecoratable<T> : AbstractBindable, IDecoratable<T>
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -2,12 +2,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc cref="AbstractBindable" />
|
||||
/// <inheritdoc cref="IDecorator" />
|
||||
public abstract class AbstractDecorator : AbstractBindable, IDecorator
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc cref="AbstractBindable" />
|
||||
/// <inheritdoc cref="IDecorator" />
|
||||
public abstract class AbstractDecorator : AbstractBindable, IDecorator
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private bool _isEnabled = true;
|
||||
@ -58,4 +58,5 @@ public abstract class AbstractDecorator : AbstractBindable, IDecorator
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic decorator which is aware of the <see cref="E:RGB.NET.Core.RGBSurface.Updating" /> event.
|
||||
/// </summary>
|
||||
public abstract class AbstractUpdateAwareDecorator : AbstractDecorator
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic decorator which is aware of the <see cref="E:RGB.NET.Core.RGBSurface.Updating" /> event.
|
||||
/// </summary>
|
||||
public abstract class AbstractUpdateAwareDecorator : AbstractDecorator
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -68,4 +68,5 @@ public abstract class AbstractUpdateAwareDecorator : AbstractDecorator
|
||||
protected abstract void Update(double deltaTime);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a <see cref="T:RGB.NET.Core.IDecorator" /> decorating a <see cref="T:RGB.NET.Core.IBrush" />.
|
||||
/// </summary>
|
||||
public interface IBrushDecorator : IDecorator
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a <see cref="T:RGB.NET.Core.IDecorator" /> decorating a <see cref="T:RGB.NET.Core.IBrush" />.
|
||||
/// </summary>
|
||||
public interface IBrushDecorator : IDecorator
|
||||
{
|
||||
/// <summary>
|
||||
/// Decorator-Method called by the <see cref="IBrush"/>.
|
||||
/// </summary>
|
||||
@ -13,4 +13,5 @@ public interface IBrushDecorator : IDecorator
|
||||
/// <param name="renderTarget">The target (key/point) from which the <see cref="Color"/> should be taken.</param>
|
||||
/// <param name="color">The <see cref="Color"/> to be modified.</param>
|
||||
void ManipulateColor(in Rectangle rectangle, in RenderTarget renderTarget, ref Color color);
|
||||
}
|
||||
}
|
||||
@ -1,22 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a basic decoratable.
|
||||
/// </summary>
|
||||
public interface IDecoratable : INotifyPropertyChanged
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic decoratable for a specific type of <see cref="T:RGB.NET.Core.IDecorator" />
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of decorators this decoratable can be decorated with.</typeparam>
|
||||
public interface IDecoratable<T> : IDecoratable
|
||||
where T : IDecorator
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a basic decoratable.
|
||||
/// </summary>
|
||||
public interface IDecoratable : INotifyPropertyChanged
|
||||
{ }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic decoratable for a specific type of <see cref="T:RGB.NET.Core.IDecorator" />
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of decorators this decoratable can be decorated with.</typeparam>
|
||||
public interface IDecoratable<T> : IDecoratable
|
||||
where T : IDecorator
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a readonly-list of all <see cref="IDecorator"/> attached to this <see cref="IDecoratable{T}"/>.
|
||||
/// </summary>
|
||||
@ -38,4 +38,5 @@ public interface IDecoratable<T> : IDecoratable
|
||||
/// Removes all <see cref="IDecorator"/> from the <see cref="IDecoratable"/>.
|
||||
/// </summary>
|
||||
void RemoveAllDecorators();
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a basic decorator.
|
||||
/// </summary>
|
||||
public interface IDecorator
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a basic decorator.
|
||||
/// </summary>
|
||||
public interface IDecorator
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -35,4 +35,5 @@ public interface IDecorator
|
||||
void OnDetached(IDecoratable decoratable);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,9 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic decorator decorating a <see cref="T:RGB.NET.Core.ILedGroup" />.
|
||||
/// </summary>
|
||||
public interface ILedGroupDecorator : IDecorator
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic decorator decorating a <see cref="T:RGB.NET.Core.ILedGroup" />.
|
||||
/// </summary>
|
||||
public interface ILedGroupDecorator : IDecorator
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -6,16 +6,16 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc cref="AbstractBindable" />
|
||||
/// <inheritdoc cref="IRGBDevice{TDeviceInfo}" />
|
||||
/// <summary>
|
||||
/// Represents a generic RGB-device.
|
||||
/// </summary>
|
||||
public abstract class AbstractRGBDevice<TDeviceInfo> : Placeable, IRGBDevice<TDeviceInfo>
|
||||
where TDeviceInfo : class, IRGBDeviceInfo
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc cref="AbstractBindable" />
|
||||
/// <inheritdoc cref="IRGBDevice{TDeviceInfo}" />
|
||||
/// <summary>
|
||||
/// Represents a generic RGB-device.
|
||||
/// </summary>
|
||||
public abstract class AbstractRGBDevice<TDeviceInfo> : Placeable, IRGBDevice<TDeviceInfo>
|
||||
where TDeviceInfo : class, IRGBDeviceInfo
|
||||
{
|
||||
private RGBSurface? _surface;
|
||||
|
||||
#region Properties & Fields
|
||||
@ -235,4 +235,5 @@ public abstract class AbstractRGBDevice<TDeviceInfo> : Placeable, IRGBDevice<TDe
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -3,13 +3,13 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the abstract base implementation for a <see cref="IRGBDeviceProvider"/>.
|
||||
/// </summary>
|
||||
public abstract class AbstractRGBDeviceProvider : IRGBDeviceProvider
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the abstract base implementation for a <see cref="IRGBDeviceProvider"/>.
|
||||
/// </summary>
|
||||
public abstract class AbstractRGBDeviceProvider : IRGBDeviceProvider
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private readonly double _defaultUpdateRateHardLimit;
|
||||
@ -203,4 +203,5 @@ public abstract class AbstractRGBDeviceProvider : IRGBDeviceProvider
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc cref="IEnumerable{Led}" />
|
||||
/// <inheritdoc cref="IBindable" />
|
||||
/// <inheritdoc cref="IDisposable" />
|
||||
/// <summary>
|
||||
/// Represents a generic RGB-device.
|
||||
/// </summary>
|
||||
public interface IRGBDevice : IEnumerable<Led>, IPlaceable, IBindable, IDisposable
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc cref="IEnumerable{Led}" />
|
||||
/// <inheritdoc cref="IBindable" />
|
||||
/// <inheritdoc cref="IDisposable" />
|
||||
/// <summary>
|
||||
/// Represents a generic RGB-device.
|
||||
/// </summary>
|
||||
public interface IRGBDevice : IEnumerable<Led>, IPlaceable, IBindable, IDisposable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
@ -82,17 +82,18 @@ public interface IRGBDevice : IEnumerable<Led>, IPlaceable, IBindable, IDisposab
|
||||
Led? RemoveLed(LedId ledId);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic RGB-device with an known device-info type.
|
||||
/// </summary>
|
||||
public interface IRGBDevice<out TDeviceInfo> : IRGBDevice
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic RGB-device with an known device-info type.
|
||||
/// </summary>
|
||||
public interface IRGBDevice<out TDeviceInfo> : IRGBDevice
|
||||
where TDeviceInfo : IRGBDeviceInfo
|
||||
{
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets generic information about the <see cref="IRGBDevice"/>.
|
||||
/// </summary>
|
||||
new TDeviceInfo DeviceInfo { get; }
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="IRGBDevice"/>
|
||||
/// </summary>
|
||||
public interface IRGBDeviceInfo
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="IRGBDevice"/>
|
||||
/// </summary>
|
||||
public interface IRGBDeviceInfo
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -33,4 +33,5 @@ public interface IRGBDeviceInfo
|
||||
object? LayoutMetadata { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -3,13 +3,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic device provider.
|
||||
/// </summary>
|
||||
public interface IRGBDeviceProvider : IDisposable
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic device provider.
|
||||
/// </summary>
|
||||
public interface IRGBDeviceProvider : IDisposable
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -54,4 +54,5 @@ public interface IRGBDeviceProvider : IDisposable
|
||||
bool Initialize(RGBDeviceType loadFilter = RGBDeviceType.All, bool throwExceptions = false);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,17 +1,18 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
#pragma warning disable 1591
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Contains a list of available keyboard layout types.
|
||||
/// </summary>
|
||||
public enum KeyboardLayoutType
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains a list of available keyboard layout types.
|
||||
/// </summary>
|
||||
public enum KeyboardLayoutType
|
||||
{
|
||||
Unknown = 0,
|
||||
ANSI = 1,
|
||||
ISO = 2,
|
||||
JIS = 3,
|
||||
ABNT = 4,
|
||||
KS = 5
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Contains a list of different types of device.
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum RGBDeviceType
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains a list of different types of device.
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum RGBDeviceType
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents nothing.
|
||||
/// </summary>
|
||||
@ -97,4 +97,5 @@ public enum RGBDeviceType
|
||||
/// Represents all devices.
|
||||
/// </summary>
|
||||
All = ~None
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a cooler-device
|
||||
/// </summary>
|
||||
public interface ICooler : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a cooler-device
|
||||
/// </summary>
|
||||
public interface ICooler : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a DRAM-device
|
||||
/// </summary>
|
||||
public interface IDRAM : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a DRAM-device
|
||||
/// </summary>
|
||||
public interface IDRAM : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// represents a fan-device
|
||||
/// </summary>
|
||||
public interface IFan : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// represents a fan-device
|
||||
/// </summary>
|
||||
public interface IFan : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a graphics-card-device
|
||||
/// </summary>
|
||||
public interface IGraphicsCard : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a graphics-card-device
|
||||
/// </summary>
|
||||
public interface IGraphicsCard : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a headset-device
|
||||
/// </summary>
|
||||
public interface IHeadset : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a headset-device
|
||||
/// </summary>
|
||||
public interface IHeadset : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a headset-stand-device
|
||||
/// </summary>
|
||||
public interface IHeadsetStand : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a headset-stand-device
|
||||
/// </summary>
|
||||
public interface IHeadsetStand : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -1,23 +1,24 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic keyboard-device.
|
||||
/// </summary>
|
||||
public interface IKeyboard : IRGBDevice
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic keyboard-device.
|
||||
/// </summary>
|
||||
public interface IKeyboard : IRGBDevice
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the device information assiciated with this device.
|
||||
/// </summary>
|
||||
new IKeyboardDeviceInfo DeviceInfo { get; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic keyboard device information.
|
||||
/// </summary>
|
||||
public interface IKeyboardDeviceInfo : IRGBDeviceInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic keyboard device information.
|
||||
/// </summary>
|
||||
public interface IKeyboardDeviceInfo : IRGBDeviceInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the <see cref="KeyboardLayoutType"/> of the keyboard.
|
||||
/// </summary>
|
||||
KeyboardLayoutType Layout { get; }
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a keypad-device
|
||||
/// </summary>
|
||||
public interface IKeypad : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a keypad-device
|
||||
/// </summary>
|
||||
public interface IKeypad : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a led-matrix-device
|
||||
/// </summary>
|
||||
public interface ILedMatrix : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a led-matrix-device
|
||||
/// </summary>
|
||||
public interface ILedMatrix : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a led-stripe-device
|
||||
/// </summary>
|
||||
public interface ILedStripe : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a led-stripe-device
|
||||
/// </summary>
|
||||
public interface ILedStripe : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a mainboard-device
|
||||
/// </summary>
|
||||
public interface IMainboard : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a mainboard-device
|
||||
/// </summary>
|
||||
public interface IMainboard : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a mouse-device
|
||||
/// </summary>
|
||||
public interface IMouse : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a mouse-device
|
||||
/// </summary>
|
||||
public interface IMouse : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a mousepad-device
|
||||
/// </summary>
|
||||
public interface IMousepad : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a mousepad-device
|
||||
/// </summary>
|
||||
public interface IMousepad : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a speaker-device
|
||||
/// </summary>
|
||||
public interface ISpeaker : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a speaker-device
|
||||
/// </summary>
|
||||
public interface ISpeaker : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a device with unkown or not specified type.
|
||||
/// </summary>
|
||||
public interface IUnknownDevice : IRGBDevice
|
||||
{ }
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a device with unkown or not specified type.
|
||||
/// </summary>
|
||||
public interface IUnknownDevice : IRGBDevice
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -3,14 +3,14 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.Exception" />-event.
|
||||
/// </summary>
|
||||
public class ExceptionEventArgs : EventArgs
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.Exception" />-event.
|
||||
/// </summary>
|
||||
public class ExceptionEventArgs : EventArgs
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -47,4 +47,5 @@ public class ExceptionEventArgs : EventArgs
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -3,14 +3,14 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.SurfaceLayoutChanged" />-event.
|
||||
/// </summary>
|
||||
public class SurfaceLayoutChangedEventArgs : EventArgs
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.SurfaceLayoutChanged" />-event.
|
||||
/// </summary>
|
||||
public class SurfaceLayoutChangedEventArgs : EventArgs
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -63,4 +63,5 @@ public class SurfaceLayoutChangedEventArgs : EventArgs
|
||||
internal static SurfaceLayoutChangedEventArgs Misc() => new(null, false, false, false);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,11 @@
|
||||
using System;
|
||||
|
||||
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
|
||||
{ }
|
||||
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
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -3,14 +3,14 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.Updating" />-event.
|
||||
/// </summary>
|
||||
public class UpdatingEventArgs : EventArgs
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the information supplied with an <see cref="E:RGB.NET.Core.RGBSurface.Updating" />-event.
|
||||
/// </summary>
|
||||
public class UpdatingEventArgs : EventArgs
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -47,4 +47,5 @@ public class UpdatingEventArgs : EventArgs
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents an exception thrown by a <see cref="IRGBDeviceProvider" />.
|
||||
/// </summary>
|
||||
public class DeviceProviderException : ApplicationException
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents an exception thrown by a <see cref="IRGBDeviceProvider" />.
|
||||
/// </summary>
|
||||
public class DeviceProviderException : ApplicationException
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -31,4 +31,5 @@ public class DeviceProviderException : ApplicationException
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents an exception thrown by an <see cref="T:RGB.NET.Core.IRGBDevice" />.
|
||||
/// </summary>
|
||||
public class RGBDeviceException : ApplicationException
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents an exception thrown by an <see cref="T:RGB.NET.Core.IRGBDevice" />.
|
||||
/// </summary>
|
||||
public class RGBDeviceException : ApplicationException
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -21,4 +21,5 @@ public class RGBDeviceException : ApplicationException
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents an exception thrown by an <see cref="T:RGB.NET.Core.RGBSurface" />.
|
||||
/// </summary>
|
||||
public class RGBSurfaceException : ApplicationException
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents an exception thrown by an <see cref="T:RGB.NET.Core.RGBSurface" />.
|
||||
/// </summary>
|
||||
public class RGBSurfaceException : ApplicationException
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -21,4 +21,5 @@ public class RGBSurfaceException : ApplicationException
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Offers some extensions and helper-methods for <see cref="Color"/> related things.
|
||||
/// </summary>
|
||||
public static class ColorExtensions
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Offers some extensions and helper-methods for <see cref="Color"/> related things.
|
||||
/// </summary>
|
||||
public static class ColorExtensions
|
||||
{
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
@ -29,4 +29,5 @@ public static class ColorExtensions
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,43 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Offers some extensions and helper-methods for the work with floats.
|
||||
/// </summary>
|
||||
public static class FloatExtensions
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Offers some extensions and helper-methods for the work with floats.
|
||||
/// </summary>
|
||||
public static class FloatExtensions
|
||||
{
|
||||
#region Constants
|
||||
|
||||
/// <summary>
|
||||
@ -107,4 +107,5 @@ public static class FloatExtensions
|
||||
=> value == 255 ? 1.0f : (value / 256.0f);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Offers some extensions and helper-methods for <see cref="Point"/> related things.
|
||||
/// </summary>
|
||||
public static class PointExtensions
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Offers some extensions and helper-methods for <see cref="Point"/> related things.
|
||||
/// </summary>
|
||||
public static class PointExtensions
|
||||
{
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
@ -40,4 +40,5 @@ public static class PointExtensions
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Offers some extensions and helper-methods for the work with rectangles.
|
||||
/// </summary>
|
||||
public static class RectangleExtensions
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Offers some extensions and helper-methods for the work with rectangles.
|
||||
/// </summary>
|
||||
public static class RectangleExtensions
|
||||
{
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
@ -173,4 +173,5 @@ public static class RectangleExtensions
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -3,13 +3,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Offers some extensions and helper-methods for the work with the surface.
|
||||
/// </summary>
|
||||
public static class SurfaceExtensions
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Offers some extensions and helper-methods for the work with the surface.
|
||||
/// </summary>
|
||||
public static class SurfaceExtensions
|
||||
{
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
@ -81,4 +81,5 @@ public static class SurfaceExtensions
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,15 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc cref="AbstractDecoratable{T}" />
|
||||
/// <inheritdoc cref="ILedGroup" />
|
||||
/// <summary>
|
||||
/// Represents a generic <see cref="T:RGB.NET.Core.AbstractLedGroup" />.
|
||||
/// </summary>
|
||||
public abstract class AbstractLedGroup : AbstractDecoratable<ILedGroupDecorator>, ILedGroup
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc cref="AbstractDecoratable{T}" />
|
||||
/// <inheritdoc cref="ILedGroup" />
|
||||
/// <summary>
|
||||
/// Represents a generic <see cref="T:RGB.NET.Core.AbstractLedGroup" />.
|
||||
/// </summary>
|
||||
public abstract class AbstractLedGroup : AbstractDecoratable<ILedGroupDecorator>, ILedGroup
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
RGBSurface? ILedGroup.Surface { get; set; }
|
||||
@ -58,4 +58,5 @@ public abstract class AbstractLedGroup : AbstractDecoratable<ILedGroupDecorator>
|
||||
public IEnumerator<Led> GetEnumerator() => GetLeds().GetEnumerator();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -3,13 +3,13 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic ledgroup.
|
||||
/// </summary>
|
||||
public interface ILedGroup : IDecoratable<ILedGroupDecorator>, IEnumerable<Led>
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic ledgroup.
|
||||
/// </summary>
|
||||
public interface ILedGroup : IDecoratable<ILedGroupDecorator>, IEnumerable<Led>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the surface this group is attached to or <c>null</c> if it is not attached to any surface.
|
||||
/// </summary>
|
||||
@ -39,4 +39,5 @@ public interface ILedGroup : IDecoratable<ILedGroupDecorator>, IEnumerable<Led>
|
||||
/// Called when the <see cref="ILedGroup"/> is detached from the <see cref="RGBSurface"/>.
|
||||
/// </summary>
|
||||
void OnDetach();
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Offers some extensions and helper-methods for <see cref="ILedGroup"/> related things.
|
||||
/// </summary>
|
||||
public static class LedGroupExtension
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Offers some extensions and helper-methods for <see cref="ILedGroup"/> related things.
|
||||
/// </summary>
|
||||
public static class LedGroupExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts the specified <see cref="ILedGroup" /> to a <see cref="ListLedGroup" />.
|
||||
/// </summary>
|
||||
@ -54,4 +54,5 @@ public static class LedGroupExtension
|
||||
/// <param name="ledGroup">The <see cref="ILedGroup"/> to attach.</param>
|
||||
/// <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;
|
||||
}
|
||||
}
|
||||
@ -3,14 +3,14 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a ledgroup containing arbitrary <see cref="T:RGB.NET.Core.Led" />.
|
||||
/// </summary>
|
||||
public class ListLedGroup : AbstractLedGroup
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a ledgroup containing arbitrary <see cref="T:RGB.NET.Core.Led" />.
|
||||
/// </summary>
|
||||
public class ListLedGroup : AbstractLedGroup
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -129,4 +129,5 @@ public class ListLedGroup : AbstractLedGroup
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Contains helper methods for converting things.
|
||||
/// </summary>
|
||||
public static class ConversionHelper
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains helper methods for converting things.
|
||||
/// </summary>
|
||||
public static class ConversionHelper
|
||||
{
|
||||
#region Methods
|
||||
|
||||
// Source: https://web.archive.org/web/20180224104425/https://stackoverflow.com/questions/623104/byte-to-hex-string/3974535
|
||||
@ -58,4 +58,5 @@ public static class ConversionHelper
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Offsers some helper methods for device creation.
|
||||
/// </summary>
|
||||
public static class DeviceHelper
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Offsers some helper methods for device creation.
|
||||
/// </summary>
|
||||
public static class DeviceHelper
|
||||
{
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
@ -23,4 +23,5 @@ public static class DeviceHelper
|
||||
public static string CreateDeviceName(string manufacturer, string model) => IdGenerator.MakeUnique(Assembly.GetCallingAssembly(), $"{manufacturer} {model}");
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -2,13 +2,13 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Offers some methods to create and handle unique identifiers.
|
||||
/// </summary>
|
||||
public static class IdGenerator
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Offers some methods to create and handle unique identifiers.
|
||||
/// </summary>
|
||||
public static class IdGenerator
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
@ -71,4 +71,5 @@ public static class IdGenerator
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -2,15 +2,15 @@
|
||||
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a single LED of a RGB-device.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Id} {Color}")]
|
||||
public class Led : Placeable
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a single LED of a RGB-device.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{Id} {Color}")]
|
||||
public class Led : Placeable
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -172,4 +172,5 @@ public class Led : Placeable
|
||||
public static implicit operator Rectangle(Led led) => led.Boundary;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -3,10 +3,10 @@
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
public enum LedId
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
public enum LedId
|
||||
{
|
||||
Invalid = -1,
|
||||
|
||||
Logo = 0,
|
||||
@ -8337,4 +8337,5 @@ public enum LedId
|
||||
Unknown1022 = 0x0FF003FE,
|
||||
Unknown1023 = 0x0FF003FF,
|
||||
Unknown1024 = 0x0FF00400,
|
||||
}
|
||||
}
|
||||
@ -2,15 +2,15 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a mapping from <see cref="LedId"/> to a custom identifier.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The identifier the <see cref="LedId"/> is mapped to.</typeparam>
|
||||
public class LedMapping<T> : IEnumerable<(LedId ledId, T mapping)>
|
||||
where T : notnull
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a mapping from <see cref="LedId"/> to a custom identifier.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The identifier the <see cref="LedId"/> is mapped to.</typeparam>
|
||||
public class LedMapping<T> : IEnumerable<(LedId ledId, T mapping)>
|
||||
where T : notnull
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private readonly Dictionary<LedId, T> _mapping = new();
|
||||
@ -145,4 +145,5 @@ public class LedMapping<T> : IEnumerable<(LedId ledId, T mapping)>
|
||||
public IEnumerator<(LedId ledId, T mapping)> GetEnumerator() => _mapping.Select(x => (x.Key, x.Value)).GetEnumerator();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic bindable class which notifies when a property value changes.
|
||||
/// </summary>
|
||||
public abstract class AbstractBindable : IBindable
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a basic bindable class which notifies when a property value changes.
|
||||
/// </summary>
|
||||
public abstract class AbstractBindable : IBindable
|
||||
{
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
@ -58,4 +58,5 @@ public abstract class AbstractBindable : IBindable
|
||||
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,11 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a basic bindable class which notifies when a property value changes.
|
||||
/// </summary>
|
||||
public interface IBindable : INotifyPropertyChanged
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a basic bindable class which notifies when a property value changes.
|
||||
/// </summary>
|
||||
public interface IBindable : INotifyPropertyChanged
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -2,13 +2,13 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic placeable element.
|
||||
/// </summary>
|
||||
public interface IPlaceable
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic placeable element.
|
||||
/// </summary>
|
||||
public interface IPlaceable
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -89,4 +89,5 @@ public interface IPlaceable
|
||||
event EventHandler<EventArgs> BoundaryChanged;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a placeable element.
|
||||
/// </summary>
|
||||
public class Placeable : AbstractBindable, IPlaceable
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a placeable element.
|
||||
/// </summary>
|
||||
public class Placeable : AbstractBindable, IPlaceable
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -258,4 +258,5 @@ public class Placeable : AbstractBindable, IPlaceable
|
||||
protected virtual void OnBoundaryChanged() => BoundaryChanged?.Invoke(this, new EventArgs());
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -4,14 +4,14 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a point consisting of a X- and a Y-position.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("[X: {X}, Y: {Y}]")]
|
||||
public readonly struct Point
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a point consisting of a X- and a Y-position.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("[X: {X}, Y: {Y}]")]
|
||||
public readonly struct Point
|
||||
{
|
||||
#region Constants
|
||||
|
||||
private static readonly Point INVALID = new(float.NaN, float.NaN);
|
||||
@ -151,4 +151,5 @@ public readonly struct Point
|
||||
public static Point operator *(in Point point, in Scale scale) => new(point.X * scale.Horizontal, point.Y * scale.Vertical);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -6,14 +6,14 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a rectangle defined by it's position and it's size.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("[Location: {Location}, Size: {Size}]")]
|
||||
public readonly struct Rectangle
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a rectangle defined by it's position and it's size.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("[Location: {Location}, Size: {Size}]")]
|
||||
public readonly struct Rectangle
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -238,4 +238,5 @@ public readonly struct Rectangle
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -4,14 +4,14 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an angular rotation.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("[{" + nameof(Degrees) + "}°]")]
|
||||
public readonly struct Rotation
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an angular rotation.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("[{" + nameof(Degrees) + "}°]")]
|
||||
public readonly struct Rotation
|
||||
{
|
||||
#region Constants
|
||||
|
||||
private const float TWO_PI = MathF.PI * 2.0f;
|
||||
@ -158,4 +158,5 @@ public readonly struct Rotation
|
||||
public static implicit operator float(in Rotation rotation) => rotation.Degrees;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -3,14 +3,14 @@
|
||||
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a scaling.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("[Horizontal: {Horizontal}, Vertical: {Vertical}]")]
|
||||
public readonly struct Scale
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a scaling.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("[Horizontal: {Horizontal}, Vertical: {Vertical}]")]
|
||||
public readonly struct Scale
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -140,4 +140,5 @@ public readonly struct Scale
|
||||
public static implicit operator Scale(float scale) => new(scale);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Contains a list of different shapes used to define the layout of a LED.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public enum Shape
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains a list of different shapes used to define the layout of a LED.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public enum Shape
|
||||
{
|
||||
/// <summary>
|
||||
/// A custom shape defined by vector-data.
|
||||
/// </summary>
|
||||
@ -22,4 +22,5 @@ public enum Shape
|
||||
/// A simple circle.
|
||||
/// </summary>
|
||||
Circle = 2,
|
||||
}
|
||||
}
|
||||
@ -3,14 +3,14 @@
|
||||
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a size consisting of a width and a height.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("[Width: {Width}, Height: {Height}]")]
|
||||
public readonly struct Size
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a size consisting of a width and a height.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("[Width: {Width}, Height: {Height}]")]
|
||||
public readonly struct Size
|
||||
{
|
||||
#region Constants
|
||||
|
||||
private static readonly Size INVALID = new(float.NaN, float.NaN);
|
||||
@ -193,4 +193,5 @@ public readonly struct Size
|
||||
public static Size operator *(in Size size, in Scale scale) => new(size.Width * scale.Horizontal, size.Height * scale.Vertical);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0</TargetFrameworks>
|
||||
<TargetFrameworks>net5.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
|
||||
@ -7,15 +7,15 @@ using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc cref="AbstractBindable" />
|
||||
/// <inheritdoc cref="IDisposable" />
|
||||
/// <summary>
|
||||
/// Represents a RGB-surface containing multiple devices.
|
||||
/// </summary>
|
||||
public sealed class RGBSurface : AbstractBindable, IDisposable
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc cref="AbstractBindable" />
|
||||
/// <inheritdoc cref="IDisposable" />
|
||||
/// <summary>
|
||||
/// Represents a RGB-surface containing multiple devices.
|
||||
/// </summary>
|
||||
public sealed class RGBSurface : AbstractBindable, IDisposable
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private readonly Stopwatch _deltaTimeCounter;
|
||||
@ -132,7 +132,7 @@ public sealed class RGBSurface : AbstractBindable, IDisposable
|
||||
/// 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((CustomUpdateDataIndex.FLUSH_LEDS, flushLeds)));
|
||||
public void Update(bool flushLeds = false) => Update(null, new CustomUpdateData(("flushLeds", flushLeds)));
|
||||
|
||||
private void Update(object? updateTrigger, CustomUpdateData customData) => Update(updateTrigger as IUpdateTrigger, customData);
|
||||
|
||||
@ -140,9 +140,9 @@ public sealed class RGBSurface : AbstractBindable, IDisposable
|
||||
{
|
||||
try
|
||||
{
|
||||
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;
|
||||
bool flushLeds = customData["flushLeds"] as bool? ?? false;
|
||||
bool render = customData["render"] as bool? ?? true;
|
||||
bool updateDevices = customData["updateDevices"] as bool? ?? true;
|
||||
|
||||
lock (UpdateTriggers)
|
||||
lock (Devices)
|
||||
@ -382,4 +382,5 @@ public sealed class RGBSurface : AbstractBindable, IDisposable
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -4,15 +4,15 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc cref="AbstractDecoratable{T}" />
|
||||
/// <inheritdoc cref="IBrush" />
|
||||
/// <summary>
|
||||
/// Represents a basic brush.
|
||||
/// </summary>
|
||||
public abstract class AbstractBrush : AbstractDecoratable<IBrushDecorator>, IBrush
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc cref="AbstractDecoratable{T}" />
|
||||
/// <inheritdoc cref="IBrush" />
|
||||
/// <summary>
|
||||
/// Represents a basic brush.
|
||||
/// </summary>
|
||||
public abstract class AbstractBrush : AbstractDecoratable<IBrushDecorator>, IBrush
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -105,4 +105,5 @@ public abstract class AbstractBrush : AbstractDecoratable<IBrushDecorator>, IBru
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -4,13 +4,13 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a basic brush.
|
||||
/// </summary>
|
||||
public interface IBrush : IDecoratable<IBrushDecorator>
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a basic brush.
|
||||
/// </summary>
|
||||
public interface IBrush : IDecoratable<IBrushDecorator>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets if the <see cref="IBrush"/> is enabled and will be drawn on an update.
|
||||
/// </summary>
|
||||
@ -37,4 +37,5 @@ public interface IBrush : IDecoratable<IBrushDecorator>
|
||||
/// <param name="rectangle">The <see cref="Rectangle"/> in which the brush should be drawn.</param>
|
||||
/// <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);
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,14 @@
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a brush drawing only a single color.
|
||||
/// </summary>
|
||||
public class SolidColorBrush : AbstractBrush
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a brush drawing only a single color.
|
||||
/// </summary>
|
||||
public class SolidColorBrush : AbstractBrush
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private Color _color;
|
||||
@ -58,4 +58,5 @@ public class SolidColorBrush : AbstractBrush
|
||||
public static implicit operator Color(SolidColorBrush brush) => brush.Color;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a brush drawing a texture.
|
||||
/// </summary>
|
||||
public class TextureBrush : AbstractBrush
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a brush drawing a texture.
|
||||
/// </summary>
|
||||
public class TextureBrush : AbstractBrush
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private ITexture _texture = ITexture.Empty;
|
||||
@ -43,4 +43,5 @@ public class TextureBrush : AbstractBrush
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Contains a list of all brush calculation modes.
|
||||
/// </summary>
|
||||
public enum RenderMode
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains a list of all brush calculation modes.
|
||||
/// </summary>
|
||||
public enum RenderMode
|
||||
{
|
||||
/// <summary>
|
||||
/// The calculation <see cref="Rectangle"/> for <see cref="IBrush"/> will be the rectangle around the <see cref="ILedGroup"/> the <see cref="IBrush"/> is applied to.
|
||||
/// </summary>
|
||||
@ -16,4 +16,5 @@ public enum RenderMode
|
||||
/// The calculation <see cref="Rectangle"/> for <see cref="IBrush"/> will always be the whole <see cref="RGBSurface"/>.
|
||||
/// </summary>
|
||||
Absolute
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a single target of a brush render.
|
||||
/// </summary>
|
||||
public readonly struct RenderTarget
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a single target of a brush render.
|
||||
/// </summary>
|
||||
public readonly struct RenderTarget
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -41,4 +41,5 @@ public readonly struct RenderTarget
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
internal class EmptyTexture : ITexture
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
internal class EmptyTexture : ITexture
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
public Size Size { get; } = new(0, 0);
|
||||
@ -9,4 +9,5 @@ internal class EmptyTexture : ITexture
|
||||
public Color this[in Rectangle rectangle] => Color.Transparent;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic texture.
|
||||
/// </summary>
|
||||
public interface ITexture
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic texture.
|
||||
/// </summary>
|
||||
public interface ITexture
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a empty texture.
|
||||
/// </summary>
|
||||
@ -28,4 +28,5 @@ public interface ITexture
|
||||
/// <param name="rectangle">The rectangle to get the color from.</param>
|
||||
/// <returns>The sampled color.</returns>
|
||||
Color this[in Rectangle rectangle] { get; }
|
||||
}
|
||||
}
|
||||
@ -2,16 +2,16 @@
|
||||
using System.Buffers;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a texture made of pixels (like a common image).
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the pixels.</typeparam>
|
||||
public abstract class PixelTexture<T> : ITexture
|
||||
where T : unmanaged
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a texture made of pixels (like a common image).
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the pixels.</typeparam>
|
||||
public abstract class PixelTexture<T> : ITexture
|
||||
where T : unmanaged
|
||||
{
|
||||
#region Constants
|
||||
|
||||
private const int STACK_ALLOC_LIMIT = 1024;
|
||||
@ -172,14 +172,14 @@ public abstract class PixelTexture<T> : ITexture
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a texture made of color-pixels.
|
||||
/// </summary>
|
||||
public sealed class PixelTexture : PixelTexture<Color>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a texture made of color-pixels.
|
||||
/// </summary>
|
||||
public sealed class PixelTexture : PixelTexture<Color>
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private readonly Color[] _data;
|
||||
@ -225,4 +225,5 @@ public sealed class PixelTexture : PixelTexture<Color>
|
||||
protected override Color GetColor(in ReadOnlySpan<Color> pixel) => pixel[0];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a sampled that averages multiple color to a single color.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Averages all components (A, R, G, B) of the colors separately which isn't ideal in cases where multiple different colors are combined.
|
||||
/// </remarks>
|
||||
public class AverageColorSampler : ISampler<Color>
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a sampled that averages multiple color to a single color.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Averages all components (A, R, G, B) of the colors separately which isn't ideal in cases where multiple different colors are combined.
|
||||
/// </remarks>
|
||||
public class AverageColorSampler : ISampler<Color>
|
||||
{
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -31,4 +31,5 @@ public class AverageColorSampler : ISampler<Color>
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,17 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic sampler to combine multipel data entries to a single one.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the data to sample.</typeparam>
|
||||
public interface ISampler<T>
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic sampler to combine multipel data entries to a single one.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the data to sample.</typeparam>
|
||||
public interface ISampler<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Samples the specified data to a single pixel-buffer.
|
||||
/// </summary>
|
||||
/// <param name="info">The information containing the data to sample.</param>
|
||||
/// <param name="pixelData">The buffer used to write the resulting pixel to.</param>
|
||||
void Sample(in SamplerInfo<T> info, in Span<T> pixelData);
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the information used to sample data.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the data to sample.</typeparam>
|
||||
public readonly ref struct SamplerInfo<T>
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the information used to sample data.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the data to sample.</typeparam>
|
||||
public readonly ref struct SamplerInfo<T>
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -43,4 +43,5 @@ public readonly ref struct SamplerInfo<T>
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic update trigger.
|
||||
/// </summary>
|
||||
public abstract class AbstractUpdateTrigger : AbstractBindable, IUpdateTrigger
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic update trigger.
|
||||
/// </summary>
|
||||
public abstract class AbstractUpdateTrigger : AbstractBindable, IUpdateTrigger
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -44,4 +44,5 @@ public abstract class AbstractUpdateTrigger : AbstractBindable, IUpdateTrigger
|
||||
public abstract void Dispose();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,36 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an index used to identify data in the <see cref="CustomUpdateData"/>.
|
||||
/// </summary>
|
||||
public static class CustomUpdateDataIndex
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <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
|
||||
/// Represents a set of custom data, each indexed by a string-key.
|
||||
/// </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>
|
||||
public class CustomUpdateData
|
||||
{
|
||||
public class CustomUpdateData
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private Dictionary<string, object?> _data = new();
|
||||
@ -71,4 +47,5 @@ public class CustomUpdateData
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,13 +4,13 @@ using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an update-trigger used to update devices with a maximum update-rate.
|
||||
/// </summary>
|
||||
public class DeviceUpdateTrigger : AbstractUpdateTrigger, IDeviceUpdateTrigger
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an update-trigger used to update devices with a maximum update-rate.
|
||||
/// </summary>
|
||||
public class DeviceUpdateTrigger : AbstractUpdateTrigger, IDeviceUpdateTrigger
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <summary>
|
||||
@ -177,4 +177,5 @@ public class DeviceUpdateTrigger : AbstractUpdateTrigger, IDeviceUpdateTrigger
|
||||
public override void Dispose() => Stop();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,13 @@
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an update trigger used to trigger device-updates.
|
||||
/// </summary>
|
||||
public interface IDeviceUpdateTrigger : IUpdateTrigger
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an update trigger used to trigger device-updates.
|
||||
/// </summary>
|
||||
public interface IDeviceUpdateTrigger : IUpdateTrigger
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates that there's data available to process.
|
||||
/// </summary>
|
||||
void TriggerHasData();
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic update queue.
|
||||
/// </summary>
|
||||
/// <typeparam name="TIdentifier">The identifier used to identify the data processed by this queue.</typeparam>
|
||||
/// <typeparam name="TData">The type of the data processed by this queue.</typeparam>
|
||||
public interface IUpdateQueue<TIdentifier, TData> : IDisposable
|
||||
where TIdentifier : notnull
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic update queue.
|
||||
/// </summary>
|
||||
/// <typeparam name="TIdentifier">The identifier used to identify the data processed by this queue.</typeparam>
|
||||
/// <typeparam name="TData">The type of the data processed by this queue.</typeparam>
|
||||
public interface IUpdateQueue<TIdentifier, TData> : IDisposable
|
||||
where TIdentifier : notnull
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets or merges the provided data set in the current dataset and notifies the trigger that there is new data available.
|
||||
/// </summary>
|
||||
@ -22,10 +22,11 @@ public interface IUpdateQueue<TIdentifier, TData> : IDisposable
|
||||
/// Resets the current data set.
|
||||
/// </summary>
|
||||
void Reset();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic update queue processing <see cref="Color"/>-data using <see cref="object"/>-identifiers.
|
||||
/// </summary>
|
||||
public interface IUpdateQueue : IUpdateQueue<object, Color>
|
||||
{ }
|
||||
/// <summary>
|
||||
/// Represents a generic update queue processing <see cref="Color"/>-data using <see cref="object"/>-identifiers.
|
||||
/// </summary>
|
||||
public interface IUpdateQueue : IUpdateQueue<object, Color>
|
||||
{ }
|
||||
}
|
||||
|
||||
@ -3,16 +3,16 @@ using System.Buffers;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic update queue.
|
||||
/// </summary>
|
||||
/// <typeparam name="TIdentifier">The type of the key used to identify some data.</typeparam>
|
||||
/// <typeparam name="TData">The type of the data.</typeparam>
|
||||
public abstract class UpdateQueue<TIdentifier, TData> : IUpdateQueue<TIdentifier, TData>
|
||||
where TIdentifier : notnull
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic update queue.
|
||||
/// </summary>
|
||||
/// <typeparam name="TIdentifier">The type of the key used to identify some data.</typeparam>
|
||||
/// <typeparam name="TData">The type of the data.</typeparam>
|
||||
public abstract class UpdateQueue<TIdentifier, TData> : IUpdateQueue<TIdentifier, TData>
|
||||
where TIdentifier : notnull
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private readonly object _dataLock = new();
|
||||
@ -120,13 +120,13 @@ public abstract class UpdateQueue<TIdentifier, TData> : IUpdateQueue<TIdentifier
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a generic <see cref="UpdateQueue{TIdentifier,TData}"/> using an object as the key and a color as the value.
|
||||
/// </summary>
|
||||
public abstract class UpdateQueue : UpdateQueue<object, Color>, IUpdateQueue
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic <see cref="UpdateQueue{TIdentifier,TData}"/> using an object as the key and a color as the value.
|
||||
/// </summary>
|
||||
public abstract class UpdateQueue : UpdateQueue<object, Color>, IUpdateQueue
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -135,4 +135,5 @@ public abstract class UpdateQueue : UpdateQueue<object, Color>, IUpdateQueue
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a trigger causing an update.
|
||||
/// </summary>
|
||||
public interface IUpdateTrigger : IDisposable
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a trigger causing an update.
|
||||
/// </summary>
|
||||
public interface IUpdateTrigger : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the time spent for the last update.
|
||||
/// </summary>
|
||||
@ -26,4 +26,5 @@ public interface IUpdateTrigger : IDisposable
|
||||
/// Starts the update trigger.
|
||||
/// </summary>
|
||||
void Start();
|
||||
}
|
||||
}
|
||||
@ -4,14 +4,14 @@ using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents an update trigger that is manully triggered by calling <see cref="TriggerUpdate"/>.
|
||||
/// </summary>
|
||||
public sealed class ManualUpdateTrigger : AbstractUpdateTrigger
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents an update trigger that is manully triggered by calling <see cref="TriggerUpdate"/>.
|
||||
/// </summary>
|
||||
public sealed class ManualUpdateTrigger : AbstractUpdateTrigger
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private readonly AutoResetEvent _mutex = new(false);
|
||||
@ -19,8 +19,6 @@ public sealed class ManualUpdateTrigger : AbstractUpdateTrigger
|
||||
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>
|
||||
@ -73,11 +71,7 @@ public sealed class ManualUpdateTrigger : AbstractUpdateTrigger
|
||||
/// <summary>
|
||||
/// Triggers an update.
|
||||
/// </summary>
|
||||
public void TriggerUpdate(CustomUpdateData? updateData = null)
|
||||
{
|
||||
_customUpdateData = updateData;
|
||||
_mutex.Set();
|
||||
}
|
||||
public void TriggerUpdate() => _mutex.Set();
|
||||
|
||||
private void UpdateLoop()
|
||||
{
|
||||
@ -88,7 +82,7 @@ public sealed class ManualUpdateTrigger : AbstractUpdateTrigger
|
||||
if (_mutex.WaitOne(100))
|
||||
{
|
||||
long preUpdateTicks = Stopwatch.GetTimestamp();
|
||||
OnUpdate(_customUpdateData);
|
||||
OnUpdate();
|
||||
LastUpdateTime = ((Stopwatch.GetTimestamp() - preUpdateTicks) / 10000.0);
|
||||
}
|
||||
}
|
||||
@ -98,4 +92,5 @@ public sealed class ManualUpdateTrigger : AbstractUpdateTrigger
|
||||
public override void Dispose() => Stop();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -5,20 +5,18 @@ using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RGB.NET.Core;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents an update trigger that triggers in a set interval.
|
||||
/// </summary>
|
||||
public class TimerUpdateTrigger : AbstractUpdateTrigger
|
||||
namespace RGB.NET.Core
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents an update trigger that triggers in a set interval.
|
||||
/// </summary>
|
||||
public class TimerUpdateTrigger : AbstractUpdateTrigger
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private readonly object _lock = new();
|
||||
|
||||
private readonly CustomUpdateData? _customUpdateData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the update loop of this trigger.
|
||||
/// </summary>
|
||||
@ -64,19 +62,6 @@ public class TimerUpdateTrigger : AbstractUpdateTrigger
|
||||
Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TimerUpdateTrigger"/> class.
|
||||
/// </summary>
|
||||
/// <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
|
||||
@ -133,7 +118,7 @@ public class TimerUpdateTrigger : AbstractUpdateTrigger
|
||||
{
|
||||
long preUpdateTicks = Stopwatch.GetTimestamp();
|
||||
|
||||
OnUpdate(_customUpdateData);
|
||||
OnUpdate();
|
||||
|
||||
if (UpdateFrequency > 0)
|
||||
{
|
||||
@ -154,4 +139,5 @@ public class TimerUpdateTrigger : AbstractUpdateTrigger
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -6,14 +6,14 @@ using System.Collections.Generic;
|
||||
using AuraServiceLib;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a device provider responsible for Cooler Master devices.
|
||||
/// </summary>
|
||||
public class AsusDeviceProvider : AbstractRGBDeviceProvider
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a device provider responsible for Cooler Master devices.
|
||||
/// </summary>
|
||||
public class AsusDeviceProvider : AbstractRGBDeviceProvider
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private static AsusDeviceProvider? _instance;
|
||||
@ -91,4 +91,5 @@ public class AsusDeviceProvider : AbstractRGBDeviceProvider
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus;
|
||||
|
||||
/// <inheritdoc cref="AsusRGBDevice{TDeviceInfo}" />
|
||||
/// <summary>
|
||||
/// Represents a Asus dram.
|
||||
/// </summary>
|
||||
public class AsusDramRGBDevice : AsusRGBDevice<AsusRGBDeviceInfo>, IDRAM
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc cref="AsusRGBDevice{TDeviceInfo}" />
|
||||
/// <summary>
|
||||
/// Represents a Asus dram.
|
||||
/// </summary>
|
||||
public class AsusDramRGBDevice : AsusRGBDevice<AsusRGBDeviceInfo>, IDRAM
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -37,4 +37,5 @@ public class AsusDramRGBDevice : AsusRGBDevice<AsusRGBDeviceInfo>, IDRAM
|
||||
protected override object? GetLedCustomData(LedId ledId) => (int)ledId - (int)LedId.DRAM1;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace RGB.NET.Devices.Asus;
|
||||
|
||||
internal enum AsusDeviceType : uint
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
internal enum AsusDeviceType : uint
|
||||
{
|
||||
ALL = 0,
|
||||
MB_RGB = 0x10000,
|
||||
MB_ADDRESABLE = 0x11000,
|
||||
@ -21,4 +21,5 @@ internal enum AsusDeviceType : uint
|
||||
MOUSE_RGB = 0x90000,
|
||||
CHASSIS_RGB = 0xB0000,
|
||||
PROJECTOR_RGB = 0xC0000
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
#pragma warning disable 1591
|
||||
|
||||
namespace RGB.NET.Devices.Asus;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a LED ID as they are known by the ASUS SDK
|
||||
/// </summary>
|
||||
public enum AsusLedId : ushort
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a LED ID as they are known by the ASUS SDK
|
||||
/// </summary>
|
||||
public enum AsusLedId : ushort
|
||||
{
|
||||
KEY_ESCAPE = 0x01,
|
||||
KEY_1 = 0x02,
|
||||
KEY_2 = 0x03,
|
||||
@ -161,4 +161,5 @@ public enum AsusLedId : ushort
|
||||
UNDOCUMENTED_4 = 0x102,
|
||||
UNDOCUMENTED_5 = 0x103,
|
||||
UNDOCUMENTED_6 = 0xDA, // Bottom-left function on the ROG Zephyrus Duo 15
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
namespace RGB.NET.Devices.Asus;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a type of ASUS LED as known by the ASUS SDK
|
||||
/// </summary>
|
||||
public enum AsusLedType
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a type of ASUS LED as known by the ASUS SDK
|
||||
/// </summary>
|
||||
public enum AsusLedType
|
||||
{
|
||||
/// <summary>
|
||||
/// An ASUS LED that is present on a device's IAuraSyncKeyboard.Keys enumerable
|
||||
/// </summary>
|
||||
@ -14,4 +14,5 @@ public enum AsusLedType
|
||||
/// An ASUS LED that is present on a device's IAuraSyncDevice.Lights enumerable
|
||||
/// </summary>
|
||||
Light
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,14 @@
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Asus;
|
||||
|
||||
/// <inheritdoc cref="AbstractRGBDevice{TDeviceInfo}" />
|
||||
/// <summary>
|
||||
/// Represents a generic Asus-device. (keyboard, mouse, headset, mousepad).
|
||||
/// </summary>
|
||||
public abstract class AsusRGBDevice<TDeviceInfo> : AbstractRGBDevice<TDeviceInfo>, IAsusRGBDevice
|
||||
where TDeviceInfo : AsusRGBDeviceInfo
|
||||
namespace RGB.NET.Devices.Asus
|
||||
{
|
||||
/// <inheritdoc cref="AbstractRGBDevice{TDeviceInfo}" />
|
||||
/// <summary>
|
||||
/// Represents a generic Asus-device. (keyboard, mouse, headset, mousepad).
|
||||
/// </summary>
|
||||
public abstract class AsusRGBDevice<TDeviceInfo> : AbstractRGBDevice<TDeviceInfo>, IAsusRGBDevice
|
||||
where TDeviceInfo : AsusRGBDeviceInfo
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
@ -21,4 +21,5 @@ public abstract class AsusRGBDevice<TDeviceInfo> : AbstractRGBDevice<TDeviceInfo
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user