Let the places of a song share what it keeps to itself (#357)
With clips, one take serves many items: four items on the four clips of one take. The rule from #355 gave every further place its own copy of an embedded asset, so a cut made in the Sound tab reached one item only. Now the song, its tracks and its items share a sound, a pattern or a sound FX the song keeps. - settleEmbedded no longer copies within the song. An embedded asset stays as long as one place names it, and goes with the last one. - A paste from another song still gets a copy, but one copy for all the places naming the same asset, with its clip ids mapped. - The picks in a song offer what the song keeps, under a line after the project's assets: the Sound row of an item the song's sounds and their clips, the Pattern row its patterns, every sound FX pick its sound FX. - Make project asset and Embed a copy are unchanged. The project cbbf160bb7e8 was merged by hand afterwards: the items of Song 2 on three copies of Take 1 now play the same clips of the first one, and the copies are gone. Tests: - Unit embedded, sound-clips, own-fx and the song tests: 66 green, 3 counter-checks red as expected - e2e 65 on melektaus-atx: ALL PASSED, 52 checks - Gate on melektaus-atx: CHECK EXIT 0, 271 files, 4198 tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
95edf9959b
commit
e721bba120
6 files changed
+131
-56
No files matched your search
@@ -77,6 +77,18 @@ describe('a sound FX of its own in a song (#355)', () => {
|
||||
expect(embeddedIn(state.project, songId).map((a) => a.name)).toEqual(['Sound FX 2']);
|
||||
});
|
||||
|
||||
it('is offered to every place of its song, which share it (#357)', () => {
|
||||
const { state, songId, theme, track, onTrack, onItem } = setup();
|
||||
const id = createOwnFx(state, songId, onTrack)!;
|
||||
const entries = ownFxEntries(state, songId, '', onItem);
|
||||
expect(labels(entries)).toEqual(['• Sound FX 1', 'Create sound FX']);
|
||||
const own = entries.find((e) => 'label' in e && e.label === '• Sound FX 1');
|
||||
if (own && 'onSelect' in own) own.onSelect();
|
||||
expect([track().fx, theme().items[0]!.fx]).toEqual([id, id]);
|
||||
state.execute(onTrack(''));
|
||||
expect(findAsset(state.project, id)?.owner).toBe(songId);
|
||||
});
|
||||
|
||||
it('goes when its track picks another one, and comes back on undo', () => {
|
||||
const { state, songId, track, echoId, onTrack } = setup();
|
||||
const id = createOwnFx(state, songId, onTrack)!;
|
||||
|
||||
Reference in new issue
Block a user