@tspro/web-music-score 5.1.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +13 -12
- package/dist/audio/index.d.ts +1 -1
- package/dist/audio/index.js +2 -2
- package/dist/audio/index.mjs +4 -4
- package/dist/audio-cg/index.js +1 -1
- package/dist/audio-cg/index.mjs +3 -3
- package/dist/audio-synth/index.js +1 -1
- package/dist/audio-synth/index.mjs +3 -3
- package/dist/{chunk-2EQHSQWO.mjs → chunk-C6UQDKWU.mjs} +2 -2
- package/dist/{chunk-ROPTZBKD.mjs → chunk-PMDIUO22.mjs} +2 -2
- package/dist/{chunk-QVYFIK3L.mjs → chunk-ZBA5XLYR.mjs} +3 -3
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +3 -3
- package/dist/{guitar-CaZJDA05.d.ts → guitar-BsSayRsH.d.ts} +1 -1
- package/dist/iife/audio-cg.global.js +9 -2
- package/dist/iife/index.global.js +11 -11
- package/dist/{music-objects-DTDFSro0.d.mts → music-objects-BGiRQIXW.d.mts} +218 -149
- package/dist/{music-objects-CMdYZeC6.d.ts → music-objects-Ih9vCl4p.d.ts} +220 -151
- package/dist/{note-eA2xPPiG.d.ts → note-CgCIBwvR.d.ts} +1 -1
- package/dist/pieces/index.d.mts +11 -2
- package/dist/pieces/index.d.ts +13 -4
- package/dist/pieces/index.js +20 -9
- package/dist/pieces/index.mjs +20 -10
- package/dist/react-ui/index.d.mts +2 -2
- package/dist/react-ui/index.d.ts +6 -6
- package/dist/react-ui/index.js +9 -9
- package/dist/react-ui/index.mjs +11 -11
- package/dist/{scale-DGx3tJH4.d.ts → scale-CBW4eTz7.d.ts} +2 -2
- package/dist/score/index.d.mts +6 -4
- package/dist/score/index.d.ts +9 -7
- package/dist/score/index.js +1406 -1182
- package/dist/score/index.mjs +1388 -1165
- package/dist/{tempo-GrstpD9G.d.ts → tempo-DMt3iwz9.d.ts} +1 -1
- package/dist/theory/index.d.ts +6 -6
- package/dist/theory/index.js +1 -1
- package/dist/theory/index.mjs +3 -3
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as Note, A as Accidental } from './note-
|
|
2
|
-
import { R as RhythmProps, N as NoteLength, i as NoteLengthStr, k as TupletRatio, d as Tempo, K as KeySignature, b as TimeSignature } from './tempo-
|
|
1
|
+
import { N as Note, A as Accidental } from './note-CgCIBwvR.js';
|
|
2
|
+
import { R as RhythmProps, N as NoteLength, i as NoteLengthStr, k as TupletRatio, d as Tempo, K as KeySignature, b as TimeSignature } from './tempo-DMt3iwz9.js';
|
|
3
3
|
import { Vec2 } from '@tspro/ts-utils-lib';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -229,8 +229,12 @@ declare enum Clef {
|
|
|
229
229
|
type BaseConfig = {
|
|
230
230
|
/** Name for this staff/tab config. */
|
|
231
231
|
name?: string;
|
|
232
|
-
/** Voice
|
|
233
|
-
|
|
232
|
+
/** Voice id that is presented in this staff/tab. Single value or array.*/
|
|
233
|
+
voiceId?: VoiceId | VoiceId[];
|
|
234
|
+
/** @deprecated - Use `voiceId` instead. */
|
|
235
|
+
voiceIds?: VoiceId | VoiceId[];
|
|
236
|
+
/** Staves/tabs with same instrument name a re grouped together with left brace. */
|
|
237
|
+
instrument?: string;
|
|
234
238
|
};
|
|
235
239
|
/** Staff config to add staff notation line in score configuration. */
|
|
236
240
|
type StaffConfig = BaseConfig & {
|
|
@@ -333,6 +337,11 @@ declare enum VerticalPosition {
|
|
|
333
337
|
type StaffTabOrGroup = number | string;
|
|
334
338
|
/** Staff/tab/group snglevalue or array of values. */
|
|
335
339
|
type StaffTabOrGroups = StaffTabOrGroup | StaffTabOrGroup[];
|
|
340
|
+
/** Measure options. */
|
|
341
|
+
type MeasureOptions = {
|
|
342
|
+
/** show measure number? */
|
|
343
|
+
showNumber?: boolean;
|
|
344
|
+
};
|
|
336
345
|
/** Options for notes/chords. */
|
|
337
346
|
type NoteOptions = {
|
|
338
347
|
/** Stem direction. */
|
|
@@ -513,9 +522,9 @@ declare class ObjAccidental extends MusicObject {
|
|
|
513
522
|
constructor(parent: MusicObject, diatonicId: number, accidental: Accidental, color?: string);
|
|
514
523
|
getMusicInterface(): MAccidental;
|
|
515
524
|
pick(x: number, y: number): MusicObject[];
|
|
516
|
-
layout(
|
|
525
|
+
layout(ctx: RenderContext): void;
|
|
517
526
|
offset(dx: number, dy: number): void;
|
|
518
|
-
draw(
|
|
527
|
+
draw(ctx: RenderContext): void;
|
|
519
528
|
}
|
|
520
529
|
|
|
521
530
|
type BoxType = "square" | "rectangle" | "circle" | "ellipse";
|
|
@@ -551,9 +560,9 @@ declare class ObjText extends MusicObject {
|
|
|
551
560
|
updateAnchorX(anchorX: number): void;
|
|
552
561
|
updateAnchorY(anchorY: number): void;
|
|
553
562
|
pick(x: number, y: number): MusicObject[];
|
|
554
|
-
layout(
|
|
563
|
+
layout(ctx: RenderContext): void;
|
|
555
564
|
offset(dx: number, dy: number): void;
|
|
556
|
-
draw(
|
|
565
|
+
draw(ctx: RenderContext): void;
|
|
557
566
|
}
|
|
558
567
|
|
|
559
568
|
type NotationLineObject = {
|
|
@@ -562,29 +571,31 @@ type NotationLineObject = {
|
|
|
562
571
|
offsetInPlace?: (dx: number, dy: number) => void;
|
|
563
572
|
};
|
|
564
573
|
declare abstract class ObjNotationLine extends MusicObject {
|
|
574
|
+
readonly row: ObjScoreRow;
|
|
565
575
|
protected readonly objects: NotationLineObject[];
|
|
566
576
|
abstract readonly id: number;
|
|
567
577
|
abstract readonly name: string;
|
|
568
578
|
private layoutGroups;
|
|
569
|
-
constructor(
|
|
579
|
+
constructor(row: ObjScoreRow);
|
|
570
580
|
addObject(o: NotationLineObject): void;
|
|
571
581
|
removeObjects(): void;
|
|
572
582
|
getLayoutGroup(lauoutGroupId: LayoutGroupId): LayoutGroup;
|
|
573
|
-
resetLayoutGroups(
|
|
574
|
-
layoutLayoutGroups(
|
|
583
|
+
resetLayoutGroups(ctx: RenderContext): void;
|
|
584
|
+
layoutLayoutGroups(ctx: RenderContext): void;
|
|
575
585
|
private setObjectY;
|
|
576
586
|
private alignObjectsY;
|
|
577
|
-
layoutLayoutGroup(
|
|
587
|
+
layoutLayoutGroup(ctx: RenderContext, layoutGroup: LayoutGroup, verticalPos: VerticalPos): void;
|
|
588
|
+
abstract getConfig(): StaffConfig | TabConfig;
|
|
578
589
|
abstract calcTop(): number;
|
|
579
590
|
abstract calcBottom(): number;
|
|
580
591
|
abstract getTopLineY(): number;
|
|
581
592
|
abstract getBottomLineY(): number;
|
|
582
593
|
abstract containsVoiceId(voiceId: number): boolean;
|
|
583
594
|
abstract containsDiatonicId(diatonicId: number): boolean;
|
|
584
|
-
abstract layoutWidth(
|
|
585
|
-
abstract layoutHeight(
|
|
595
|
+
abstract layoutWidth(ctx: RenderContext): void;
|
|
596
|
+
abstract layoutHeight(ctx: RenderContext): void;
|
|
586
597
|
abstract offset(dx: number, dy: number): void;
|
|
587
|
-
abstract draw(
|
|
598
|
+
abstract draw(ctx: RenderContext): void;
|
|
588
599
|
}
|
|
589
600
|
declare class ObjStaff extends ObjNotationLine {
|
|
590
601
|
readonly row: ObjScoreRow;
|
|
@@ -605,6 +616,7 @@ declare class ObjStaff extends ObjNotationLine {
|
|
|
605
616
|
getMusicInterface(): MStaff;
|
|
606
617
|
get isOctaveDown(): boolean;
|
|
607
618
|
get name(): string;
|
|
619
|
+
getConfig(): StaffConfig | TabConfig;
|
|
608
620
|
getTopLineY(): number;
|
|
609
621
|
getMiddleLineY(): number;
|
|
610
622
|
getBottomLineY(): number;
|
|
@@ -617,14 +629,14 @@ declare class ObjStaff extends ObjNotationLine {
|
|
|
617
629
|
getDiatonicIdAt(y: number): number | undefined;
|
|
618
630
|
isLine(diatonicId: number): boolean;
|
|
619
631
|
isSpace(diatonicId: number): boolean;
|
|
620
|
-
containsVoiceId(voiceId:
|
|
632
|
+
containsVoiceId(voiceId: VoiceId): boolean;
|
|
621
633
|
calcTop(): number;
|
|
622
634
|
calcBottom(): number;
|
|
623
635
|
pick(x: number, y: number): MusicObject[];
|
|
624
|
-
layoutHeight(
|
|
625
|
-
layoutWidth(
|
|
636
|
+
layoutHeight(ctx: RenderContext): void;
|
|
637
|
+
layoutWidth(ctx: RenderContext): void;
|
|
626
638
|
offset(dx: number, dy: number): void;
|
|
627
|
-
draw(
|
|
639
|
+
draw(ctx: RenderContext): void;
|
|
628
640
|
}
|
|
629
641
|
declare class ObjTab extends ObjNotationLine {
|
|
630
642
|
readonly row: ObjScoreRow;
|
|
@@ -638,6 +650,7 @@ declare class ObjTab extends ObjNotationLine {
|
|
|
638
650
|
constructor(row: ObjScoreRow, tabConfig: TabConfig, id: number);
|
|
639
651
|
getMusicInterface(): MTab;
|
|
640
652
|
get name(): string;
|
|
653
|
+
getConfig(): StaffConfig | TabConfig;
|
|
641
654
|
getTuningName(): string | undefined;
|
|
642
655
|
getTuningStrings(): ReadonlyArray<Note>;
|
|
643
656
|
/** Return Y coordinate of string. */
|
|
@@ -648,15 +661,15 @@ declare class ObjTab extends ObjNotationLine {
|
|
|
648
661
|
getBottomLineY(): number;
|
|
649
662
|
getTop(): number;
|
|
650
663
|
getBottom(): number;
|
|
651
|
-
containsVoiceId(voiceId:
|
|
664
|
+
containsVoiceId(voiceId: VoiceId): boolean;
|
|
652
665
|
containsDiatonicId(diatonicId: number): boolean;
|
|
653
666
|
calcTop(): number;
|
|
654
667
|
calcBottom(): number;
|
|
655
668
|
pick(x: number, y: number): MusicObject[];
|
|
656
|
-
layoutHeight(
|
|
657
|
-
layoutWidth(
|
|
669
|
+
layoutHeight(ctx: RenderContext): void;
|
|
670
|
+
layoutWidth(ctx: RenderContext): void;
|
|
658
671
|
offset(dx: number, dy: number): void;
|
|
659
|
-
draw(
|
|
672
|
+
draw(ctx: RenderContext): void;
|
|
660
673
|
}
|
|
661
674
|
|
|
662
675
|
declare class ObjStaffNoteGroup extends MusicObject {
|
|
@@ -693,11 +706,12 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
693
706
|
readonly col: ObjRhythmColumn;
|
|
694
707
|
readonly voiceId: VoiceId;
|
|
695
708
|
readonly notes: ReadonlyArray<Note>;
|
|
696
|
-
readonly
|
|
697
|
-
readonly
|
|
698
|
-
readonly
|
|
699
|
-
|
|
700
|
-
|
|
709
|
+
readonly options?: NoteOptions | undefined;
|
|
710
|
+
readonly setDiatonicId: number;
|
|
711
|
+
readonly setStringsNumbers?: StringNumber[];
|
|
712
|
+
private runningDiatonicId;
|
|
713
|
+
private runningStemDir;
|
|
714
|
+
private runningStringNumbers;
|
|
701
715
|
readonly color: string;
|
|
702
716
|
readonly staccato: boolean;
|
|
703
717
|
readonly diamond: boolean;
|
|
@@ -712,14 +726,18 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
712
726
|
private readonly staffObjects;
|
|
713
727
|
private readonly tabObjects;
|
|
714
728
|
readonly mi: MNoteGroup;
|
|
715
|
-
constructor(col: ObjRhythmColumn, voiceId: VoiceId, notes: ReadonlyArray<Note>, noteLength: NoteLength | NoteLengthStr, options?: NoteOptions, tupletRatio?: TupletRatio);
|
|
729
|
+
constructor(col: ObjRhythmColumn, voiceId: VoiceId, notes: ReadonlyArray<Note>, noteLength: NoteLength | NoteLengthStr, options?: NoteOptions | undefined, tupletRatio?: TupletRatio);
|
|
716
730
|
getMusicInterface(): MNoteGroup;
|
|
717
731
|
get doc(): ObjDocument;
|
|
718
732
|
get measure(): ObjMeasure;
|
|
719
733
|
get row(): ObjScoreRow;
|
|
734
|
+
get minDiatonicId(): number;
|
|
735
|
+
get maxDiatonicId(): number;
|
|
736
|
+
getDiatonicId(staff?: ObjStaff): number;
|
|
720
737
|
get stemDir(): Stem.Up | Stem.Down;
|
|
721
738
|
enableConnective(line: ObjNotationLine): boolean;
|
|
722
739
|
startConnective(connectiveProps: ConnectiveProps): void;
|
|
740
|
+
updateRunningArguments(diatonicId: number, stemDir: Stem.Up | Stem.Down, stringNumbers: StringNumber[]): void;
|
|
723
741
|
getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
|
|
724
742
|
pick(x: number, y: number): MusicObject[];
|
|
725
743
|
getTopNote(): Note;
|
|
@@ -728,8 +746,8 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
728
746
|
x: number;
|
|
729
747
|
y: number;
|
|
730
748
|
};
|
|
731
|
-
getFretNumberString(noteIndex: number):
|
|
732
|
-
getFretNumber(
|
|
749
|
+
getFretNumberString(noteIndex: number): StringNumber | undefined;
|
|
750
|
+
getFretNumber(tab: ObjTab, noteIndex: number): number | undefined;
|
|
733
751
|
private getNextNoteGroup;
|
|
734
752
|
collectConnectiveProps(): void;
|
|
735
753
|
removeConnectiveProps(): void;
|
|
@@ -743,7 +761,7 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
743
761
|
y: number;
|
|
744
762
|
stemHeight: number;
|
|
745
763
|
} | undefined)[];
|
|
746
|
-
getStemHeight(
|
|
764
|
+
getStemHeight(ctx: RenderContext): number;
|
|
747
765
|
hasBeamCount(): boolean;
|
|
748
766
|
getLeftBeamCount(): number;
|
|
749
767
|
getRightBeamCount(): number;
|
|
@@ -754,11 +772,11 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
754
772
|
visibleInStaff(staff: ObjStaff): boolean;
|
|
755
773
|
getPlayTicks(note: Note): number;
|
|
756
774
|
updateAccidentalState(accState: AccidentalState): void;
|
|
757
|
-
layout(
|
|
775
|
+
layout(ctx: RenderContext, accState: AccidentalState): void;
|
|
758
776
|
updateRect(): void;
|
|
759
777
|
setStemTipY(staff: ObjStaff, stemTipY: number): void;
|
|
760
778
|
offset(dx: number, dy: number): void;
|
|
761
|
-
draw(
|
|
779
|
+
draw(ctx: RenderContext): void;
|
|
762
780
|
getDotVerticalDisplacement(staff: ObjStaff, diatonicId: number, stemDir: Stem): 1 | 0 | -1;
|
|
763
781
|
static hasSameNotes(ng1: ObjNoteGroup, ng2: ObjNoteGroup): boolean;
|
|
764
782
|
}
|
|
@@ -800,8 +818,9 @@ declare class ObjBeamGroup extends MusicObject {
|
|
|
800
818
|
private readonly type;
|
|
801
819
|
private readonly staffObjects;
|
|
802
820
|
private constructor();
|
|
821
|
+
get stemDir(): Stem.Up | Stem.Down;
|
|
803
822
|
private get showTupletRatio();
|
|
804
|
-
static createBeam(noteGroups: ObjNoteGroup[]):
|
|
823
|
+
static createBeam(noteGroups: ObjNoteGroup[]): boolean;
|
|
805
824
|
static createOldStyleTriplet(symbols: RhythmSymbol[]): number;
|
|
806
825
|
static createTuplet(symbols: RhythmSymbol[], tupletRatio: TupletRatio & TupletOptions): void;
|
|
807
826
|
getMusicInterface(): MBeamGroup;
|
|
@@ -814,12 +833,12 @@ declare class ObjBeamGroup extends MusicObject {
|
|
|
814
833
|
getSymbols(): ReadonlyArray<RhythmSymbol>;
|
|
815
834
|
getFirstSymbol(): RhythmSymbol | undefined;
|
|
816
835
|
getLastSymbol(): RhythmSymbol | undefined;
|
|
817
|
-
get
|
|
818
|
-
layout(
|
|
836
|
+
get color(): string;
|
|
837
|
+
layout(ctx: RenderContext): void;
|
|
819
838
|
updateRect(): void;
|
|
820
839
|
updateStemTips(): void;
|
|
821
840
|
offset(dx: number, dy: number): void;
|
|
822
|
-
draw(
|
|
841
|
+
draw(ctx: RenderContext): void;
|
|
823
842
|
private setBeamCounts;
|
|
824
843
|
private setTupletBeamCounts;
|
|
825
844
|
}
|
|
@@ -839,22 +858,27 @@ declare class ObjStaffRest extends MusicObject {
|
|
|
839
858
|
declare class ObjRest extends MusicObject {
|
|
840
859
|
readonly col: ObjRhythmColumn;
|
|
841
860
|
readonly voiceId: VoiceId;
|
|
842
|
-
readonly
|
|
843
|
-
readonly ownDiatonicId: number;
|
|
861
|
+
readonly options?: RestOptions | undefined;
|
|
844
862
|
readonly color: string;
|
|
845
863
|
readonly hide: boolean;
|
|
846
864
|
readonly oldStyleTriplet: boolean;
|
|
847
865
|
readonly rhythmProps: RhythmProps;
|
|
866
|
+
static UndefinedDiatonicId: number;
|
|
867
|
+
readonly setDiatonicId: number;
|
|
868
|
+
private runningDiatonicId;
|
|
869
|
+
private runningStemDir;
|
|
848
870
|
private beamGroup?;
|
|
849
871
|
readonly staffObjects: ObjStaffRest[];
|
|
850
872
|
readonly mi: MRest;
|
|
851
|
-
constructor(col: ObjRhythmColumn, voiceId: VoiceId, noteLength: NoteLength | NoteLengthStr, options?: RestOptions, tupletRatio?: TupletRatio);
|
|
873
|
+
constructor(col: ObjRhythmColumn, voiceId: VoiceId, noteLength: NoteLength | NoteLengthStr, options?: RestOptions | undefined, tupletRatio?: TupletRatio);
|
|
852
874
|
getMusicInterface(): MRest;
|
|
853
875
|
get doc(): ObjDocument;
|
|
854
876
|
get measure(): ObjMeasure;
|
|
855
877
|
get row(): ObjScoreRow;
|
|
856
878
|
get noteLength(): NoteLength;
|
|
879
|
+
getDiatonicId(staff?: ObjStaff): number;
|
|
857
880
|
get stemDir(): Stem.Up | Stem.Down;
|
|
881
|
+
updateRunningArguments(diatonicId: number, stemDir: Stem.Up | Stem.Down, stringNumbers: StringNumber[]): void;
|
|
858
882
|
getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
|
|
859
883
|
pick(x: number, y: number): MusicObject[];
|
|
860
884
|
getBeamGroup(): ObjBeamGroup | undefined;
|
|
@@ -871,38 +895,32 @@ declare class ObjRest extends MusicObject {
|
|
|
871
895
|
visibleInStaff(staff: ObjStaff): boolean;
|
|
872
896
|
private getRestDotVerticalDisplacement;
|
|
873
897
|
updateAccidentalState(accState: AccidentalState): void;
|
|
874
|
-
layout(
|
|
898
|
+
layout(ctx: RenderContext, accState: AccidentalState): void;
|
|
875
899
|
updateRect(): void;
|
|
876
900
|
offset(dx: number, dy: number): void;
|
|
877
|
-
draw(
|
|
901
|
+
draw(ctx: RenderContext): void;
|
|
878
902
|
}
|
|
879
903
|
|
|
880
|
-
declare class LyricsContainer {
|
|
881
|
-
readonly col: ObjRhythmColumn;
|
|
882
|
-
readonly lyricsObjects: ObjLyrics[];
|
|
883
|
-
readonly rhythmProps: RhythmProps;
|
|
884
|
-
constructor(col: ObjRhythmColumn, lyricsLength: NoteLength);
|
|
885
|
-
addLyricsObject(lyricsObj: ObjLyrics): void;
|
|
886
|
-
}
|
|
887
904
|
declare class ObjLyrics extends MusicObject {
|
|
888
905
|
readonly col: ObjRhythmColumn;
|
|
889
906
|
readonly verse: VerseNumber;
|
|
890
907
|
readonly line: ObjNotationLine;
|
|
891
908
|
readonly vpos: VerticalPos;
|
|
892
909
|
private nextLyricsObject?;
|
|
910
|
+
readonly rhythmProps: RhythmProps;
|
|
893
911
|
private readonly color;
|
|
894
912
|
private readonly hyphen?;
|
|
895
913
|
private readonly text;
|
|
896
914
|
readonly mi: MLyrics;
|
|
897
|
-
constructor(col: ObjRhythmColumn, verse: VerseNumber, line: ObjNotationLine, vpos: VerticalPos, lyricsText: string, lyricsOptions?: LyricsOptions);
|
|
915
|
+
constructor(col: ObjRhythmColumn, verse: VerseNumber, line: ObjNotationLine, vpos: VerticalPos, lyricsLength: NoteLength, lyricsText: string, lyricsOptions?: LyricsOptions);
|
|
898
916
|
getMusicInterface(): MLyrics;
|
|
899
917
|
get measure(): ObjMeasure;
|
|
900
918
|
getText(): string;
|
|
901
919
|
setNextLyricsObject(lyricsObj: ObjLyrics): void;
|
|
902
920
|
pick(x: number, y: number): MusicObject[];
|
|
903
|
-
layout(
|
|
921
|
+
layout(ctx: RenderContext): void;
|
|
904
922
|
offset(dx: number, dy: number): void;
|
|
905
|
-
draw(
|
|
923
|
+
draw(ctx: RenderContext): void;
|
|
906
924
|
}
|
|
907
925
|
|
|
908
926
|
type ScorePlayerNote = {
|
|
@@ -912,17 +930,11 @@ type ScorePlayerNote = {
|
|
|
912
930
|
slur: undefined | "first" | "slurred";
|
|
913
931
|
};
|
|
914
932
|
type RhythmSymbol = ObjNoteGroup | ObjRest;
|
|
915
|
-
type LyricsContainerData = {
|
|
916
|
-
lyricsContainer: LyricsContainer;
|
|
917
|
-
verse: VerseNumber;
|
|
918
|
-
line: ObjNotationLine;
|
|
919
|
-
vpos: VerticalPos;
|
|
920
|
-
};
|
|
921
933
|
declare class ObjRhythmColumn extends MusicObject {
|
|
922
934
|
readonly measure: ObjMeasure;
|
|
923
935
|
readonly positionTicks: number;
|
|
924
936
|
private readonly voiceSymbol;
|
|
925
|
-
private readonly
|
|
937
|
+
private readonly lyricsObject;
|
|
926
938
|
private minDiatonicId?;
|
|
927
939
|
private maxDiatonicId?;
|
|
928
940
|
private staffMinDiatonicId;
|
|
@@ -958,19 +970,19 @@ declare class ObjRhythmColumn extends MusicObject {
|
|
|
958
970
|
getArpeggioDir(): Arpeggio;
|
|
959
971
|
setVoiceSymbol(voiceId: VoiceId, symbol: RhythmSymbol): void;
|
|
960
972
|
getVoiceSymbol(voiceId: VoiceId): RhythmSymbol | undefined;
|
|
961
|
-
|
|
962
|
-
|
|
973
|
+
getLyricsObject(verse: VerseNumber, line: ObjNotationLine, vpos: VerticalPos): ObjLyrics | undefined;
|
|
974
|
+
addLyricsObject(lyricsObj: ObjLyrics): void;
|
|
963
975
|
getMinWidth(): number;
|
|
964
976
|
setupNoteHeadDisplacements(): void;
|
|
965
977
|
getNoteHeadDisplacement(noteGroup: ObjNoteGroup, note: Note): -1 | 0 | 1;
|
|
966
978
|
isEmpty(): boolean;
|
|
967
979
|
getPlayerNotes(): ScorePlayerNote[];
|
|
968
980
|
requestLayout(): void;
|
|
969
|
-
layout(
|
|
981
|
+
layout(ctx: RenderContext, accState: AccidentalState): void;
|
|
970
982
|
layoutDone(): void;
|
|
971
983
|
updateRect(): void;
|
|
972
984
|
offset(dx: number, dy: number): void;
|
|
973
|
-
draw(
|
|
985
|
+
draw(ctx: RenderContext): void;
|
|
974
986
|
}
|
|
975
987
|
|
|
976
988
|
type PlayerColumn = ObjRhythmColumn | ObjBarLineRight;
|
|
@@ -1002,8 +1014,15 @@ declare enum BarLineType {
|
|
|
1002
1014
|
declare class ObjStaffTabBarLine extends MusicObject {
|
|
1003
1015
|
readonly barLine: ObjBarLine;
|
|
1004
1016
|
readonly line: ObjNotationLine;
|
|
1005
|
-
|
|
1006
|
-
|
|
1017
|
+
verticalLines: {
|
|
1018
|
+
left: number;
|
|
1019
|
+
width: number;
|
|
1020
|
+
}[];
|
|
1021
|
+
dots: {
|
|
1022
|
+
x: number;
|
|
1023
|
+
y: number;
|
|
1024
|
+
r: number;
|
|
1025
|
+
}[];
|
|
1007
1026
|
readonly mi: MStaffTabBarLine;
|
|
1008
1027
|
constructor(barLine: ObjBarLine, line: ObjNotationLine);
|
|
1009
1028
|
getMusicInterface(): MusicInterface;
|
|
@@ -1014,14 +1033,15 @@ declare class ObjStaffTabBarLine extends MusicObject {
|
|
|
1014
1033
|
declare abstract class ObjBarLine extends MusicObject {
|
|
1015
1034
|
readonly measure: ObjMeasure;
|
|
1016
1035
|
protected staffTabObjects: ObjStaffTabBarLine[];
|
|
1036
|
+
protected staffTabObjectGroups: ObjStaffTabBarLine[][];
|
|
1017
1037
|
protected barLineType: BarLineType;
|
|
1018
1038
|
constructor(measure: ObjMeasure);
|
|
1019
1039
|
abstract solveBarLineType(): BarLineType;
|
|
1020
1040
|
pick(x: number, y: number): MusicObject[];
|
|
1021
|
-
layout(
|
|
1041
|
+
layout(ctx: RenderContext): void;
|
|
1022
1042
|
updateRect(): void;
|
|
1023
1043
|
offset(dx: number, dy: number): void;
|
|
1024
|
-
draw(
|
|
1044
|
+
draw(ctx: RenderContext): void;
|
|
1025
1045
|
}
|
|
1026
1046
|
declare class ObjBarLineLeft extends ObjBarLine {
|
|
1027
1047
|
readonly mi: MBarLineLeft;
|
|
@@ -1040,7 +1060,6 @@ declare class ObjBarLineRight extends ObjBarLine {
|
|
|
1040
1060
|
|
|
1041
1061
|
declare class ObjConnective extends MusicObject {
|
|
1042
1062
|
readonly connectiveProps: ConnectiveProps;
|
|
1043
|
-
readonly line: ObjNotationLine;
|
|
1044
1063
|
readonly measure: ObjMeasure;
|
|
1045
1064
|
private lx;
|
|
1046
1065
|
private ly;
|
|
@@ -1051,6 +1070,7 @@ declare class ObjConnective extends MusicObject {
|
|
|
1051
1070
|
private cp2x;
|
|
1052
1071
|
private cp2y;
|
|
1053
1072
|
private arcHeight;
|
|
1073
|
+
private readonly line;
|
|
1054
1074
|
private readonly leftNoteGroup;
|
|
1055
1075
|
private readonly leftNoteId;
|
|
1056
1076
|
private readonly rightNoteGroup?;
|
|
@@ -1062,13 +1082,14 @@ declare class ObjConnective extends MusicObject {
|
|
|
1062
1082
|
getMusicInterface(): MConnective;
|
|
1063
1083
|
isInsideMeasure(): boolean;
|
|
1064
1084
|
pick(x: number, y: number): MusicObject[];
|
|
1065
|
-
layout(
|
|
1085
|
+
layout(ctx: RenderContext): void;
|
|
1066
1086
|
offset(dx: number, dy: number): void;
|
|
1067
|
-
draw(
|
|
1087
|
+
draw(ctx: RenderContext): void;
|
|
1068
1088
|
}
|
|
1069
1089
|
|
|
1070
1090
|
declare class ObjMeasure extends MusicObject {
|
|
1071
1091
|
readonly row: ObjScoreRow;
|
|
1092
|
+
private readonly options;
|
|
1072
1093
|
static readonly MinFlexContentWidth = 10;
|
|
1073
1094
|
private prevMeasure;
|
|
1074
1095
|
private nextMeasure;
|
|
@@ -1091,9 +1112,6 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1091
1112
|
private leftSolidAreaWidth;
|
|
1092
1113
|
private minColumnsAreaWidth;
|
|
1093
1114
|
private rightSolidAreaWidth;
|
|
1094
|
-
private useDiatonicId;
|
|
1095
|
-
private useStemDir;
|
|
1096
|
-
private useString;
|
|
1097
1115
|
private voiceSymbols;
|
|
1098
1116
|
private lastAddedRhythmColumn?;
|
|
1099
1117
|
private lastAddedRhythmSymbol?;
|
|
@@ -1110,7 +1128,7 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1110
1128
|
private staticObjectsCache;
|
|
1111
1129
|
private lyricsObjectsCache;
|
|
1112
1130
|
readonly mi: MMeasure;
|
|
1113
|
-
constructor(row: ObjScoreRow);
|
|
1131
|
+
constructor(row: ObjScoreRow, options: MeasureOptions);
|
|
1114
1132
|
getMusicInterface(): MMeasure;
|
|
1115
1133
|
get doc(): ObjDocument;
|
|
1116
1134
|
isPartialMeasure(): boolean;
|
|
@@ -1118,9 +1136,11 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1118
1136
|
resetPassCount(): void;
|
|
1119
1137
|
incPassCount(): void;
|
|
1120
1138
|
getPassCount(): number;
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1139
|
+
updateRunningArguments(runningArgs?: {
|
|
1140
|
+
diatonicId: number;
|
|
1141
|
+
stemDir: Stem;
|
|
1142
|
+
stringNumbers: StringNumber[];
|
|
1143
|
+
}[]): void;
|
|
1124
1144
|
pick(x: number, y: number): MusicObject[];
|
|
1125
1145
|
getMeasureNumber(): number;
|
|
1126
1146
|
getColumns(): ReadonlyArray<ObjRhythmColumn>;
|
|
@@ -1199,15 +1219,15 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1199
1219
|
getVoiceSymbols(voiceId: VoiceId): ReadonlyArray<RhythmSymbol>;
|
|
1200
1220
|
completeRests(voiceId?: VoiceId | VoiceId[]): void;
|
|
1201
1221
|
requestLayout(): void;
|
|
1202
|
-
layout(
|
|
1203
|
-
layoutWidth(
|
|
1204
|
-
layoutConnectives(
|
|
1205
|
-
layoutBeams(
|
|
1222
|
+
layout(ctx: RenderContext): void;
|
|
1223
|
+
layoutWidth(ctx: RenderContext, width: number): void;
|
|
1224
|
+
layoutConnectives(ctx: RenderContext): void;
|
|
1225
|
+
layoutBeams(ctx: RenderContext): void;
|
|
1206
1226
|
alignStemsToBeams(): void;
|
|
1207
1227
|
layoutDone(): void;
|
|
1208
1228
|
updateRect(): void;
|
|
1209
1229
|
offset(dx: number, dy: number): void;
|
|
1210
|
-
draw(
|
|
1230
|
+
draw(ctx: RenderContext): void;
|
|
1211
1231
|
}
|
|
1212
1232
|
|
|
1213
1233
|
declare class ObjScoreRow extends MusicObject {
|
|
@@ -1217,8 +1237,10 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1217
1237
|
private nextRow?;
|
|
1218
1238
|
private minWidth;
|
|
1219
1239
|
private readonly notationLines;
|
|
1240
|
+
private readonly instrumentLineGroups;
|
|
1220
1241
|
private readonly staves;
|
|
1221
1242
|
private readonly tabs;
|
|
1243
|
+
private readonly instrumentNames;
|
|
1222
1244
|
private readonly measures;
|
|
1223
1245
|
private needLayout;
|
|
1224
1246
|
readonly mi: MScoreRow;
|
|
@@ -1226,6 +1248,8 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1226
1248
|
getMusicInterface(): MScoreRow;
|
|
1227
1249
|
private createNotationLines;
|
|
1228
1250
|
getNotationLines(): ReadonlyArray<ObjNotationLine>;
|
|
1251
|
+
getInstrumentLineGroups(): ReadonlyArray<ReadonlyArray<ObjNotationLine>>;
|
|
1252
|
+
findMatchingLine(line: ObjNotationLine): ObjNotationLine | undefined;
|
|
1229
1253
|
getStaves(): ReadonlyArray<ObjStaff>;
|
|
1230
1254
|
getTabs(): ReadonlyArray<ObjTab>;
|
|
1231
1255
|
get hasStaff(): boolean;
|
|
@@ -1233,8 +1257,8 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1233
1257
|
getTopStaff(): ObjStaff;
|
|
1234
1258
|
getBottomStaff(): ObjStaff;
|
|
1235
1259
|
getStaff(diatonicId: number): ObjStaff | undefined;
|
|
1236
|
-
resetLayoutGroups(
|
|
1237
|
-
layoutLayoutGroups(
|
|
1260
|
+
resetLayoutGroups(ctx: RenderContext): void;
|
|
1261
|
+
layoutLayoutGroups(ctx: RenderContext): void;
|
|
1238
1262
|
pick(x: number, y: number): MusicObject[];
|
|
1239
1263
|
getConnectivesContentRect(): DivRect;
|
|
1240
1264
|
getDiatonicIdAt(y: number): number | undefined;
|
|
@@ -1247,21 +1271,23 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1247
1271
|
getFirstMeasure(): ObjMeasure | undefined;
|
|
1248
1272
|
getLastMeasure(): ObjMeasure | undefined;
|
|
1249
1273
|
getMinWidth(): number;
|
|
1274
|
+
solveAutoStemDir(symbols: ReadonlyArray<RhythmSymbol>): Stem.Up | Stem.Down;
|
|
1275
|
+
getInstrumentNameWidth(ctx: RenderContext): number;
|
|
1250
1276
|
requestLayout(): void;
|
|
1251
|
-
layout(
|
|
1252
|
-
layoutWidth(
|
|
1277
|
+
layout(ctx: RenderContext): void;
|
|
1278
|
+
layoutWidth(ctx: RenderContext, left: number, right: number): void;
|
|
1253
1279
|
updateRect(): void;
|
|
1254
1280
|
alignStemsToBeams(): void;
|
|
1255
|
-
layoutSetNotationLines(
|
|
1256
|
-
layoutPadding(
|
|
1281
|
+
layoutSetNotationLines(ctx: RenderContext): void;
|
|
1282
|
+
layoutPadding(ctx: RenderContext): void;
|
|
1257
1283
|
layoutDone(): void;
|
|
1258
1284
|
offset(dx: number, dy: number): void;
|
|
1259
|
-
draw(
|
|
1285
|
+
draw(ctx: RenderContext): void;
|
|
1260
1286
|
}
|
|
1261
1287
|
|
|
1262
1288
|
declare class ObjDocument extends MusicObject {
|
|
1263
1289
|
private needLayout;
|
|
1264
|
-
private
|
|
1290
|
+
private ctx?;
|
|
1265
1291
|
private readonly rows;
|
|
1266
1292
|
private readonly measures;
|
|
1267
1293
|
private measuresPerRow;
|
|
@@ -1276,7 +1302,7 @@ declare class ObjDocument extends MusicObject {
|
|
|
1276
1302
|
setScoreConfiguration(config: StaffPreset | ScoreConfiguration): void;
|
|
1277
1303
|
setMeasuresPerRow(measuresPerRow: number): void;
|
|
1278
1304
|
addConnectiveProps(connectiveProps: ConnectiveProps): void;
|
|
1279
|
-
|
|
1305
|
+
setRenderContext(ctx?: RenderContext): void;
|
|
1280
1306
|
setHeader(title?: string, composer?: string, arranger?: string): void;
|
|
1281
1307
|
getTitle(): string | undefined;
|
|
1282
1308
|
getComposer(): string | undefined;
|
|
@@ -1290,7 +1316,7 @@ declare class ObjDocument extends MusicObject {
|
|
|
1290
1316
|
getRows(): ReadonlyArray<ObjScoreRow>;
|
|
1291
1317
|
getMeasures(): ReadonlyArray<ObjMeasure>;
|
|
1292
1318
|
requestNewRow(): void;
|
|
1293
|
-
addMeasure(): ObjMeasure;
|
|
1319
|
+
addMeasure(measureOptions: MeasureOptions): ObjMeasure;
|
|
1294
1320
|
addStaffGroup(groupName: string, layoutElements: number | string | (number | string)[], verticalPosition: VerticalPosition): void;
|
|
1295
1321
|
getStaffGroup(groupName: string): StaffGroup | undefined;
|
|
1296
1322
|
getVoiceSymbols(voiceId: VoiceId): ReadonlyArray<RhythmSymbol>;
|
|
@@ -1298,6 +1324,12 @@ declare class ObjDocument extends MusicObject {
|
|
|
1298
1324
|
private forEachMeasure;
|
|
1299
1325
|
resetMeasures(): void;
|
|
1300
1326
|
updateCursorRect(cursorRect?: DivRect): void;
|
|
1327
|
+
getInstrumentGroupSize(ctx: RenderContext): {
|
|
1328
|
+
nameLeft: number;
|
|
1329
|
+
nameRight: number;
|
|
1330
|
+
braceLeft: number;
|
|
1331
|
+
braceRight: number;
|
|
1332
|
+
};
|
|
1301
1333
|
requestLayout(): void;
|
|
1302
1334
|
requestFullLayout(): void;
|
|
1303
1335
|
layout(): void;
|
|
@@ -1310,16 +1342,15 @@ declare class ObjDocument extends MusicObject {
|
|
|
1310
1342
|
}
|
|
1311
1343
|
|
|
1312
1344
|
declare enum ImageAsset {
|
|
1313
|
-
|
|
1314
|
-
|
|
1345
|
+
G_Clef = 0,
|
|
1346
|
+
F_Clef = 1
|
|
1315
1347
|
}
|
|
1316
|
-
declare class
|
|
1348
|
+
declare class RenderContext {
|
|
1317
1349
|
private readonly mi;
|
|
1318
1350
|
readonly devicePixelRatio: number;
|
|
1319
1351
|
readonly fontSize: number;
|
|
1320
1352
|
readonly unitSize: number;
|
|
1321
|
-
readonly
|
|
1322
|
-
readonly beamThickness: number;
|
|
1353
|
+
readonly _lineWidth: number;
|
|
1323
1354
|
private scoreEventListener?;
|
|
1324
1355
|
private canvas?;
|
|
1325
1356
|
private ctx?;
|
|
@@ -1335,8 +1366,8 @@ declare class Renderer {
|
|
|
1335
1366
|
private onMouseMoveFn;
|
|
1336
1367
|
private onMouseLeaveFn;
|
|
1337
1368
|
private onTouchEndFn;
|
|
1338
|
-
constructor(mi:
|
|
1339
|
-
getMusicInterface():
|
|
1369
|
+
constructor(mi: MRenderContext);
|
|
1370
|
+
getMusicInterface(): MRenderContext;
|
|
1340
1371
|
get doc(): ObjDocument | undefined;
|
|
1341
1372
|
private finishImageAsset;
|
|
1342
1373
|
getImageAsset(imageAsset: ImageAsset): HTMLImageElement | undefined;
|
|
@@ -1365,17 +1396,41 @@ declare class Renderer {
|
|
|
1365
1396
|
drawPlayCursor(): void;
|
|
1366
1397
|
txFromScreenCoord(screenCoord: Vec2): Vec2;
|
|
1367
1398
|
txToScreenCoord(coord: Vec2): Vec2;
|
|
1368
|
-
getCanvasContext(): CanvasRenderingContext2D | undefined;
|
|
1369
1399
|
clearCanvas(): void;
|
|
1370
|
-
getTextWidth(text: string, font: string): number;
|
|
1371
1400
|
drawDebugRect(r: DivRect): void;
|
|
1372
|
-
fillCircle(x: number, y: number, radius: number, color?: string): void;
|
|
1373
|
-
drawLine(startX: number, startY: number, endX: number, endY: number, color?: string, lineWidth?: number): void;
|
|
1374
|
-
drawPartialLine(startX: number, startY: number, endX: number, endY: number, startT: number, endT: number, color?: string, lineWidth?: number): void;
|
|
1375
1401
|
drawLedgerLines(staff: ObjStaff, diatonicId: number, x: number): void;
|
|
1376
1402
|
getRestRect(restSize: number): DivRect;
|
|
1377
|
-
drawRest(restSize: number, x: number, y: number
|
|
1403
|
+
drawRest(restSize: number, x: number, y: number): void;
|
|
1378
1404
|
drawFlag(rect: DivRect, dir: "up" | "down"): void;
|
|
1405
|
+
color(color: string): RenderContext;
|
|
1406
|
+
lineColor(color: string): RenderContext;
|
|
1407
|
+
fillColor(color: string): RenderContext;
|
|
1408
|
+
lineWidth(lineWidth?: number): RenderContext;
|
|
1409
|
+
font(font: string): RenderContext;
|
|
1410
|
+
beginPath(): RenderContext;
|
|
1411
|
+
stroke(): RenderContext;
|
|
1412
|
+
fill(): RenderContext;
|
|
1413
|
+
moveTo(x: number, y: number): RenderContext;
|
|
1414
|
+
lineTo(x: number, y: number): RenderContext;
|
|
1415
|
+
bezierCurveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): RenderContext;
|
|
1416
|
+
quadraticCurveTo(x1: number, y1: number, x2: number, y2: number): RenderContext;
|
|
1417
|
+
fillRect(x: number, y: number, w: number, h: number): RenderContext;
|
|
1418
|
+
setLineDash(pattern: number[]): RenderContext;
|
|
1419
|
+
drawImage(img: CanvasImageSource, x: number, y: number, w: number, h: number): RenderContext;
|
|
1420
|
+
ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number): RenderContext;
|
|
1421
|
+
clip(): RenderContext;
|
|
1422
|
+
save(): RenderContext;
|
|
1423
|
+
restore(): RenderContext;
|
|
1424
|
+
rect(x: number, y: number, w: number, h: number): RenderContext;
|
|
1425
|
+
scale(x: number, y: number): RenderContext;
|
|
1426
|
+
strokeRect(x: number, y: number, w: number, h: number): RenderContext;
|
|
1427
|
+
fillText(text: string, x: number, y: number): RenderContext;
|
|
1428
|
+
getTextWidth(text: string, font: string): number;
|
|
1429
|
+
arc(x: number, y: number, radius: number, startRadians: number, endRadians: number): void;
|
|
1430
|
+
fillCircle(x: number, y: number, radius: number): void;
|
|
1431
|
+
strokeLine(startX: number, startY: number, endX: number, endY: number): void;
|
|
1432
|
+
strokePartialLine(startX: number, startY: number, endX: number, endY: number, startT: number, endT: number): void;
|
|
1433
|
+
drawBrace(rect: DivRect, side: "left" | "right"): void;
|
|
1379
1434
|
}
|
|
1380
1435
|
|
|
1381
1436
|
declare class ObjEnding extends MusicObject {
|
|
@@ -1391,10 +1446,10 @@ declare class ObjEnding extends MusicObject {
|
|
|
1391
1446
|
hasPassage(pass: number): boolean;
|
|
1392
1447
|
getHighestPassage(): number;
|
|
1393
1448
|
pick(x: number, y: number): MusicObject[];
|
|
1394
|
-
layout(
|
|
1395
|
-
layoutFitToMeasure(
|
|
1449
|
+
layout(ctx: RenderContext): void;
|
|
1450
|
+
layoutFitToMeasure(ctx: RenderContext): void;
|
|
1396
1451
|
offset(dx: number, dy: number): void;
|
|
1397
|
-
draw(
|
|
1452
|
+
draw(ctx: RenderContext): void;
|
|
1398
1453
|
}
|
|
1399
1454
|
|
|
1400
1455
|
declare class ObjFermata extends MusicObject {
|
|
@@ -1405,9 +1460,9 @@ declare class ObjFermata extends MusicObject {
|
|
|
1405
1460
|
getMusicInterface(): MFermata;
|
|
1406
1461
|
static getFermataPositions(anchor: ObjRhythmColumn | ObjBarLineRight): VerticalPos[];
|
|
1407
1462
|
pick(x: number, y: number): MusicObject[];
|
|
1408
|
-
layout(
|
|
1463
|
+
layout(ctx: RenderContext): void;
|
|
1409
1464
|
offset(dx: number, dy: number): void;
|
|
1410
|
-
draw(
|
|
1465
|
+
draw(ctx: RenderContext): void;
|
|
1411
1466
|
}
|
|
1412
1467
|
|
|
1413
1468
|
declare class ObjSpecialText extends MusicObject {
|
|
@@ -1421,9 +1476,9 @@ declare class ObjSpecialText extends MusicObject {
|
|
|
1421
1476
|
getMusicInterface(): MSpecialText;
|
|
1422
1477
|
getText(): string;
|
|
1423
1478
|
pick(x: number, y: number): MusicObject[];
|
|
1424
|
-
layout(
|
|
1479
|
+
layout(ctx: RenderContext): void;
|
|
1425
1480
|
offset(dx: number, dy: number): void;
|
|
1426
|
-
draw(
|
|
1481
|
+
draw(ctx: RenderContext): void;
|
|
1427
1482
|
}
|
|
1428
1483
|
|
|
1429
1484
|
type ExtensionLineStyle = "solid" | "dashed";
|
|
@@ -1463,27 +1518,27 @@ declare class ObjExtensionLine extends MusicObject {
|
|
|
1463
1518
|
getMusicInterface(): MExtensionLine;
|
|
1464
1519
|
private getLineLeft;
|
|
1465
1520
|
private getLineRight;
|
|
1466
|
-
layoutFitToMeasure(
|
|
1521
|
+
layoutFitToMeasure(ctx: RenderContext): void;
|
|
1467
1522
|
pick(x: number, y: number): MusicObject[];
|
|
1468
|
-
layout(
|
|
1523
|
+
layout(ctx: RenderContext): void;
|
|
1469
1524
|
offset(dx: number, dy: number): void;
|
|
1470
|
-
draw(
|
|
1525
|
+
draw(ctx: RenderContext): void;
|
|
1471
1526
|
}
|
|
1472
1527
|
|
|
1473
1528
|
declare class ObjTabRhythm extends MusicObject {
|
|
1474
1529
|
readonly measure: ObjMeasure;
|
|
1475
1530
|
readonly tab: ObjTab;
|
|
1476
|
-
private readonly
|
|
1531
|
+
private readonly voiceId;
|
|
1477
1532
|
readonly mi: MTabRhythm;
|
|
1478
1533
|
constructor(measure: ObjMeasure, tab: ObjTab);
|
|
1479
1534
|
getMusicInterface(): MTabRhythm;
|
|
1480
1535
|
pick(x: number, y: number): MusicObject[];
|
|
1481
|
-
layout(
|
|
1536
|
+
layout(ctx: RenderContext): void;
|
|
1482
1537
|
private hasTuplets;
|
|
1483
|
-
layoutFitToMeasure(
|
|
1538
|
+
layoutFitToMeasure(ctx: RenderContext): void;
|
|
1484
1539
|
offset(dx: number, dy: number): void;
|
|
1485
1540
|
private readonly tupletPartsTextObjMap;
|
|
1486
|
-
draw(
|
|
1541
|
+
draw(ctx: RenderContext): void;
|
|
1487
1542
|
}
|
|
1488
1543
|
|
|
1489
1544
|
declare enum LayoutGroupId {
|
|
@@ -1524,9 +1579,9 @@ declare class LayoutObjectWrapper {
|
|
|
1524
1579
|
clearPositionResolved(): void;
|
|
1525
1580
|
setPositionResolved(): void;
|
|
1526
1581
|
isPositionResolved(): boolean;
|
|
1527
|
-
resolveClosestToStaffY(
|
|
1582
|
+
resolveClosestToStaffY(ctx: RenderContext): number;
|
|
1528
1583
|
getTextContent(): string | undefined;
|
|
1529
|
-
layout(
|
|
1584
|
+
layout(ctx: RenderContext): void;
|
|
1530
1585
|
offset(dx: number, dy: number): void;
|
|
1531
1586
|
getRect(): DivRect;
|
|
1532
1587
|
}
|
|
@@ -1539,7 +1594,7 @@ declare class LayoutGroup {
|
|
|
1539
1594
|
getLayoutObjects(verticalPos: VerticalPos): Readonly<LayoutObjectWrapper[]>;
|
|
1540
1595
|
add(layoutObj: LayoutObjectWrapper): void;
|
|
1541
1596
|
remove(layoutObj: LayoutObjectWrapper): void;
|
|
1542
|
-
clearPositionAndLayout(
|
|
1597
|
+
clearPositionAndLayout(ctx: RenderContext): void;
|
|
1543
1598
|
}
|
|
1544
1599
|
|
|
1545
1600
|
declare class MusicObjectLink {
|
|
@@ -1599,9 +1654,9 @@ declare class ObjArpeggio extends MusicObject {
|
|
|
1599
1654
|
constructor(col: ObjRhythmColumn, line: ObjNotationLine, arpeggioDir: Arpeggio);
|
|
1600
1655
|
getMusicInterface(): MArpeggio;
|
|
1601
1656
|
pick(x: number, y: number): MusicObject[];
|
|
1602
|
-
layout(
|
|
1657
|
+
layout(ctx: RenderContext): void;
|
|
1603
1658
|
offset(dx: number, dy: number): void;
|
|
1604
|
-
draw(
|
|
1659
|
+
draw(ctx: RenderContext): void;
|
|
1605
1660
|
}
|
|
1606
1661
|
|
|
1607
1662
|
declare class ObjHeader extends MusicObject {
|
|
@@ -1615,9 +1670,9 @@ declare class ObjHeader extends MusicObject {
|
|
|
1615
1670
|
constructor(doc: ObjDocument, title?: string | undefined, composer?: string | undefined, arranger?: string | undefined);
|
|
1616
1671
|
getMusicInterface(): MHeader;
|
|
1617
1672
|
pick(x: number, y: number): MusicObject[];
|
|
1618
|
-
layoutWidth(
|
|
1673
|
+
layoutWidth(ctx: RenderContext, left: number, right: number): void;
|
|
1619
1674
|
offset(dx: number, dy: number): void;
|
|
1620
|
-
draw(
|
|
1675
|
+
draw(ctx: RenderContext): void;
|
|
1621
1676
|
}
|
|
1622
1677
|
|
|
1623
1678
|
declare class ObjImage extends MusicObject {
|
|
@@ -1629,9 +1684,9 @@ declare class ObjImage extends MusicObject {
|
|
|
1629
1684
|
constructor(parent: MusicObject, image: HTMLImageElement, anchorX: number, anchorY: number, imageScale: number);
|
|
1630
1685
|
getMusicInterface(): MImage;
|
|
1631
1686
|
pick(x: number, y: number): MusicObject[];
|
|
1632
|
-
layout(
|
|
1687
|
+
layout(ctx: RenderContext): void;
|
|
1633
1688
|
offset(dx: number, dy: number): void;
|
|
1634
|
-
draw(
|
|
1689
|
+
draw(ctx: RenderContext): void;
|
|
1635
1690
|
}
|
|
1636
1691
|
|
|
1637
1692
|
declare class ObjStaffSignature extends MusicObject {
|
|
@@ -1648,16 +1703,16 @@ declare class ObjStaffSignature extends MusicObject {
|
|
|
1648
1703
|
readonly mi: MStaffSignature;
|
|
1649
1704
|
constructor(measure: ObjMeasure, staff: ObjStaff);
|
|
1650
1705
|
getMusicInterface(): MStaffSignature;
|
|
1651
|
-
updateClefImage(
|
|
1706
|
+
updateClefImage(ctx: RenderContext, showClef: boolean): void;
|
|
1652
1707
|
updateMeasureNumber(showMeasureNumber: boolean): void;
|
|
1653
1708
|
updateKeySignature(showKeySignature: boolean): void;
|
|
1654
1709
|
updateTimeSignature(showTimeSignature: boolean): void;
|
|
1655
1710
|
updateTempo(showTempo: boolean): void;
|
|
1656
1711
|
private getAccidentalDiatonicId;
|
|
1657
1712
|
pick(x: number, y: number): MusicObject[];
|
|
1658
|
-
layout(
|
|
1713
|
+
layout(ctx: RenderContext): void;
|
|
1659
1714
|
offset(dx: number, dy: number): void;
|
|
1660
|
-
draw(
|
|
1715
|
+
draw(ctx: RenderContext): void;
|
|
1661
1716
|
}
|
|
1662
1717
|
declare class ObjTabSignature extends MusicObject {
|
|
1663
1718
|
readonly measure: ObjMeasure;
|
|
@@ -1673,9 +1728,9 @@ declare class ObjTabSignature extends MusicObject {
|
|
|
1673
1728
|
updateTimeSignature(showTimeSignature: boolean): void;
|
|
1674
1729
|
updateTempo(showTempo: boolean): void;
|
|
1675
1730
|
pick(x: number, y: number): MusicObject[];
|
|
1676
|
-
layout(
|
|
1731
|
+
layout(ctx: RenderContext): void;
|
|
1677
1732
|
offset(dx: number, dy: number): void;
|
|
1678
|
-
draw(
|
|
1733
|
+
draw(ctx: RenderContext): void;
|
|
1679
1734
|
}
|
|
1680
1735
|
|
|
1681
1736
|
/** Score event type. */
|
|
@@ -1691,29 +1746,37 @@ declare abstract class ScoreEvent {
|
|
|
1691
1746
|
}
|
|
1692
1747
|
/** Score staff position event for clicking/entering/leaving staff position (diatonic id) in staff notation line. */
|
|
1693
1748
|
declare class ScoreStaffPosEvent extends ScoreEvent {
|
|
1694
|
-
readonly
|
|
1749
|
+
readonly renderContext: MRenderContext;
|
|
1695
1750
|
readonly scoreRow: MScoreRow;
|
|
1696
1751
|
readonly diatonicId: number;
|
|
1697
1752
|
/**
|
|
1698
1753
|
* Create new score staff position event.
|
|
1699
1754
|
* @param type - Score event type.
|
|
1700
|
-
* @param
|
|
1755
|
+
* @param renderContext - Render context.
|
|
1701
1756
|
* @param scoreRow - Score row.
|
|
1702
1757
|
* @param diatonicId - Diatonic id that was clicked/entered/left.
|
|
1703
1758
|
*/
|
|
1704
|
-
constructor(type: ScoreEventType,
|
|
1759
|
+
constructor(type: ScoreEventType, renderContext: MRenderContext, scoreRow: MScoreRow, diatonicId: number);
|
|
1760
|
+
/**
|
|
1761
|
+
* @deprecated - Provided for legacy support, use renderContext instead.
|
|
1762
|
+
*/
|
|
1763
|
+
get renderer(): MRenderer;
|
|
1705
1764
|
}
|
|
1706
1765
|
/** Score object event for clicking/entering/leaving score object. */
|
|
1707
1766
|
declare class ScoreObjectEvent extends ScoreEvent {
|
|
1708
|
-
readonly
|
|
1767
|
+
readonly renderContext: MRenderContext;
|
|
1709
1768
|
readonly objects: MusicInterface[];
|
|
1710
1769
|
/**
|
|
1711
1770
|
* Create new score object event.
|
|
1712
1771
|
* @param type - Score event type.
|
|
1713
|
-
* @param
|
|
1772
|
+
* @param renderContext - Render context.
|
|
1714
1773
|
* @param objects - Array of objects, last object in this array is the top object that was clicked/entered/left, previous objects are it's parent objects.
|
|
1715
1774
|
*/
|
|
1716
|
-
constructor(type: ScoreEventType,
|
|
1775
|
+
constructor(type: ScoreEventType, renderContext: MRenderContext, objects: MusicInterface[]);
|
|
1776
|
+
/**
|
|
1777
|
+
* @deprecated - Provided for legacy support, use renderContext instead.
|
|
1778
|
+
*/
|
|
1779
|
+
get renderer(): MRenderer;
|
|
1717
1780
|
/** Top object getter. */
|
|
1718
1781
|
get topObject(): MusicInterface;
|
|
1719
1782
|
/**
|
|
@@ -1756,25 +1819,25 @@ declare class MPlayer {
|
|
|
1756
1819
|
*/
|
|
1757
1820
|
stop(): this;
|
|
1758
1821
|
}
|
|
1759
|
-
/**
|
|
1760
|
-
declare class
|
|
1761
|
-
private readonly
|
|
1822
|
+
/** Render context class. */
|
|
1823
|
+
declare class MRenderContext {
|
|
1824
|
+
private readonly ctx;
|
|
1762
1825
|
/**
|
|
1763
|
-
* Create new
|
|
1826
|
+
* Create new render context instance.
|
|
1764
1827
|
*/
|
|
1765
1828
|
constructor();
|
|
1766
1829
|
/**
|
|
1767
|
-
* Attach music document to this
|
|
1830
|
+
* Attach music document to this render context.
|
|
1768
1831
|
* @param doc - Music document.
|
|
1769
|
-
* @returns - This
|
|
1832
|
+
* @returns - This render context instance.
|
|
1770
1833
|
*/
|
|
1771
|
-
setDocument(doc?: MDocument):
|
|
1834
|
+
setDocument(doc?: MDocument): MRenderContext;
|
|
1772
1835
|
/**
|
|
1773
|
-
* Set target canvas html element for this
|
|
1836
|
+
* Set target canvas html element for this render context.
|
|
1774
1837
|
* @param canvas - HTML canvas element or element id.
|
|
1775
|
-
* @returns - This
|
|
1838
|
+
* @returns - This render context instance.
|
|
1776
1839
|
*/
|
|
1777
|
-
setCanvas(canvas: HTMLCanvasElement | string):
|
|
1840
|
+
setCanvas(canvas: HTMLCanvasElement | string): MRenderContext;
|
|
1778
1841
|
/**
|
|
1779
1842
|
* Set score event listener.
|
|
1780
1843
|
* @param scoreEventListener - Score event listener.
|
|
@@ -1798,6 +1861,12 @@ declare class MRenderer {
|
|
|
1798
1861
|
*/
|
|
1799
1862
|
draw(): void;
|
|
1800
1863
|
}
|
|
1864
|
+
/**
|
|
1865
|
+
* Renderer class.
|
|
1866
|
+
* @deprecated - Use MRenderContext instead.
|
|
1867
|
+
* */
|
|
1868
|
+
declare class MRenderer extends MRenderContext {
|
|
1869
|
+
}
|
|
1801
1870
|
/** Playback buttons helper class. */
|
|
1802
1871
|
declare class MPlaybackButtons {
|
|
1803
1872
|
private playButton?;
|
|
@@ -2474,4 +2543,4 @@ declare class MExtensionLine extends MusicInterface {
|
|
|
2474
2543
|
getMusicObject(): ObjExtensionLine;
|
|
2475
2544
|
}
|
|
2476
2545
|
|
|
2477
|
-
export {
|
|
2546
|
+
export { MStaffSignature as $, type AnnotationText as A, MFermata as B, Connective as C, DivRect as D, MHeader as E, Fermata as F, MImage as G, MMeasure as H, MBarLineRight as I, MBarLineLeft as J, MStaffTabBarLine as K, type LyricsOptions as L, MDocument as M, type NoteOptions as N, MNoteGroup as O, MStaffNoteGroup as P, MTabNoteGroup as Q, type RestOptions as R, StaffPreset as S, type TupletOptions as T, MRest as U, type VoiceId as V, MStaffRest as W, MRhythmColumn as X, MScoreRow as Y, MStaff as Z, MTab as _, type ScoreConfiguration as a, MTabSignature as a0, MTabRhythm as a1, MSpecialText as a2, MText as a3, MLyrics as a4, MExtensionLine as a5, Clef as a6, type BaseConfig as a7, type StaffConfig as a8, type TabConfig as a9, getVoiceIds as aa, type StringNumber as ab, getStringNumbers as ac, getVerseNumbers as ad, Stem as ae, Arpeggio as af, type StaffTabOrGroup as ag, LyricsAlign as ah, LyricsHyphen as ai, DynamicsAnnotation as aj, TempoAnnotation as ak, PlayState as al, type PlayStateChangeListener as am, type MeasureOptions as b, type VerseNumber as c, type StaffTabOrGroups as d, Navigation as e, Annotation as f, Label as g, TieType as h, NoteAnchor as i, VerticalPosition as j, type ScoreEventType as k, ScoreEvent as l, ScoreStaffPosEvent as m, ScoreObjectEvent as n, type ScoreEventListener as o, MPlayer as p, MRenderContext as q, MRenderer as r, MPlaybackButtons as s, MusicInterface as t, MAccidental as u, MConnective as v, MArpeggio as w, MBeamGroup as x, MStaffBeamGroup as y, MEnding as z };
|