Server sequences that are not in the local index open through a RemoteSequenceSource: proxies from the cache, project from the server's settings with their version (a 409 merges again), analysis report from the server, analyses and renders posted as server jobs (one per preset) and followed through the server's events. Set hero now reaches the index (SequenceEdit.HeroFrameId) so the Library card shows it. The Export tab gains the Sync option (remembered in the project) and restores "Save both" copies through undo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
98 lines
3.4 KiB
C#
98 lines
3.4 KiB
C#
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;
|
|
|
|
/// <summary>What Optimise section does, or why it cannot run now.</summary>
|
|
public string OptimiseToolTip => Loc.L(!CanOptimise ? "Tooltips.Editor.OptimiseNone" : Editor.IsBusy ? "Tooltips.Editor.Busy" : "Tooltips.Editor.OptimiseSection");
|
|
|
|
public string ResetToolTip => Loc.L(Editor.IsBusy ? "Tooltips.Editor.Busy" : "Tooltips.Editor.ResetSection");
|
|
|
|
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()
|
|
{
|
|
}
|
|
|
|
/// <summary>The frame on screen changed (playheads, the frame table, keyframe commands).</summary>
|
|
public virtual void OnCurrentFrameChanged()
|
|
{
|
|
}
|
|
|
|
/// <summary>A job of this sequence started or ended: commands and their tooltips follow.</summary>
|
|
public virtual void OnBusyChanged()
|
|
{
|
|
OnPropertyChanged(nameof(OptimiseToolTip));
|
|
OnPropertyChanged(nameof(ResetToolTip));
|
|
}
|
|
|
|
/// <summary>Raises the enabled state of the tab's asynchronous commands (the others follow the command manager).</summary>
|
|
public virtual void RefreshCommands()
|
|
{
|
|
}
|
|
|
|
/// <summary>Whether this sequence can send its renders to the server changed (<see cref="EditorViewModel.SyncGate"/>).</summary>
|
|
public virtual void OnSyncGateChanged()
|
|
{
|
|
}
|
|
|
|
public override void Dispose()
|
|
{
|
|
foreach (var row in Rows) row.Dispose();
|
|
base.Dispose();
|
|
}
|
|
}
|