mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Added PauseValue to FlashDecorator
This commit is contained in:
parent
50cfd296be
commit
302ff7743f
@ -51,6 +51,11 @@ namespace RGB.NET.Decorators.Brush
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public double SustainValue { get; set; } = 1;
|
public double SustainValue { get; set; } = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the level at which the oppacity (percentage) should stay in the pause-cycle. (default: 0);
|
||||||
|
/// </summary>
|
||||||
|
public double PauseValue { get; set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the interval (in seconds) in which the decorator should repeat (if repetition is enabled). (default: 1)
|
/// Gets or sets the interval (in seconds) in which the decorator should repeat (if repetition is enabled). (default: 1)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -84,7 +89,7 @@ namespace RGB.NET.Decorators.Brush
|
|||||||
|
|
||||||
if (_currentPhase == ADSRPhase.Attack)
|
if (_currentPhase == ADSRPhase.Attack)
|
||||||
if (_currentPhaseValue > 0)
|
if (_currentPhaseValue > 0)
|
||||||
_currentValue = Math.Min(1, (Attack - _currentPhaseValue) / Attack) * AttackValue;
|
_currentValue = PauseValue + (Math.Min(1, (Attack - _currentPhaseValue) / Attack) * (AttackValue - PauseValue));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_currentPhaseValue = Decay;
|
_currentPhaseValue = Decay;
|
||||||
@ -111,7 +116,7 @@ namespace RGB.NET.Decorators.Brush
|
|||||||
|
|
||||||
if (_currentPhase == ADSRPhase.Release)
|
if (_currentPhase == ADSRPhase.Release)
|
||||||
if (_currentPhaseValue > 0)
|
if (_currentPhaseValue > 0)
|
||||||
_currentValue = Math.Min(1, _currentPhaseValue / Release) * SustainValue;
|
_currentValue = PauseValue + (Math.Min(1, _currentPhaseValue / Release) * (SustainValue - PauseValue));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_currentPhaseValue = Interval;
|
_currentPhaseValue = Interval;
|
||||||
@ -120,7 +125,7 @@ namespace RGB.NET.Decorators.Brush
|
|||||||
|
|
||||||
if (_currentPhase == ADSRPhase.Pause)
|
if (_currentPhase == ADSRPhase.Pause)
|
||||||
if (_currentPhaseValue > 0)
|
if (_currentPhaseValue > 0)
|
||||||
_currentValue = 0;
|
_currentValue = PauseValue;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((++_repetitionCount >= Repetitions) && (Repetitions > 0))
|
if ((++_repetitionCount >= Repetitions) && (Repetitions > 0))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user