vexflow 5.0.0-alpha.2 → 5.0.0-alpha.3
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/build/cjs/vexflow-bravura.js +2 -2
- package/build/cjs/vexflow-bravura.js.map +1 -1
- package/build/cjs/vexflow-core.js +2 -2
- package/build/cjs/vexflow-core.js.map +1 -1
- package/build/cjs/vexflow-debug-with-tests.js +4 -4
- package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
- package/build/cjs/vexflow-debug.js +4 -4
- package/build/cjs/vexflow-debug.js.map +1 -1
- package/build/cjs/vexflow.js +2 -2
- package/build/cjs/vexflow.js.map +1 -1
- package/build/esm/src/version.js +3 -3
- package/package.json +1 -3
- package/entry/vexflow-bravura.ts +0 -25
- package/entry/vexflow-core.ts +0 -16
- package/entry/vexflow-debug-with-tests.ts +0 -64
- package/entry/vexflow-debug.ts +0 -54
- package/entry/vexflow.ts +0 -47
- package/src/accidental.ts +0 -570
- package/src/annotation.ts +0 -294
- package/src/articulation.ts +0 -383
- package/src/barnote.ts +0 -95
- package/src/beam.ts +0 -999
- package/src/bend.ts +0 -268
- package/src/boundingbox.ts +0 -108
- package/src/canvascontext.ts +0 -348
- package/src/chordsymbol.ts +0 -473
- package/src/clef.ts +0 -164
- package/src/clefnote.ts +0 -50
- package/src/crescendo.ts +0 -132
- package/src/curve.ts +0 -195
- package/src/dot.ts +0 -171
- package/src/easyscore.ts +0 -538
- package/src/element.ts +0 -692
- package/src/factory.ts +0 -694
- package/src/font.ts +0 -343
- package/src/fonts/academico.ts +0 -2
- package/src/fonts/academicobold.ts +0 -2
- package/src/fonts/bravura.ts +0 -2
- package/src/fonts/gonville.ts +0 -2
- package/src/fonts/petaluma.ts +0 -2
- package/src/fonts/petalumascript.ts +0 -2
- package/src/formatter.ts +0 -1107
- package/src/fraction.ts +0 -245
- package/src/frethandfinger.ts +0 -180
- package/src/ghostnote.ts +0 -75
- package/src/glyphnote.ts +0 -68
- package/src/glyphs.ts +0 -5880
- package/src/gracenote.ts +0 -146
- package/src/gracenotegroup.ts +0 -194
- package/src/gracetabnote.ts +0 -30
- package/src/index.ts +0 -90
- package/src/keymanager.ts +0 -153
- package/src/keysignature.ts +0 -272
- package/src/keysignote.ts +0 -46
- package/src/metrics.ts +0 -222
- package/src/modifier.ts +0 -216
- package/src/modifiercontext.ts +0 -177
- package/src/multimeasurerest.ts +0 -229
- package/src/music.ts +0 -443
- package/src/note.ts +0 -690
- package/src/notehead.ts +0 -158
- package/src/notesubgroup.ts +0 -88
- package/src/ornament.ts +0 -301
- package/src/parenthesis.ts +0 -89
- package/src/parser.ts +0 -263
- package/src/pedalmarking.ts +0 -273
- package/src/registry.ts +0 -146
- package/src/rendercontext.ts +0 -98
- package/src/renderer.ts +0 -166
- package/src/repeatnote.ts +0 -25
- package/src/stave.ts +0 -885
- package/src/stavebarline.ts +0 -231
- package/src/staveconnector.ts +0 -281
- package/src/stavehairpin.ts +0 -209
- package/src/staveline.ts +0 -343
- package/src/stavemodifier.ts +0 -93
- package/src/stavenote.ts +0 -1230
- package/src/staverepetition.ts +0 -148
- package/src/stavesection.ts +0 -54
- package/src/stavetempo.ts +0 -162
- package/src/stavetext.ts +0 -69
- package/src/stavetie.ts +0 -235
- package/src/stavevolta.ts +0 -66
- package/src/stem.ts +0 -225
- package/src/stemmablenote.ts +0 -248
- package/src/stringnumber.ts +0 -286
- package/src/strokes.ts +0 -214
- package/src/svgcontext.ts +0 -639
- package/src/system.ts +0 -327
- package/src/tables.ts +0 -796
- package/src/tabnote.ts +0 -449
- package/src/tabslide.ts +0 -115
- package/src/tabstave.ts +0 -31
- package/src/tabtie.ts +0 -44
- package/src/textbracket.ts +0 -231
- package/src/textdynamics.ts +0 -101
- package/src/textnote.ts +0 -175
- package/src/tickable.ts +0 -374
- package/src/tickcontext.ts +0 -280
- package/src/timesignature.ts +0 -229
- package/src/timesignote.ts +0 -45
- package/src/tremolo.ts +0 -51
- package/src/tuning.ts +0 -90
- package/src/tuplet.ts +0 -349
- package/src/typeguard.ts +0 -136
- package/src/util.ts +0 -169
- package/src/version.ts +0 -4
- package/src/vexflow.ts +0 -378
- package/src/vibrato.ts +0 -99
- package/src/vibratobracket.ts +0 -81
- package/src/voice.ts +0 -302
- package/src/web.ts +0 -35
package/src/barnote.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2023-present VexFlow contributors: https://github.com/vexflow/vexflow/graphs/contributors
|
|
2
|
-
// MIT License
|
|
3
|
-
|
|
4
|
-
import { ModifierContext } from './modifiercontext';
|
|
5
|
-
import { Note } from './note';
|
|
6
|
-
import { Barline, BarlineType } from './stavebarline';
|
|
7
|
-
import { Category } from './typeguard';
|
|
8
|
-
import { log } from './util';
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line
|
|
11
|
-
function L(...args: any[]) {
|
|
12
|
-
if (BarNote.DEBUG) log('VexFlow.BarNote', args);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A `BarNote` is used to render bar lines (from `barline.ts`). `BarNote`s can
|
|
17
|
-
* be added to a voice and rendered in the middle of a stave. Since it has no
|
|
18
|
-
* duration, it consumes no `tick`s, and is dealt with appropriately by the formatter.
|
|
19
|
-
*
|
|
20
|
-
* See `tests/barnote_tests.ts` for usage examples.
|
|
21
|
-
*/
|
|
22
|
-
export class BarNote extends Note {
|
|
23
|
-
/** To enable logging for this class. Set `VexFlow.BarNote.DEBUG` to `true`. */
|
|
24
|
-
static DEBUG: boolean = false;
|
|
25
|
-
|
|
26
|
-
static get CATEGORY(): string {
|
|
27
|
-
return Category.BarNote;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
protected metrics: { widths: Record<string, number> };
|
|
31
|
-
// Initialized by the constructor via this.setType(type)
|
|
32
|
-
protected type!: BarlineType;
|
|
33
|
-
|
|
34
|
-
constructor(type: string | BarlineType = BarlineType.SINGLE) {
|
|
35
|
-
super({ duration: 'b' });
|
|
36
|
-
|
|
37
|
-
this.metrics = {
|
|
38
|
-
widths: {},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const TYPE = BarlineType;
|
|
42
|
-
this.metrics.widths = {
|
|
43
|
-
[TYPE.SINGLE]: 8,
|
|
44
|
-
[TYPE.DOUBLE]: 12,
|
|
45
|
-
[TYPE.END]: 15,
|
|
46
|
-
[TYPE.REPEAT_BEGIN]: 14,
|
|
47
|
-
[TYPE.REPEAT_END]: 14,
|
|
48
|
-
[TYPE.REPEAT_BOTH]: 18,
|
|
49
|
-
[TYPE.NONE]: 0,
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
// Tell the formatter that bar notes have no duration.
|
|
53
|
-
this.ignoreTicks = true;
|
|
54
|
-
this.setType(type);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** Get the type of bar note.*/
|
|
58
|
-
getType(): BarlineType {
|
|
59
|
-
return this.type;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/** Set the type of bar note. */
|
|
63
|
-
setType(type: string | BarlineType): this {
|
|
64
|
-
this.type = typeof type === 'string' ? Barline.typeString[type] : type;
|
|
65
|
-
|
|
66
|
-
// Set width to width of relevant `Barline`.
|
|
67
|
-
this.setWidth(this.metrics.widths[this.type]);
|
|
68
|
-
return this;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/* Overridden to ignore */
|
|
72
|
-
// eslint-disable-next-line
|
|
73
|
-
addToModifierContext(mc: ModifierContext): this {
|
|
74
|
-
// DO NOTHING.
|
|
75
|
-
return this;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/** Overridden to ignore. */
|
|
79
|
-
preFormat(): this {
|
|
80
|
-
this.preFormatted = true;
|
|
81
|
-
return this;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** Render note to stave. */
|
|
85
|
-
draw(): void {
|
|
86
|
-
const ctx = this.checkContext();
|
|
87
|
-
L('Rendering bar line at: ', this.getAbsoluteX());
|
|
88
|
-
this.applyStyle(ctx);
|
|
89
|
-
const barline = new Barline(this.type);
|
|
90
|
-
barline.setX(this.getAbsoluteX());
|
|
91
|
-
barline.draw(this.checkStave());
|
|
92
|
-
this.restoreStyle(ctx);
|
|
93
|
-
this.setRendered();
|
|
94
|
-
}
|
|
95
|
-
}
|