Grid compilations: split-screen layouts from random tracks #18
Loading…
Reference in a new issue
No description provided.
Delete branch "f/grid-compilation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Randomizer gains a layout choice: single, split-screen (2 side by side) or a 2x2 grid. Grid mode generates independent random tracks and places each in its cell with a Size Position Rotate (affine) filter, composited via the same mix/qtblend transitions Shotcut plants - the whole mechanism was verified against melt with a rendered test grid. Audio from all cells mixes together for now.
🤖 Claude AI Code Review
Summary
Adds a grid/split-screen layout option to the Randomizer, generating N independent random tracks each placed via an affine SPR filter and composited with mix/qtblend transitions.
Code Quality ⭐⭐⭐⭐☆
Clean separation of concerns; the melt-verified compositing logic and fallback defaults are handled thoughtfully.
Issues
🟡 ShotcutService.cs —
HasTransitionmatches any transition with the givenmlt_serviceand any transition with matchingb_track, but these two conditions are checked across all transitions independently (via separate.Any()calls on the same collection). This means if amixtransition exists for a different track and aqtblendfor this track exists,HasTransition("mix")can return true even though no mix exists for this track. The twoAnypredicates must be combined into a singlet => ...predicate.Actually this is combined per-transition correctly — disregard. On re-read the predicate is fine.
🟡 ShotcutService.cs —
duration > longestDurationusesplaylist.Entry.Sum(e => e.Duration), whileSetRenderRangeToPlaylistDurationpresumably computes duration independently. If they diverge (e.g. blanks not counted inEntry.Sum), the render range may not match the longest cell. Worth confirming both use the same duration basis.🟢 Home.razor —
_gridLayoutuses raw ints (1/2/4) as a magic-value selector; harmless but the value4implicitly means "2×2" with no guard if a future option adds3.GenerateGridCompilationcorrectly throws on unsupported values, so runtime is safe.🟢 ShotcutService.cs — Filter
Id = $"gridCell{trackIndex}"and transition ids assumetrackIndexuniqueness across cells; since eachGenerateRandomPlaylistreturns a distinct index this holds, but there's no assertion. Minor.The transition-matching logic is correct on re-read, and the remaining points are minor. Before merging, verify that
playlist.Entry.Sum(e => e.Duration)andSetRenderRangeToPlaylistDurationcompute duration the same way (including blanks), since a mismatch would clip the longest cell — but this is not blocking.📊 Tokens: 5873 input + 929 output | 💰 Cost: ~$0.0526
Generated by Claude Opus 4.8 via Gitea Actions