|
@@ -4,10 +4,12 @@ import {SystemLinesEnum} from "../SystemLinesEnum";
|
|
import {SystemLinePosition} from "../SystemLinePosition";
|
|
import {SystemLinePosition} from "../SystemLinePosition";
|
|
import {StaffMeasure} from "../StaffMeasure";
|
|
import {StaffMeasure} from "../StaffMeasure";
|
|
import {SystemLine} from "../SystemLine";
|
|
import {SystemLine} from "../SystemLine";
|
|
|
|
+import {VexFlowStaffLine} from "./VexFlowStaffLine";
|
|
import {VexFlowMeasure} from "./VexFlowMeasure";
|
|
import {VexFlowMeasure} from "./VexFlowMeasure";
|
|
import {VexFlowConverter} from "./VexFlowConverter";
|
|
import {VexFlowConverter} from "./VexFlowConverter";
|
|
import {StaffLine} from "../StaffLine";
|
|
import {StaffLine} from "../StaffLine";
|
|
import {EngravingRules} from "../EngravingRules";
|
|
import {EngravingRules} from "../EngravingRules";
|
|
|
|
+import { VexFlowInstrumentBracket } from "./VexFlowInstrumentBracket";
|
|
|
|
|
|
export class VexFlowMusicSystem extends MusicSystem {
|
|
export class VexFlowMusicSystem extends MusicSystem {
|
|
constructor(parent: GraphicalMusicPage, id: number) {
|
|
constructor(parent: GraphicalMusicPage, id: number) {
|
|
@@ -50,22 +52,13 @@ export class VexFlowMusicSystem extends MusicSystem {
|
|
* @param firstStaffLine the upper StaffLine (use a cast to get the VexFlowStaffLine) of the brace to create
|
|
* @param firstStaffLine the upper StaffLine (use a cast to get the VexFlowStaffLine) of the brace to create
|
|
* @param lastStaffLine the lower StaffLine (use a cast to get the VexFlowStaffLine) of the brace to create
|
|
* @param lastStaffLine the lower StaffLine (use a cast to get the VexFlowStaffLine) of the brace to create
|
|
*/
|
|
*/
|
|
- protected createInstrumentBrace(firstStaffLine: StaffLine, lastStaffLine: StaffLine): void {
|
|
|
|
- // first cast the staff lines to get the VexFlow content:
|
|
|
|
- // let firstVexFlowStaffLine: VexFlowStaffLine = (firstStaffLine as VexFlowStaffLine);
|
|
|
|
- // let lastVexFlowStaffLine: VexFlowStaffLine = (lastStaffLine as VexFlowStaffLine);
|
|
|
|
- // Create a VexFlowInstrumentBrace object (class doesn't exist yet, shall extend GraphicalObject to have a BoundingBox)
|
|
|
|
- // do the following in the constructor of the VexFlowInstrumentBrace (which takes firstVexFlowStaffLine and lastVexFlowStaffLine as arguments):
|
|
|
|
- // create the Vexflow stave connector,
|
|
|
|
- // correctly connect it to the first and last VexFlowStaffLines
|
|
|
|
- // infer from VexFlow the bounding box size of the created brace.
|
|
|
|
- // transform the Vexflow coordinates to unit coordinate space.
|
|
|
|
- // set the VexFlowInstrumentBrace.boundingBox to these coordinates
|
|
|
|
- // finally add the graphical element to the music system with:
|
|
|
|
- // this.boundingBox.ChildElements.push(vexFlowInstrumentBrace.boundingBox);
|
|
|
|
- // and very importantly add the brace to the braces list of this system (needed to call the draw method in VexFlowMusicSheetDrawer later):
|
|
|
|
- // this.instrumentBrackets.push(vexFlowInstrumentBrace);
|
|
|
|
- return;
|
|
|
|
|
|
+ protected createInstrumentBracket(firstStaffLine: StaffLine, lastStaffLine: StaffLine): void {
|
|
|
|
+ // You could write this in one line but the linter doesn't let me.
|
|
|
|
+ const firstVexStaff: VexFlowStaffLine = (firstStaffLine as VexFlowStaffLine);
|
|
|
|
+ const lastVexStaff: VexFlowStaffLine = (lastStaffLine as VexFlowStaffLine);
|
|
|
|
+ const vexFlowBracket: VexFlowInstrumentBracket = new VexFlowInstrumentBracket(firstVexStaff, lastVexStaff);
|
|
|
|
+ this.InstrumentBrackets.push(vexFlowBracket);
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|