CI / Build and test (push) Successful in 9m41s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 9s
Release / Build, test and publish (push) Successful in 14m49s
CI / PostgreSQL 16 integration (push) Successful in 8m51s
CI / PostgreSQL 17 integration (push) Successful in 9m48s
CI / Docker image (push) Successful in 54s
Release / Server image (push) Successful in 1m39s
Owner review 1 R3, R8, R9. A grouped Export step and Render menu; encoding, playback (reverse, boomerang, loops, fades, hold) and still frames; one videos library on the desktop and the server with a verified trash and copies to a videos folder. Closes #21 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
41 lines
2.4 KiB
C#
41 lines
2.4 KiB
C#
using Chronos.Core.Export;
|
|
using Chronos.Core.Project;
|
|
using Chronos.Core.Render;
|
|
using Chronos.Testing;
|
|
|
|
namespace Chronos.Core.Tests.Render;
|
|
|
|
public sealed class RenderRulesTests
|
|
{
|
|
[Test]
|
|
public void AMismatchedFixedPresetNeedsFormatTwo()
|
|
{
|
|
var project = new ProjectSettings { Camera = Camera("9:16") };
|
|
Assert.Equal(2, RenderRules.RequiredFormat(project, Export("4k-h264"), 6000, 4000));
|
|
// The same proportions as the preset, "source" or a free-size preset change nothing an older build would render.
|
|
Assert.Equal(1, RenderRules.RequiredFormat(project with { Camera = Camera("16:9") }, Export("4k-h264"), 6000, 4000));
|
|
Assert.Equal(1, RenderRules.RequiredFormat(new ProjectSettings(), Export("4k-h264"), 6000, 4000));
|
|
Assert.Equal(1, RenderRules.RequiredFormat(project, Export("png-sequence"), 6000, 4000));
|
|
// The settings' own format counts too.
|
|
var turned = new ProjectSettings { Camera = new CameraSettings { Rotate = 90 } };
|
|
Assert.Equal(2, RenderRules.RequiredFormat(turned, Export("png-sequence"), 6000, 4000));
|
|
var newer = ProjectSettings.FromJson("""{ "version": 4 }""", allowNewer: true);
|
|
Assert.Equal(4, RenderRules.RequiredFormat(newer, Export("4k-h264"), 6000, 4000));
|
|
}
|
|
|
|
[Test]
|
|
public void APlaybackOrAStillNeedsFormatThree()
|
|
{
|
|
var playback = new ProjectSettings { Export = new ExportSettings { Playback = new PlaybackSettings { FadeIn = 1 } } };
|
|
Assert.Equal(3, RenderRules.RequiredFormat(playback, Export("4k-h264"), 6000, 4000));
|
|
Assert.Equal(1, RenderRules.RequiredFormat(new ProjectSettings(), Export("4k-h264"), 6000, 4000, still: false));
|
|
Assert.Equal(RenderRules.StillFormat, RenderRules.RequiredFormat(new ProjectSettings(), Export("4k-h264"), 6000, 4000, still: true));
|
|
Assert.SequenceEqual([Chronos.Core.Video.VideoCodec.PngSequence, Chronos.Core.Video.VideoCodec.JpegSequence, Chronos.Core.Video.VideoCodec.Tiff16Sequence], RenderRules.StillCodecs);
|
|
}
|
|
|
|
private static CameraSettings Camera(string aspect) => new() { Aspect = new Auto<string>().WithManual(aspect) };
|
|
|
|
private static ResolvedExport Export(string preset, ExportOverrides? overrides = null) =>
|
|
ExportResolver.Resolve(new ExportSettings { Preset = new Auto<string>().WithManual(preset), Overrides = overrides ?? new ExportOverrides() });
|
|
}
|