diff --git a/src/Artemis.Core/Services/Interfaces/IRenderService.cs b/src/Artemis.Core/Services/Interfaces/IRenderService.cs
index 684cd193b..153f4c827 100644
--- a/src/Artemis.Core/Services/Interfaces/IRenderService.cs
+++ b/src/Artemis.Core/Services/Interfaces/IRenderService.cs
@@ -31,11 +31,6 @@ public interface IRenderService : IArtemisService
///
bool IsPaused { get; set; }
- ///
- /// Gets or sets a boolean indicating whether to flush the RGB.NET LEDs during next update
- ///
- bool FlushLeds { get; set; }
-
///
/// The time the last frame took to render
///
diff --git a/src/Artemis.Core/Services/RenderService.cs b/src/Artemis.Core/Services/RenderService.cs
index 66813052a..d9653279a 100644
--- a/src/Artemis.Core/Services/RenderService.cs
+++ b/src/Artemis.Core/Services/RenderService.cs
@@ -70,21 +70,10 @@ internal class RenderService : IRenderService, IRenderer, IDisposable
///
public TimeSpan FrameTime { get; private set; }
- ///
- public bool FlushLeds { get; set; }
-
///
public void Render(SKCanvas canvas, double delta)
{
_frameStopWatch.Restart();
-
- if (FlushLeds)
- {
- FlushLeds = false;
- Surface.Update(true);
- return;
- }
-
try
{
OnFrameRendering(new FrameRenderingEventArgs(canvas, delta, _surfaceManager.Surface));
diff --git a/src/Artemis.UI/Screens/Device/Tabs/DeviceGeneralTabViewModel.cs b/src/Artemis.UI/Screens/Device/Tabs/DeviceGeneralTabViewModel.cs
index 20808ad4f..892b270dc 100644
--- a/src/Artemis.UI/Screens/Device/Tabs/DeviceGeneralTabViewModel.cs
+++ b/src/Artemis.UI/Screens/Device/Tabs/DeviceGeneralTabViewModel.cs
@@ -218,8 +218,7 @@ public class DeviceGeneralTabViewModel : ActivatableViewModelBase
Device.RedScale = RedScale / 100f;
Device.GreenScale = GreenScale / 100f;
Device.BlueScale = BlueScale / 100f;
-
- _renderService.FlushLeds = true;
+ Device.RgbDevice.Update(true);
}
public void ResetScaling()
@@ -227,6 +226,7 @@ public class DeviceGeneralTabViewModel : ActivatableViewModelBase
RedScale = _initialRedScale * 100;
GreenScale = _initialGreenScale * 100;
BlueScale = _initialBlueScale * 100;
+ Device.RgbDevice.Update(true);
}
private void OnFrameRendering(object? sender, FrameRenderingEventArgs e)
diff --git a/src/Artemis.UI/Screens/Device/Tabs/DeviceLayoutTabViewModel.cs b/src/Artemis.UI/Screens/Device/Tabs/DeviceLayoutTabViewModel.cs
index 306e7399a..419243e9a 100644
--- a/src/Artemis.UI/Screens/Device/Tabs/DeviceLayoutTabViewModel.cs
+++ b/src/Artemis.UI/Screens/Device/Tabs/DeviceLayoutTabViewModel.cs
@@ -37,11 +37,7 @@ public class DeviceLayoutTabViewModel : ActivatableViewModelBase
this.WhenActivated(d =>
{
Device.PropertyChanged += DeviceOnPropertyChanged;
-
- Disposable.Create(() =>
- {
- Device.PropertyChanged -= DeviceOnPropertyChanged;
- }).DisposeWith(d);
+ Disposable.Create(() => Device.PropertyChanged -= DeviceOnPropertyChanged).DisposeWith(d);
});
}
@@ -51,7 +47,7 @@ public class DeviceLayoutTabViewModel : ActivatableViewModelBase
public string? ImagePath => Device.Layout?.Image?.LocalPath;
- public string CustomLayoutPath => Device.CustomLayoutPath;
+ public string? CustomLayoutPath => Device.CustomLayoutPath;
public bool HasCustomLayout => Device.CustomLayoutPath != null;
@@ -61,6 +57,8 @@ public class DeviceLayoutTabViewModel : ActivatableViewModelBase
_notificationService.CreateNotification()
.WithMessage("Cleared imported layout.")
.WithSeverity(NotificationSeverity.Informational);
+
+ _deviceService.SaveDevice(Device);
}
public async Task BrowseCustomLayout()
@@ -77,6 +75,8 @@ public class DeviceLayoutTabViewModel : ActivatableViewModelBase
.WithTitle("Imported layout")
.WithMessage($"File loaded from {files[0]}")
.WithSeverity(NotificationSeverity.Informational);
+
+ _deviceService.SaveDevice(Device);
}
}
@@ -153,6 +153,10 @@ public class DeviceLayoutTabViewModel : ActivatableViewModelBase
private void DeviceOnPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
if (e.PropertyName is nameof(Device.CustomLayoutPath) or nameof(Device.DisableDefaultLayout))
+ {
Task.Run(() => _deviceService.ApplyDeviceLayout(Device, Device.GetBestDeviceLayout()));
+ this.RaisePropertyChanged(nameof(CustomLayoutPath));
+ this.RaisePropertyChanged(nameof(HasCustomLayout));
+ }
}
}
\ No newline at end of file
diff --git a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineEasingView.axaml b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineEasingView.axaml
index e925b4edb..ef1a69c32 100644
--- a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineEasingView.axaml
+++ b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineEasingView.axaml
@@ -3,17 +3,21 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:keyframes="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Keyframes"
+ xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Keyframes.TimelineEasingView"
x:DataType="keyframes:TimelineEasingViewModel">
-
-
+
+
-
-
+ HorizontalAlignment="Left"/>
+
+
+
\ No newline at end of file
diff --git a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineEasingViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineEasingViewModel.cs
index cada48d40..3c196c0a1 100644
--- a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineEasingViewModel.cs
+++ b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineEasingViewModel.cs
@@ -1,8 +1,10 @@
using System.Collections.Generic;
+using System.Reactive;
using Artemis.Core;
using Artemis.UI.Shared;
using Avalonia;
using Humanizer;
+using ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Keyframes;
@@ -10,11 +12,12 @@ public class TimelineEasingViewModel : ViewModelBase
{
private readonly ILayerPropertyKeyframe _keyframe;
- public TimelineEasingViewModel(Easings.Functions easingFunction, ILayerPropertyKeyframe keyframe)
+ public TimelineEasingViewModel(Easings.Functions easingFunction, ILayerPropertyKeyframe keyframe, ReactiveCommand selectEasingFunction)
{
_keyframe = keyframe;
EasingFunction = easingFunction;
+ SelectEasingFunction = selectEasingFunction;
Description = easingFunction.Humanize();
EasingPoints = new List();
@@ -27,6 +30,7 @@ public class TimelineEasingViewModel : ViewModelBase
}
public Easings.Functions EasingFunction { get; }
+ public ReactiveCommand SelectEasingFunction { get; }
public List EasingPoints { get; }
public string Description { get; }
public bool IsEasingModeSelected => _keyframe.EasingFunction == EasingFunction;
diff --git a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineKeyframeView.axaml b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineKeyframeView.axaml
index f72a45823..7977a73d9 100644
--- a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineKeyframeView.axaml
+++ b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineKeyframeView.axaml
@@ -3,6 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
+ xmlns:keyframes="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Keyframes"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Keyframes.TimelineKeyframeView"
ClipToBounds="False">
@@ -34,16 +35,9 @@