update
This commit is contained in:
12
src/Beat.ts
12
src/Beat.ts
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user