feat(app): editor view models for every section, preset cards and render actions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
15 files changed
+2666
-6
No files matched your search
@@ -0,0 +1,72 @@
|
||||
using System.Windows.Input;
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// One section of the editor (BRIEF §12.3): a tab with its measuring tool below the filmstrip and its settings column on
|
||||
/// the right, with "Optimise section" and "Reset". <see cref="Refresh"/> runs after every project change.
|
||||
/// </summary>
|
||||
public abstract class EditorTab : LocalizedViewModel
|
||||
{
|
||||
protected EditorTab(EditorViewModel editor, string key, AdvisorSection section)
|
||||
{
|
||||
Editor = editor;
|
||||
Key = key;
|
||||
Section = section;
|
||||
OptimiseCommand = new RelayCommand(() => Editor.Optimise(Section), () => CanOptimise && !Editor.IsBusy);
|
||||
ResetCommand = new RelayCommand(() => Editor.Session.ResetSection(Section), () => CanReset && !Editor.IsBusy);
|
||||
}
|
||||
|
||||
public EditorViewModel Editor { get; }
|
||||
|
||||
/// <summary>"Frames", "Exposure"… (resource key suffix).</summary>
|
||||
public string Key { get; }
|
||||
|
||||
public AdvisorSection Section { get; }
|
||||
|
||||
public string Header => Loc.L("Editor.Tab." + Key);
|
||||
|
||||
public string ToolTip => Loc.L("Tooltips.Editor.Tab." + Key);
|
||||
|
||||
/// <summary>Settings rows of the right column (empty for tabs with their own panel).</summary>
|
||||
public IReadOnlyList<SettingRow> Rows { get; protected init; } = [];
|
||||
|
||||
/// <summary>The advisor has heavier decisions for this section (stacking has none).</summary>
|
||||
public virtual bool CanOptimise => true;
|
||||
|
||||
public virtual bool CanReset => true;
|
||||
|
||||
public string OptimiseToolTip => Loc.L(CanOptimise ? "Tooltips.Editor.OptimiseSection" : "Tooltips.Editor.OptimiseNone");
|
||||
|
||||
public ICommand OptimiseCommand { get; }
|
||||
|
||||
public ICommand ResetCommand { get; }
|
||||
|
||||
/// <summary>Re-reads the project (any change).</summary>
|
||||
public virtual void Refresh()
|
||||
{
|
||||
foreach (var row in Rows) row.Refresh();
|
||||
}
|
||||
|
||||
/// <summary>The sequence was read again: new analyses (charts, findings).</summary>
|
||||
public virtual void OnContentChanged() => Refresh();
|
||||
|
||||
/// <summary>The preview's corrections were prepared for the current settings (target curves).</summary>
|
||||
public virtual void OnCorrectionsChanged()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>The export plan of the project changed (durations, sizes).</summary>
|
||||
public virtual void OnPlanChanged()
|
||||
{
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
foreach (var row in Rows) row.Dispose();
|
||||
base.Dispose();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user