This commit is contained in:
2024-03-30 22:44:15 +01:00
parent 4268cec832
commit ebca41dc8f
9 changed files with 497 additions and 761 deletions

View File

@@ -117,17 +117,17 @@ export class Beat extends EffectScoped {
return track;
}
swapTracksByIndices(trackIndex1: number, trackIndex2: number): void {
const track1 = this.getTrackByIndex(trackIndex1);
const track2 = this.getTrackByIndex(trackIndex2);
this.tracks.value[trackIndex1] = track2;
this.tracks.value[trackIndex2] = track1;
insertAt(trackIndex: number, newIndex: number): void {
const track = this.getTrackByIndex(trackIndex);
this.tracks.value.splice(trackIndex, 1);
this.tracks.value = this.tracks.value.slice(0, newIndex).concat([track]).concat(this.tracks.value.slice(newIndex));
triggerRef(this.tracks);
}
addTrack(options?: Omit<TrackInitOptions, 'manager'>): Track | null {
const optionsResolved = {
manager: this.manager,
bars: this.barCount.value,
barCount: this.barCount.value,
isLooping: this.globalIsLooping.value,
loopLength: this.globalLoopLength.value,
...options,