MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / finishTuplet

Method finishTuplet

packages/alphatab/src/model/Beat.ts:897–921  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

895 }
896
897 public finishTuplet(): void {
898 const previousBeat: Beat | null = this.previousBeat;
899 let currentTupletGroup: TupletGroup | null = previousBeat ? previousBeat.tupletGroup : null;
900 if (this.hasTuplet || (this.graceType !== GraceType.None && currentTupletGroup)) {
901 if (!previousBeat || !currentTupletGroup || !currentTupletGroup.check(this)) {
902 currentTupletGroup = new TupletGroup(this.voice);
903 currentTupletGroup.check(this);
904 }
905 this.tupletGroup = currentTupletGroup;
906 }
907
908 const barDuration = this.voice.bar.masterBar.calculateDuration(false);
909 const validBeatAutomations: Automation[] = [];
910 for (const automation of this.automations) {
911 if (automation.ratioPosition === 0) {
912 automation.ratioPosition = this.playbackStart / barDuration;
913 }
914
915 // we store tempo automations only on masterbar level
916 if (automation.type !== AutomationType.Tempo) {
917 validBeatAutomations.push(automation);
918 }
919 }
920 this.automations = validBeatAutomations;
921 }
922
923 public finish(settings: Settings, sharedDataBag: Map<string, unknown> | null = null): void {
924 if (

Callers 1

finishMethod · 0.80

Calls 3

checkMethod · 0.80
calculateDurationMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected