Skip to content

Commit

Permalink
merge fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rvilarl committed Dec 25, 2022
1 parent d4b39d1 commit 9520eea
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 417 deletions.
52 changes: 26 additions & 26 deletions package.json
Expand Up @@ -68,58 +68,58 @@
},
"homepage": "http://opensheetmusicdisplay.org",
"dependencies": {
"jszip": "3.7.1",
"loglevel": "^1.8.0",
"jszip": "3.10.1",
"loglevel": "^1.8.1",
"typescript-collections": "^1.3.3",
"vexflow": "^4.2.0-beta.0"
},
"devDependencies": {
"@types/chai": "^4.3.0",
"@types/mocha": "^9.1.0",
"@types/node": "^17.0.15",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
"canvas": "^2.9.0",
"chai": "^4.3.6",
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"@types/node": "^18.11.17",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"canvas": "^2.11.0",
"chai": "^4.3.7",
"clean-webpack-plugin": "^4.0.0",
"cross-blob": "^3.0.1",
"cross-blob": "^3.0.2",
"cross-env": "^7.0.3",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.8.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsdoc": "^37.7.1",
"eslint": "^8.30.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.6.4",
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-standard": "^4.1.0",
"html-webpack-plugin": "^5.5.0",
"jquery": "^3.6.0",
"jsdom": "^19.0.0",
"jquery": "^3.6.3",
"jsdom": "^20.0.3",
"jspdf": "^2.5.1",
"karma": "^6.3.15",
"karma": "^6.4.1",
"karma-base64-to-js-preprocessor": "^0.1.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.1.0",
"karma-chrome-launcher": "^3.1.1",
"karma-firefox-launcher": "^2.1.2",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-webpack": "^5.0.0",
"karma-xml2js-preprocessor": "^0.1.0",
"mocha": "^9.2.0",
"mocha": "^10.2.0",
"ncp": "^2.0.0",
"npm-run-all": "^4.1.5",
"pre-commit": "^1.2.2",
"svg2pdf.js": "^2.2.0",
"ts-loader": "^9.2.6",
"typedoc": "^0.22.11",
"typescript": "^4.5.5",
"webpack": "^5.68.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4",
"svg2pdf.js": "^2.2.1",
"ts-loader": "^9.4.2",
"typedoc": "^0.23.23",
"typescript": "^4.9.4",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1",
"webpack-merge": "^5.8.0",
"webpack-visualizer-plugin2": "^1.0.0"
},
"optionalDependencies": {
"gl": "^5.0.0"
"gl": "^6.0.2"
},
"config": {
"commitizen": {
Expand Down
4 changes: 1 addition & 3 deletions src/MusicalScore/Graphical/VexFlow/VexFlowMeasure.ts
Expand Up @@ -415,9 +415,7 @@ export class VexFlowMeasure extends GraphicalMeasure {
break;
}
if (instruction) {
const repetition: VF.Repetition = new VF.Repetition(instruction, xShift, -this.rules.RepetitionSymbolsYOffset);
(repetition as any).xShiftAsPercentOfStaveWidth = this.rules.RepetitionEndInstructionXShiftAsPercentOfStaveWidth;
this.stave.addModifier(repetition, position);
this.stave.setRepetitionType(instruction, xShift);
return;
}

Expand Down
Expand Up @@ -1184,7 +1184,7 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
endBbox = vfPedal.endMeasure.PositionAndShape;
}
//Just for shorthand. Easier readability below
const PEDAL_STYLES_ENUM: any = Vex.Flow.PedalMarking.Styles;
const PEDAL_STYLES_ENUM: any = VF.PedalMarking.type;
const pedalMarking: any = vfPedal.getPedalMarking();
//VF adds 3 lines to whatever the pedal line is set to.
//VF also measures from the bottom line, whereas our bottom line is from the top staff line
Expand Down Expand Up @@ -1252,7 +1252,7 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
}
}
//Take into account in-staff clefs associated with the staff entry (they modify the bounding box position)
const vfClefBefore: Vex.Flow.ClefNote = (endVfVoiceEntry?.parentStaffEntry as VexFlowStaffEntry)?.vfClefBefore;
const vfClefBefore: VF.ClefNote = (endVfVoiceEntry?.parentStaffEntry as VexFlowStaffEntry)?.vfClefBefore;
if (vfClefBefore) {
const clefWidth: number = vfClefBefore.getWidth() / 10;
stopX += clefWidth;
Expand Down Expand Up @@ -1315,7 +1315,7 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
}
}
//Take into account in-staff clefs associated with the staff entry (they modify the bounding box position)
const vfOtherClefBefore: Vex.Flow.ClefNote = (vfOtherPedal.endVfVoiceEntry?.parentStaffEntry as VexFlowStaffEntry)?.vfClefBefore;
const vfOtherClefBefore: VF.ClefNote = (vfOtherPedal.endVfVoiceEntry?.parentStaffEntry as VexFlowStaffEntry)?.vfClefBefore;
if (vfOtherClefBefore) {
const otherClefWidth: number = vfOtherClefBefore.getWidth() / 10;
otherPedalStopX += otherClefWidth;
Expand Down
4 changes: 2 additions & 2 deletions src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer.ts
Expand Up @@ -374,8 +374,8 @@ export class VexFlowMusicSheetDrawer extends MusicSheetDrawer {
for (const graphicalPedal of staffLine.Pedals) {
if (graphicalPedal) {
const vexFlowPedal: VexFlowPedal = graphicalPedal as VexFlowPedal;
const ctx: Vex.IRenderContext = this.backend.getContext();
const pedalMarking: Vex.Flow.PedalMarking = vexFlowPedal.getPedalMarking();
const ctx: VF.RenderContext = this.backend.getContext();
const pedalMarking: VF.PedalMarking = vexFlowPedal.getPedalMarking();
(pedalMarking as any).render_options.color = this.rules.DefaultColorMusic;
pedalMarking.setContext(ctx);
pedalMarking.draw();
Expand Down
32 changes: 16 additions & 16 deletions src/MusicalScore/Graphical/VexFlow/VexFlowPedal.ts
@@ -1,4 +1,4 @@
import Vex from "vexflow";
import * as VF from "vexflow";
import { BoundingBox } from "../BoundingBox";
import { GraphicalStaffEntry } from "../GraphicalStaffEntry";
import { VexFlowVoiceEntry } from "./VexFlowVoiceEntry";
Expand All @@ -12,10 +12,10 @@ import { VexFlowMeasure } from "./VexFlowMeasure";
*/
export class VexFlowPedal extends GraphicalPedal {
/** Defines the note where the pedal starts */
public startNote: Vex.Flow.StemmableNote;
public startNote: VF.StemmableNote;
/** Defines the note where the pedal ends */
public endNote: Vex.Flow.StemmableNote;
private vfStyle: Vex.Flow.PedalMarking.Styles = Vex.Flow.PedalMarking.Styles.BRACKET;
public endNote: VF.StemmableNote;
private vfStyle = VF.PedalMarking.type.BRACKET;
public DepressText: string;
public ReleaseText: string;
public startVfVoiceEntry: VexFlowVoiceEntry;
Expand All @@ -38,30 +38,30 @@ export class VexFlowPedal extends GraphicalPedal {
switch (this.pedalSymbol) {
case MusicSymbol.PEDAL_SYMBOL:
//This renders the pedal symbols in VF.
this.vfStyle = Vex.Flow.PedalMarking.Styles.TEXT;
this.vfStyle = VF.PedalMarking.type.TEXT;
this.EndSymbolPositionAndShape = new BoundingBox(this, parent);
break;
case MusicSymbol.PEDAL_MIXED:
if (openBegin && openEnd) {
this.vfStyle = (Vex.Flow.PedalMarking.Styles as any).BRACKET_OPEN_BOTH;
this.vfStyle = (VF.PedalMarking.type as any).BRACKET_OPEN_BOTH;
} else if (openBegin) {
this.vfStyle = (Vex.Flow.PedalMarking.Styles as any).BRACKET_OPEN_BEGIN;
this.vfStyle = (VF.PedalMarking.type as any).BRACKET_OPEN_BEGIN;
} else if (openEnd) {
this.vfStyle = (Vex.Flow.PedalMarking.Styles as any).MIXED_OPEN_END;
this.vfStyle = (VF.PedalMarking.type as any).MIXED_OPEN_END;
} else {
this.vfStyle = Vex.Flow.PedalMarking.Styles.MIXED;
this.vfStyle = VF.PedalMarking.type.MIXED;
}
break;
case MusicSymbol.PEDAL_BRACKET:
default:
if (openBegin && openEnd) {
this.vfStyle = (Vex.Flow.PedalMarking.Styles as any).BRACKET_OPEN_BOTH;
this.vfStyle = (VF.PedalMarking.type as any).BRACKET_OPEN_BOTH;
} else if (openBegin) {
this.vfStyle = (Vex.Flow.PedalMarking.Styles as any).BRACKET_OPEN_BEGIN;
this.vfStyle = (VF.PedalMarking.type as any).BRACKET_OPEN_BEGIN;
} else if (openEnd) {
this.vfStyle = (Vex.Flow.PedalMarking.Styles as any).BRACKET_OPEN_END;
this.vfStyle = (VF.PedalMarking.type as any).BRACKET_OPEN_END;
} else {
this.vfStyle = Vex.Flow.PedalMarking.Styles.BRACKET;
this.vfStyle = VF.PedalMarking.type.BRACKET;
}
break;
}
Expand Down Expand Up @@ -120,12 +120,12 @@ export class VexFlowPedal extends GraphicalPedal {
/**
* Get the actual vexflow Pedal Marking used for drawing
*/
public getPedalMarking(): Vex.Flow.PedalMarking {
const pedalMarking: Vex.Flow.PedalMarking = new Vex.Flow.PedalMarking([this.startNote, this.endNote]);
public getPedalMarking(): VF.PedalMarking {
const pedalMarking: VF.PedalMarking = new VF.PedalMarking([this.startNote as VF.StaveNote, this.endNote as VF.StaveNote]);
if (this.endMeasure) {
(pedalMarking as any).setEndStave((this.endMeasure as VexFlowMeasure).getVFStave());
}
pedalMarking.setStyle(this.vfStyle);
pedalMarking.setType(this.vfStyle);
pedalMarking.setLine(this.line);
pedalMarking.setCustomText(this.DepressText, this.ReleaseText);
//If our end note is at the end of a stave, set that value
Expand Down
Empty file removed src/VexFlowPatch/readme.txt
Empty file.
Empty file.

0 comments on commit 9520eea

Please sign in to comment.