فهرست منبع

Added comments for feature implementation

Matthias Uiberacker 7 سال پیش
والد
کامیت
5b3d8079ec

+ 2 - 2
src/MusicalScore/Graphical/MusicSheetDrawer.ts

@@ -239,7 +239,7 @@ export abstract class MusicSheetDrawer {
         // empty
         // empty
     }
     }
 
 
-    protected drawInstrumentBracket(bracket: GraphicalObject, system: MusicSystem): void {
+    protected drawInstrumentBrace(brace: GraphicalObject, system: MusicSystem): void {
         // empty
         // empty
     }
     }
 
 
@@ -300,7 +300,7 @@ export abstract class MusicSheetDrawer {
             }
             }
         }
         }
         for (let bracket of musicSystem.InstrumentBrackets) {
         for (let bracket of musicSystem.InstrumentBrackets) {
-            this.drawInstrumentBracket(bracket, musicSystem);
+            this.drawInstrumentBrace(bracket, musicSystem);
         }
         }
         for (let bracket of musicSystem.GroupBrackets) {
         for (let bracket of musicSystem.GroupBrackets) {
             this.drawGroupBracket(bracket, musicSystem);
             this.drawGroupBracket(bracket, musicSystem);

+ 3 - 2
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer.ts

@@ -83,8 +83,9 @@ export class VexFlowMusicSheetDrawer extends MusicSheetDrawer {
         }
         }
     }
     }
 
 
-    protected drawInstrumentBrace(bracket: GraphicalObject, system: MusicSystem): void {
-        // empty
+    protected drawInstrumentBrace(brace: GraphicalObject, system: MusicSystem): void {
+      // cast brace to VexFlowInstrumentBrace
+      // render it with Vexflow.
     }
     }
 
 
     protected drawGroupBracket(bracket: GraphicalObject, system: MusicSystem): void {
     protected drawGroupBracket(bracket: GraphicalObject, system: MusicSystem): void {

+ 15 - 1
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSystem.ts

@@ -51,7 +51,21 @@ export class VexFlowMusicSystem extends MusicSystem {
      * @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 {
     protected createInstrumentBrace(firstStaffLine: StaffLine, lastStaffLine: StaffLine): void {
-        return;
+      // 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;
     }
     }
 
 
     /**
     /**