Sfoglia il codice sorgente

Added comments for where to implement code for repetition feature.

Matthias 8 anni fa
parent
commit
cd4db91402

+ 1 - 0
src/MusicalScore/Graphical/VexFlow/VexFlowConverter.ts

@@ -255,6 +255,7 @@ export class VexFlowConverter {
      * @returns {any}
      */
     public static line(lineType: SystemLinesEnum): any {
+        // ToDo: feature/Repetitions
         // TODO Not all line types are correctly mapped!
         switch (lineType) {
             case SystemLinesEnum.SingleThin:

+ 14 - 10
src/MusicalScore/Graphical/VexFlow/VexFlowMeasure.ts

@@ -81,16 +81,20 @@ export class VexFlowMeasure extends StaffMeasure {
      * @returns {SystemLinesEnum} the x-width
      */
     public getLineWidth(line: SystemLinesEnum): number {
-        // FIXME: See values in VexFlow's stavebarline.js
-        let vfline: any = VexFlowConverter.line(line);
-        switch (vfline) {
-            case Vex.Flow.StaveConnector.type.SINGLE:
-                return 1.0 / unitInPixels;
-            case Vex.Flow.StaveConnector.type.DOUBLE:
-                return 3.0 / unitInPixels;
-            default:
-                return 0;
-        }
+      // FIXME: See values in VexFlow's stavebarline.js
+
+      // ToDo: feature/Repetitions
+      // Extend the lineWidth calculation with all repetition lines.
+      // Change also the code in VexFlowConverter.line.
+      let vfline: any = VexFlowConverter.line(line);
+      switch (vfline) {
+          case Vex.Flow.StaveConnector.type.SINGLE:
+              return 1.0 / unitInPixels;
+          case Vex.Flow.StaveConnector.type.DOUBLE:
+              return 3.0 / unitInPixels;
+          default:
+              return 0;
+      }
     }
 
     /**

+ 3 - 1
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts

@@ -265,7 +265,9 @@ export class VexFlowMusicSheetCalculator extends MusicSheetCalculator {
           break;
         }
       }
-      // now create graphical symbol or Text in VexFlow:
+      // ToDo: feature/Repetitions
+      // now create corresponding graphical symbol or Text in VexFlow:
+      // use top measure and staffline for positioning.
       if (staffLine !== undefined) {
         let instruction: string = "";
         switch (repetitionInstruction.type) {

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

@@ -38,7 +38,9 @@ export class VexFlowMusicSystem extends MusicSystem {
     protected createSystemLine(xPosition: number, lineWidth: number, lineType: SystemLinesEnum, linePosition: SystemLinePosition,
                                musicSystem: MusicSystem, topMeasure: StaffMeasure, bottomMeasure: StaffMeasure = undefined): SystemLine {
         if (bottomMeasure) {
-            (bottomMeasure as VexFlowMeasure).lineTo(topMeasure as VexFlowMeasure, VexFlowConverter.line(lineType));
+          // ToDo: feature/Repetitions
+          // create here the correct lines according to the given lineType.
+          (bottomMeasure as VexFlowMeasure).lineTo(topMeasure as VexFlowMeasure, VexFlowConverter.line(lineType));
         }
         return new SystemLine(lineType, linePosition, this, topMeasure, bottomMeasure);
     }