Pārlūkot izejas kodu

fixed lint errors

Matthias 9 gadi atpakaļ
vecāks
revīzija
966b7bb170

+ 28 - 17
src/MusicalScore/Graphical/VexFlow/VexFlowConverter.ts

@@ -51,26 +51,37 @@ export class VexFlowConverter {
         let octave: number = pitch.Octave + clef.OctaveOffset + 3; // FIXME + 3
         let acc: string = "";
 
-        // switch (pitch.Accidental) {
-        //     case AccidentalEnum.NONE:
-        //         break;
-        //     case AccidentalEnum.FLAT:
-        //         acc = "b";
-        //         break;
-        //     case AccidentalEnum.SHARP:
-        //         acc = "#";
-        //         break;
-        //     case AccidentalEnum.DOUBLESHARP:
-        //         acc = "##";
-        //         break;
-        //     case AccidentalEnum.DOUBLEFLAT:
-        //         acc = "bb";
-        //         break;
-        //     default:
-        // }
         return [fund + acc + "/" + octave, acc, clef];
     }
 
+    /**
+     * Converts AccidentalEnum to vexFlow accidental string
+     * @param accidental
+     * @returns {string}
+     */
+    public static accidental(accidental: AccidentalEnum): string {
+        let acc: string = "";
+        switch (accidental) {
+            case AccidentalEnum.NONE:
+                break;
+            case AccidentalEnum.FLAT:
+                acc = "b";
+                break;
+            case AccidentalEnum.SHARP:
+                acc = "#";
+                break;
+            case AccidentalEnum.DOUBLESHARP:
+                acc = "##";
+                break;
+            case AccidentalEnum.DOUBLEFLAT:
+                acc = "bb";
+                break;
+            default:
+        }
+        return acc;
+    }
+
+
     public static StaveNote(notes: GraphicalNote[]): Vex.Flow.StaveNote {
         let keys: string[] = [];
         let frac: Fraction = notes[0].sourceNote.Length;

+ 1 - 1
src/MusicalScore/Graphical/VexFlow/VexFlowGraphicalSymbolFactory.ts

@@ -127,8 +127,8 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
      * @param graceScalingFactor
      */
     public addGraphicalAccidental(graphicalNote: GraphicalNote, pitch: Pitch, grace: boolean, graceScalingFactor: number): void {
-        let note: VexFlowGraphicalNote = <VexFlowGraphicalNote> graphicalNote;
         // ToDo: set accidental here from pitch.Accidental
+        // let note: VexFlowGraphicalNote = <VexFlowGraphicalNote> graphicalNote;
         //note.vfpitch = 
     }
 

+ 3 - 6
src/MusicalScore/ScoreIO/InstrumentReader.ts

@@ -787,8 +787,7 @@ export class InstrumentReader {
                             this.abstractInstructions.splice(i, 1);
                         }
                     }
-                }
-                else if (key <= this.activeClefs.length && clefInstruction === this.activeClefs[key - 1]) {
+                } else if (key <= this.activeClefs.length && clefInstruction === this.activeClefs[key - 1]) {
                     this.abstractInstructions.splice(i, 1);
                 }
             }
@@ -832,8 +831,7 @@ export class InstrumentReader {
                             }
                         }
                     }
-                }
-                else {
+                } else {
                     this.abstractInstructions.splice(i, 1);
                 }
             }
@@ -857,8 +855,7 @@ export class InstrumentReader {
                             firstStaffEntry.Instructions.push(newRhythmInstruction);
                         }
                     }
-                }
-                else {
+                } else {
                     this.abstractInstructions.splice(i, 1);
                 }
             }