Profile editor - Added F5 previewing

Core - Performance fixes
This commit is contained in:
Robert committed 2022-04-14 21:12:29 +02:00
1 parent 5b183d3010
commit 8c7bbc3f0f
11 files changed
+180 -82

No files matched your search

@@ -46,6 +46,11 @@ public interface IProfileEditorService : IArtemisSharedUIService
/// </summary>
IObservable<int> PixelsPerSecond { get; }
/// <summary>
/// Gets an observable of the suspended state.
/// </summary>
IObservable<bool> SuspendedEditing { get; }
/// <summary>
/// Gets a source list of all available editor tools.
/// </summary>
@@ -87,6 +92,12 @@ public interface IProfileEditorService : IArtemisSharedUIService
/// <param name="pixelsPerSecond">The new pixels per second.</param>
void ChangePixelsPerSecond(int pixelsPerSecond);
/// <summary>
/// Changes the current suspended state.
/// </summary>
/// <param name="suspend">The new suspended state.</param>
void ChangeSuspendedEditing(bool suspend);
/// <summary>
/// Selects the provided keyframe.
/// </summary>
@@ -62,8 +62,6 @@ internal class ProfileEditorService : IProfileEditorService
});
}
public IObservable<bool> SuspendedEditing { get; }
private ProfileEditorHistory? GetHistory(ProfileConfiguration? profileConfiguration)
{
if (profileConfiguration == null)
@@ -107,6 +105,7 @@ internal class ProfileEditorService : IProfileEditorService
public IObservable<RenderProfileElement?> ProfileElement { get; }
public IObservable<ILayerProperty?> LayerProperty { get; }
public IObservable<ProfileEditorHistory?> History { get; }
public IObservable<bool> SuspendedEditing { get; }
public IObservable<TimeSpan> Time { get; }
public IObservable<bool> Playing { get; }
public IObservable<int> PixelsPerSecond { get; }
@@ -180,6 +179,25 @@ internal class ProfileEditorService : IProfileEditorService
_timeSubject.OnNext(time);
}
public void ChangeSuspendedEditing(bool suspend)
{
if (_suspendedEditingSubject.Value == suspend)
return;
_suspendedEditingSubject.OnNext(suspend);
if (suspend)
{
Pause();
_profileService.RenderForEditor = false;
}
else
{
if (_profileConfigurationSubject.Value != null)
_profileService.RenderForEditor = true;
Tick(_timeSubject.Value);
}
}
public void SelectKeyframe(ILayerPropertyKeyframe? keyframe, bool expand, bool toggle)
{
if (keyframe == null)