mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Timeline segments - Move keyframes on segment changes
This commit is contained in:
1 parent
beff2a0788
commit
a729e8f361
8 files changed
+121
-48
No files matched your search
@@ -1,12 +1,13 @@
|
||||
using System;
|
||||
using Artemis.Core.Utilities;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.Core.Models.Profile.LayerProperties
|
||||
{
|
||||
/// <summary>
|
||||
/// For internal use only, use <see cref="LayerPropertyKeyframe{T}" /> instead.
|
||||
/// </summary>
|
||||
public abstract class BaseLayerPropertyKeyframe
|
||||
public abstract class BaseLayerPropertyKeyframe : PropertyChangedBase
|
||||
{
|
||||
internal BaseLayerPropertyKeyframe(BaseLayerProperty baseLayerProperty)
|
||||
{
|
||||
@@ -27,5 +28,10 @@ namespace Artemis.Core.Models.Profile.LayerProperties
|
||||
/// The easing function applied on the value of the keyframe
|
||||
/// </summary>
|
||||
public Easings.Functions EasingFunction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Removes the keyframe from the layer property
|
||||
/// </summary>
|
||||
public abstract void Remove();
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,8 @@ namespace Artemis.Core.Models.Profile.LayerProperties
|
||||
public class LayerPropertyKeyframe<T> : BaseLayerPropertyKeyframe
|
||||
{
|
||||
private TimeSpan _position;
|
||||
private T _value;
|
||||
private LayerProperty<T> _layerProperty;
|
||||
|
||||
public LayerPropertyKeyframe(T value, TimeSpan position, Easings.Functions easingFunction, LayerProperty<T> layerProperty) : base(layerProperty)
|
||||
{
|
||||
@@ -18,12 +20,20 @@ namespace Artemis.Core.Models.Profile.LayerProperties
|
||||
/// <summary>
|
||||
/// The layer property this keyframe is applied to
|
||||
/// </summary>
|
||||
public LayerProperty<T> LayerProperty { get; internal set; }
|
||||
public LayerProperty<T> LayerProperty
|
||||
{
|
||||
get => _layerProperty;
|
||||
internal set => SetAndNotify(ref _layerProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The value of this keyframe
|
||||
/// </summary>
|
||||
public T Value { get; set; }
|
||||
public T Value
|
||||
{
|
||||
get => _value;
|
||||
set => SetAndNotify(ref _value, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TimeSpan Position
|
||||
@@ -31,9 +41,15 @@ namespace Artemis.Core.Models.Profile.LayerProperties
|
||||
get => _position;
|
||||
set
|
||||
{
|
||||
_position = value;
|
||||
SetAndNotify(ref _position, value);
|
||||
LayerProperty.SortKeyframes();
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Remove()
|
||||
{
|
||||
LayerProperty.RemoveKeyframe(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user