Browse Source

Refactoring to hand over top and bottom measure for system line generation.
Added more graphical objects for future use.

Matthias 10 năm trước cách đây
mục cha
commit
ccc90cf7d6

+ 1 - 1
src/MusicalScore/Graphical/GraphicalComment.ts

@@ -6,4 +6,4 @@ export class GraphicalComment {
     }
     public label: GraphicalLabel;
     public settings: GraphicalLabel;
-}
+}

+ 3 - 2
src/MusicalScore/Graphical/GraphicalMarkedArea.ts

@@ -1,7 +1,8 @@
 import {GraphicalLabel} from "./GraphicalLabel";
 import {GraphicalRectangle} from "./GraphicalRectangle";
 export class GraphicalMarkedArea {
-    constructor(systemRectangle: GraphicalRectangle, labelRectangle: GraphicalRectangle = null, label: GraphicalLabel = null, settingsLabel: GraphicalLabel = null) {
+    constructor(systemRectangle: GraphicalRectangle, labelRectangle: GraphicalRectangle = undefined, label: GraphicalLabel = undefined,
+                settingsLabel: GraphicalLabel = undefined) {
         this.systemRectangle = systemRectangle;
         this.labelRectangle = labelRectangle;
         this.label = label;
@@ -11,4 +12,4 @@ export class GraphicalMarkedArea {
     public labelRectangle: GraphicalRectangle;
     public label: GraphicalLabel;
     public settings: GraphicalLabel;
-}
+}

+ 1 - 1
src/MusicalScore/Graphical/GraphicalRectangle.ts

@@ -12,4 +12,4 @@ export class GraphicalRectangle extends GraphicalObject {
         this.style = style;
     }
     public style: OutlineAndFillStyleEnum;
-}
+}

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

@@ -364,12 +364,12 @@ export abstract class MusicSheetCalculator {
                 musicSystem.setMusicSystemLabelsYPosition();
                 if (!this.leadSheet) {
                     musicSystem.setYPositionsToVerticalLineObjectsAndCreateLines(this.rules);
-                    musicSystem.createSystemLeftVerticalLineObject(this.rules.SystemThinLineWidth, this.rules.SystemLabelsRightMargin);
+                    musicSystem.createSystemLeftLine(this.rules.SystemThinLineWidth, this.rules.SystemLabelsRightMargin);
                     musicSystem.createInstrumentBrackets(this.graphicalMusicSheet.ParentMusicSheet.Instruments, this.rules.StaffHeight);
                     musicSystem.createGroupBrackets(this.graphicalMusicSheet.ParentMusicSheet.InstrumentalGroups, this.rules.StaffHeight, 0);
                     musicSystem.alignBeginInstructions();
                 } else if (musicSystem === musicSystem.Parent.MusicSystems[0]) {
-                    musicSystem.createSystemLeftVerticalLineObject(this.rules.SystemThinLineWidth, this.rules.SystemLabelsRightMargin);
+                    musicSystem.createSystemLeftLine(this.rules.SystemThinLineWidth, this.rules.SystemLabelsRightMargin);
                 }
                 musicSystem.calculateBorders(this.rules);
             }

+ 60 - 3
src/MusicalScore/Graphical/MusicSystem.ts

@@ -17,6 +17,9 @@ import Dictionary from "typescript-collections/dist/lib/Dictionary";
 import {CollectionUtil} from "../../Util/collectionUtil";
 import {GraphicalComment} from "./GraphicalComment";
 import {GraphicalMarkedArea} from "./GraphicalMarkedArea";
