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

Method finish

packages/alphatab/src/model/Note.ts:865–1097  ·  view source on GitHub ↗
(settings: Settings, sharedDataBag: Map<string, unknown> | null = null)

Source from the content-addressed store, hash-verified

863 }
864
865 public finish(settings: Settings, sharedDataBag: Map<string, unknown> | null = null): void {
866 const nextNoteOnLine: Lazy<Note | null> = new Lazy<Note | null>(() => Note.nextNoteOnSameLine(this));
867 const isSongBook: boolean = settings && settings.notation.notationMode === NotationMode.SongBook;
868
869 // connect ties
870 if (this.isTieDestination) {
871 this.chain(sharedDataBag);
872 // implicit let ring
873 if (isSongBook && this.tieOrigin && this.tieOrigin.isLetRing) {
874 this.isLetRing = true;
875 }
876 }
877 // connect letring
878 if (this.isLetRing) {
879 if (!nextNoteOnLine.value || !nextNoteOnLine.value.isLetRing) {
880 this.letRingDestination = this;
881 } else {
882 this.letRingDestination = nextNoteOnLine.value;
883 }
884 if (isSongBook && this.isTieDestination && !this.tieOrigin!.hasBend) {
885 this.isVisible = false;
886 }
887 }
888 // connect palmmute
889 if (this.isPalmMute) {
890 if (!nextNoteOnLine.value || !nextNoteOnLine.value.isPalmMute) {
891 this.palmMuteDestination = this;
892 } else {
893 this.palmMuteDestination = nextNoteOnLine.value;
894 }
895 }
896 // set hammeron/pulloffs
897 if (this.isHammerPullOrigin) {
898 const hammerPullDestination = Note.findHammerPullDestination(this);
899 if (!hammerPullDestination) {
900 this.isHammerPullOrigin = false;
901 } else {
902 this.hammerPullDestination = hammerPullDestination;
903 hammerPullDestination.hammerPullOrigin = this;
904 }
905 }
906 // set slides
907 switch (this.slideOutType) {
908 case SlideOutType.Shift:
909 case SlideOutType.Legato:
910 if (!this.slideTarget) {
911 this.slideTarget = nextNoteOnLine.value;
912 }
913
914 if (!this.slideTarget) {
915 this.slideOutType = SlideOutType.None;
916 } else {
917 this.slideTarget.slideOrigin = this;
918 }
919 break;
920 }
921 let effectSlurDestination: Note | null = null;
922 let effectSlurSegmentKind: SlurSegmentKind | null = null;

Callers

nothing calls this directly

Calls 6

chainMethod · 0.95
nextNoteOnSameLineMethod · 0.80
warningMethod · 0.65
pushMethod · 0.45
spliceMethod · 0.45

Tested by

no test coverage detected