diff --git a/Devices/Keyboard/Brushes/AbstractBrush.cs b/Brushes/AbstractBrush.cs similarity index 98% rename from Devices/Keyboard/Brushes/AbstractBrush.cs rename to Brushes/AbstractBrush.cs index 300fbc5..56d78ac 100644 --- a/Devices/Keyboard/Brushes/AbstractBrush.cs +++ b/Brushes/AbstractBrush.cs @@ -1,7 +1,7 @@ using System.Drawing; using CUE.NET.Helper; -namespace CUE.NET.Devices.Keyboard.Brushes +namespace CUE.NET.Brushes { /// /// Represents a basic brush. diff --git a/Devices/Keyboard/Brushes/IBrush.cs b/Brushes/IBrush.cs similarity index 95% rename from Devices/Keyboard/Brushes/IBrush.cs rename to Brushes/IBrush.cs index 4e3bf98..f441aca 100644 --- a/Devices/Keyboard/Brushes/IBrush.cs +++ b/Brushes/IBrush.cs @@ -1,6 +1,6 @@ using System.Drawing; -namespace CUE.NET.Devices.Keyboard.Brushes +namespace CUE.NET.Brushes { /// /// Represents a basic brush. diff --git a/Devices/Keyboard/Brushes/LinearGradientBrush.cs b/Brushes/LinearGradientBrush.cs similarity index 97% rename from Devices/Keyboard/Brushes/LinearGradientBrush.cs rename to Brushes/LinearGradientBrush.cs index a7bde7f..e3a851d 100644 --- a/Devices/Keyboard/Brushes/LinearGradientBrush.cs +++ b/Brushes/LinearGradientBrush.cs @@ -4,10 +4,10 @@ // ReSharper disable AutoPropertyCanBeMadeGetOnly.Global using System.Drawing; -using CUE.NET.Devices.Keyboard.Brushes.Gradient; +using CUE.NET.Gradients; using CUE.NET.Helper; -namespace CUE.NET.Devices.Keyboard.Brushes +namespace CUE.NET.Brushes { /// /// Represents a brush drawing a linear gradient. diff --git a/Devices/Keyboard/Brushes/RadialGradientBrush.cs b/Brushes/RadialGradientBrush.cs similarity index 97% rename from Devices/Keyboard/Brushes/RadialGradientBrush.cs rename to Brushes/RadialGradientBrush.cs index b5a0225..0f614d8 100644 --- a/Devices/Keyboard/Brushes/RadialGradientBrush.cs +++ b/Brushes/RadialGradientBrush.cs @@ -3,10 +3,10 @@ using System; using System.Drawing; -using CUE.NET.Devices.Keyboard.Brushes.Gradient; +using CUE.NET.Gradients; using CUE.NET.Helper; -namespace CUE.NET.Devices.Keyboard.Brushes +namespace CUE.NET.Brushes { /// /// Represents a brush drawing a radial gradient around a center point. diff --git a/Devices/Keyboard/Brushes/RandomColorBrush.cs b/Brushes/RandomColorBrush.cs similarity index 95% rename from Devices/Keyboard/Brushes/RandomColorBrush.cs rename to Brushes/RandomColorBrush.cs index 09f4fc4..6a4c184 100644 --- a/Devices/Keyboard/Brushes/RandomColorBrush.cs +++ b/Brushes/RandomColorBrush.cs @@ -2,7 +2,7 @@ using System.Drawing; using CUE.NET.Helper; -namespace CUE.NET.Devices.Keyboard.Brushes +namespace CUE.NET.Brushes { //TODO DarthAffe 30.09.2015: Like this the brush seems kinda useless. Think about making it cool. diff --git a/Devices/Keyboard/Brushes/SolidColorBrush.cs b/Brushes/SolidColorBrush.cs similarity index 96% rename from Devices/Keyboard/Brushes/SolidColorBrush.cs rename to Brushes/SolidColorBrush.cs index 2a2c7a4..1ad65bd 100644 --- a/Devices/Keyboard/Brushes/SolidColorBrush.cs +++ b/Brushes/SolidColorBrush.cs @@ -3,7 +3,7 @@ using System.Drawing; -namespace CUE.NET.Devices.Keyboard.Brushes +namespace CUE.NET.Brushes { /// /// Represents a brush drawing only a single color. diff --git a/CUE.NET.csproj b/CUE.NET.csproj index 06f833a..47c2c85 100644 --- a/CUE.NET.csproj +++ b/CUE.NET.csproj @@ -46,20 +46,20 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -85,7 +85,7 @@ - + diff --git a/Devices/Generic/AbstractCueDevice.cs b/Devices/Generic/AbstractCueDevice.cs index 6a9fbc3..f58b846 100644 --- a/Devices/Generic/AbstractCueDevice.cs +++ b/Devices/Generic/AbstractCueDevice.cs @@ -6,6 +6,7 @@ using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using CUE.NET.Devices.Generic.Enums; +using CUE.NET.Effects; using CUE.NET.Native; namespace CUE.NET.Devices.Generic @@ -51,6 +52,11 @@ namespace CUE.NET.Devices.Generic /// protected abstract bool HasEffect { get; } + /// + /// + /// + protected LinkedList Effects { get; } = new LinkedList(); + private CancellationTokenSource _updateTokenSource; private CancellationToken _updateToken; private Task _updateTask; @@ -146,11 +152,13 @@ namespace CUE.NET.Devices.Generic } /// - /// Perform an update for all dirty keys, or all keys if flushLeds is set to true. + /// Performs an update for all dirty keys, or all keys if flushLeds is set to true. /// /// Specifies whether all keys (including clean ones) should be updated. public virtual void Update(bool flushLeds = false) { + UpdateEffects(); + IList> ledsToUpdate = (flushLeds ? Leds : Leds.Where(x => x.Value.IsDirty)).ToList(); foreach (CorsairLed led in Leds.Values) @@ -159,6 +167,48 @@ namespace CUE.NET.Devices.Generic UpdateLeds(ledsToUpdate); } + private void UpdateEffects() + { + List effectsToRemove = new List(); + lock (Effects) + { + long currentTicks = DateTime.Now.Ticks; + foreach (EffectTimeContainer effect in Effects.OrderBy(x => x.ZIndex)) + { + try + { + float deltaTime; + if (effect.TicksAtLastUpdate < 0) + { + effect.TicksAtLastUpdate = currentTicks; + deltaTime = 0f; + } + else + deltaTime = (currentTicks - effect.TicksAtLastUpdate) / 10000000f; + + effect.TicksAtLastUpdate = currentTicks; + effect.Effect.Update(deltaTime); + + ApplyEffect(effect.Effect); + + if (effect.Effect.IsDone) + effectsToRemove.Add(effect.Effect); + } + // ReSharper disable once CatchAllClause + catch (Exception ex) { ManageException(ex); } + } + } + + foreach (IEffect effect in effectsToRemove) + DetachEffect(effect); + } + + /// + /// Applies the given effect to the device LEDs. + /// + /// The effect to apply. + protected abstract void ApplyEffect(IEffect effect); + private static void UpdateLeds(ICollection> ledsToUpdate) { ledsToUpdate = ledsToUpdate.Where(x => x.Value.Color != Color.Transparent).ToList(); @@ -186,6 +236,53 @@ namespace CUE.NET.Devices.Generic Marshal.FreeHGlobal(ptr); } + /// + /// Attaches the given effect. + /// + /// The effect to attach. + /// true if the effect could be attached; otherwise, false. + public bool AttachEffect(IEffect effect) + { + bool retVal = false; + lock (Effects) + { + if (effect != null && Effects.All(x => x.Effect != effect)) + { + effect.OnAttach(); + Effects.AddLast(new EffectTimeContainer(effect, -1)); + retVal = true; + } + } + + CheckUpdateLoop(); + return retVal; + } + + /// + /// Detaches the given effect. + /// + /// The effect to detached. + /// true if the effect could be detached; otherwise, false. + public bool DetachEffect(IEffect effect) + { + bool retVal = false; + lock (Effects) + { + if (effect != null) + { + EffectTimeContainer val = Effects.FirstOrDefault(x => x.Effect == effect); + if (val != null) + { + effect.OnDetach(); + Effects.Remove(val); + retVal = true; + } + } + } + CheckUpdateLoop(); + return retVal; + } + /// /// Handles the needed event-calls for an exception. /// diff --git a/Devices/Generic/Enums/UpdateMode.cs b/Devices/Generic/Enums/UpdateMode.cs index c61c57d..6dc10a1 100644 --- a/Devices/Generic/Enums/UpdateMode.cs +++ b/Devices/Generic/Enums/UpdateMode.cs @@ -1,4 +1,6 @@ -namespace CUE.NET.Devices.Generic.Enums +using CUE.NET.Effects; + +namespace CUE.NET.Devices.Generic.Enums { /// /// Contains list of available update modes. @@ -12,7 +14,7 @@ /// /// The device will perform automatic updates at the rate set in - /// as long as an is attached. + /// as long as an is attached. /// AutoOnEffect, diff --git a/Devices/Headset/CorsairHeadset.cs b/Devices/Headset/CorsairHeadset.cs index 9e4f826..5e3eac0 100644 --- a/Devices/Headset/CorsairHeadset.cs +++ b/Devices/Headset/CorsairHeadset.cs @@ -4,9 +4,11 @@ using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Drawing; using System.Linq; using CUE.NET.Devices.Generic; using CUE.NET.Devices.Headset.Enums; +using CUE.NET.Effects; namespace CUE.NET.Devices.Headset { @@ -69,6 +71,13 @@ namespace CUE.NET.Devices.Headset #region Methods + protected override void ApplyEffect(IEffect effect) + { + //TODO DarthAffe 18.10.2015: How should brushes be applied to headsets? + foreach (CorsairLed led in effect.LedList) + led.Color = effect.EffectBrush.GetColorAtPoint(new RectangleF(0, 0, 2, 2), new PointF(1, 1)); + } + private void InitializeLeds() { GetLed((int)CorsairHeadsetLedId.LeftLogo); diff --git a/Devices/Keyboard/CorsairKeyboard.cs b/Devices/Keyboard/CorsairKeyboard.cs index 642c239..7387038 100644 --- a/Devices/Keyboard/CorsairKeyboard.cs +++ b/Devices/Keyboard/CorsairKeyboard.cs @@ -9,11 +9,11 @@ using System.Collections.ObjectModel; using System.Drawing; using System.Linq; using System.Runtime.InteropServices; +using CUE.NET.Brushes; using CUE.NET.Devices.Generic; -using CUE.NET.Devices.Keyboard.Brushes; -using CUE.NET.Devices.Keyboard.Effects; using CUE.NET.Devices.Keyboard.Enums; using CUE.NET.Devices.Keyboard.Keys; +using CUE.NET.Effects; using CUE.NET.Helper; using CUE.NET.Native; @@ -76,7 +76,6 @@ namespace CUE.NET.Devices.Keyboard #endregion private readonly LinkedList _keyGroups = new LinkedList(); - private readonly LinkedList _effects = new LinkedList(); private Dictionary _keys = new Dictionary(); @@ -113,8 +112,8 @@ namespace CUE.NET.Devices.Keyboard { get { - lock (_effects) - return _effects.Any(); + lock (Effects) + return Effects.Any(); } } @@ -148,7 +147,6 @@ namespace CUE.NET.Devices.Keyboard public override void Update(bool flushLeds = false) { UpdateKeyGroups(); - UpdateEffects(); // Perform 'real' update base.Update(flushLeds); @@ -166,40 +164,13 @@ namespace CUE.NET.Devices.Keyboard } } - private void UpdateEffects() + protected override void ApplyEffect(IEffect effect) { - List effectsToRemove = new List(); - lock (_effects) - { - long currentTicks = DateTime.Now.Ticks; - foreach (EffectTimeContainer effect in _effects.OrderBy(x => x.ZIndex)) - { - try - { - float deltaTime; - if (effect.TicksAtLastUpdate < 0) - { - effect.TicksAtLastUpdate = currentTicks; - deltaTime = 0f; - } - else - deltaTime = (currentTicks - effect.TicksAtLastUpdate) / 10000000f; + if (effect == null) return; - effect.TicksAtLastUpdate = currentTicks; - effect.Effect.Update(deltaTime); - - ApplyBrush((effect.Effect.KeyList ?? this).ToList(), effect.Effect.EffectBrush); - - if (effect.Effect.IsDone) - effectsToRemove.Add(effect.Effect); - } - // ReSharper disable once CatchAllClause - catch (Exception ex) { ManageException(ex); } - } - } - - foreach (IEffect effect in effectsToRemove) - DetachEffect(effect); + //TODO DarthAffe 18.10.2015: This is really dirty and might have a really negative performance impact - find a better solution. + IEnumerable keys = effect.LedList?.Select(x => this.FirstOrDefault(y => y.Led == x)); + ApplyBrush((keys ?? this).ToList(), effect.EffectBrush); } // ReSharper disable once MemberCanBeMadeStatic.Local - idc @@ -215,6 +186,11 @@ namespace CUE.NET.Devices.Keyboard catch (Exception ex) { ManageException(ex); } } + public IEnumerable GetLeds() + { + return this.Select(x => x.Led); + } + #endregion /// @@ -252,53 +228,6 @@ namespace CUE.NET.Devices.Keyboard } } - /// - /// Attaches the given effect. - /// - /// The effect to attach. - /// true if the effect could be attached; otherwise, false. - public bool AttachEffect(IEffect effect) - { - bool retVal = false; - lock (_effects) - { - if (effect != null && _effects.All(x => x.Effect != effect)) - { - effect.OnAttach(); - _effects.AddLast(new EffectTimeContainer(effect, -1)); - retVal = true; - } - } - - CheckUpdateLoop(); - return retVal; - } - - /// - /// Detaches the given effect. - /// - /// The effect to detached. - /// true if the effect could be detached; otherwise, false. - public bool DetachEffect(IEffect effect) - { - bool retVal = false; - lock (_effects) - { - if (effect != null) - { - EffectTimeContainer val = _effects.FirstOrDefault(x => x.Effect == effect); - if (val != null) - { - effect.OnDetach(); - _effects.Remove(val); - retVal = true; - } - } - } - CheckUpdateLoop(); - return retVal; - } - private void InitializeKeys() { _CorsairLedPositions nativeLedPositions = (_CorsairLedPositions)Marshal.PtrToStructure(_CUESDK.CorsairGetLedPositions(), typeof(_CorsairLedPositions)); diff --git a/Devices/Keyboard/Keys/BaseKeyGroup.cs b/Devices/Keyboard/Keys/BaseKeyGroup.cs index b968e40..fa8874c 100644 --- a/Devices/Keyboard/Keys/BaseKeyGroup.cs +++ b/Devices/Keyboard/Keys/BaseKeyGroup.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; -using CUE.NET.Devices.Keyboard.Brushes; +using System.Linq; +using CUE.NET.Brushes; +using CUE.NET.Devices.Generic; using CUE.NET.Devices.Keyboard.Extensions; namespace CUE.NET.Devices.Keyboard.Keys @@ -49,6 +51,15 @@ namespace CUE.NET.Devices.Keyboard.Keys this.Attach(); } + #endregion + + #region Methods + + public IEnumerable GetLeds() + { + return GetGroupKeys().Select(x => x.Led); + } + /// /// Gets a list containing the keys from this group. /// diff --git a/Devices/Keyboard/Keys/IKeyGroup.cs b/Devices/Keyboard/Keys/IKeyGroup.cs index ff23029..96ab7cf 100644 --- a/Devices/Keyboard/Keys/IKeyGroup.cs +++ b/Devices/Keyboard/Keys/IKeyGroup.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; -using CUE.NET.Devices.Keyboard.Brushes; +using CUE.NET.Brushes; +using CUE.NET.Devices.Generic; namespace CUE.NET.Devices.Keyboard.Keys { @@ -19,5 +20,11 @@ namespace CUE.NET.Devices.Keyboard.Keys /// Gets or sets the z-index of this keygroup to allow ordering them before drawing. (lowest first) (default: 0) /// int ZIndex { get; set; } + + /// + /// Gets a list containing all LEDs of this group. + /// + /// The list containing all LEDs of this group. + IEnumerable GetLeds(); } } diff --git a/Devices/Mouse/CorsairMouse.cs b/Devices/Mouse/CorsairMouse.cs index 944b769..8ff3888 100644 --- a/Devices/Mouse/CorsairMouse.cs +++ b/Devices/Mouse/CorsairMouse.cs @@ -2,12 +2,15 @@ // ReSharper disable UnusedAutoPropertyAccessor.Global // ReSharper disable UnusedMember.Global +using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Drawing; using System.Linq; using CUE.NET.Devices.Generic; using CUE.NET.Devices.Mouse.Enums; +using CUE.NET.Effects; using CUE.NET.Exceptions; namespace CUE.NET.Devices.Mouse @@ -72,6 +75,13 @@ namespace CUE.NET.Devices.Mouse #region Methods + protected override void ApplyEffect(IEffect effect) + { + //TODO DarthAffe 18.10.2015: How should brushes be applied to mice? + foreach (CorsairLed led in effect.LedList) + led.Color = effect.EffectBrush.GetColorAtPoint(new RectangleF(0, 0, 2, 2), new PointF(1, 1)); + } + private void InitializeLeds() { switch (MouseDeviceInfo.PhysicalLayout) diff --git a/Devices/Keyboard/Effects/AbstractEffect.cs b/Effects/AbstractEffect.cs similarity index 71% rename from Devices/Keyboard/Effects/AbstractEffect.cs rename to Effects/AbstractEffect.cs index 51569e5..c3ea829 100644 --- a/Devices/Keyboard/Effects/AbstractEffect.cs +++ b/Effects/AbstractEffect.cs @@ -1,11 +1,10 @@ // ReSharper disable MemberCanBePrivate.Global using System.Collections.Generic; -using System.Linq; -using CUE.NET.Devices.Keyboard.Brushes; -using CUE.NET.Devices.Keyboard.Keys; +using CUE.NET.Brushes; +using CUE.NET.Devices.Generic; -namespace CUE.NET.Devices.Keyboard.Effects +namespace CUE.NET.Effects { /// /// Represents a basic effect. @@ -15,9 +14,9 @@ namespace CUE.NET.Devices.Keyboard.Effects #region Properties & Fields /// - /// Gets or sets the list of keys to which the effect applies. + /// Gets or sets the list of LEDSs to which the effect applies. /// - public IEnumerable KeyList { get; protected set; } + public IEnumerable LedList { get; set; } /// /// Gets the brush which is drawn by the effect. @@ -38,15 +37,6 @@ namespace CUE.NET.Devices.Keyboard.Effects #region Methods - /// - /// Sets the list of keys to which the effect applies. - /// - /// - public void SetTarget(IKeyGroup keyGroup) - { - KeyList = keyGroup.Keys.ToList(); - } - /// /// Updates the effect. /// @@ -54,13 +44,13 @@ namespace CUE.NET.Devices.Keyboard.Effects public abstract void Update(float deltaTime); /// - /// Hook which is called when the effect is attached to a keyboard. + /// Hook which is called when the effect is attached to a device. /// public virtual void OnAttach() { } /// - /// Hook which is called when the effect is detached from a keyboard. + /// Hook which is called when the effect is detached from a device. /// public virtual void OnDetach() { } diff --git a/Devices/Keyboard/Effects/EffectTimeContainer.cs b/Effects/EffectTimeContainer.cs similarity index 77% rename from Devices/Keyboard/Effects/EffectTimeContainer.cs rename to Effects/EffectTimeContainer.cs index 9a2a963..a1c5c8a 100644 --- a/Devices/Keyboard/Effects/EffectTimeContainer.cs +++ b/Effects/EffectTimeContainer.cs @@ -1,29 +1,29 @@ // ReSharper disable MemberCanBePrivate.Global // ReSharper disable AutoPropertyCanBeMadeGetOnly.Global -namespace CUE.NET.Devices.Keyboard.Effects +namespace CUE.NET.Effects { /// /// Represents a wrapped effect with additional time information. /// - internal class EffectTimeContainer + public class EffectTimeContainer { #region Properties & Fields /// /// Gets or sets the wrapped effect. /// - internal IEffect Effect { get; set; } + public IEffect Effect { get; set; } /// /// Gets or sets the tick-count from the last time the effect was updated. /// - internal long TicksAtLastUpdate { get; set; } + public long TicksAtLastUpdate { get; set; } /// /// Gets the z-index of the effect. /// - internal int ZIndex => Effect?.ZIndex ?? 0; + public int ZIndex => Effect?.ZIndex ?? 0; #endregion @@ -34,7 +34,7 @@ namespace CUE.NET.Devices.Keyboard.Effects /// /// The wrapped effect. /// The tick-count from the last time the effect was updated. - internal EffectTimeContainer(IEffect effect, long ticksAtLastUpdate) + public EffectTimeContainer(IEffect effect, long ticksAtLastUpdate) { this.Effect = effect; this.TicksAtLastUpdate = ticksAtLastUpdate; diff --git a/Devices/Keyboard/Effects/FlashEffect.cs b/Effects/FlashEffect.cs similarity index 98% rename from Devices/Keyboard/Effects/FlashEffect.cs rename to Effects/FlashEffect.cs index 93d6a7d..7228bd6 100644 --- a/Devices/Keyboard/Effects/FlashEffect.cs +++ b/Effects/FlashEffect.cs @@ -3,9 +3,9 @@ using System; using System.Drawing; -using CUE.NET.Devices.Keyboard.Brushes; +using CUE.NET.Brushes; -namespace CUE.NET.Devices.Keyboard.Effects +namespace CUE.NET.Effects { /// /// Represents an effect which allows to flash an brush by modifying his opacity. diff --git a/Devices/Keyboard/Effects/IEffect.cs b/Effects/IEffect.cs similarity index 83% rename from Devices/Keyboard/Effects/IEffect.cs rename to Effects/IEffect.cs index 8cf4a6a..6e9ce35 100644 --- a/Devices/Keyboard/Effects/IEffect.cs +++ b/Effects/IEffect.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -using CUE.NET.Devices.Keyboard.Brushes; -using CUE.NET.Devices.Keyboard.Keys; +using CUE.NET.Brushes; +using CUE.NET.Devices.Generic; -namespace CUE.NET.Devices.Keyboard.Effects +namespace CUE.NET.Effects { /// /// Represents a basic effect. @@ -12,9 +12,9 @@ namespace CUE.NET.Devices.Keyboard.Effects #region Properties & Fields /// - /// Gets or sets the list of keys to which the effect applies. + /// Gets or sets the list of LEDs to which the effect applies. /// - IEnumerable KeyList { get; } + IEnumerable LedList { get; set; } /// /// Gets the brush which is drawn by the effect. @@ -42,12 +42,12 @@ namespace CUE.NET.Devices.Keyboard.Effects void Update(float deltaTime); /// - /// Hook which is called when the effect is attached to a keyboard. + /// Hook which is called when the effect is attached to a device. /// void OnAttach(); /// - /// Hook which is called when the effect is detached from a keyboard. + /// Hook which is called when the effect is detached from a device. /// void OnDetach(); diff --git a/Devices/Keyboard/Brushes/Gradient/AbstractGradient.cs b/Gradients/AbstractGradient.cs similarity index 97% rename from Devices/Keyboard/Brushes/Gradient/AbstractGradient.cs rename to Gradients/AbstractGradient.cs index f6e429b..7a48ad2 100644 --- a/Devices/Keyboard/Brushes/Gradient/AbstractGradient.cs +++ b/Gradients/AbstractGradient.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; -namespace CUE.NET.Devices.Keyboard.Brushes.Gradient +namespace CUE.NET.Gradients { /// /// Represents a basic gradient. diff --git a/Devices/Keyboard/Brushes/Gradient/GradientStop.cs b/Gradients/GradientStop.cs similarity index 95% rename from Devices/Keyboard/Brushes/Gradient/GradientStop.cs rename to Gradients/GradientStop.cs index 06ade36..ae2c92a 100644 --- a/Devices/Keyboard/Brushes/Gradient/GradientStop.cs +++ b/Gradients/GradientStop.cs @@ -3,7 +3,7 @@ using System.Drawing; -namespace CUE.NET.Devices.Keyboard.Brushes.Gradient +namespace CUE.NET.Gradients { /// /// Represents a stop on a gradient. diff --git a/Devices/Keyboard/Brushes/Gradient/IGradient.cs b/Gradients/IGradient.cs similarity index 89% rename from Devices/Keyboard/Brushes/Gradient/IGradient.cs rename to Gradients/IGradient.cs index c30c8ec..275d9af 100644 --- a/Devices/Keyboard/Brushes/Gradient/IGradient.cs +++ b/Gradients/IGradient.cs @@ -1,6 +1,6 @@ using System.Drawing; -namespace CUE.NET.Devices.Keyboard.Brushes.Gradient +namespace CUE.NET.Gradients { /// /// Represents a basic gradient. diff --git a/Devices/Keyboard/Brushes/Gradient/LinearGradient.cs b/Gradients/LinearGradient.cs similarity index 97% rename from Devices/Keyboard/Brushes/Gradient/LinearGradient.cs rename to Gradients/LinearGradient.cs index 2057e01..f3ffd7a 100644 --- a/Devices/Keyboard/Brushes/Gradient/LinearGradient.cs +++ b/Gradients/LinearGradient.cs @@ -1,7 +1,7 @@ using System.Drawing; using System.Linq; -namespace CUE.NET.Devices.Keyboard.Brushes.Gradient +namespace CUE.NET.Gradients { /// /// Represents a linear interpolated gradient with n stops. diff --git a/Devices/Keyboard/Brushes/Gradient/RainbowGradient.cs b/Gradients/RainbowGradient.cs similarity index 97% rename from Devices/Keyboard/Brushes/Gradient/RainbowGradient.cs rename to Gradients/RainbowGradient.cs index dd86986..84ba9be 100644 --- a/Devices/Keyboard/Brushes/Gradient/RainbowGradient.cs +++ b/Gradients/RainbowGradient.cs @@ -3,7 +3,7 @@ using System.Drawing; using CUE.NET.Helper; -namespace CUE.NET.Devices.Keyboard.Brushes.Gradient +namespace CUE.NET.Gradients { /// /// Represents a rainbow gradient which circles through all color colors of the HUE-color-space.