fix: wire the phase 5 parcels together
The seven parcels merged without textual conflicts; this connects what each left to the others: - Save frame renders through the Core still path (RenderTarget.StillFrame) instead of the interim one-frame project in a hidden folder, and is named by ExportNaming.StillPath; a missing encoder reports its own notice. - Render progress counts the output program's entries, so loops, boomerang and fades no longer overshoot; the Export panel shows RenderSetup.Program (the boomerang-over-star-trails fallback included). - A videos trash entry is titled by its sequence and carries the path it was deleted from, as the panel's restore message and the desktop row expect. - The desktop sets the videos library's protected folders (workspace) and its server connection; the server protects its data folder for copy jobs too. - Render menu and Export footer open Videos filtered on the sequence; the Videos section implements IVideosSection; the editor's group states are kept in AppSettings.EditorGroups and survive a restart. - Rail tooltips and the shortcut test follow the Videos shift (Ctrl+4 Videos, Archive/Jobs/Server Ctrl+5..7); the trash Restore button binds its row tooltip. Refs #21 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c4301eb6d3
commit
c4924c122e
49 files changed
+178
-193
No files matched your search
@@ -98,13 +98,14 @@ internal sealed class SequenceRender : IAsyncDisposable
|
||||
outcomes.Add(new TargetOutcome(target, null, Reason(ex)));
|
||||
continue;
|
||||
}
|
||||
if (setup.Encoder.IsReady && setup.Plan.Frames.Count > 0) ready.Add((index, target, setup));
|
||||
if (setup.Encoder.IsReady && setup.Program.Count > 0) ready.Add((index, target, setup));
|
||||
else outcomes.Add(new TargetOutcome(target, null, Reason(setup)));
|
||||
}
|
||||
if (ready.Count == 0) return outcomes;
|
||||
|
||||
var preparing = ready[0].Setup.NeedsPreparation ? ready[0].Setup.Plan.IncludedFrames.Count : 0;
|
||||
var total = preparing + ready.Sum(r => (long)r.Setup.Plan.Frames.Count);
|
||||
// Rendered pictures are counted in the output program's entries (loops, a boomerang and fades add to the plan's).
|
||||
var total = preparing + ready.Sum(r => (long)r.Setup.Program.Count);
|
||||
var stage = Loc.L("Export.Job.Preparing");
|
||||
var chain = new ProgressChain(progress);
|
||||
var corrections = await RenderPreparation.PrepareAsync(Input, _options, Stage(chain, 0, preparing, total, stage), cancellationToken).ConfigureAwait(false);
|
||||
@@ -119,7 +120,7 @@ internal sealed class SequenceRender : IAsyncDisposable
|
||||
try
|
||||
{
|
||||
var result = await Pipeline(target.Export).RenderAsync(Input, corrections, new RenderTarget(target.Export, output), _options,
|
||||
Stage(chain, done, setup.Plan.Frames.Count, total, target.PresetName), cancellationToken).ConfigureAwait(false);
|
||||
Stage(chain, done, setup.Program.Count, total, target.PresetName), cancellationToken).ConfigureAwait(false);
|
||||
await chain.FlushAsync().ConfigureAwait(false);
|
||||
await finished(index, target, result).ConfigureAwait(false);
|
||||
outcomes.Add(new TargetOutcome(target, result, null));
|
||||
@@ -129,7 +130,7 @@ internal sealed class SequenceRender : IAsyncDisposable
|
||||
Core.Diagnostics.Log.Warning("processing", $"Render of {target.PresetName} to {output} failed", ex);
|
||||
outcomes.Add(new TargetOutcome(target, null, Reason(ex)));
|
||||
}
|
||||
done += setup.Plan.Frames.Count;
|
||||
done += setup.Program.Count;
|
||||
}
|
||||
return outcomes;
|
||||
}
|
||||
@@ -137,11 +138,10 @@ internal sealed class SequenceRender : IAsyncDisposable
|
||||
/// <summary>
|
||||
/// Saves frame <paramref name="frameIndex"/> as one image ("Save frame", owner review 1, R8): the sequence prepared whole
|
||||
/// as for a video (so its exposure, colour and stabilisation corrections are the ones the video gives that frame), then
|
||||
/// that frame alone rendered at the export's output size with every correction and the look, without interpolation,
|
||||
/// motion blur or playback, through the image encoder of <paramref name="target"/>'s codec (PNG, JPEG or TIFF 16-bit). It
|
||||
/// is written into a hidden working folder beside the output (<c>.<name>.<random>.tmp</c>, which
|
||||
/// leftover clean-ups find) and moved to <paramref name="name"/>'s path once complete. The result's path is the image's,
|
||||
/// its duration 0 and its frame count 1.
|
||||
/// that frame rendered by the pipeline's still path (<see cref="RenderTarget.StillFrame"/>) at the export's output size
|
||||
/// with every correction and the look, without stacking, interpolation, motion blur or playback, through the image
|
||||
/// encoder of <paramref name="target"/>'s codec (PNG, JPEG or TIFF 16-bit). The encoder writes a temporary name and
|
||||
/// renames it once complete, so a cancelled or failed still leaves nothing behind.
|
||||
/// </summary>
|
||||
/// <param name="name">The output path of the still from its setup.</param>
|
||||
/// <param name="starting">Runs with that path before anything is written (checkpoints).</param>
|
||||
@@ -151,63 +151,35 @@ internal sealed class SequenceRender : IAsyncDisposable
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(target);
|
||||
ArgumentNullException.ThrowIfNull(name);
|
||||
if ((uint)frameIndex >= (uint)Input.Frames.Count) throw new RenderException("Export.Render.NoFrames", $"Frame {frameIndex} is not in the sequence.");
|
||||
// That frame alone, one output period long, whatever the timing would have made of it.
|
||||
var project = Input.Project with
|
||||
{
|
||||
ExcludedFrames = [.. Enumerable.Range(0, Input.Frames.Count).Where(i => i != frameIndex)],
|
||||
Timing = Input.Project.Timing with { Mode = Input.Project.Timing.Mode.WithManual(TimingMode.Constant), FitToSeconds = null },
|
||||
Motion = Input.Project.Motion with { MotionBlur = Input.Project.Motion.MotionBlur.WithManual(false) },
|
||||
};
|
||||
var still = Input with { Project = project };
|
||||
var pipeline = Pipeline(target.Export);
|
||||
var setup = pipeline.Setup(still, new RenderTarget(target.Export, ExportNaming.FallbackName), _options);
|
||||
if (!setup.Encoder.IsReady || setup.Plan.Frames.Count == 0) throw new RenderException("Export.Render.NoFrames", Reason(setup));
|
||||
var setup = pipeline.Setup(Input, new RenderTarget(target.Export, ExportNaming.FallbackName, frameIndex), _options);
|
||||
if (!setup.Encoder.IsReady)
|
||||
{
|
||||
var notice = setup.Encoder.Notices.LastOrDefault() ?? new EncoderNotice(EncoderNotices.NoEncoder, setup.Encoder.Settings.Codec.ToString());
|
||||
throw new RenderException(notice.Key, $"No encoder can save {target.Export.Codec} here ({setup.Encoder.Status})", notice.Args);
|
||||
}
|
||||
var output = name(setup);
|
||||
await starting(output).ConfigureAwait(false);
|
||||
var chain = new ProgressChain(progress);
|
||||
var whole = pipeline.Setup(Input, new RenderTarget(target.Export, ExportNaming.FallbackName), _options);
|
||||
var preparing = whole.NeedsPreparation ? whole.Plan.IncludedFrames.Count : 0;
|
||||
var preparing = setup.NeedsPreparation ? setup.Plan.IncludedFrames.Count : 0;
|
||||
var total = preparing + 1L;
|
||||
// The corrections of the whole sequence, indexed by source frame: the frame gets what the video gives it.
|
||||
var corrections = await RenderPreparation.PrepareAsync(Input, _options, Stage(chain, 0, preparing, total, Loc.L("Export.Job.Preparing")), cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
var work = Path.Combine(Path.GetDirectoryName(output)!, "." + Path.GetFileName(output) + "." + Guid.NewGuid().ToString("N")[..8] + ".tmp");
|
||||
Directory.CreateDirectory(work);
|
||||
try
|
||||
{
|
||||
var result = await pipeline.RenderAsync(still, corrections, new RenderTarget(target.Export, Path.Combine(work, "still")), _options,
|
||||
Stage(chain, preparing, 1, total, target.PresetName), cancellationToken).ConfigureAwait(false);
|
||||
await chain.FlushAsync().ConfigureAwait(false);
|
||||
var image = Directory.EnumerateFiles(result.OutputPath).Order(StringComparer.Ordinal).FirstOrDefault()
|
||||
?? throw new RenderException("Export.Render.NoFrames", "The still was not written.");
|
||||
File.Move(image, output, overwrite: false);
|
||||
return result with { OutputPath = output, Bytes = new FileInfo(output).Length, DurationSeconds = 0, FrameCount = 1 };
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.Delete(work, recursive: true);
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
|
||||
{
|
||||
Core.Diagnostics.Log.Warning("processing", $"The still's working folder {work} could not be removed", ex);
|
||||
}
|
||||
}
|
||||
await chain.FlushAsync().ConfigureAwait(false);
|
||||
var result = await pipeline.RenderAsync(Input, corrections, new RenderTarget(target.Export, output, frameIndex), _options,
|
||||
Stage(chain, preparing, 1, total, target.PresetName), cancellationToken).ConfigureAwait(false);
|
||||
await chain.FlushAsync().ConfigureAwait(false);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The path of a still of frame <paramref name="frameIndex"/> (0-based) in <paramref name="folder"/>: the export's name
|
||||
/// template expanded, then " - " and the 1-based frame number in four digits, with the codec's extension
|
||||
/// ("2026-09-28 Harbour sunset - PNG - 0124.png"); " (2)" and so on when taken.
|
||||
/// The path of a still of frame <paramref name="frameIndex"/> (0-based) in <paramref name="folder"/> (or the export's own
|
||||
/// folder): <see cref="ExportNaming.StillPath(ExportSettings, string, ExportNameContext, int, Func{string, bool}?)"/>,
|
||||
/// "2026-09-28 Harbour sunset - PNG - 0124.png"; " (2)" and so on when taken.
|
||||
/// </summary>
|
||||
public static string StillPath(ExportSettings export, string folder, ExportNameContext context, int frameIndex, Func<string, bool>? taken = null)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(export);
|
||||
var name = ExportNaming.Expand(export.NameTemplate, context).Name + " - " + (frameIndex + 1).ToString("0000", System.Globalization.CultureInfo.InvariantCulture);
|
||||
return ExportNaming.Unique(string.IsNullOrWhiteSpace(export.Folder) ? folder : export.Folder, name, Core.Video.VideoCodecInfo.FileExtension(context.Codec), taken);
|
||||
}
|
||||
public static string StillPath(ExportSettings export, string folder, ExportNameContext context, int frameIndex, Func<string, bool>? taken = null) =>
|
||||
ExportNaming.StillPath(export, folder, context, frameIndex, taken);
|
||||
|
||||
/// <summary>
|
||||
/// The frame a still job saves (<see cref="Protocol.RenderJobParameters.StillFrame"/>, <see cref="Protocol.RenderJobParameters.StillPhoto"/>):
|
||||
@@ -259,7 +231,7 @@ internal sealed class SequenceRender : IAsyncDisposable
|
||||
|
||||
private static string Reason(RenderSetup setup)
|
||||
{
|
||||
if (setup.Plan.Frames.Count == 0) return Loc.L("Export.Render.NoFrames");
|
||||
if (setup.Program.Count == 0) return Loc.L("Export.Render.NoFrames");
|
||||
var notice = setup.Encoder.Notices.LastOrDefault() ?? new EncoderNotice(EncoderNotices.NoEncoder, setup.Encoder.Settings.Codec.ToString());
|
||||
return Loc.L(notice.Key, [.. notice.Args]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user