+import {SystemLine} from "./SystemLine";
+import {SystemLinePosition} from "./SystemLinePosition";
+import {Staff} from "../VoiceData/Staff";
 
 export abstract class MusicSystem extends GraphicalObject {
     public needsToBeRedrawn: boolean = true;
@@ -32,13 +35,16 @@ export abstract class MusicSystem extends GraphicalObject {
     protected groupBrackets: GraphicalObject[] = [];
     protected graphicalMarkedAreas: GraphicalMarkedArea[] = [];
     protected graphicalComments: GraphicalComment[] = [];
-    protected
+    protected systemLines: SystemLine[]  = [];
+    protected rules: EngravingRules;
+
     constructor(parent: GraphicalMusicPage, id: number) {
         super();
         this.parent = parent;
         this.id = id;
         this.boundingBox = new BoundingBox(this, parent.PositionAndShape);
         this.maxLabelLength = 0.0;
+        this.rules = this.parent.Parent.ParentMusicSheet.Rules;
     }
 
     public get Parent(): GraphicalMusicPage {
@@ -85,15 +91,66 @@ export abstract class MusicSystem extends GraphicalObject {
         return this.graphicalComments;
     }
 
+    public get SystemLines(): SystemLine[] {
+        return this.systemLines;
+    }
+
     public get Id(): number {
         return this.id;
     }
 
-    public createSystemLeftVerticalLineObject(lineWidth: number, systemLabelsRightMargin: number): void {
+    public createSystemLeftLine(lineWidth: number, systemLabelsRightMargin: number): void {
         throw new Error("not implemented");
     }
 
-    public createVerticalLineForMeasure(position: number, lineType: SystemLinesEnum, lineWidth: number, index: number): void {
+    /**
+     * This method creates the vertical Lines after the End of all StaffLine's Measures
+     * @param xPosition
+     * @param lineWidth
+     * @param lineType
+     * @param linePosition indicates if the line belongs to start or end of measure
+     * @param measureIndex the measure index within the staffline
+     * @param measure
+     */
+    public createVerticalLineForMeasure(xPosition: number, lineWidth: number, lineType: SystemLinesEnum, linePosition: SystemLinePosition,
+                                        measureIndex: number, measure: StaffMeasure): void {
+        let staffLine: StaffLine = measure.ParentStaffLine;
+        let staffLineRelative: PointF2D = new PointF2D(staffLine.PositionAndShape.RelativePosition.x,
+                                                       staffLine.PositionAndShape.RelativePosition.y);
+        let staves: Staff[]  = staffLine.ParentStaff.ParentInstrument.Staves;
+        if (staffLine.ParentStaff === staves[0]) {
+            let bottomMeasure: StaffMeasure = undefined;
+            if (staves.length > 1) {
+                let last: Staff = staves[staves.length - 1];
+                for (let line of staffLine.ParentMusicSystem.staffLines) {
+                    if (line.ParentStaff === last) {
+                        bottomMeasure = line.Measures[measureIndex];
+                        break;
+                    }
+                }
+            }
+            let singleVerticalLineAfterMeasure: SystemLine = this.createSystemLine(xPosition, lineWidth, lineType, linePosition, this, measure, bottomMeasure);
+            let systemXPosition: number = staffLineRelative.x + xPosition;
+            singleVerticalLineAfterMeasure.PositionAndShape.RelativePosition = new PointF2D(systemXPosition, 0);
+            singleVerticalLineAfterMeasure.PositionAndShape.BorderLeft = 0;
+            singleVerticalLineAfterMeasure.PositionAndShape.BorderRight = lineWidth;
+            this.SystemLines.push(singleVerticalLineAfterMeasure);
+            this.boundingBox.ChildElements.push(singleVerticalLineAfterMeasure.PositionAndShape);
+        }
+    }
+
+    /**
+     * This method creates all the graphical lines and dots needed to render a system line (e.g. bold-thin-dots..).
+     * @param xPosition
+     * @param lineWidth
+     * @param lineType
+     * @param linePosition indicates if the line belongs to start or end of measure
+     * @param musicSystem
+     * @param topMeasure
+     * @param bottomMeasure
+     */
+    public createSystemLine(xPosition: number, lineWidth: number, lineType: SystemLinesEnum, linePosition: SystemLinePosition,
+                            musicSystem: MusicSystem, topMeasure: StaffMeasure, bottomMeasure: StaffMeasure = undefined): SystemLine {
         throw new Error("not implemented");
     }
 

+ 13 - 11
src/MusicalScore/Graphical/MusicSystemBuilder.ts

@@ -20,6 +20,7 @@ import {IGraphicalSymbolFactory} from "../Interfaces/IGraphicalSymbolFactory";
 import {MusicSheetCalculator} from "./MusicSheetCalculator";
 import {MidiInstrument} from "../VoiceData/Instructions/ClefInstruction";
 import {CollectionUtil} from "../../Util/collectionUtil";
+import {SystemLinePosition} from "./SystemLinePosition";
 
 export class MusicSystemBuilder {
     private measureList: StaffMeasure[][];
@@ -719,39 +720,40 @@ export class MusicSystemBuilder {
         for (let visStaffIdx: number = 0, len: number = currentSystem.StaffLines.length; visStaffIdx < len; ++visStaffIdx) {
             let staffLine: StaffLine = currentSystem.StaffLines[visStaffIdx];
             let currentXPosition: number = 0.0;
-            for (let i: number = 0; i < staffLine.Measures.length; i++) {
-                let measure: StaffMeasure = staffLine.Measures[i];
+            for (let measureIndex: number = 0; measureIndex < staffLine.Measures.length; measureIndex++) {
+                let measure: StaffMeasure = staffLine.Measures[measureIndex];
                 measure.setPositionInStaffline(currentXPosition);
                 measure.setWidth(measure.beginInstructionsWidth + measure.minimumStaffEntriesWidth * scalingFactor + measure.endInstructionsWidth);
-                if (i < this.currentSystemParams.systemMeasures.length) {
-                    let startLine: SystemLinesEnum = this.currentSystemParams.systemMeasures[i].beginLine;
+                if (measureIndex < this.currentSystemParams.systemMeasures.length) {
+                    let startLine: SystemLinesEnum = this.currentSystemParams.systemMeasures[measureIndex].beginLine;
                     let lineWidth: number = measure.getLineWidth(SystemLinesEnum.BoldThinDots);
                     switch (startLine) {
                         case SystemLinesEnum.BoldThinDots:
                             let xPosition: number = currentXPosition;
-                            if (i === 0) {
+                            if (measureIndex === 0) {
                                 xPosition = currentXPosition + measure.beginInstructionsWidth - lineWidth;
                             }
-                            currentSystem.createVerticalLineForMeasure(xPosition, SystemLinesEnum.BoldThinDots, lineWidth, visStaffIdx);
+
+                            currentSystem.createVerticalLineForMeasure(xPosition, lineWidth, startLine, SystemLinePosition.MeasureBegin, measureIndex, measure);
                             break;
                         default:
                     }
                 }
                 measure.staffEntriesScaleFactor = scalingFactor;
                 measure.layoutSymbols();
-                let nextMeasureHasRepStartLine: boolean = i + 1 < this.currentSystemParams.systemMeasures.length
-                    && this.currentSystemParams.systemMeasures[i + 1].beginLine === SystemLinesEnum.BoldThinDots;
+                let nextMeasureHasRepStartLine: boolean = measureIndex + 1 < this.currentSystemParams.systemMeasures.length
+                    && this.currentSystemParams.systemMeasures[measureIndex + 1].beginLine === SystemLinesEnum.BoldThinDots;
                 if (!nextMeasureHasRepStartLine) {
                     let endLine: SystemLinesEnum = SystemLinesEnum.SingleThin;
-                    if (i < this.currentSystemParams.systemMeasures.length) {
-                        endLine = this.currentSystemParams.systemMeasures[i].endLine;
+                    if (measureIndex < this.currentSystemParams.systemMeasures.length) {
+                        endLine = this.currentSystemParams.systemMeasures[measureIndex].endLine;
                     }
                     let lineWidth: number = measure.getLineWidth(endLine);
                     let xPos: number = measure.PositionAndShape.RelativePosition.x + measure.PositionAndShape.BorderRight - lineWidth;
                     if (endLine === SystemLinesEnum.DotsBoldBoldDots) {
                         xPos -= lineWidth / 2;
                     }
-                    currentSystem.createVerticalLineForMeasure(xPos, endLine, lineWidth, visStaffIdx);
+                    currentSystem.createVerticalLineForMeasure(xPos, lineWidth, endLine, SystemLinePosition.MeasureEnd, measureIndex, measure);
                 }
                 currentXPosition = measure.PositionAndShape.RelativePosition.x + measure.PositionAndShape.BorderRight;
             }

+ 48 - 0
src/MusicalScore/Graphical/SystemLine.ts

@@ -0,0 +1,48 @@
+import {StaffMeasure} from "./StaffMeasure";
+import {StaffLine} from "./StaffLine";
+import {MusicSystem} from "./MusicSystem";
+import {SystemLinePosition} from "./SystemLinePosition";
+import {SystemLinesEnum} from "./SystemLinesEnum";
+import {BoundingBox} from "./BoundingBox";
+import {GraphicalObject} from "./GraphicalObject";
+import {EngravingRules} from "./EngravingRules";
+export class SystemLine extends GraphicalObject {
+    constructor(lineType: SystemLinesEnum, linePosition: SystemLinePosition, musicSystem: MusicSystem,
+                topMeasure: StaffMeasure, bottomMeasure: StaffMeasure = undefined) {
+        super();
+        this.lineType = lineType;
+        this.linePosition = linePosition;
+        this.parentMusicSystem = musicSystem;
+        this.topMeasure = topMeasure;
+        this.bottomMeasure = bottomMeasure;
+        this.parentTopStaffLine = topMeasure.ParentStaffLine;
+        this.boundingBox = new BoundingBox(this, musicSystem.PositionAndShape);
+    }
+    public lineType: SystemLinesEnum;
+    public linePosition: SystemLinePosition;
+    public parentMusicSystem: MusicSystem;
+    public parentTopStaffLine: StaffLine;
+    public topMeasure: StaffMeasure;
+    public bottomMeasure: StaffMeasure;
+    public static getObjectWidthForLineType(rules: EngravingRules, systemLineType: SystemLinesEnum): number {
+        switch (systemLineType) {
+            case SystemLinesEnum.SingleThin:
+                return rules.SystemThinLineWidth;
+            case SystemLinesEnum.DoubleThin:
+                return rules.SystemThinLineWidth * 2 + rules.DistanceBetweenVerticalSystemLines;
+            case SystemLinesEnum.ThinBold:
+                return rules.SystemThinLineWidth + rules.SystemBoldLineWidth + rules.DistanceBetweenVerticalSystemLines;
+            case SystemLinesEnum.BoldThinDots:
+                return rules.SystemThinLineWidth + rules.SystemBoldLineWidth + rules.DistanceBetweenVerticalSystemLines + rules.SystemDotWidth +
+                    rules.DistanceBetweenDotAndLine;
+            case SystemLinesEnum.DotsThinBold:
+                return rules.SystemThinLineWidth + rules.SystemBoldLineWidth + rules.DistanceBetweenVerticalSystemLines + rules.SystemDotWidth +
+                    rules.DistanceBetweenDotAndLine;
+            case SystemLinesEnum.DotsBoldBoldDots:
+                return 2 * rules.SystemBoldLineWidth + 2 * rules.SystemDotWidth + 2 * rules.DistanceBetweenDotAndLine +
+                    rules.DistanceBetweenVerticalSystemLines;
+            default:
+                return 0;
+        }
+    }
+}

+ 4 - 0
src/MusicalScore/Graphical/SystemLinePosition.ts

@@ -0,0 +1,4 @@
+export enum SystemLinePosition {
+    MeasureBegin,
+    MeasureEnd
+}

+ 20 - 0
src/MusicalScore/Graphical/VexFlow/VexFlowMusicSystem.ts

@@ -3,6 +3,9 @@ import {GraphicalMusicPage} from "../GraphicalMusicPage";
 import {SystemLinesEnum} from "../SystemLinesEnum";
 import {EngravingRules} from "../EngravingRules";
 import {PointF2D} from "../../../Common/DataObjects/PointF2D";
+import {SystemLinePosition} from "../SystemLinePosition";
+import {StaffMeasure} from "../StaffMeasure";
+import {SystemLine} from "../SystemLine";
 
 export class VexFlowMusicSystem extends MusicSystem {
     constructor(parent: GraphicalMusicPage, id: number) {
@@ -31,6 +34,23 @@ export class VexFlowMusicSystem extends MusicSystem {
     }
 
     /**
+     * This method creates all the graphical lines and dots needed to render a system line (e.g. bold-thin-dots..).
+     * @param xPosition
+     * @param lineWidth
+     * @param lineType
+     * @param linePosition indicates if the line belongs to start or end of measure
+     * @param musicSystem
+     * @param topMeasure
+     * @param bottomMeasure
+     */
+    public createSystemLine(xPosition: number, lineWidth: number, lineType: SystemLinesEnum, linePosition: SystemLinePosition,
+                            musicSystem: MusicSystem, topMeasure: StaffMeasure, bottomMeasure: StaffMeasure = undefined): SystemLine {
+        // ToDo: create line in Vexflow
+
+        return new SystemLine(lineType, linePosition, this, topMeasure, bottomMeasure);
+    }
+
+    /**
      * This method sets the y-Positions of vertical Line Objects and creates the Lines within.
      * @param rules
      */

+ 17 - 12
src/MusicalScore/ScoreIO/InstrumentReader.ts

@@ -243,7 +243,8 @@ export class InstrumentReader {
                     if (divisionsNode !== undefined) {
                         this.divisions = parseInt(divisionsNode.value, 10);
                         if (isNaN(this.divisions)) {
-                            let errorMsg: string = ITextTranslation.translateText("ReaderErrorMessages/DivisionError", "Invalid divisions value at Instrument: ");
+                            let errorMsg: string = ITextTranslation.translateText(  "ReaderErrorMessages/DivisionError",
+                                                                                    "Invalid divisions value at Instrument: ");
                             Logging.debug("InstrumentReader.readNextXmlMeasure", errorMsg);
                             this.divisions = this.readDivisionsFromNotes();
                             if (this.divisions > 0) {
@@ -270,7 +271,8 @@ export class InstrumentReader {
                         }
                     }
                     this.addAbstractInstruction(xmlNode, guitarPro);
-                    if (currentFraction.Equals(new Fraction(0, 1)) && this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex], xmlNode)) {
+                    if (currentFraction.Equals(new Fraction(0, 1)) &&
+                        this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex], xmlNode)) {
                         this.saveAbstractInstructionList(this.instrument.Staves.length, true);
                     }
                     if (this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex], xmlNode)) {
@@ -298,7 +300,8 @@ export class InstrumentReader {
                     }
                     // unused: let handeled: boolean = false;
                     // (*) if (this.repetitionInstructionReader !== undefined) {
-                    //  handeled = this.repetitionInstructionReader.handleRepetitionInstructionsFromWordsOrSymbols(directionTypeNode, relativePositionInMeasure);
+                    //  handeled = this.repetitionInstructionReader.handleRepetitionInstructionsFromWordsOrSymbols(directionTypeNode,
+                    //                                                                                              relativePositionInMeasure);
                     //}
                     //if (!handeled) {
                     //  let expressionReader: ExpressionReader = this.expressionReaders[0];
@@ -740,33 +743,35 @@ export class InstrumentReader {
                         let firstStaffEntry: SourceStaffEntry;
                         if (this.currentMeasure !== undefined) {
                             let newClefInstruction: ClefInstruction = clefInstruction;
+                            let sseIndex: number = this.inSourceMeasureInstrumentIndex + key - 1;
+                            let firstSse: SourceStaffEntry = this.currentMeasure.FirstInstructionsStaffEntries[sseIndex];
                             if (this.currentXmlMeasureIndex === 0) {
-                                if (this.currentMeasure.FirstInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex + key - 1] === undefined) {
+                                if (firstSse === undefined) {
                                     firstStaffEntry = new SourceStaffEntry(undefined, undefined);
-                                    this.currentMeasure.FirstInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex + key - 1] = firstStaffEntry;
+                                    this.currentMeasure.FirstInstructionsStaffEntries[sseIndex] = firstStaffEntry;
                                     newClefInstruction.Parent = firstStaffEntry;
                                     firstStaffEntry.Instructions.push(newClefInstruction);
                                     this.activeClefsHaveBeenInitialized[key - 1] = true;
-                                } else if (this.currentMeasure.FirstInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex + key - 1]
+                                } else if (this.currentMeasure.FirstInstructionsStaffEntries[sseIndex]
                                     !==
-                                    undefined && !(this.currentMeasure.FirstInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex + key - 1].Instructions[0] instanceof ClefInstruction)) {
-                                    firstStaffEntry = this.currentMeasure.FirstInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex + key - 1];
+                                    undefined && !(firstSse.Instructions[0] instanceof ClefInstruction)) {
+                                    firstStaffEntry = firstSse;
                                     newClefInstruction.Parent = firstStaffEntry;
                                     firstStaffEntry.removeFirstInstructionOfType<ClefInstruction>();
                                     firstStaffEntry.Instructions.splice(0, 0, newClefInstruction);
                                     this.activeClefsHaveBeenInitialized[key - 1] = true;
                                 } else {
                                     let lastStaffEntry: SourceStaffEntry = new SourceStaffEntry(undefined, undefined);
-                                    this.currentMeasure.LastInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex + key - 1] = lastStaffEntry;
+                                    this.currentMeasure.LastInstructionsStaffEntries[sseIndex] = lastStaffEntry;
                                     newClefInstruction.Parent = lastStaffEntry;
                                     lastStaffEntry.Instructions.push(newClefInstruction);
                                 }
                             } else if (!this.activeClefsHaveBeenInitialized[key - 1]) {
                                 let first: SourceMeasure = this.musicSheet.SourceMeasures[0];
-                                if (first.FirstInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex + key - 1] === undefined) {
+                                if (first.FirstInstructionsStaffEntries[sseIndex] === undefined) {
                                     firstStaffEntry = new SourceStaffEntry(undefined, undefined);
                                 } else {
-                                    firstStaffEntry = first.FirstInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex + key - 1];
+                                    firstStaffEntry = first.FirstInstructionsStaffEntries[sseIndex];
                                     firstStaffEntry.removeFirstInstructionOfType<ClefInstruction>();
                                 }
                                 newClefInstruction.Parent = firstStaffEntry;
@@ -774,7 +779,7 @@ export class InstrumentReader {
                                 this.activeClefsHaveBeenInitialized[key - 1] = true;
                             } else {
                                 let lastStaffEntry: SourceStaffEntry = new SourceStaffEntry(undefined, undefined);
-                                this.previousMeasure.LastInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex + key - 1] = lastStaffEntry;
+                                this.previousMeasure.LastInstructionsStaffEntries[sseIndex] = lastStaffEntry;
                                 newClefInstruction.Parent = lastStaffEntry;
                                 lastStaffEntry.Instructions.push(newClefInstruction);
                             }

+ 4 - 2
src/MusicalScore/ScoreIO/MusicSheetReader.ts

@@ -253,7 +253,8 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
             let rhythmInstruction: RhythmInstruction = rhythmInstructions[index].clone();
             for (let i: number = 0; i < this.completeNumberOfStaves; i++) {
                 if (
-                    this.currentMeasure.FirstInstructionsStaffEntries[i] !== undefined && !(this._lastElement(this.currentMeasure.FirstInstructionsStaffEntries[i].Instructions) instanceof RhythmInstruction)
+                    this.currentMeasure.FirstInstructionsStaffEntries[i] !== undefined &&
+                    !(this._lastElement(this.currentMeasure.FirstInstructionsStaffEntries[i].Instructions) instanceof RhythmInstruction)
                 ) {
                     this.currentMeasure.FirstInstructionsStaffEntries[i].removeAllInstructionsOfTypeRhythmInstruction();
                     this.currentMeasure.FirstInstructionsStaffEntries[i].Instructions.push(rhythmInstruction.clone());
@@ -361,7 +362,8 @@ export class MusicSheetReader /*implements IMusicSheetReader*/ {
                 for (let staffIndex: number = 0; staffIndex < this.musicSheet.Instruments[i].Staves.length; staffIndex++) {
                     if (!this.staffMeasureIsEmpty(firstStaffIndexOfInstrument + staffIndex)) {
                         this.currentMeasure.setErrorInStaffMeasure(firstStaffIndexOfInstrument + staffIndex, true);
-                        let errorMsg: string = ITextTranslation.translateText("ReaderErrorMessages/MissingNotesError", "Given Notes don't correspond to measure duration.");
+                        let errorMsg: string = ITextTranslation.translateText("ReaderErrorMessages/MissingNotesError",
+                                                                              "Given Notes don't correspond to measure duration.");
                         this.musicSheet.SheetErrors.pushMeasureError(errorMsg);
                     }
                 }