@tspro/web-music-score 5.2.0 → 5.4.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 +24 -0
- package/README.md +15 -12
- package/dist/audio/index.d.mts +1 -1
- package/dist/audio/index.d.ts +1 -1
- package/dist/audio/index.js +3 -3
- package/dist/audio/index.mjs +6 -6
- 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-LC5JMIVF.mjs → chunk-AUT4C6TY.mjs} +2 -2
- package/dist/{chunk-XUGM7SCC.mjs → chunk-MHDBTCVG.mjs} +21 -21
- package/dist/{chunk-6S5BDSCM.mjs → chunk-QGMOI7AP.mjs} +2 -2
- package/dist/chunk-ZWUBO5EW.mjs +37 -0
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +6 -31
- package/dist/{guitar-BsSayRsH.d.ts → guitar-CarHGDAt.d.ts} +1 -1
- package/dist/{guitar-DdexKdN6.d.mts → guitar-DXlB-9vK.d.mts} +1 -1
- package/dist/iife/audio-cg.global.js +1 -1
- package/dist/iife/index.global.js +18 -11
- package/dist/{music-objects-CwPOlqFi.d.ts → music-objects-3Esbz7ij.d.ts} +261 -381
- package/dist/{music-objects-CB05XryE.d.mts → music-objects-ONIuVUgs.d.mts} +261 -381
- package/dist/{note-CgCIBwvR.d.ts → note-CJuq5aBy.d.ts} +13 -1
- package/dist/{note-eA2xPPiG.d.mts → note-RVXvpfyV.d.mts} +13 -1
- package/dist/pieces/index.d.mts +13 -4
- 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 +10 -10
- package/dist/react-ui/index.d.ts +10 -10
- package/dist/react-ui/index.js +19 -21
- package/dist/react-ui/index.mjs +23 -25
- package/dist/{scale-CBW4eTz7.d.ts → scale-C8gHC448.d.mts} +3 -3
- package/dist/{scale-DQP3b9Zx.d.mts → scale-DulPFco_.d.ts} +3 -3
- package/dist/score/index.d.mts +235 -7
- package/dist/score/index.d.ts +235 -7
- package/dist/score/index.js +2064 -1807
- package/dist/score/index.mjs +1897 -1671
- package/dist/{tempo-dkctPkCS.d.mts → tempo-BlCGZuYg.d.mts} +14 -2
- package/dist/{tempo-DMt3iwz9.d.ts → tempo-BnUjm25M.d.ts} +14 -2
- package/dist/theory/index.d.mts +6 -6
- package/dist/theory/index.d.ts +6 -6
- package/dist/theory/index.js +88 -86
- package/dist/theory/index.mjs +85 -81
- package/package.json +5 -4
|
@@ -1,207 +1,6 @@
|
|
|
1
|
-
import { N as Note, A as Accidental } from './note-
|
|
2
|
-
import { R as RhythmProps, N as NoteLength, i as NoteLengthStr,
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* DivRect class, left, top, right, bottom rectangle divided into four sections by centerX, centerY.
|
|
7
|
-
*/
|
|
8
|
-
declare class DivRect {
|
|
9
|
-
left: number;
|
|
10
|
-
centerX: number;
|
|
11
|
-
right: number;
|
|
12
|
-
top: number;
|
|
13
|
-
centerY: number;
|
|
14
|
-
bottom: number;
|
|
15
|
-
/**
|
|
16
|
-
* Create rectangle with all zero values.
|
|
17
|
-
*/
|
|
18
|
-
constructor();
|
|
19
|
-
/**
|
|
20
|
-
* Create rectangle with left, right, top, bottom.
|
|
21
|
-
* Properties centerX and centerY will be centered in the middle.
|
|
22
|
-
*
|
|
23
|
-
* @param left - Left coordinate.
|
|
24
|
-
* @param right - Right coordinate.
|
|
25
|
-
* @param top - Top coordinate.
|
|
26
|
-
* @param bottom - Bottom coordinate.
|
|
27
|
-
*/
|
|
28
|
-
constructor(left: number, right: number, top: number, bottom: number);
|
|
29
|
-
/**
|
|
30
|
-
* Create rectangle with full arguments.
|
|
31
|
-
*
|
|
32
|
-
* @param left - Left coordinate.
|
|
33
|
-
* @param centerX - Center x-coordinate.
|
|
34
|
-
* @param right - Right coordinate.
|
|
35
|
-
* @param top - Top coordinate.
|
|
36
|
-
* @param centerY - Center y-coordinate.
|
|
37
|
-
* @param bottom - Bottom coordinate.
|
|
38
|
-
*/
|
|
39
|
-
constructor(left: number, centerX: number, right: number, top: number, centerY: number, bottom: number);
|
|
40
|
-
/**
|
|
41
|
-
* Create rect from basic left, top, width and height arguments.
|
|
42
|
-
*
|
|
43
|
-
* @param left - Left coordinate.
|
|
44
|
-
* @param top - Top coordinate.
|
|
45
|
-
* @param width - With.
|
|
46
|
-
* @param height - Height.
|
|
47
|
-
* @returns - DivRect.
|
|
48
|
-
*/
|
|
49
|
-
static create(left: number, top: number, width: number, height: number): DivRect;
|
|
50
|
-
/**
|
|
51
|
-
* Create rect from centerX, centerY, width, height arguments.
|
|
52
|
-
*
|
|
53
|
-
* @param centerX - Center x-coordinate.
|
|
54
|
-
* @param centerY - Center y-coordinate.
|
|
55
|
-
* @param width - Width.
|
|
56
|
-
* @param height - Height.
|
|
57
|
-
* @returns - DivRect.
|
|
58
|
-
*/
|
|
59
|
-
static createCentered(centerX: number, centerY: number, width: number, height: number): DivRect;
|
|
60
|
-
/**
|
|
61
|
-
* Create rect from sections.
|
|
62
|
-
*
|
|
63
|
-
* @param leftw - Left section width.
|
|
64
|
-
* @param rightw - Right section width.
|
|
65
|
-
* @param toph - Top section height.
|
|
66
|
-
* @param bottomh - Bottomsection height.
|
|
67
|
-
* @returns - DivRect.
|
|
68
|
-
*/
|
|
69
|
-
static createSections(leftw: number, rightw: number, toph: number, bottomh: number): DivRect;
|
|
70
|
-
/**
|
|
71
|
-
* Width getter.
|
|
72
|
-
*/
|
|
73
|
-
get width(): number;
|
|
74
|
-
/**
|
|
75
|
-
* Height getter.
|
|
76
|
-
*/
|
|
77
|
-
get height(): number;
|
|
78
|
-
/**
|
|
79
|
-
* Left section width getter.
|
|
80
|
-
*/
|
|
81
|
-
get leftw(): number;
|
|
82
|
-
/**
|
|
83
|
-
* Right section width getter.
|
|
84
|
-
*/
|
|
85
|
-
get rightw(): number;
|
|
86
|
-
/**
|
|
87
|
-
* Top section height getter.
|
|
88
|
-
*/
|
|
89
|
-
get toph(): number;
|
|
90
|
-
/**
|
|
91
|
-
* Bottom section height getter.
|
|
92
|
-
*/
|
|
93
|
-
get bottomh(): number;
|
|
94
|
-
/**
|
|
95
|
-
* Does this Rect contain given (x, y)-point?
|
|
96
|
-
*
|
|
97
|
-
* @param x - X-coordinate.
|
|
98
|
-
* @param y - Y-coordinate.
|
|
99
|
-
* @returns - True/false.
|
|
100
|
-
*/
|
|
101
|
-
contains(x: number, y: number): boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Do a and b rects overlap?
|
|
104
|
-
*
|
|
105
|
-
* @param a - DivRect a.
|
|
106
|
-
* @param b - DivRect b.
|
|
107
|
-
* @returns - True/false.
|
|
108
|
-
*/
|
|
109
|
-
static overlap(a: DivRect, b: DivRect): boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Do horizontal measures of a and b rects overlap?
|
|
112
|
-
*
|
|
113
|
-
* @param a - DivRect a.
|
|
114
|
-
* @param b - DivRect b.
|
|
115
|
-
* @returns - True/false.
|
|
116
|
-
*/
|
|
117
|
-
static overlapX(a: DivRect, b: DivRect): boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Check if this Rect equals with given Rect.
|
|
120
|
-
* @param a - DivRect a.
|
|
121
|
-
* @param b - DivRect b.
|
|
122
|
-
* @returns - True/false.
|
|
123
|
-
*/
|
|
124
|
-
static equals(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
125
|
-
/**
|
|
126
|
-
* Check if frame of this Rect equals with given Rect, ignoring center x- and center y-coordinates.
|
|
127
|
-
*
|
|
128
|
-
* @param a - DivRect a.
|
|
129
|
-
* @param b - DivRect b.
|
|
130
|
-
* @returns - True/false.
|
|
131
|
-
*/
|
|
132
|
-
static equalsFrame(a: DivRect | null | undefined, b: DivRect | null | undefined): boolean;
|
|
133
|
-
/**
|
|
134
|
-
* Created duplicate of this Rect.
|
|
135
|
-
*
|
|
136
|
-
* @returns - Duplicate.
|
|
137
|
-
*/
|
|
138
|
-
copy(): DivRect;
|
|
139
|
-
/**
|
|
140
|
-
* Move this rect by (dx, dy). Modifies this Rect.
|
|
141
|
-
*
|
|
142
|
-
* @param dx - Offset amount in x-direction.
|
|
143
|
-
* @param dy - Offset amount in y-direction.
|
|
144
|
-
* @returns - This DivRect instance.
|
|
145
|
-
*/
|
|
146
|
-
offsetInPlace(dx: number, dy: number): DivRect;
|
|
147
|
-
/**
|
|
148
|
-
* Move this rect by (dx, dy). Immutable, returns modified copy.
|
|
149
|
-
*
|
|
150
|
-
* @param dx - Offset amount in x-direction.
|
|
151
|
-
* @param dy - Offset amount in y-direction.
|
|
152
|
-
* @returns - DivRect copy with applied offset.
|
|
153
|
-
*/
|
|
154
|
-
offsetCopy(dx: number, dy: number): DivRect;
|
|
155
|
-
/**
|
|
156
|
-
* Expand this Rect by given Rect. Modifies this Rect.
|
|
157
|
-
*
|
|
158
|
-
* @param rect - DivRect to expand this instance with.
|
|
159
|
-
* @returns - This DivRect instance.
|
|
160
|
-
*/
|
|
161
|
-
expandInPlace(rect: DivRect): DivRect;
|
|
162
|
-
/**
|
|
163
|
-
* Expand this Rect by given Rect. Immutable, returns modified copy.
|
|
164
|
-
*
|
|
165
|
-
* @param rect - DivRect to expand this instance with.
|
|
166
|
-
* @returns - Expanded copy of this DivRect.
|
|
167
|
-
*/
|
|
168
|
-
expandCopy(rect: DivRect): DivRect;
|
|
169
|
-
/**
|
|
170
|
-
* Clip this Rect by given Rect. Mmodifies this Rect.
|
|
171
|
-
*
|
|
172
|
-
* @param clipRect - DivRect to clip this instance with.
|
|
173
|
-
* @returns - This DivRect instance.
|
|
174
|
-
*/
|
|
175
|
-
clipInPlace(clipRect: DivRect): DivRect;
|
|
176
|
-
/**
|
|
177
|
-
* Clip this Rect by given Rect. Immutable, return modified copy.
|
|
178
|
-
*
|
|
179
|
-
* @param clipRect - DivRecto to clip this instance with.
|
|
180
|
-
* @returns - Clipped DivRect copy.
|
|
181
|
-
*/
|
|
182
|
-
clipCopy(clipRect: DivRect): DivRect;
|
|
183
|
-
/**
|
|
184
|
-
* Scale Rect. Anchor pos is (centerX, centerY). Modifies this Rect.
|
|
185
|
-
*
|
|
186
|
-
* @param scaleX - Scale x-amount.
|
|
187
|
-
* @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
|
|
188
|
-
* @returns This DivRect instance.
|
|
189
|
-
*/
|
|
190
|
-
scaleInPlace(scaleX: number, scaleY?: number): DivRect;
|
|
191
|
-
/**
|
|
192
|
-
* Scale Rect. Anchor pos is (centerX, centerY). Immutable, returns modified copy.
|
|
193
|
-
*
|
|
194
|
-
* @param scaleX - Scale x-amount.
|
|
195
|
-
* @param scaleY - Scale y-amount. If undefined then scale x-amount is used.
|
|
196
|
-
* @returns Scaled copy of this DivRect.
|
|
197
|
-
*/
|
|
198
|
-
scaleCopy(scaleX: number, scaleY?: number): DivRect;
|
|
199
|
-
/**
|
|
200
|
-
* Get this DivRect instance.
|
|
201
|
-
* @returns - This DivRect instance.
|
|
202
|
-
*/
|
|
203
|
-
getRect(): DivRect;
|
|
204
|
-
}
|
|
1
|
+
import { N as Note, A as Accidental } from './note-RVXvpfyV.mjs';
|
|
2
|
+
import { R as RhythmProps, N as NoteLength, i as NoteLengthStr, l as TupletRatio, d as Tempo, K as KeySignature, b as TimeSignature } from './tempo-BlCGZuYg.mjs';
|
|
3
|
+
import { AnchoredRect, Rect, Vec } from '@tspro/ts-utils-lib';
|
|
205
4
|
|
|
206
5
|
/** Staff preset values for score configuration. */
|
|
207
6
|
declare enum StaffPreset {
|
|
@@ -229,8 +28,12 @@ declare enum Clef {
|
|
|
229
28
|
type BaseConfig = {
|
|
230
29
|
/** Name for this staff/tab config. */
|
|
231
30
|
name?: string;
|
|
232
|
-
/** Voice
|
|
233
|
-
|
|
31
|
+
/** Voice id that is presented in this staff/tab. Single value or array.*/
|
|
32
|
+
voiceId?: VoiceId | VoiceId[];
|
|
33
|
+
/** @deprecated - Use `voiceId` instead. */
|
|
34
|
+
voiceIds?: VoiceId | VoiceId[];
|
|
35
|
+
/** Staves/tabs with same instrument name a re grouped together with left brace. */
|
|
36
|
+
instrument?: string;
|
|
234
37
|
};
|
|
235
38
|
/** Staff config to add staff notation line in score configuration. */
|
|
236
39
|
type StaffConfig = BaseConfig & {
|
|
@@ -265,14 +68,20 @@ type ScoreConfiguration = StaffConfig | TabConfig | (StaffConfig | TabConfig)[];
|
|
|
265
68
|
type VoiceId = 0 | 1 | 2 | 3;
|
|
266
69
|
/** Get supported voice ids. Returns [0, 1, 2, 3]. */
|
|
267
70
|
declare function getVoiceIds(): ReadonlyArray<VoiceId>;
|
|
71
|
+
declare function isVoiceId(voiceId: unknown): voiceId is VoiceId;
|
|
72
|
+
declare function validateVoiceId(voiceId: unknown): VoiceId;
|
|
268
73
|
/** Strng number. */
|
|
269
74
|
type StringNumber = 1 | 2 | 3 | 4 | 5 | 6;
|
|
270
75
|
/** Get string numbers. Returns [0, 1, 2, 3, 4, 5]. */
|
|
271
76
|
declare function getStringNumbers(): ReadonlyArray<StringNumber>;
|
|
77
|
+
declare function isStringNumber(stringNum: unknown): stringNum is VerseNumber;
|
|
78
|
+
declare function validateStringNumber(stringNum: unknown): VerseNumber;
|
|
272
79
|
/** Verse number. */
|
|
273
80
|
type VerseNumber = 1 | 2 | 3;
|
|
274
81
|
/** Get supported verse numbers. Returns [1, 2, 3]. */
|
|
275
82
|
declare function getVerseNumbers(): ReadonlyArray<VerseNumber>;
|
|
83
|
+
declare function isVerseNumber(verse: unknown): verse is VerseNumber;
|
|
84
|
+
declare function validateVerseNumber(verseNum: unknown): VerseNumber;
|
|
276
85
|
/** Stem direction enum. */
|
|
277
86
|
declare enum Stem {
|
|
278
87
|
/** Auto stem direction. */
|
|
@@ -333,6 +142,11 @@ declare enum VerticalPosition {
|
|
|
333
142
|
type StaffTabOrGroup = number | string;
|
|
334
143
|
/** Staff/tab/group snglevalue or array of values. */
|
|
335
144
|
type StaffTabOrGroups = StaffTabOrGroup | StaffTabOrGroup[];
|
|
145
|
+
/** Measure options. */
|
|
146
|
+
type MeasureOptions = {
|
|
147
|
+
/** show measure number? */
|
|
148
|
+
showNumber?: boolean;
|
|
149
|
+
};
|
|
336
150
|
/** Options for notes/chords. */
|
|
337
151
|
type NoteOptions = {
|
|
338
152
|
/** Stem direction. */
|
|
@@ -513,9 +327,9 @@ declare class ObjAccidental extends MusicObject {
|
|
|
513
327
|
constructor(parent: MusicObject, diatonicId: number, accidental: Accidental, color?: string);
|
|
514
328
|
getMusicInterface(): MAccidental;
|
|
515
329
|
pick(x: number, y: number): MusicObject[];
|
|
516
|
-
layout(
|
|
330
|
+
layout(ctx: RenderContext): void;
|
|
517
331
|
offset(dx: number, dy: number): void;
|
|
518
|
-
draw(
|
|
332
|
+
draw(ctx: RenderContext): void;
|
|
519
333
|
}
|
|
520
334
|
|
|
521
335
|
type BoxType = "square" | "rectangle" | "circle" | "ellipse";
|
|
@@ -551,40 +365,42 @@ declare class ObjText extends MusicObject {
|
|
|
551
365
|
updateAnchorX(anchorX: number): void;
|
|
552
366
|
updateAnchorY(anchorY: number): void;
|
|
553
367
|
pick(x: number, y: number): MusicObject[];
|
|
554
|
-
layout(
|
|
368
|
+
layout(ctx: RenderContext): void;
|
|
555
369
|
offset(dx: number, dy: number): void;
|
|
556
|
-
draw(
|
|
370
|
+
draw(ctx: RenderContext): void;
|
|
557
371
|
}
|
|
558
372
|
|
|
559
373
|
type NotationLineObject = {
|
|
560
|
-
getRect: () =>
|
|
374
|
+
getRect: () => AnchoredRect;
|
|
561
375
|
offset?: (dx: number, dy: number) => void;
|
|
562
376
|
offsetInPlace?: (dx: number, dy: number) => void;
|
|
563
377
|
};
|
|
564
378
|
declare abstract class ObjNotationLine extends MusicObject {
|
|
379
|
+
readonly row: ObjScoreRow;
|
|
565
380
|
protected readonly objects: NotationLineObject[];
|
|
566
381
|
abstract readonly id: number;
|
|
567
382
|
abstract readonly name: string;
|
|
568
383
|
private layoutGroups;
|
|
569
|
-
constructor(
|
|
384
|
+
constructor(row: ObjScoreRow);
|
|
570
385
|
addObject(o: NotationLineObject): void;
|
|
571
386
|
removeObjects(): void;
|
|
572
387
|
getLayoutGroup(lauoutGroupId: LayoutGroupId): LayoutGroup;
|
|
573
|
-
resetLayoutGroups(
|
|
574
|
-
layoutLayoutGroups(
|
|
388
|
+
resetLayoutGroups(ctx: RenderContext): void;
|
|
389
|
+
layoutLayoutGroups(ctx: RenderContext): void;
|
|
575
390
|
private setObjectY;
|
|
576
391
|
private alignObjectsY;
|
|
577
|
-
layoutLayoutGroup(
|
|
392
|
+
layoutLayoutGroup(ctx: RenderContext, layoutGroup: LayoutGroup, verticalPos: VerticalPos): void;
|
|
393
|
+
abstract getConfig(): StaffConfig | TabConfig;
|
|
578
394
|
abstract calcTop(): number;
|
|
579
395
|
abstract calcBottom(): number;
|
|
580
396
|
abstract getTopLineY(): number;
|
|
581
397
|
abstract getBottomLineY(): number;
|
|
582
398
|
abstract containsVoiceId(voiceId: number): boolean;
|
|
583
399
|
abstract containsDiatonicId(diatonicId: number): boolean;
|
|
584
|
-
abstract layoutWidth(
|
|
585
|
-
abstract layoutHeight(
|
|
400
|
+
abstract layoutWidth(ctx: RenderContext): void;
|
|
401
|
+
abstract layoutHeight(ctx: RenderContext): void;
|
|
586
402
|
abstract offset(dx: number, dy: number): void;
|
|
587
|
-
abstract draw(
|
|
403
|
+
abstract draw(ctx: RenderContext): void;
|
|
588
404
|
}
|
|
589
405
|
declare class ObjStaff extends ObjNotationLine {
|
|
590
406
|
readonly row: ObjScoreRow;
|
|
@@ -605,6 +421,7 @@ declare class ObjStaff extends ObjNotationLine {
|
|
|
605
421
|
getMusicInterface(): MStaff;
|
|
606
422
|
get isOctaveDown(): boolean;
|
|
607
423
|
get name(): string;
|
|
424
|
+
getConfig(): StaffConfig | TabConfig;
|
|
608
425
|
getTopLineY(): number;
|
|
609
426
|
getMiddleLineY(): number;
|
|
610
427
|
getBottomLineY(): number;
|
|
@@ -617,14 +434,14 @@ declare class ObjStaff extends ObjNotationLine {
|
|
|
617
434
|
getDiatonicIdAt(y: number): number | undefined;
|
|
618
435
|
isLine(diatonicId: number): boolean;
|
|
619
436
|
isSpace(diatonicId: number): boolean;
|
|
620
|
-
containsVoiceId(voiceId:
|
|
437
|
+
containsVoiceId(voiceId: VoiceId): boolean;
|
|
621
438
|
calcTop(): number;
|
|
622
439
|
calcBottom(): number;
|
|
623
440
|
pick(x: number, y: number): MusicObject[];
|
|
624
|
-
layoutHeight(
|
|
625
|
-
layoutWidth(
|
|
441
|
+
layoutHeight(ctx: RenderContext): void;
|
|
442
|
+
layoutWidth(ctx: RenderContext): void;
|
|
626
443
|
offset(dx: number, dy: number): void;
|
|
627
|
-
draw(
|
|
444
|
+
draw(ctx: RenderContext): void;
|
|
628
445
|
}
|
|
629
446
|
declare class ObjTab extends ObjNotationLine {
|
|
630
447
|
readonly row: ObjScoreRow;
|
|
@@ -638,6 +455,7 @@ declare class ObjTab extends ObjNotationLine {
|
|
|
638
455
|
constructor(row: ObjScoreRow, tabConfig: TabConfig, id: number);
|
|
639
456
|
getMusicInterface(): MTab;
|
|
640
457
|
get name(): string;
|
|
458
|
+
getConfig(): StaffConfig | TabConfig;
|
|
641
459
|
getTuningName(): string | undefined;
|
|
642
460
|
getTuningStrings(): ReadonlyArray<Note>;
|
|
643
461
|
/** Return Y coordinate of string. */
|
|
@@ -648,26 +466,26 @@ declare class ObjTab extends ObjNotationLine {
|
|
|
648
466
|
getBottomLineY(): number;
|
|
649
467
|
getTop(): number;
|
|
650
468
|
getBottom(): number;
|
|
651
|
-
containsVoiceId(voiceId:
|
|
469
|
+
containsVoiceId(voiceId: VoiceId): boolean;
|
|
652
470
|
containsDiatonicId(diatonicId: number): boolean;
|
|
653
471
|
calcTop(): number;
|
|
654
472
|
calcBottom(): number;
|
|
655
473
|
pick(x: number, y: number): MusicObject[];
|
|
656
|
-
layoutHeight(
|
|
657
|
-
layoutWidth(
|
|
474
|
+
layoutHeight(ctx: RenderContext): void;
|
|
475
|
+
layoutWidth(ctx: RenderContext): void;
|
|
658
476
|
offset(dx: number, dy: number): void;
|
|
659
|
-
draw(
|
|
477
|
+
draw(ctx: RenderContext): void;
|
|
660
478
|
}
|
|
661
479
|
|
|
662
480
|
declare class ObjStaffNoteGroup extends MusicObject {
|
|
663
481
|
readonly staff: ObjStaff;
|
|
664
482
|
readonly noteGroup: ObjNoteGroup;
|
|
665
|
-
noteHeadRects:
|
|
666
|
-
dotRects:
|
|
483
|
+
noteHeadRects: AnchoredRect[];
|
|
484
|
+
dotRects: AnchoredRect[];
|
|
667
485
|
accidentals: ObjAccidental[];
|
|
668
|
-
stemTip?:
|
|
669
|
-
stemBase?:
|
|
670
|
-
flagRects:
|
|
486
|
+
stemTip?: AnchoredRect;
|
|
487
|
+
stemBase?: AnchoredRect;
|
|
488
|
+
flagRects: AnchoredRect[];
|
|
671
489
|
private prevTopNoteY;
|
|
672
490
|
private prevBottomNoteY;
|
|
673
491
|
readonly mi: MStaffNoteGroup;
|
|
@@ -675,7 +493,7 @@ declare class ObjStaffNoteGroup extends MusicObject {
|
|
|
675
493
|
getMusicInterface(): MusicInterface;
|
|
676
494
|
pick(x: number, y: number): MusicObject[];
|
|
677
495
|
updateRect(): void;
|
|
678
|
-
getRect():
|
|
496
|
+
getRect(): AnchoredRect;
|
|
679
497
|
offset(dx: number, dy: number): void;
|
|
680
498
|
}
|
|
681
499
|
declare class ObjTabNoteGroup extends MusicObject {
|
|
@@ -693,11 +511,12 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
693
511
|
readonly col: ObjRhythmColumn;
|
|
694
512
|
readonly voiceId: VoiceId;
|
|
695
513
|
readonly notes: ReadonlyArray<Note>;
|
|
696
|
-
readonly
|
|
697
|
-
readonly
|
|
698
|
-
readonly
|
|
699
|
-
|
|
700
|
-
|
|
514
|
+
readonly options?: NoteOptions | undefined;
|
|
515
|
+
readonly setDiatonicId: number;
|
|
516
|
+
readonly setStringsNumbers?: StringNumber[];
|
|
517
|
+
private runningDiatonicId;
|
|
518
|
+
private runningStemDir;
|
|
519
|
+
private runningStringNumbers;
|
|
701
520
|
readonly color: string;
|
|
702
521
|
readonly staccato: boolean;
|
|
703
522
|
readonly diamond: boolean;
|
|
@@ -711,16 +530,21 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
711
530
|
private beamGroup?;
|
|
712
531
|
private readonly staffObjects;
|
|
713
532
|
private readonly tabObjects;
|
|
533
|
+
private isNoteDisplaced;
|
|
714
534
|
readonly mi: MNoteGroup;
|
|
715
|
-
constructor(col: ObjRhythmColumn, voiceId: VoiceId, notes: ReadonlyArray<Note>, noteLength: NoteLength | NoteLengthStr, options?: NoteOptions, tupletRatio?: TupletRatio);
|
|
535
|
+
constructor(col: ObjRhythmColumn, voiceId: VoiceId, notes: ReadonlyArray<Note>, noteLength: NoteLength | NoteLengthStr, options?: NoteOptions | undefined, tupletRatio?: TupletRatio);
|
|
716
536
|
getMusicInterface(): MNoteGroup;
|
|
717
537
|
get doc(): ObjDocument;
|
|
718
538
|
get measure(): ObjMeasure;
|
|
719
539
|
get row(): ObjScoreRow;
|
|
540
|
+
get minDiatonicId(): number;
|
|
541
|
+
get maxDiatonicId(): number;
|
|
542
|
+
getDiatonicId(staff?: ObjStaff): number;
|
|
720
543
|
get stemDir(): Stem.Up | Stem.Down;
|
|
544
|
+
setNoteDisplacement(note: Note, isDisplaced: boolean): void;
|
|
721
545
|
enableConnective(line: ObjNotationLine): boolean;
|
|
722
546
|
startConnective(connectiveProps: ConnectiveProps): void;
|
|
723
|
-
|
|
547
|
+
updateRunningArguments(diatonicId: number, stemDir: Stem.Up | Stem.Down, stringNumbers: StringNumber[]): void;
|
|
724
548
|
pick(x: number, y: number): MusicObject[];
|
|
725
549
|
getTopNote(): Note;
|
|
726
550
|
getBottomNote(): Note;
|
|
@@ -728,8 +552,8 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
728
552
|
x: number;
|
|
729
553
|
y: number;
|
|
730
554
|
};
|
|
731
|
-
getFretNumberString(noteIndex: number):
|
|
732
|
-
getFretNumber(
|
|
555
|
+
getFretNumberString(noteIndex: number): StringNumber | undefined;
|
|
556
|
+
getFretNumber(tab: ObjTab, noteIndex: number): number | undefined;
|
|
733
557
|
private getNextNoteGroup;
|
|
734
558
|
collectConnectiveProps(): void;
|
|
735
559
|
removeConnectiveProps(): void;
|
|
@@ -743,7 +567,7 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
743
567
|
y: number;
|
|
744
568
|
stemHeight: number;
|
|
745
569
|
} | undefined)[];
|
|
746
|
-
getStemHeight(
|
|
570
|
+
getStemHeight(ctx: RenderContext): number;
|
|
747
571
|
hasBeamCount(): boolean;
|
|
748
572
|
getLeftBeamCount(): number;
|
|
749
573
|
getRightBeamCount(): number;
|
|
@@ -754,12 +578,12 @@ declare class ObjNoteGroup extends MusicObject {
|
|
|
754
578
|
visibleInStaff(staff: ObjStaff): boolean;
|
|
755
579
|
getPlayTicks(note: Note): number;
|
|
756
580
|
updateAccidentalState(accState: AccidentalState): void;
|
|
757
|
-
layout(
|
|
581
|
+
layout(ctx: RenderContext, accState: AccidentalState): void;
|
|
758
582
|
updateRect(): void;
|
|
759
583
|
setStemTipY(staff: ObjStaff, stemTipY: number): void;
|
|
760
584
|
offset(dx: number, dy: number): void;
|
|
761
|
-
draw(
|
|
762
|
-
getDotVerticalDisplacement(staff: ObjStaff, diatonicId: number, stemDir: Stem):
|
|
585
|
+
draw(ctx: RenderContext): void;
|
|
586
|
+
getDotVerticalDisplacement(staff: ObjStaff, diatonicId: number, stemDir: Stem): 0 | 1 | -1;
|
|
763
587
|
static hasSameNotes(ng1: ObjNoteGroup, ng2: ObjNoteGroup): boolean;
|
|
764
588
|
}
|
|
765
589
|
|
|
@@ -778,7 +602,7 @@ declare class BeamPoint {
|
|
|
778
602
|
bottomBeamsHeight: number;
|
|
779
603
|
constructor(staff: ObjStaff, beamGroup: ObjBeamGroup, symbol: RhythmSymbol, x: number, y: number);
|
|
780
604
|
offset(dx: number, dy: number): void;
|
|
781
|
-
getRect():
|
|
605
|
+
getRect(): AnchoredRect;
|
|
782
606
|
}
|
|
783
607
|
declare class ObjStaffBeamGroup extends MusicObject {
|
|
784
608
|
readonly staff: ObjStaff;
|
|
@@ -800,6 +624,7 @@ declare class ObjBeamGroup extends MusicObject {
|
|
|
800
624
|
private readonly type;
|
|
801
625
|
private readonly staffObjects;
|
|
802
626
|
private constructor();
|
|
627
|
+
get stemDir(): Stem.Up | Stem.Down;
|
|
803
628
|
private get showTupletRatio();
|
|
804
629
|
static createBeam(noteGroups: ObjNoteGroup[]): boolean;
|
|
805
630
|
static createOldStyleTriplet(symbols: RhythmSymbol[]): number;
|
|
@@ -814,13 +639,12 @@ declare class ObjBeamGroup extends MusicObject {
|
|
|
814
639
|
getSymbols(): ReadonlyArray<RhythmSymbol>;
|
|
815
640
|
getFirstSymbol(): RhythmSymbol | undefined;
|
|
816
641
|
getLastSymbol(): RhythmSymbol | undefined;
|
|
817
|
-
get stemDir(): Stem.Up | Stem.Down;
|
|
818
642
|
get color(): string;
|
|
819
|
-
layout(
|
|
643
|
+
layout(ctx: RenderContext): void;
|
|
820
644
|
updateRect(): void;
|
|
821
645
|
updateStemTips(): void;
|
|
822
646
|
offset(dx: number, dy: number): void;
|
|
823
|
-
draw(
|
|
647
|
+
draw(ctx: RenderContext): void;
|
|
824
648
|
private setBeamCounts;
|
|
825
649
|
private setTupletBeamCounts;
|
|
826
650
|
}
|
|
@@ -828,8 +652,8 @@ declare class ObjBeamGroup extends MusicObject {
|
|
|
828
652
|
declare class ObjStaffRest extends MusicObject {
|
|
829
653
|
readonly staff: ObjStaff;
|
|
830
654
|
readonly rest: ObjRest;
|
|
831
|
-
restRect:
|
|
832
|
-
dotRects:
|
|
655
|
+
restRect: AnchoredRect;
|
|
656
|
+
dotRects: AnchoredRect[];
|
|
833
657
|
readonly mi: MStaffRest;
|
|
834
658
|
constructor(staff: ObjStaff, rest: ObjRest);
|
|
835
659
|
getMusicInterface(): MusicInterface;
|
|
@@ -840,22 +664,27 @@ declare class ObjStaffRest extends MusicObject {
|
|
|
840
664
|
declare class ObjRest extends MusicObject {
|
|
841
665
|
readonly col: ObjRhythmColumn;
|
|
842
666
|
readonly voiceId: VoiceId;
|
|
843
|
-
readonly
|
|
844
|
-
readonly ownDiatonicId: number;
|
|
667
|
+
readonly options?: RestOptions | undefined;
|
|
845
668
|
readonly color: string;
|
|
846
669
|
readonly hide: boolean;
|
|
847
670
|
readonly oldStyleTriplet: boolean;
|
|
848
671
|
readonly rhythmProps: RhythmProps;
|
|
672
|
+
static UndefinedDiatonicId: number;
|
|
673
|
+
readonly setDiatonicId: number;
|
|
674
|
+
private runningDiatonicId;
|
|
675
|
+
private runningStemDir;
|
|
849
676
|
private beamGroup?;
|
|
850
677
|
readonly staffObjects: ObjStaffRest[];
|
|
851
678
|
readonly mi: MRest;
|
|
852
|
-
constructor(col: ObjRhythmColumn, voiceId: VoiceId, noteLength: NoteLength | NoteLengthStr, options?: RestOptions, tupletRatio?: TupletRatio);
|
|
679
|
+
constructor(col: ObjRhythmColumn, voiceId: VoiceId, noteLength: NoteLength | NoteLengthStr, options?: RestOptions | undefined, tupletRatio?: TupletRatio);
|
|
853
680
|
getMusicInterface(): MRest;
|
|
854
681
|
get doc(): ObjDocument;
|
|
855
682
|
get measure(): ObjMeasure;
|
|
856
683
|
get row(): ObjScoreRow;
|
|
857
684
|
get noteLength(): NoteLength;
|
|
685
|
+
getDiatonicId(staff?: ObjStaff): number;
|
|
858
686
|
get stemDir(): Stem.Up | Stem.Down;
|
|
687
|
+
updateRunningArguments(diatonicId: number, stemDir: Stem.Up | Stem.Down, stringNumbers: StringNumber[]): void;
|
|
859
688
|
getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
|
|
860
689
|
pick(x: number, y: number): MusicObject[];
|
|
861
690
|
getBeamGroup(): ObjBeamGroup | undefined;
|
|
@@ -872,38 +701,32 @@ declare class ObjRest extends MusicObject {
|
|
|
872
701
|
visibleInStaff(staff: ObjStaff): boolean;
|
|
873
702
|
private getRestDotVerticalDisplacement;
|
|
874
703
|
updateAccidentalState(accState: AccidentalState): void;
|
|
875
|
-
layout(
|
|
704
|
+
layout(ctx: RenderContext, accState: AccidentalState): void;
|
|
876
705
|
updateRect(): void;
|
|
877
706
|
offset(dx: number, dy: number): void;
|
|
878
|
-
draw(
|
|
707
|
+
draw(ctx: RenderContext): void;
|
|
879
708
|
}
|
|
880
709
|
|
|
881
|
-
declare class LyricsContainer {
|
|
882
|
-
readonly col: ObjRhythmColumn;
|
|
883
|
-
readonly lyricsObjects: ObjLyrics[];
|
|
884
|
-
readonly rhythmProps: RhythmProps;
|
|
885
|
-
constructor(col: ObjRhythmColumn, lyricsLength: NoteLength);
|
|
886
|
-
addLyricsObject(lyricsObj: ObjLyrics): void;
|
|
887
|
-
}
|
|
888
710
|
declare class ObjLyrics extends MusicObject {
|
|
889
711
|
readonly col: ObjRhythmColumn;
|
|
890
712
|
readonly verse: VerseNumber;
|
|
891
713
|
readonly line: ObjNotationLine;
|
|
892
714
|
readonly vpos: VerticalPos;
|
|
893
715
|
private nextLyricsObject?;
|
|
716
|
+
readonly rhythmProps: RhythmProps;
|
|
894
717
|
private readonly color;
|
|
895
718
|
private readonly hyphen?;
|
|
896
719
|
private readonly text;
|
|
897
720
|
readonly mi: MLyrics;
|
|
898
|
-
constructor(col: ObjRhythmColumn, verse: VerseNumber, line: ObjNotationLine, vpos: VerticalPos, lyricsText: string, lyricsOptions?: LyricsOptions);
|
|
721
|
+
constructor(col: ObjRhythmColumn, verse: VerseNumber, line: ObjNotationLine, vpos: VerticalPos, lyricsLength: NoteLength, lyricsText: string, lyricsOptions?: LyricsOptions);
|
|
899
722
|
getMusicInterface(): MLyrics;
|
|
900
723
|
get measure(): ObjMeasure;
|
|
901
724
|
getText(): string;
|
|
902
725
|
setNextLyricsObject(lyricsObj: ObjLyrics): void;
|
|
903
726
|
pick(x: number, y: number): MusicObject[];
|
|
904
|
-
layout(
|
|
727
|
+
layout(ctx: RenderContext): void;
|
|
905
728
|
offset(dx: number, dy: number): void;
|
|
906
|
-
draw(
|
|
729
|
+
draw(ctx: RenderContext): void;
|
|
907
730
|
}
|
|
908
731
|
|
|
909
732
|
type ScorePlayerNote = {
|
|
@@ -917,14 +740,13 @@ declare class ObjRhythmColumn extends MusicObject {
|
|
|
917
740
|
readonly measure: ObjMeasure;
|
|
918
741
|
readonly positionTicks: number;
|
|
919
742
|
private readonly voiceSymbol;
|
|
920
|
-
private readonly
|
|
743
|
+
private readonly lyricsObject;
|
|
921
744
|
private minDiatonicId?;
|
|
922
745
|
private maxDiatonicId?;
|
|
923
746
|
private staffMinDiatonicId;
|
|
924
747
|
private staffMaxDiatonicId;
|
|
925
748
|
private arpeggioDir;
|
|
926
749
|
private arpeggios;
|
|
927
|
-
private noteHeadDisplacements;
|
|
928
750
|
private readonly playerProps;
|
|
929
751
|
private needLayout;
|
|
930
752
|
private shapeRects;
|
|
@@ -944,8 +766,7 @@ declare class ObjRhythmColumn extends MusicObject {
|
|
|
944
766
|
*/
|
|
945
767
|
getNextColumn(): ObjRhythmColumn | undefined;
|
|
946
768
|
getTicksToNextColumn(): number;
|
|
947
|
-
getShapeRects():
|
|
948
|
-
getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
|
|
769
|
+
getShapeRects(): AnchoredRect[];
|
|
949
770
|
get doc(): ObjDocument;
|
|
950
771
|
get row(): ObjScoreRow;
|
|
951
772
|
pick(x: number, y: number): MusicObject[];
|
|
@@ -953,18 +774,18 @@ declare class ObjRhythmColumn extends MusicObject {
|
|
|
953
774
|
getArpeggioDir(): Arpeggio;
|
|
954
775
|
setVoiceSymbol(voiceId: VoiceId, symbol: RhythmSymbol): void;
|
|
955
776
|
getVoiceSymbol(voiceId: VoiceId): RhythmSymbol | undefined;
|
|
956
|
-
|
|
777
|
+
getLyricsObject(verse: VerseNumber, line: ObjNotationLine, vpos: VerticalPos): ObjLyrics | undefined;
|
|
778
|
+
addLyricsObject(lyricsObj: ObjLyrics): void;
|
|
957
779
|
getMinWidth(): number;
|
|
958
|
-
|
|
959
|
-
getNoteHeadDisplacement(noteGroup: ObjNoteGroup, note: Note): -1 | 0 | 1;
|
|
780
|
+
updateNoteDisplacements(): void;
|
|
960
781
|
isEmpty(): boolean;
|
|
961
782
|
getPlayerNotes(): ScorePlayerNote[];
|
|
962
783
|
requestLayout(): void;
|
|
963
|
-
layout(
|
|
784
|
+
layout(ctx: RenderContext, accState: AccidentalState): void;
|
|
964
785
|
layoutDone(): void;
|
|
965
786
|
updateRect(): void;
|
|
966
787
|
offset(dx: number, dy: number): void;
|
|
967
|
-
draw(
|
|
788
|
+
draw(ctx: RenderContext): void;
|
|
968
789
|
}
|
|
969
790
|
|
|
970
791
|
type PlayerColumn = ObjRhythmColumn | ObjBarLineRight;
|
|
@@ -996,26 +817,34 @@ declare enum BarLineType {
|
|
|
996
817
|
declare class ObjStaffTabBarLine extends MusicObject {
|
|
997
818
|
readonly barLine: ObjBarLine;
|
|
998
819
|
readonly line: ObjNotationLine;
|
|
999
|
-
|
|
1000
|
-
|
|
820
|
+
verticalLines: {
|
|
821
|
+
left: number;
|
|
822
|
+
width: number;
|
|
823
|
+
}[];
|
|
824
|
+
dots: {
|
|
825
|
+
x: number;
|
|
826
|
+
y: number;
|
|
827
|
+
r: number;
|
|
828
|
+
}[];
|
|
1001
829
|
readonly mi: MStaffTabBarLine;
|
|
1002
830
|
constructor(barLine: ObjBarLine, line: ObjNotationLine);
|
|
1003
831
|
getMusicInterface(): MusicInterface;
|
|
1004
832
|
pick(x: number, y: number): MusicObject[];
|
|
1005
|
-
setRect(r:
|
|
833
|
+
setRect(r: AnchoredRect): void;
|
|
1006
834
|
offset(dx: number, dy: number): void;
|
|
1007
835
|
}
|
|
1008
836
|
declare abstract class ObjBarLine extends MusicObject {
|
|
1009
837
|
readonly measure: ObjMeasure;
|
|
1010
838
|
protected staffTabObjects: ObjStaffTabBarLine[];
|
|
839
|
+
protected staffTabObjectGroups: ObjStaffTabBarLine[][];
|
|
1011
840
|
protected barLineType: BarLineType;
|
|
1012
841
|
constructor(measure: ObjMeasure);
|
|
1013
842
|
abstract solveBarLineType(): BarLineType;
|
|
1014
843
|
pick(x: number, y: number): MusicObject[];
|
|
1015
|
-
layout(
|
|
844
|
+
layout(ctx: RenderContext): void;
|
|
1016
845
|
updateRect(): void;
|
|
1017
846
|
offset(dx: number, dy: number): void;
|
|
1018
|
-
draw(
|
|
847
|
+
draw(ctx: RenderContext): void;
|
|
1019
848
|
}
|
|
1020
849
|
declare class ObjBarLineLeft extends ObjBarLine {
|
|
1021
850
|
readonly mi: MBarLineLeft;
|
|
@@ -1034,7 +863,6 @@ declare class ObjBarLineRight extends ObjBarLine {
|
|
|
1034
863
|
|
|
1035
864
|
declare class ObjConnective extends MusicObject {
|
|
1036
865
|
readonly connectiveProps: ConnectiveProps;
|
|
1037
|
-
readonly line: ObjNotationLine;
|
|
1038
866
|
readonly measure: ObjMeasure;
|
|
1039
867
|
private lx;
|
|
1040
868
|
private ly;
|
|
@@ -1045,6 +873,7 @@ declare class ObjConnective extends MusicObject {
|
|
|
1045
873
|
private cp2x;
|
|
1046
874
|
private cp2y;
|
|
1047
875
|
private arcHeight;
|
|
876
|
+
private readonly line;
|
|
1048
877
|
private readonly leftNoteGroup;
|
|
1049
878
|
private readonly leftNoteId;
|
|
1050
879
|
private readonly rightNoteGroup?;
|
|
@@ -1056,13 +885,14 @@ declare class ObjConnective extends MusicObject {
|
|
|
1056
885
|
getMusicInterface(): MConnective;
|
|
1057
886
|
isInsideMeasure(): boolean;
|
|
1058
887
|
pick(x: number, y: number): MusicObject[];
|
|
1059
|
-
layout(
|
|
888
|
+
layout(ctx: RenderContext): void;
|
|
1060
889
|
offset(dx: number, dy: number): void;
|
|
1061
|
-
draw(
|
|
890
|
+
draw(ctx: RenderContext): void;
|
|
1062
891
|
}
|
|
1063
892
|
|
|
1064
893
|
declare class ObjMeasure extends MusicObject {
|
|
1065
894
|
readonly row: ObjScoreRow;
|
|
895
|
+
private readonly options;
|
|
1066
896
|
static readonly MinFlexContentWidth = 10;
|
|
1067
897
|
private prevMeasure;
|
|
1068
898
|
private nextMeasure;
|
|
@@ -1085,9 +915,6 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1085
915
|
private leftSolidAreaWidth;
|
|
1086
916
|
private minColumnsAreaWidth;
|
|
1087
917
|
private rightSolidAreaWidth;
|
|
1088
|
-
private useDiatonicId;
|
|
1089
|
-
private useStemDir;
|
|
1090
|
-
private useString;
|
|
1091
918
|
private voiceSymbols;
|
|
1092
919
|
private lastAddedRhythmColumn?;
|
|
1093
920
|
private lastAddedRhythmSymbol?;
|
|
@@ -1104,7 +931,7 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1104
931
|
private staticObjectsCache;
|
|
1105
932
|
private lyricsObjectsCache;
|
|
1106
933
|
readonly mi: MMeasure;
|
|
1107
|
-
constructor(row: ObjScoreRow);
|
|
934
|
+
constructor(row: ObjScoreRow, options: MeasureOptions);
|
|
1108
935
|
getMusicInterface(): MMeasure;
|
|
1109
936
|
get doc(): ObjDocument;
|
|
1110
937
|
isPartialMeasure(): boolean;
|
|
@@ -1112,9 +939,11 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1112
939
|
resetPassCount(): void;
|
|
1113
940
|
incPassCount(): void;
|
|
1114
941
|
getPassCount(): number;
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
942
|
+
updateRunningArguments(runningArgs?: {
|
|
943
|
+
diatonicId: number;
|
|
944
|
+
stemDir: Stem;
|
|
945
|
+
stringNumbers: StringNumber[];
|
|
946
|
+
}[]): void;
|
|
1118
947
|
pick(x: number, y: number): MusicObject[];
|
|
1119
948
|
getMeasureNumber(): number;
|
|
1120
949
|
getColumns(): ReadonlyArray<ObjRhythmColumn>;
|
|
@@ -1168,7 +997,7 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1168
997
|
private getRhythmColumn;
|
|
1169
998
|
getMeasureTicks(): number;
|
|
1170
999
|
getConsumedTicks(voiceId?: VoiceId): number;
|
|
1171
|
-
getColumnsContentRect():
|
|
1000
|
+
getColumnsContentRect(): AnchoredRect;
|
|
1172
1001
|
getLeftSolidAreaWidth(): number;
|
|
1173
1002
|
getMinColumnsAreaWidth(): number;
|
|
1174
1003
|
getRightSolidAreaWidth(): number;
|
|
@@ -1176,9 +1005,9 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1176
1005
|
getMinWidth(): number;
|
|
1177
1006
|
getStaffLineLeft(): number;
|
|
1178
1007
|
getStaffLineRight(): number;
|
|
1179
|
-
private getLyricsObjects;
|
|
1180
1008
|
getPrevLyricsObject(lyricsObj: ObjLyrics): ObjLyrics | undefined;
|
|
1181
1009
|
getStaticObjects(line: ObjNotationLine): ReadonlyArray<MusicObject>;
|
|
1010
|
+
addStaticObject(line: ObjNotationLine, staticObj: MusicObject): void;
|
|
1182
1011
|
removeLayoutObjects(musicObj: MusicObject): void;
|
|
1183
1012
|
addConnectiveObject(connective: ObjConnective): void;
|
|
1184
1013
|
removeConnectiveObjects(): void;
|
|
@@ -1193,15 +1022,15 @@ declare class ObjMeasure extends MusicObject {
|
|
|
1193
1022
|
getVoiceSymbols(voiceId: VoiceId): ReadonlyArray<RhythmSymbol>;
|
|
1194
1023
|
completeRests(voiceId?: VoiceId | VoiceId[]): void;
|
|
1195
1024
|
requestLayout(): void;
|
|
1196
|
-
layout(
|
|
1197
|
-
layoutWidth(
|
|
1198
|
-
layoutConnectives(
|
|
1199
|
-
layoutBeams(
|
|
1025
|
+
layout(ctx: RenderContext): void;
|
|
1026
|
+
layoutWidth(ctx: RenderContext, width: number): void;
|
|
1027
|
+
layoutConnectives(ctx: RenderContext): void;
|
|
1028
|
+
layoutBeams(ctx: RenderContext): void;
|
|
1200
1029
|
alignStemsToBeams(): void;
|
|
1201
1030
|
layoutDone(): void;
|
|
1202
1031
|
updateRect(): void;
|
|
1203
1032
|
offset(dx: number, dy: number): void;
|
|
1204
|
-
draw(
|
|
1033
|
+
draw(ctx: RenderContext): void;
|
|
1205
1034
|
}
|
|
1206
1035
|
|
|
1207
1036
|
declare class ObjScoreRow extends MusicObject {
|
|
@@ -1211,8 +1040,10 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1211
1040
|
private nextRow?;
|
|
1212
1041
|
private minWidth;
|
|
1213
1042
|
private readonly notationLines;
|
|
1043
|
+
private readonly instrumentLineGroups;
|
|
1214
1044
|
private readonly staves;
|
|
1215
1045
|
private readonly tabs;
|
|
1046
|
+
private readonly instrumentNames;
|
|
1216
1047
|
private readonly measures;
|
|
1217
1048
|
private needLayout;
|
|
1218
1049
|
readonly mi: MScoreRow;
|
|
@@ -1220,6 +1051,8 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1220
1051
|
getMusicInterface(): MScoreRow;
|
|
1221
1052
|
private createNotationLines;
|
|
1222
1053
|
getNotationLines(): ReadonlyArray<ObjNotationLine>;
|
|
1054
|
+
getInstrumentLineGroups(): ReadonlyArray<ReadonlyArray<ObjNotationLine>>;
|
|
1055
|
+
findMatchingLine(line: ObjNotationLine): ObjNotationLine | undefined;
|
|
1223
1056
|
getStaves(): ReadonlyArray<ObjStaff>;
|
|
1224
1057
|
getTabs(): ReadonlyArray<ObjTab>;
|
|
1225
1058
|
get hasStaff(): boolean;
|
|
@@ -1227,10 +1060,10 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1227
1060
|
getTopStaff(): ObjStaff;
|
|
1228
1061
|
getBottomStaff(): ObjStaff;
|
|
1229
1062
|
getStaff(diatonicId: number): ObjStaff | undefined;
|
|
1230
|
-
resetLayoutGroups(
|
|
1231
|
-
layoutLayoutGroups(
|
|
1063
|
+
resetLayoutGroups(ctx: RenderContext): void;
|
|
1064
|
+
layoutLayoutGroups(ctx: RenderContext): void;
|
|
1232
1065
|
pick(x: number, y: number): MusicObject[];
|
|
1233
|
-
getConnectivesContentRect():
|
|
1066
|
+
getConnectivesContentRect(): AnchoredRect;
|
|
1234
1067
|
getDiatonicIdAt(y: number): number | undefined;
|
|
1235
1068
|
addMeasure(m: ObjMeasure): void;
|
|
1236
1069
|
getMeasures(): ReadonlyArray<ObjMeasure>;
|
|
@@ -1241,21 +1074,23 @@ declare class ObjScoreRow extends MusicObject {
|
|
|
1241
1074
|
getFirstMeasure(): ObjMeasure | undefined;
|
|
1242
1075
|
getLastMeasure(): ObjMeasure | undefined;
|
|
1243
1076
|
getMinWidth(): number;
|
|
1077
|
+
solveAutoStemDir(symbols: ReadonlyArray<RhythmSymbol>): Stem.Up | Stem.Down;
|
|
1078
|
+
getInstrumentNameWidth(ctx: RenderContext): number;
|
|
1244
1079
|
requestLayout(): void;
|
|
1245
|
-
layout(
|
|
1246
|
-
layoutWidth(
|
|
1080
|
+
layout(ctx: RenderContext): void;
|
|
1081
|
+
layoutWidth(ctx: RenderContext, left: number, right: number): void;
|
|
1247
1082
|
updateRect(): void;
|
|
1248
1083
|
alignStemsToBeams(): void;
|
|
1249
|
-
layoutSetNotationLines(
|
|
1250
|
-
layoutPadding(
|
|
1084
|
+
layoutSetNotationLines(ctx: RenderContext): void;
|
|
1085
|
+
layoutPadding(ctx: RenderContext): void;
|
|
1251
1086
|
layoutDone(): void;
|
|
1252
1087
|
offset(dx: number, dy: number): void;
|
|
1253
|
-
draw(
|
|
1088
|
+
draw(ctx: RenderContext): void;
|
|
1254
1089
|
}
|
|
1255
1090
|
|
|
1256
1091
|
declare class ObjDocument extends MusicObject {
|
|
1257
1092
|
private needLayout;
|
|
1258
|
-
private
|
|
1093
|
+
private ctx?;
|
|
1259
1094
|
private readonly rows;
|
|
1260
1095
|
private readonly measures;
|
|
1261
1096
|
private measuresPerRow;
|
|
@@ -1270,7 +1105,7 @@ declare class ObjDocument extends MusicObject {
|
|
|
1270
1105
|
setScoreConfiguration(config: StaffPreset | ScoreConfiguration): void;
|
|
1271
1106
|
setMeasuresPerRow(measuresPerRow: number): void;
|
|
1272
1107
|
addConnectiveProps(connectiveProps: ConnectiveProps): void;
|
|
1273
|
-
|
|
1108
|
+
setRenderContext(ctx?: RenderContext): void;
|
|
1274
1109
|
setHeader(title?: string, composer?: string, arranger?: string): void;
|
|
1275
1110
|
getTitle(): string | undefined;
|
|
1276
1111
|
getComposer(): string | undefined;
|
|
@@ -1284,14 +1119,20 @@ declare class ObjDocument extends MusicObject {
|
|
|
1284
1119
|
getRows(): ReadonlyArray<ObjScoreRow>;
|
|
1285
1120
|
getMeasures(): ReadonlyArray<ObjMeasure>;
|
|
1286
1121
|
requestNewRow(): void;
|
|
1287
|
-
addMeasure(): ObjMeasure;
|
|
1122
|
+
addMeasure(measureOptions: MeasureOptions): ObjMeasure;
|
|
1288
1123
|
addStaffGroup(groupName: string, layoutElements: number | string | (number | string)[], verticalPosition: VerticalPosition): void;
|
|
1289
1124
|
getStaffGroup(groupName: string): StaffGroup | undefined;
|
|
1290
1125
|
getVoiceSymbols(voiceId: VoiceId): ReadonlyArray<RhythmSymbol>;
|
|
1291
1126
|
removeLayoutObjects(musicObj: MusicObject): void;
|
|
1292
1127
|
private forEachMeasure;
|
|
1293
1128
|
resetMeasures(): void;
|
|
1294
|
-
updateCursorRect(cursorRect?:
|
|
1129
|
+
updateCursorRect(cursorRect?: Rect): void;
|
|
1130
|
+
getInstrumentGroupSize(ctx: RenderContext): {
|
|
1131
|
+
nameLeft: number;
|
|
1132
|
+
nameRight: number;
|
|
1133
|
+
braceLeft: number;
|
|
1134
|
+
braceRight: number;
|
|
1135
|
+
};
|
|
1295
1136
|
requestLayout(): void;
|
|
1296
1137
|
requestFullLayout(): void;
|
|
1297
1138
|
layout(): void;
|
|
@@ -1304,16 +1145,15 @@ declare class ObjDocument extends MusicObject {
|
|
|
1304
1145
|
}
|
|
1305
1146
|
|
|
1306
1147
|
declare enum ImageAsset {
|
|
1307
|
-
|
|
1308
|
-
|
|
1148
|
+
G_Clef = 0,
|
|
1149
|
+
F_Clef = 1
|
|
1309
1150
|
}
|
|
1310
|
-
declare class
|
|
1151
|
+
declare class RenderContext {
|
|
1311
1152
|
private readonly mi;
|
|
1312
1153
|
readonly devicePixelRatio: number;
|
|
1313
1154
|
readonly fontSize: number;
|
|
1314
1155
|
readonly unitSize: number;
|
|
1315
|
-
readonly
|
|
1316
|
-
readonly beamThickness: number;
|
|
1156
|
+
readonly _lineWidth: number;
|
|
1317
1157
|
private scoreEventListener?;
|
|
1318
1158
|
private canvas?;
|
|
1319
1159
|
private ctx?;
|
|
@@ -1329,8 +1169,8 @@ declare class Renderer {
|
|
|
1329
1169
|
private onMouseMoveFn;
|
|
1330
1170
|
private onMouseLeaveFn;
|
|
1331
1171
|
private onTouchEndFn;
|
|
1332
|
-
constructor(mi:
|
|
1333
|
-
getMusicInterface():
|
|
1172
|
+
constructor(mi: MRenderContext);
|
|
1173
|
+
getMusicInterface(): MRenderContext;
|
|
1334
1174
|
get doc(): ObjDocument | undefined;
|
|
1335
1175
|
private finishImageAsset;
|
|
1336
1176
|
getImageAsset(imageAsset: ImageAsset): HTMLImageElement | undefined;
|
|
@@ -1338,7 +1178,7 @@ declare class Renderer {
|
|
|
1338
1178
|
setCanvas(canvas: HTMLCanvasElement): void;
|
|
1339
1179
|
setScoreEventListener(fn: ScoreEventListener): void;
|
|
1340
1180
|
needMouseInput(): boolean;
|
|
1341
|
-
getMousePos(e: MouseEvent):
|
|
1181
|
+
getMousePos(e: MouseEvent): Vec;
|
|
1342
1182
|
private updateCurStaffPos;
|
|
1343
1183
|
private updateCurObjects;
|
|
1344
1184
|
onClick(e: MouseEvent): void;
|
|
@@ -1351,25 +1191,49 @@ declare class Renderer {
|
|
|
1351
1191
|
scoreRow: ObjScoreRow;
|
|
1352
1192
|
diatonicId: number;
|
|
1353
1193
|
}): void;
|
|
1354
|
-
updateCursorRect(cursorRect:
|
|
1194
|
+
updateCursorRect(cursorRect: Rect | undefined): void;
|
|
1355
1195
|
updateCanvasSize(): void;
|
|
1356
1196
|
draw(): void;
|
|
1357
1197
|
drawHilightStaffPosRect(): void;
|
|
1358
1198
|
drawHilightObjectRect(): void;
|
|
1359
1199
|
drawPlayCursor(): void;
|
|
1360
|
-
txFromScreenCoord(screenCoord:
|
|
1361
|
-
txToScreenCoord(coord:
|
|
1362
|
-
getCanvasContext(): CanvasRenderingContext2D | undefined;
|
|
1200
|
+
txFromScreenCoord(screenCoord: Vec): Vec;
|
|
1201
|
+
txToScreenCoord(coord: Vec): Vec;
|
|
1363
1202
|
clearCanvas(): void;
|
|
1364
|
-
|
|
1365
|
-
drawDebugRect(r: DivRect): void;
|
|
1366
|
-
fillCircle(x: number, y: number, radius: number, color?: string): void;
|
|
1367
|
-
drawLine(startX: number, startY: number, endX: number, endY: number, color?: string, lineWidth?: number): void;
|
|
1368
|
-
drawPartialLine(startX: number, startY: number, endX: number, endY: number, startT: number, endT: number, color?: string, lineWidth?: number): void;
|
|
1203
|
+
drawDebugRect(r: AnchoredRect | Rect): void;
|
|
1369
1204
|
drawLedgerLines(staff: ObjStaff, diatonicId: number, x: number): void;
|
|
1370
|
-
getRestRect(restSize: number):
|
|
1371
|
-
drawRest(restSize: number, x: number, y: number
|
|
1372
|
-
drawFlag(rect:
|
|
1205
|
+
getRestRect(restSize: number): AnchoredRect;
|
|
1206
|
+
drawRest(restSize: number, x: number, y: number): void;
|
|
1207
|
+
drawFlag(rect: Rect | AnchoredRect, dir: "up" | "down"): void;
|
|
1208
|
+
color(color: string): RenderContext;
|
|
1209
|
+
lineColor(color: string): RenderContext;
|
|
1210
|
+
fillColor(color: string): RenderContext;
|
|
1211
|
+
lineWidth(lineWidth?: number): RenderContext;
|
|
1212
|
+
font(font: string): RenderContext;
|
|
1213
|
+
beginPath(): RenderContext;
|
|
1214
|
+
stroke(): RenderContext;
|
|
1215
|
+
fill(): RenderContext;
|
|
1216
|
+
moveTo(x: number, y: number): RenderContext;
|
|
1217
|
+
lineTo(x: number, y: number): RenderContext;
|
|
1218
|
+
bezierCurveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): RenderContext;
|
|
1219
|
+
quadraticCurveTo(x1: number, y1: number, x2: number, y2: number): RenderContext;
|
|
1220
|
+
fillRect(x: number, y: number, w: number, h: number): RenderContext;
|
|
1221
|
+
setLineDash(pattern: number[]): RenderContext;
|
|
1222
|
+
drawImage(img: CanvasImageSource, x: number, y: number, w: number, h: number): RenderContext;
|
|
1223
|
+
ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number): RenderContext;
|
|
1224
|
+
clip(): RenderContext;
|
|
1225
|
+
save(): RenderContext;
|
|
1226
|
+
restore(): RenderContext;
|
|
1227
|
+
rect(x: number, y: number, w: number, h: number): RenderContext;
|
|
1228
|
+
scale(x: number, y: number): RenderContext;
|
|
1229
|
+
strokeRect(x: number, y: number, w: number, h: number): RenderContext;
|
|
1230
|
+
fillText(text: string, x: number, y: number): RenderContext;
|
|
1231
|
+
getTextWidth(text: string, font: string): number;
|
|
1232
|
+
arc(x: number, y: number, radius: number, startRadians: number, endRadians: number): void;
|
|
1233
|
+
fillCircle(x: number, y: number, radius: number): void;
|
|
1234
|
+
strokeLine(startX: number, startY: number, endX: number, endY: number): void;
|
|
1235
|
+
strokePartialLine(startX: number, startY: number, endX: number, endY: number, startT: number, endT: number): void;
|
|
1236
|
+
drawBrace(rect: AnchoredRect, side: "left" | "right"): void;
|
|
1373
1237
|
}
|
|
1374
1238
|
|
|
1375
1239
|
declare class ObjEnding extends MusicObject {
|
|
@@ -1380,15 +1244,15 @@ declare class ObjEnding extends MusicObject {
|
|
|
1380
1244
|
readonly mi: MEnding;
|
|
1381
1245
|
constructor(measure: ObjMeasure, passages: number[]);
|
|
1382
1246
|
getMusicInterface(): MEnding;
|
|
1383
|
-
getShapeRects():
|
|
1247
|
+
getShapeRects(): AnchoredRect[];
|
|
1384
1248
|
isSingleMeasureEnding(): boolean;
|
|
1385
1249
|
hasPassage(pass: number): boolean;
|
|
1386
1250
|
getHighestPassage(): number;
|
|
1387
1251
|
pick(x: number, y: number): MusicObject[];
|
|
1388
|
-
layout(
|
|
1389
|
-
layoutFitToMeasure(
|
|
1252
|
+
layout(ctx: RenderContext): void;
|
|
1253
|
+
layoutFitToMeasure(ctx: RenderContext): void;
|
|
1390
1254
|
offset(dx: number, dy: number): void;
|
|
1391
|
-
draw(
|
|
1255
|
+
draw(ctx: RenderContext): void;
|
|
1392
1256
|
}
|
|
1393
1257
|
|
|
1394
1258
|
declare class ObjFermata extends MusicObject {
|
|
@@ -1399,9 +1263,9 @@ declare class ObjFermata extends MusicObject {
|
|
|
1399
1263
|
getMusicInterface(): MFermata;
|
|
1400
1264
|
static getFermataPositions(anchor: ObjRhythmColumn | ObjBarLineRight): VerticalPos[];
|
|
1401
1265
|
pick(x: number, y: number): MusicObject[];
|
|
1402
|
-
layout(
|
|
1266
|
+
layout(ctx: RenderContext): void;
|
|
1403
1267
|
offset(dx: number, dy: number): void;
|
|
1404
|
-
draw(
|
|
1268
|
+
draw(ctx: RenderContext): void;
|
|
1405
1269
|
}
|
|
1406
1270
|
|
|
1407
1271
|
declare class ObjSpecialText extends MusicObject {
|
|
@@ -1415,9 +1279,9 @@ declare class ObjSpecialText extends MusicObject {
|
|
|
1415
1279
|
getMusicInterface(): MSpecialText;
|
|
1416
1280
|
getText(): string;
|
|
1417
1281
|
pick(x: number, y: number): MusicObject[];
|
|
1418
|
-
layout(
|
|
1282
|
+
layout(ctx: RenderContext): void;
|
|
1419
1283
|
offset(dx: number, dy: number): void;
|
|
1420
|
-
draw(
|
|
1284
|
+
draw(ctx: RenderContext): void;
|
|
1421
1285
|
}
|
|
1422
1286
|
|
|
1423
1287
|
type ExtensionLineStyle = "solid" | "dashed";
|
|
@@ -1457,27 +1321,27 @@ declare class ObjExtensionLine extends MusicObject {
|
|
|
1457
1321
|
getMusicInterface(): MExtensionLine;
|
|
1458
1322
|
private getLineLeft;
|
|
1459
1323
|
private getLineRight;
|
|
1460
|
-
layoutFitToMeasure(
|
|
1324
|
+
layoutFitToMeasure(ctx: RenderContext): void;
|
|
1461
1325
|
pick(x: number, y: number): MusicObject[];
|
|
1462
|
-
layout(
|
|
1326
|
+
layout(ctx: RenderContext): void;
|
|
1463
1327
|
offset(dx: number, dy: number): void;
|
|
1464
|
-
draw(
|
|
1328
|
+
draw(ctx: RenderContext): void;
|
|
1465
1329
|
}
|
|
1466
1330
|
|
|
1467
1331
|
declare class ObjTabRhythm extends MusicObject {
|
|
1468
1332
|
readonly measure: ObjMeasure;
|
|
1469
1333
|
readonly tab: ObjTab;
|
|
1470
|
-
private readonly
|
|
1334
|
+
private readonly voiceId;
|
|
1471
1335
|
readonly mi: MTabRhythm;
|
|
1472
1336
|
constructor(measure: ObjMeasure, tab: ObjTab);
|
|
1473
1337
|
getMusicInterface(): MTabRhythm;
|
|
1474
1338
|
pick(x: number, y: number): MusicObject[];
|
|
1475
|
-
layout(
|
|
1339
|
+
layout(ctx: RenderContext): void;
|
|
1476
1340
|
private hasTuplets;
|
|
1477
|
-
layoutFitToMeasure(
|
|
1341
|
+
layoutFitToMeasure(ctx: RenderContext): void;
|
|
1478
1342
|
offset(dx: number, dy: number): void;
|
|
1479
1343
|
private readonly tupletPartsTextObjMap;
|
|
1480
|
-
draw(
|
|
1344
|
+
draw(ctx: RenderContext): void;
|
|
1481
1345
|
}
|
|
1482
1346
|
|
|
1483
1347
|
declare enum LayoutGroupId {
|
|
@@ -1515,25 +1379,27 @@ declare class LayoutObjectWrapper {
|
|
|
1515
1379
|
readonly layoutGroup: LayoutGroup;
|
|
1516
1380
|
private positionResolved;
|
|
1517
1381
|
constructor(musicObj: LayoutableMusicObject, line: ObjNotationLine, layoutGroupId: LayoutGroupId, verticalPos: VerticalPos);
|
|
1518
|
-
|
|
1382
|
+
resetPositionResolved(): void;
|
|
1519
1383
|
setPositionResolved(): void;
|
|
1520
1384
|
isPositionResolved(): boolean;
|
|
1521
|
-
resolveClosestToStaffY(
|
|
1385
|
+
resolveClosestToStaffY(ctx: RenderContext): number;
|
|
1522
1386
|
getTextContent(): string | undefined;
|
|
1523
|
-
layout(
|
|
1387
|
+
layout(ctx: RenderContext): void;
|
|
1524
1388
|
offset(dx: number, dy: number): void;
|
|
1525
|
-
getRect():
|
|
1389
|
+
getRect(): AnchoredRect;
|
|
1526
1390
|
}
|
|
1527
1391
|
declare class LayoutGroup {
|
|
1528
1392
|
readonly layoutGroupId: number;
|
|
1529
|
-
private readonly
|
|
1393
|
+
private readonly layoutObject;
|
|
1530
1394
|
readonly rowAlign: boolean;
|
|
1531
1395
|
readonly widensColumn: boolean;
|
|
1396
|
+
readonly padding: number;
|
|
1532
1397
|
constructor(layoutGroupId: number);
|
|
1533
1398
|
getLayoutObjects(verticalPos: VerticalPos): Readonly<LayoutObjectWrapper[]>;
|
|
1534
1399
|
add(layoutObj: LayoutObjectWrapper): void;
|
|
1535
1400
|
remove(layoutObj: LayoutObjectWrapper): void;
|
|
1536
|
-
|
|
1401
|
+
layout(ctx: RenderContext): void;
|
|
1402
|
+
getPadding(ctx: RenderContext): number;
|
|
1537
1403
|
}
|
|
1538
1404
|
|
|
1539
1405
|
declare class MusicObjectLink {
|
|
@@ -1552,11 +1418,11 @@ declare abstract class MusicObject {
|
|
|
1552
1418
|
constructor(parent: MusicObject | undefined);
|
|
1553
1419
|
abstract getMusicInterface(): MusicInterface;
|
|
1554
1420
|
getParent(): MusicObject | undefined;
|
|
1555
|
-
protected rect:
|
|
1421
|
+
protected rect: AnchoredRect;
|
|
1556
1422
|
private needRectUpdate;
|
|
1557
1423
|
requestRectUpdate(): void;
|
|
1558
1424
|
updateRect(): void;
|
|
1559
|
-
getRect():
|
|
1425
|
+
getRect(): AnchoredRect;
|
|
1560
1426
|
/**
|
|
1561
1427
|
* Most objects are simple rects in shape.
|
|
1562
1428
|
* Some objects might be more complex consisting of multiple rects.
|
|
@@ -1564,7 +1430,7 @@ declare abstract class MusicObject {
|
|
|
1564
1430
|
*
|
|
1565
1431
|
* @returns Array of rects.
|
|
1566
1432
|
*/
|
|
1567
|
-
getShapeRects():
|
|
1433
|
+
getShapeRects(): AnchoredRect[];
|
|
1568
1434
|
/**
|
|
1569
1435
|
* Pick objects.
|
|
1570
1436
|
*
|
|
@@ -1593,9 +1459,9 @@ declare class ObjArpeggio extends MusicObject {
|
|
|
1593
1459
|
constructor(col: ObjRhythmColumn, line: ObjNotationLine, arpeggioDir: Arpeggio);
|
|
1594
1460
|
getMusicInterface(): MArpeggio;
|
|
1595
1461
|
pick(x: number, y: number): MusicObject[];
|
|
1596
|
-
layout(
|
|
1462
|
+
layout(ctx: RenderContext): void;
|
|
1597
1463
|
offset(dx: number, dy: number): void;
|
|
1598
|
-
draw(
|
|
1464
|
+
draw(ctx: RenderContext): void;
|
|
1599
1465
|
}
|
|
1600
1466
|
|
|
1601
1467
|
declare class ObjHeader extends MusicObject {
|
|
@@ -1609,9 +1475,9 @@ declare class ObjHeader extends MusicObject {
|
|
|
1609
1475
|
constructor(doc: ObjDocument, title?: string | undefined, composer?: string | undefined, arranger?: string | undefined);
|
|
1610
1476
|
getMusicInterface(): MHeader;
|
|
1611
1477
|
pick(x: number, y: number): MusicObject[];
|
|
1612
|
-
layoutWidth(
|
|
1478
|
+
layoutWidth(ctx: RenderContext, left: number, right: number): void;
|
|
1613
1479
|
offset(dx: number, dy: number): void;
|
|
1614
|
-
draw(
|
|
1480
|
+
draw(ctx: RenderContext): void;
|
|
1615
1481
|
}
|
|
1616
1482
|
|
|
1617
1483
|
declare class ObjImage extends MusicObject {
|
|
@@ -1623,9 +1489,9 @@ declare class ObjImage extends MusicObject {
|
|
|
1623
1489
|
constructor(parent: MusicObject, image: HTMLImageElement, anchorX: number, anchorY: number, imageScale: number);
|
|
1624
1490
|
getMusicInterface(): MImage;
|
|
1625
1491
|
pick(x: number, y: number): MusicObject[];
|
|
1626
|
-
layout(
|
|
1492
|
+
layout(ctx: RenderContext): void;
|
|
1627
1493
|
offset(dx: number, dy: number): void;
|
|
1628
|
-
draw(
|
|
1494
|
+
draw(ctx: RenderContext): void;
|
|
1629
1495
|
}
|
|
1630
1496
|
|
|
1631
1497
|
declare class ObjStaffSignature extends MusicObject {
|
|
@@ -1642,16 +1508,16 @@ declare class ObjStaffSignature extends MusicObject {
|
|
|
1642
1508
|
readonly mi: MStaffSignature;
|
|
1643
1509
|
constructor(measure: ObjMeasure, staff: ObjStaff);
|
|
1644
1510
|
getMusicInterface(): MStaffSignature;
|
|
1645
|
-
updateClefImage(
|
|
1511
|
+
updateClefImage(ctx: RenderContext, showClef: boolean): void;
|
|
1646
1512
|
updateMeasureNumber(showMeasureNumber: boolean): void;
|
|
1647
1513
|
updateKeySignature(showKeySignature: boolean): void;
|
|
1648
1514
|
updateTimeSignature(showTimeSignature: boolean): void;
|
|
1649
1515
|
updateTempo(showTempo: boolean): void;
|
|
1650
1516
|
private getAccidentalDiatonicId;
|
|
1651
1517
|
pick(x: number, y: number): MusicObject[];
|
|
1652
|
-
layout(
|
|
1518
|
+
layout(ctx: RenderContext): void;
|
|
1653
1519
|
offset(dx: number, dy: number): void;
|
|
1654
|
-
draw(
|
|
1520
|
+
draw(ctx: RenderContext): void;
|
|
1655
1521
|
}
|
|
1656
1522
|
declare class ObjTabSignature extends MusicObject {
|
|
1657
1523
|
readonly measure: ObjMeasure;
|
|
@@ -1667,9 +1533,9 @@ declare class ObjTabSignature extends MusicObject {
|
|
|
1667
1533
|
updateTimeSignature(showTimeSignature: boolean): void;
|
|
1668
1534
|
updateTempo(showTempo: boolean): void;
|
|
1669
1535
|
pick(x: number, y: number): MusicObject[];
|
|
1670
|
-
layout(
|
|
1536
|
+
layout(ctx: RenderContext): void;
|
|
1671
1537
|
offset(dx: number, dy: number): void;
|
|
1672
|
-
draw(
|
|
1538
|
+
draw(ctx: RenderContext): void;
|
|
1673
1539
|
}
|
|
1674
1540
|
|
|
1675
1541
|
/** Score event type. */
|
|
@@ -1685,29 +1551,37 @@ declare abstract class ScoreEvent {
|
|
|
1685
1551
|
}
|
|
1686
1552
|
/** Score staff position event for clicking/entering/leaving staff position (diatonic id) in staff notation line. */
|
|
1687
1553
|
declare class ScoreStaffPosEvent extends ScoreEvent {
|
|
1688
|
-
readonly
|
|
1554
|
+
readonly renderContext: MRenderContext;
|
|
1689
1555
|
readonly scoreRow: MScoreRow;
|
|
1690
1556
|
readonly diatonicId: number;
|
|
1691
1557
|
/**
|
|
1692
1558
|
* Create new score staff position event.
|
|
1693
1559
|
* @param type - Score event type.
|
|
1694
|
-
* @param
|
|
1560
|
+
* @param renderContext - Render context.
|
|
1695
1561
|
* @param scoreRow - Score row.
|
|
1696
1562
|
* @param diatonicId - Diatonic id that was clicked/entered/left.
|
|
1697
1563
|
*/
|
|
1698
|
-
constructor(type: ScoreEventType,
|
|
1564
|
+
constructor(type: ScoreEventType, renderContext: MRenderContext, scoreRow: MScoreRow, diatonicId: number);
|
|
1565
|
+
/**
|
|
1566
|
+
* @deprecated - Provided for legacy support, use renderContext instead.
|
|
1567
|
+
*/
|
|
1568
|
+
get renderer(): MRenderer;
|
|
1699
1569
|
}
|
|
1700
1570
|
/** Score object event for clicking/entering/leaving score object. */
|
|
1701
1571
|
declare class ScoreObjectEvent extends ScoreEvent {
|
|
1702
|
-
readonly
|
|
1572
|
+
readonly renderContext: MRenderContext;
|
|
1703
1573
|
readonly objects: MusicInterface[];
|
|
1704
1574
|
/**
|
|
1705
1575
|
* Create new score object event.
|
|
1706
1576
|
* @param type - Score event type.
|
|
1707
|
-
* @param
|
|
1577
|
+
* @param renderContext - Render context.
|
|
1708
1578
|
* @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.
|
|
1709
1579
|
*/
|
|
1710
|
-
constructor(type: ScoreEventType,
|
|
1580
|
+
constructor(type: ScoreEventType, renderContext: MRenderContext, objects: MusicInterface[]);
|
|
1581
|
+
/**
|
|
1582
|
+
* @deprecated - Provided for legacy support, use renderContext instead.
|
|
1583
|
+
*/
|
|
1584
|
+
get renderer(): MRenderer;
|
|
1711
1585
|
/** Top object getter. */
|
|
1712
1586
|
get topObject(): MusicInterface;
|
|
1713
1587
|
/**
|
|
@@ -1750,25 +1624,25 @@ declare class MPlayer {
|
|
|
1750
1624
|
*/
|
|
1751
1625
|
stop(): this;
|
|
1752
1626
|
}
|
|
1753
|
-
/**
|
|
1754
|
-
declare class
|
|
1755
|
-
private readonly
|
|
1627
|
+
/** Render context class. */
|
|
1628
|
+
declare class MRenderContext {
|
|
1629
|
+
private readonly ctx;
|
|
1756
1630
|
/**
|
|
1757
|
-
* Create new
|
|
1631
|
+
* Create new render context instance.
|
|
1758
1632
|
*/
|
|
1759
1633
|
constructor();
|
|
1760
1634
|
/**
|
|
1761
|
-
* Attach music document to this
|
|
1635
|
+
* Attach music document to this render context.
|
|
1762
1636
|
* @param doc - Music document.
|
|
1763
|
-
* @returns - This
|
|
1637
|
+
* @returns - This render context instance.
|
|
1764
1638
|
*/
|
|
1765
|
-
setDocument(doc?: MDocument):
|
|
1639
|
+
setDocument(doc?: MDocument): MRenderContext;
|
|
1766
1640
|
/**
|
|
1767
|
-
* Set target canvas html element for this
|
|
1641
|
+
* Set target canvas html element for this render context.
|
|
1768
1642
|
* @param canvas - HTML canvas element or element id.
|
|
1769
|
-
* @returns - This
|
|
1643
|
+
* @returns - This render context instance.
|
|
1770
1644
|
*/
|
|
1771
|
-
setCanvas(canvas: HTMLCanvasElement | string):
|
|
1645
|
+
setCanvas(canvas: HTMLCanvasElement | string): MRenderContext;
|
|
1772
1646
|
/**
|
|
1773
1647
|
* Set score event listener.
|
|
1774
1648
|
* @param scoreEventListener - Score event listener.
|
|
@@ -1792,6 +1666,12 @@ declare class MRenderer {
|
|
|
1792
1666
|
*/
|
|
1793
1667
|
draw(): void;
|
|
1794
1668
|
}
|
|
1669
|
+
/**
|
|
1670
|
+
* Renderer class.
|
|
1671
|
+
* @deprecated - Use MRenderContext instead.
|
|
1672
|
+
* */
|
|
1673
|
+
declare class MRenderer extends MRenderContext {
|
|
1674
|
+
}
|
|
1795
1675
|
/** Playback buttons helper class. */
|
|
1796
1676
|
declare class MPlaybackButtons {
|
|
1797
1677
|
private playButton?;
|
|
@@ -2468,4 +2348,4 @@ declare class MExtensionLine extends MusicInterface {
|
|
|
2468
2348
|
getMusicObject(): ObjExtensionLine;
|
|
2469
2349
|
}
|
|
2470
2350
|
|
|
2471
|
-
export {
|
|
2351
|
+
export { MTabSignature as $, type AnnotationText as A, MFermata as B, Connective as C, MHeader as D, MImage as E, Fermata as F, MMeasure as G, MBarLineRight as H, MBarLineLeft as I, MStaffTabBarLine as J, MNoteGroup as K, type LyricsOptions as L, MDocument as M, type NoteOptions as N, MStaffNoteGroup as O, MTabNoteGroup as P, MRest as Q, type RestOptions as R, StaffPreset as S, type TupletOptions as T, MStaffRest as U, type VoiceId as V, MRhythmColumn as W, MScoreRow as X, MStaff as Y, MTab as Z, MStaffSignature as _, type ScoreConfiguration as a, MTabRhythm as a0, MSpecialText as a1, MText as a2, MLyrics as a3, MExtensionLine as a4, Clef as a5, type BaseConfig as a6, type StaffConfig as a7, type TabConfig as a8, getVoiceIds as a9, isVoiceId as aa, validateVoiceId as ab, type StringNumber as ac, getStringNumbers as ad, isStringNumber as ae, validateStringNumber as af, getVerseNumbers as ag, isVerseNumber as ah, validateVerseNumber as ai, Stem as aj, Arpeggio as ak, type StaffTabOrGroup as al, LyricsAlign as am, LyricsHyphen as an, DynamicsAnnotation as ao, TempoAnnotation as ap, PlayState as aq, type PlayStateChangeListener as ar, 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 };
|