merge: remote editor after the review (server jobs, stale proxies, conflict prompt, read-only accounts)
Resolved: the export plan keeps the remote editor's version counter and the integration branch's ran flag; the capture runs the Save-both copies scene, then the Arabic scenes, and the remote editor scenes after the sync ones. Dropped the translations of Archive.Adopt.Copy and Tooltips.Editor.Frames.Hero, whose English changed; DECISIONS gains the three branches' decisions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
81 files changed
+3826
-262
No files matched your search
@@ -10,6 +10,7 @@ using Titano.Core.Model;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Core.Video;
|
||||
using Titano.Data.Processing;
|
||||
using Titano.Ui.Controls;
|
||||
using Titano.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
@@ -31,9 +32,12 @@ public sealed class PresetCard(ExportTab owner, ExportChoice choice) : Observabl
|
||||
/// <summary>Sequence presets apply full settings; export presets only choose the output.</summary>
|
||||
public bool IsSequencePreset => Choice.Sequence is not null;
|
||||
|
||||
public string ToolTip => Choice.Reason is { } reason
|
||||
/// <summary>What choosing the card does, or why it cannot be chosen now (a job runs, the project cannot change).</summary>
|
||||
public string ToolTip => owner.Editor.LockedToolTip ?? (Choice.Reason is { } reason
|
||||
? Loc.L(IsSequencePreset ? "Tooltips.Editor.Export.ApplyPreset" : "Tooltips.Editor.Export.Recommended", reason)
|
||||
: Loc.L("Tooltips.Editor.Export.Preset", Name);
|
||||
: Loc.L("Tooltips.Editor.Export.Preset", Name));
|
||||
|
||||
public string BatchToolTip => owner.Editor.LockedToolTip ?? Loc.L("Tooltips.Editor.Export.InBatch");
|
||||
|
||||
/// <summary>"MP4 · HEVC Main10 · 3840×2160 · 24 fps".</summary>
|
||||
public string? Format { get => _format; private set => Set(ref _format, value); }
|
||||
@@ -57,6 +61,7 @@ public sealed class PresetCard(ExportTab owner, ExportChoice choice) : Observabl
|
||||
|
||||
public ICommand SelectCommand => owner.SelectCommand;
|
||||
|
||||
/// <remarks>A server sequence renders on the server: this PC's encoders neither name nor rule out the encoding.</remarks>
|
||||
public void Update(ExportPlan? plan)
|
||||
{
|
||||
if (plan is null)
|
||||
@@ -65,12 +70,20 @@ public sealed class PresetCard(ExportTab owner, ExportChoice choice) : Observabl
|
||||
return;
|
||||
}
|
||||
var settings = plan.Setup.Encoder.Settings;
|
||||
var remote = owner.Editor.IsRemote;
|
||||
Format = EditorText.Format(plan.Export, settings.Width, settings.Height);
|
||||
Encoding = EditorText.Encoding(plan.Export, settings.BitRate, plan.Setup.Encoder.Capability?.Name);
|
||||
Estimate = plan.Setup.Encoder.IsReady ? EditorText.Estimate(plan.Estimate) : Loc.L("Editor.Export.Unavailable");
|
||||
Encoding = EditorText.Encoding(plan.Export, settings.BitRate, remote ? null : plan.Setup.Encoder.Capability?.Name);
|
||||
Estimate = remote || plan.Setup.Encoder.IsReady ? EditorText.Estimate(plan.Estimate) : Loc.L("Editor.Export.Unavailable");
|
||||
}
|
||||
|
||||
public void RefreshBatch() => OnPropertyChanged(nameof(IsInBatch));
|
||||
|
||||
/// <summary>A job of the sequence started or ended, or the project became read-only: the tooltips say why the card waits.</summary>
|
||||
public void RefreshLocked()
|
||||
{
|
||||
OnPropertyChanged(nameof(ToolTip));
|
||||
OnPropertyChanged(nameof(BatchToolTip));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A codec choice of the Output panel with the profile and depth it implies.</summary>
|
||||
@@ -106,6 +119,8 @@ public sealed class ExportTab : EditorTab
|
||||
private readonly AsyncRelayCommand _renderNow;
|
||||
private readonly AsyncRelayCommand _addToQueue;
|
||||
private readonly AsyncRelayCommand _batch;
|
||||
private readonly AsyncRelayCommand _restore;
|
||||
private SavedCopy? _selectedCopy;
|
||||
private IReadOnlyList<PresetCard> _cards = [];
|
||||
private IReadOnlyList<CodecChoice> _codecChoices = [];
|
||||
private IReadOnlyList<Choice> _encoders = [];
|
||||
@@ -117,16 +132,18 @@ public sealed class ExportTab : EditorTab
|
||||
public ExportTab(EditorViewModel editor)
|
||||
: base(editor, "Export", AdvisorSection.Export)
|
||||
{
|
||||
SelectCommand = new RelayCommand(p => Select(p as PresetCard), _ => !Editor.IsBusy);
|
||||
SelectCommand = new RelayCommand(p => Select(p as PresetCard), _ => !Editor.IsLocked);
|
||||
_renderNow = new AsyncRelayCommand(() => Editor.RenderAsync(JobPriority.User, batch: false), () => Editor.CanRender);
|
||||
_addToQueue = new AsyncRelayCommand(() => Editor.RenderAsync(JobPriority.Normal, batch: false), () => Editor.CanRender);
|
||||
_batch = new AsyncRelayCommand(() => Editor.RenderAsync(JobPriority.User, batch: true), () => Editor.CanRender && Batch.Count > 0);
|
||||
HistoryCommand = new RelayCommand(OpenHistory);
|
||||
RevealLastCommand = new RelayCommand(() => ShellActions.Reveal(Editor.Session.Content.Renders[0].OutputPath), () => Editor.Session.Content.Renders.Count > 0);
|
||||
RevealLastCommand = new RelayCommand(() => ShellActions.Reveal(Editor.Session.Content.Renders[0].OutputPath), () => CanReveal);
|
||||
_restore = new AsyncRelayCommand(RestoreAsync, () => !Editor.IsLocked && SelectedCopy is not null);
|
||||
ResetFrameRateCommand = new RelayCommand(() => EditOverrides(o => o with { FrameRate = null }));
|
||||
Width = new EditableField(string.Empty, ValidateSize, v => EditOverrides(o => o with { Width = ParseSize(v) }), () => Loc.L("Tooltips.Editor.Export.Width"));
|
||||
Height = new EditableField(string.Empty, ValidateSize, v => EditOverrides(o => o with { Height = ParseSize(v) }), () => Loc.L("Tooltips.Editor.Export.Height"));
|
||||
NameTemplate = new EditableField(string.Empty, ValidateTemplate, v => EditExport(e => e with { NameTemplate = v }), () => Loc.L("Tooltips.Editor.Export.Name"));
|
||||
_selectedCopy = SavedCopies.FirstOrDefault();
|
||||
LoadCards();
|
||||
Refresh();
|
||||
}
|
||||
@@ -149,10 +166,71 @@ public sealed class ExportTab : EditorTab
|
||||
|
||||
public string AddToQueueToolTip => Editor.RenderBlockedReason ?? Loc.L("Tooltips.Editor.Export.AddToQueue");
|
||||
|
||||
public string BatchToolTip => Editor.RenderBlockedReason ?? Loc.L(Batch.Count > 0 ? "Tooltips.Editor.Export.Batch" : "Tooltips.Editor.Export.BatchEmpty");
|
||||
public string BatchToolTip => Editor.RenderBlockedReason ?? (Batch.Count == 0 ? Loc.L("Tooltips.Editor.Export.BatchEmpty")
|
||||
: Editor.IsRemote ? Loc.L("Tooltips.Editor.Export.BatchServer", Editor.ServerName)
|
||||
: Loc.L("Tooltips.Editor.Export.Batch"));
|
||||
|
||||
public bool HasHistory => Editor.Session.Content.Renders.Count > 0;
|
||||
|
||||
/// <summary>The "history" link opens this PC's Jobs screen, which does not list a server's jobs.</summary>
|
||||
public bool CanOpenHistory => !Editor.IsRemote;
|
||||
|
||||
/// <summary>The newest render is a file on this PC (a server's renders stay on the server).</summary>
|
||||
public bool CanReveal => Editor.Session.Content.Renders is [{ OutputPath.Length: > 0 }, ..];
|
||||
|
||||
// ---- Export "Sync" (Export.html, next to Save to) ----
|
||||
|
||||
/// <summary>Send each render made on this PC to the server the sequence is linked to; remembered in the project.</summary>
|
||||
public bool SyncToServer
|
||||
{
|
||||
get => Export.SyncToServer;
|
||||
set
|
||||
{
|
||||
if (!_refreshing && value != Export.SyncToServer) EditExport(e => e with { SyncToServer = value });
|
||||
}
|
||||
}
|
||||
|
||||
public bool CanSync => Editor.SyncGate == ExportSyncGate.Available;
|
||||
|
||||
/// <summary>What Sync does, or why it cannot be used for this sequence now.</summary>
|
||||
public string SyncToolTip => Loc.L(Editor.SyncGate switch
|
||||
{
|
||||
ExportSyncGate.Remote => "Tooltips.Editor.Export.SyncRemote",
|
||||
ExportSyncGate.SignedOut => "Tooltips.Editor.Export.SyncSignedOut",
|
||||
ExportSyncGate.NotLinked => "Tooltips.Editor.Export.SyncNotLinked",
|
||||
ExportSyncGate.NoUpload => "Tooltips.Editor.Export.SyncNoUpload",
|
||||
_ => "Tooltips.Editor.Export.Sync",
|
||||
});
|
||||
|
||||
/// <summary>A server sequence renders into its exports folder on the server.</summary>
|
||||
public bool CanChooseFolder => !Editor.IsRemote;
|
||||
|
||||
// ---- "Save both" copies of this PC's settings ----
|
||||
|
||||
public IReadOnlyList<SavedCopy> SavedCopies => Editor.Session.Content.SavedCopies;
|
||||
|
||||
public bool HasSavedCopies => SavedCopies.Count > 0;
|
||||
|
||||
/// <summary>The copy Restore makes the project: the newest unless another is chosen in the menu.</summary>
|
||||
public SavedCopy? SelectedCopy
|
||||
{
|
||||
get => _selectedCopy;
|
||||
set
|
||||
{
|
||||
if (!Set(ref _selectedCopy, value)) return;
|
||||
OnPropertyChanged(nameof(RestoreText));
|
||||
OnPropertyChanged(nameof(RestoreToolTip));
|
||||
_restore.RaiseCanExecuteChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>"Restore settings · 03/10/2026 14:22".</summary>
|
||||
public string RestoreText => Loc.L("Editor.Export.Restore", SelectedCopy?.Label ?? string.Empty);
|
||||
|
||||
public string RestoreToolTip => Editor.LockedToolTip ?? Loc.L("Tooltips.Editor.Export.Restore", SelectedCopy?.Label ?? string.Empty);
|
||||
|
||||
public ICommand RestoreCommand => _restore;
|
||||
|
||||
public ICommand ResetFrameRateCommand { get; }
|
||||
|
||||
/// <summary>"Output · 4K archive".</summary>
|
||||
@@ -234,6 +312,11 @@ public sealed class ExportTab : EditorTab
|
||||
|
||||
public IReadOnlyList<Choice> Encoders { get => _encoders; private set => Set(ref _encoders, value); }
|
||||
|
||||
/// <summary>The encoder is this PC's choice only for its own renders; the server or its render node picks its own.</summary>
|
||||
public bool CanChooseEncoder => !Editor.IsRemote;
|
||||
|
||||
public string EncoderToolTip => Editor.IsRemote ? Loc.L("Tooltips.Editor.Export.EncoderServer", Editor.ServerName) : Loc.L("Tooltips.Editor.Export.Encoder");
|
||||
|
||||
public Choice? SelectedEncoder
|
||||
{
|
||||
get => Encoders.FirstOrDefault(e => Equals(e.Value, Export.Overrides.Encoder ?? string.Empty));
|
||||
@@ -243,10 +326,12 @@ public sealed class ExportTab : EditorTab
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>"hardware", "software" (the word, not a colour, carries the state).</summary>
|
||||
public string? EncoderKind => Editor.Plan?.Setup.Encoder.Capability is { } c ? Loc.L(c.Hardware ? "Editor.Export.Hardware" : "Editor.Export.Software") : null;
|
||||
/// <summary>"hardware", "software" for this PC's encoder (the word, not a colour, carries the state).</summary>
|
||||
public string? EncoderKind => !Editor.IsRemote && Editor.Plan?.Setup.Encoder.Capability is { } c
|
||||
? Loc.L(c.Hardware ? "Editor.Export.Hardware" : "Editor.Export.Software")
|
||||
: null;
|
||||
|
||||
public bool IsHardware => Editor.Plan?.Setup.Encoder.Capability?.Hardware == true;
|
||||
public bool IsHardware => !Editor.IsRemote && Editor.Plan?.Setup.Encoder.Capability?.Hardware == true;
|
||||
|
||||
public IReadOnlyList<Choice> Depths { get => _depths; private set => Set(ref _depths, value); }
|
||||
|
||||
@@ -270,9 +355,10 @@ public sealed class ExportTab : EditorTab
|
||||
|
||||
public IReadOnlyList<SaveChoice> SaveChoices { get => _saveChoices; private set => Set(ref _saveChoices, value); }
|
||||
|
||||
/// <summary>The project's folder; a server sequence always renders into its exports folder on the server.</summary>
|
||||
public SaveChoice? SelectedSave
|
||||
{
|
||||
get => SaveChoices.FirstOrDefault(c => !c.Browse && c.Folder == Export.Folder);
|
||||
get => SaveChoices.FirstOrDefault(c => !c.Browse && c.Folder == (CanChooseFolder ? Export.Folder : null));
|
||||
set
|
||||
{
|
||||
if (_refreshing || value is null) return;
|
||||
@@ -287,12 +373,15 @@ public sealed class ExportTab : EditorTab
|
||||
}
|
||||
}
|
||||
|
||||
public string SaveToolTip => Loc.L("Tooltips.Editor.Export.Folder", Export.Folder ?? Editor.Session.Content.ExportsFolder ?? string.Empty);
|
||||
public string SaveToolTip => Editor.IsRemote
|
||||
? Loc.L("Tooltips.Editor.Export.FolderServer")
|
||||
: Loc.L("Tooltips.Editor.Export.Folder", Export.Folder ?? Editor.Session.Content.ExportsFolder ?? string.Empty);
|
||||
|
||||
public string? EstimatedSize => Editor.Plan is { Setup.Encoder.IsReady: true } plan ? Formatting.Bytes(plan.Estimate.Bytes) : null;
|
||||
public string? EstimatedSize => Estimated is { } plan ? Formatting.Bytes(plan.Estimate.Bytes) : null;
|
||||
|
||||
public string? EstimatedTime => Editor.Plan is { Setup.Encoder.IsReady: true } plan
|
||||
? Loc.L("Editor.Export.About", Formatting.Duration(plan.Estimate.Time)) + (plan.Setup.Encoder.Capability is { } c ? " · " + c.Name : string.Empty)
|
||||
/// <summary>"about 5 min · NVENC"; without this PC's encoder for a server sequence.</summary>
|
||||
public string? EstimatedTime => Estimated is { } plan
|
||||
? Loc.L("Editor.Export.About", Formatting.Duration(plan.Estimate.Time)) + (!Editor.IsRemote && plan.Setup.Encoder.Capability is { } c ? " · " + c.Name : string.Empty)
|
||||
: null;
|
||||
|
||||
public string? ResultName => Editor.Plan?.FileName;
|
||||
@@ -314,6 +403,9 @@ public sealed class ExportTab : EditorTab
|
||||
|
||||
private ResolvedExport Resolved => Editor.Plan?.Export ?? ExportResolver.Resolve(Export);
|
||||
|
||||
/// <summary>The plan when its estimates mean something: this PC can encode it, or the server renders it.</summary>
|
||||
private ExportPlan? Estimated => Editor.Plan is { } plan && (Editor.IsRemote || plan.Setup.Encoder.IsReady) ? plan : null;
|
||||
|
||||
public bool IsInBatch(string presetId) => Export.Batch.Contains(presetId, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
public void SetInBatch(string presetId, bool value)
|
||||
@@ -329,8 +421,8 @@ public sealed class ExportTab : EditorTab
|
||||
try
|
||||
{
|
||||
UpdateLists();
|
||||
SaveChoices = Export.Folder is { } folder
|
||||
? [new SaveChoice(null), new SaveChoice(folder), new SaveChoice(null, Browse: true)]
|
||||
SaveChoices = !CanChooseFolder ? [new SaveChoice(null)]
|
||||
: Export.Folder is { } folder ? [new SaveChoice(null), new SaveChoice(folder), new SaveChoice(null, Browse: true)]
|
||||
: [new SaveChoice(null), new SaveChoice(null, Browse: true)];
|
||||
if (!NameTemplate.IsDirty) NameTemplate.Load(Export.NameTemplate);
|
||||
OnAllPropertiesChanged();
|
||||
@@ -339,11 +431,8 @@ public sealed class ExportTab : EditorTab
|
||||
{
|
||||
_refreshing = false;
|
||||
}
|
||||
foreach (var card in Cards)
|
||||
{
|
||||
card.IsSelected = card.Choice.Sequence is null && string.Equals(card.Choice.ExportPresetId, Resolved.PresetId, StringComparison.OrdinalIgnoreCase);
|
||||
card.RefreshBatch();
|
||||
}
|
||||
SelectCards();
|
||||
foreach (var card in Cards) card.RefreshBatch();
|
||||
_ = EstimateCardsAsync();
|
||||
}
|
||||
|
||||
@@ -356,20 +445,27 @@ public sealed class ExportTab : EditorTab
|
||||
if (!Width.IsDirty) Width.Load(settings?.Width.ToString(CultureInfo.InvariantCulture) ?? string.Empty);
|
||||
if (!Height.IsDirty) Height.Load(settings?.Height.ToString(CultureInfo.InvariantCulture) ?? string.Empty);
|
||||
UpdateLists();
|
||||
Notices = Editor.Plan is { } plan
|
||||
? [.. plan.Setup.Warnings.Select(w => Loc.L(w.Key, [.. w.Args])).Concat(plan.Export.Warnings.Select(k => Loc.L(k))).Distinct()]
|
||||
: [];
|
||||
Notices = Editor.Plan is { } plan ? PlanNotices(plan) : [];
|
||||
OnAllPropertiesChanged();
|
||||
}
|
||||
finally
|
||||
{
|
||||
_refreshing = false;
|
||||
}
|
||||
// The plan follows the preset a read-only session chose to render.
|
||||
SelectCards();
|
||||
}
|
||||
|
||||
public override void OnBusyChanged()
|
||||
{
|
||||
base.OnBusyChanged();
|
||||
foreach (var card in Cards) card.RefreshLocked();
|
||||
}
|
||||
|
||||
public override void OnContentChanged()
|
||||
{
|
||||
LoadCards();
|
||||
if (SelectedCopy is null || !SavedCopies.Contains(SelectedCopy)) SelectedCopy = SavedCopies.FirstOrDefault();
|
||||
base.OnContentChanged();
|
||||
}
|
||||
|
||||
@@ -378,8 +474,16 @@ public sealed class ExportTab : EditorTab
|
||||
_renderNow.RaiseCanExecuteChanged();
|
||||
_addToQueue.RaiseCanExecuteChanged();
|
||||
_batch.RaiseCanExecuteChanged();
|
||||
_restore.RaiseCanExecuteChanged();
|
||||
OnPropertyChanged(nameof(AddToQueueToolTip));
|
||||
OnPropertyChanged(nameof(BatchToolTip));
|
||||
OnPropertyChanged(nameof(RestoreToolTip));
|
||||
}
|
||||
|
||||
public override void OnSyncGateChanged()
|
||||
{
|
||||
OnPropertyChanged(nameof(CanSync));
|
||||
OnPropertyChanged(nameof(SyncToolTip));
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
@@ -406,6 +510,24 @@ public sealed class ExportTab : EditorTab
|
||||
|
||||
private void LoadCards() => Cards = [.. ExportPlanner.Choices(Editor.Session.Presets, Editor.Session.Advice).Select(c => new PresetCard(this, c))];
|
||||
|
||||
/// <summary>The card of the export preset the plan renders.</summary>
|
||||
private void SelectCards()
|
||||
{
|
||||
foreach (var card in Cards)
|
||||
card.IsSelected = card.Choice.Sequence is null && string.Equals(card.Choice.ExportPresetId, Resolved.PresetId, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// What the plan changed or cannot do, localised; for a server sequence without this PC's encoder notices (the server
|
||||
/// or its render node picks the encoder).
|
||||
/// </summary>
|
||||
private IReadOnlyList<string> PlanNotices(ExportPlan plan)
|
||||
{
|
||||
var encoder = Editor.IsRemote ? plan.Setup.Encoder.Notices.Select(n => n.Key).ToHashSet(StringComparer.Ordinal) : [];
|
||||
return [.. plan.Setup.Warnings.Where(w => !encoder.Contains(w.Key)).Select(w => Loc.L(w.Key, [.. w.Args]))
|
||||
.Concat(plan.Export.Warnings.Select(k => Loc.L(k))).Distinct()];
|
||||
}
|
||||
|
||||
/// <summary>Estimates every card off the UI thread for the project as it is now (latest request wins).</summary>
|
||||
private async Task EstimateCardsAsync()
|
||||
{
|
||||
@@ -437,6 +559,40 @@ public sealed class ExportTab : EditorTab
|
||||
for (var i = 0; i < cards.Count; i++) cards[i].Update(plans[i]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Makes the chosen copy the project as one undo step. The toast's Undo brings back the project as it was before, as
|
||||
/// a new step, while the restore is still the last change of this editor (a later edit would otherwise be undone).
|
||||
/// </summary>
|
||||
private async Task RestoreAsync()
|
||||
{
|
||||
if (SelectedCopy is not { } copy) return;
|
||||
ProjectRestore? restore;
|
||||
try
|
||||
{
|
||||
restore = await Editor.Session.RestoreAsync(copy);
|
||||
}
|
||||
catch (InvalidDataException ex)
|
||||
{
|
||||
Editor.Shell.ReportError(ex);
|
||||
return;
|
||||
}
|
||||
if (restore is null)
|
||||
{
|
||||
Editor.Shell.Notify(Loc.L("Editor.Copy.Same"), copy.Label);
|
||||
return;
|
||||
}
|
||||
var editor = Editor;
|
||||
editor.Shell.ShowToast(new Toast
|
||||
{
|
||||
Title = Loc.L("Editor.Copy.Restored"),
|
||||
Message = copy.Label,
|
||||
ActionText = Loc.L("Editor.Copy.Undo"),
|
||||
ActionToolTip = Loc.L("Tooltips.Editor.Copy.Undo"),
|
||||
// Only in the editor that made it: another sequence opened meanwhile has its own project.
|
||||
ActionCommand = new RelayCommand(() => restore.Undo(), () => ReferenceEquals(editor.Shell.Sequence.Editor, editor) && restore.CanUndo),
|
||||
});
|
||||
}
|
||||
|
||||
private void OpenHistory()
|
||||
{
|
||||
Editor.Shell.Jobs.Filter = Jobs.JobFilter.All;
|
||||
|
||||
Reference in new issue
Block a user