| 
					
				 | 
			
			
				@@ -9,7 +9,7 @@ import {GraphicalLine} from "./GraphicalLine"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import {MusicSystem} from "./MusicSystem"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import {GraphicalStaffEntry} from "./GraphicalStaffEntry"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import {SourceStaffEntry} from "../VoiceData/SourceStaffEntry"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import {PointF_2D} from "../../Common/DataObjects/PointF_2D"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import {PointF2D} from "../../Common/DataObjects/PointF2D"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import {ClefInstruction} from "../VoiceData/Instructions/ClefInstruction"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import {AbstractNotationInstruction} from "../VoiceData/Instructions/AbstractNotationInstruction"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import {KeyInstruction} from "../VoiceData/Instructions/KeyInstruction"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -20,6 +20,8 @@ import {BoundingBox} from "./BoundingBox"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import {VoiceEntry} from "../VoiceData/VoiceEntry"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import {Note} from "../VoiceData/Note"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import {MusicSheetCalculator} from "./MusicSheetCalculator"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import {Logging} from "../../Common/logging"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     constructor(musicSheet: MusicSheet, calculator: MusicSheetCalculator) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.musicSheet = musicSheet; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -28,8 +30,9 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.SourceToGraphicalMeasureLinks = new Dictionary<SourceMeasure, StaffMeasure[]>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.calculator.initialize(this); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private musicSheet: MusicSheet; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private fontInfo: FontInfo = this.FontInfo.Info; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private fontInfo: FontInfo = FontInfo.Info; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private calculator: MusicSheetCalculator; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private musicPages: GraphicalMusicPage[] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private measureList: StaffMeasure[][] = []; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -43,97 +46,127 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private systemImages: Dictionary<MusicSystem, SystemImageProperties> = new Dictionary<MusicSystem, SystemImageProperties>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private numberOfStaves: number; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private leadSheet: boolean = false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get ParentMusicSheet(): MusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.musicSheet; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get GetCalculator(): MusicSheetCalculator { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.calculator; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get MusicPages(): GraphicalMusicPage[] { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.musicPages; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public set MusicPages(value: GraphicalMusicPage[]) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.musicPages = value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get FontInfo(): FontInfo { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.fontInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get MeasureList(): StaffMeasure[][] { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.measureList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public set MeasureList(value: StaffMeasure[][]) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.measureList = value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get VerticalGraphicalStaffEntryContainers(): VerticalGraphicalStaffEntryContainer[] { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.verticalGraphicalStaffEntryContainers; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public set VerticalGraphicalStaffEntryContainers(value: VerticalGraphicalStaffEntryContainer[]) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.verticalGraphicalStaffEntryContainers = value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get Title(): GraphicalLabel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.title; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public set Title(value: GraphicalLabel) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.title = value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get Subtitle(): GraphicalLabel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.subtitle; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public set Subtitle(value: GraphicalLabel) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.subtitle = value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get Composer(): GraphicalLabel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.composer; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public set Composer(value: GraphicalLabel) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.composer = value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get Lyricist(): GraphicalLabel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.lyricist; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public set Lyricist(value: GraphicalLabel) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.lyricist = value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get ScoreFollowingLines(): GraphicalLine[] { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.scoreFollowingLines; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get MaxAllowedSystemWidth(): number { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.maxAllowedSystemWidth; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public set MaxAllowedSystemWidth(value: number) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.maxAllowedSystemWidth = value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get SystemImages(): Dictionary<MusicSystem, SystemImageProperties> { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.systemImages; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public SourceToGraphicalMeasureLinks: Dictionary<SourceMeasure, StaffMeasure[]>; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //public SourceToGraphicalMeasureLinks: Dictionary<SourceMeasure, StaffMeasure[]>; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get NumberOfStaves(): number { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.numberOfStaves; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public get LeadSheet(): boolean { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.leadSheet; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public set LeadSheet(value: boolean) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.leadSheet = value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public static transformRelativeToAbsolutePosition(graphicalMusicSheet: GraphicalMusicSheet): void { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let i: number = 0; i < graphicalMusicSheet.MusicPages.length; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            let pageAbsolute: PointF_2D = graphicalMusicSheet.MusicPages[i].setMusicPageAbsolutePosition(i, graphicalMusicSheet.ParentMusicSheet.Rules); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            let pageAbsolute: PointF2D = graphicalMusicSheet.MusicPages[i].setMusicPageAbsolutePosition(i, graphicalMusicSheet.ParentMusicSheet.rules); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let page: GraphicalMusicPage = graphicalMusicSheet.MusicPages[i]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            page.PositionAndShape.calculateAbsolutePositionsRecursive(pageAbsolute.X, pageAbsolute.Y); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            page.PositionAndShape.calculateAbsolutePositionsRecursive(pageAbsolute.x, pageAbsolute.y); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public Initialize(): void { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.verticalGraphicalStaffEntryContainers = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.musicPages = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.measureList = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public reCalculate(): void { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.calculator.calculate(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public prepare(): void { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.calculator.prepareGraphicalMusicSheet(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public EnforceRedrawOfMusicSystems(): void { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = this.musicPages.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let graphicalMusicPage: GraphicalMusicPage = this.musicPages[idx]; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -143,62 +176,70 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public getClickedObject<T>(positionOnMusicSheet: PointF_2D): T { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public getClickedObject<T>(positionOnMusicSheet: PointF2D): T { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = this.MusicPages.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let graphicalMusicPage: GraphicalMusicPage = this.MusicPages[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return graphicalMusicPage.PositionAndShape.getClickedObjectOfType<T>(positionOnMusicSheet); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public findGraphicalStaffEntryFromMeasureList(staffIndex: number, measureIndex: number, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        sourceStaffEntry: SourceStaffEntry): GraphicalStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public findGraphicalStaffEntryFromMeasureList(staffIndex: number, measureIndex: number, sourceStaffEntry: SourceStaffEntry): GraphicalStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let i: number = measureIndex; i < this.measureList.length; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let graphicalMeasure: StaffMeasure = this.measureList[i][staffIndex]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for (let idx: number = 0, len: number = graphicalMeasure.StaffEntries.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let graphicalStaffEntry: GraphicalStaffEntry = graphicalMeasure.StaffEntries[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (graphicalStaffEntry.SourceStaffEntry === sourceStaffEntry) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (graphicalStaffEntry.SourceStaffEntry === sourceStaffEntry) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     return graphicalStaffEntry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public findNextGraphicalStaffEntry(staffIndex: number, measureIndex: number, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        graphicalStaffEntry: GraphicalStaffEntry): GraphicalStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public findNextGraphicalStaffEntry(staffIndex: number, measureIndex: number, graphicalStaffEntry: GraphicalStaffEntry): GraphicalStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let graphicalMeasure: StaffMeasure = graphicalStaffEntry.ParentMeasure; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let graphicalStaffEntryIndex: number = graphicalMeasure.StaffEntries.indexOf(graphicalStaffEntry); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (graphicalStaffEntryIndex < graphicalMeasure.StaffEntries.length - 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return graphicalMeasure.StaffEntries[graphicalStaffEntryIndex + 1]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } else if (measureIndex < this.measureList.length - 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let nextMeasure: StaffMeasure = this.measureList[measureIndex + 1][staffIndex]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (nextMeasure.StaffEntries.length > 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (nextMeasure.StaffEntries.length > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return nextMeasure.StaffEntries[0]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public getFirstVisibleMeasuresListFromIndeces(start: number, end: number): StaffMeasure[] { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let graphicalMeasures: StaffMeasure[] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let numberOfStaves: number = this.measureList[0].length; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        for (let i: number = start; i <= end; i++) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            for (let j: number = 0; j < numberOfStaves; j++) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (let i: number = start; i <= end; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (let j: number = 0; j < numberOfStaves; j++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (this.measureList[i][j].isVisible()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     graphicalMeasures.push(this.measureList[i][j]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return graphicalMeasures; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public orderMeasuresByStaffLine(measures: StaffMeasure[]): StaffMeasure[][] { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let orderedMeasures: StaffMeasure[][] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let mList: StaffMeasure[] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         orderedMeasures.push(mList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let i: number = 0; i < measures.length; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (i === 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (i === 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 mList.push(measures[0]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (measures[i].ParentStaffLine === measures[i - 1].ParentStaffLine) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (measures[i].ParentStaffLine === measures[i - 1].ParentStaffLine) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     mList.push(measures[i]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (!orderedMeasures.indexOf(mList) !== -1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (orderedMeasures.indexOf(mList) === -1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         orderedMeasures.push(mList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     mList = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     orderedMeasures.push(mList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     mList.push(measures[i]); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -207,6 +248,7 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return orderedMeasures; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public initializeActiveClefs(): ClefInstruction[] { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let activeClefs: ClefInstruction[] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let firstSourceMeasure: SourceMeasure = this.musicSheet.getFirstSourceMeasure(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -222,6 +264,7 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return activeClefs; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public GetMainKey(): KeyInstruction { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let firstSourceMeasure: SourceMeasure = this.musicSheet.getFirstSourceMeasure(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (firstSourceMeasure !== undefined) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -236,6 +279,7 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public getOrCreateVerticalContainer(timestamp: Fraction): VerticalGraphicalStaffEntryContainer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (this.verticalGraphicalStaffEntryContainers.length === 0 || timestamp > this.verticalGraphicalStaffEntryContainers.Last().AbsoluteTimestamp) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let verticalGraphicalStaffEntryContainer: VerticalGraphicalStaffEntryContainer = new VerticalGraphicalStaffEntryContainer(this.numberOfStaves, timestamp); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -249,28 +293,34 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 this.verticalGraphicalStaffEntryContainers.splice(i + 1, 0, verticalGraphicalStaffEntryContainer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return verticalGraphicalStaffEntryContainer; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (this.verticalGraphicalStaffEntryContainers[i].AbsoluteTimestamp === timestamp) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (this.verticalGraphicalStaffEntryContainers[i].AbsoluteTimestamp === timestamp) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return this.verticalGraphicalStaffEntryContainers[i]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public GetVerticalContainerFromTimestamp(timestamp: Fraction, startIndex: number): VerticalGraphicalStaffEntryContainer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let index: number = this.verticalGraphicalStaffEntryContainers.BinarySearch(startIndex, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             this.verticalGraphicalStaffEntryContainers.length - startIndex, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             new VerticalGraphicalStaffEntryContainer(0, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 timestamp), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             new VerticalGraphicalStaffEntryContainer.VgseContainerTimestampComparer()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (index >= 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (index >= 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return this.verticalGraphicalStaffEntryContainers[index]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public GetVerticalContainerFromTimestamp(timestamp: Fraction): VerticalGraphicalStaffEntryContainer { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let index: number = this.verticalGraphicalStaffEntryContainers.BinarySearch(new VerticalGraphicalStaffEntryContainer(0, timestamp), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             new VerticalGraphicalStaffEntryContainer.VgseContainerTimestampComparer()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (index >= 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (index >= 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return this.verticalGraphicalStaffEntryContainers[index]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public GetInterpolatedIndexInVerticalContainers(musicTimestamp: Fraction): number { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let containers: VerticalGraphicalStaffEntryContainer[] = this.verticalGraphicalStaffEntryContainers; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let leftIndex: number = 0; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -278,7 +328,7 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let foundIndex: number; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let leftTS: Fraction = undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let rightTS: Fraction = undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (musicTimestamp <= containers.Last().AbsoluteTimestamp) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (musicTimestamp <= containers[containers.length - 1].AbsoluteTimestamp) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             while (rightIndex - leftIndex > 1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let middleIndex: number = (rightIndex + leftIndex) / 2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (containers[leftIndex].AbsoluteTimestamp === musicTimestamp) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -295,13 +345,14 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     leftIndex = middleIndex; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (leftIndex === rightIndex) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (leftIndex === rightIndex) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return this.verticalGraphicalStaffEntryContainers.indexOf(containers[leftIndex]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             leftTS = containers[leftIndex].AbsoluteTimestamp; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             rightTS = containers[rightIndex].AbsoluteTimestamp; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            leftTS = containers.Last().AbsoluteTimestamp; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            rightTS = new Fraction(getLongestStaffEntryDuration(containers.length - 1) + leftTS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leftTS = containers[containers.length - 1].AbsoluteTimestamp; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            rightTS = new Fraction(this.getLongestStaffEntryDuration(containers.length - 1) + leftTS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             rightIndex = containers.length; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let diff: number = rightTS.RealValue - leftTS.RealValue; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -309,112 +360,129 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         foundIndex = rightIndex - (diffTS / diff); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return Math.min(foundIndex, this.verticalGraphicalStaffEntryContainers.length); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private getLongestStaffEntryDuration(index: number): Fraction { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let maxLength: Fraction = new Fraction(0, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = this.verticalGraphicalStaffEntryContainers[index].StaffEntries.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let graphicalStaffEntry: GraphicalStaffEntry = this.verticalGraphicalStaffEntryContainers[index].StaffEntries[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (graphicalStaffEntry === undefined) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (graphicalStaffEntry === undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for (let idx2: number = 0, len2: number = graphicalStaffEntry.Notes.length; idx2 < len2; ++idx2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let graphicalNotes: GraphicalNote[] = graphicalStaffEntry.Notes[idx2]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 for (let idx3: number = 0, len3: number = graphicalNotes.length; idx3 < len3; ++idx3) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     let note: GraphicalNote = graphicalNotes[idx3]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (note.GraphicalNoteLength > maxLength) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (note.GraphicalNoteLength > maxLength) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         maxLength = note.GraphicalNoteLength; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return maxLength; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public getVisibleStavesIndecesFromSourceMeasure(visibleMeasures: StaffMeasure[]): number[] { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let visibleInstruments: Instrument[] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let visibleStavesIndeces: number[] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = visibleMeasures.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let graphicalMeasure: StaffMeasure = visibleMeasures[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let instrument: Instrument = graphicalMeasure.ParentStaff.ParentInstrument; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (!visibleInstruments.indexOf(instrument) !== -1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (!visibleInstruments.indexOf(instrument) !== -1) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 visibleInstruments.push(instrument); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = visibleInstruments.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let instrument: Instrument = visibleInstruments[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let index: number = this.musicSheet.GetGlobalStaffIndexOfFirstStaff(instrument); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            for (let j: number = 0; j < instrument.Staves.length; j++) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (let j: number = 0; j < instrument.Staves.length; j++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 visibleStavesIndeces.push(index + j); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return visibleStavesIndeces; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public getGraphicalMeasureFromSourceMeasureAndIndex(sourceMeasure: SourceMeasure, index: number): StaffMeasure { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let i: number = 0; i < this.measureList.length; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (this.measureList[i][0].ParentSourceMeasure === sourceMeasure) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (this.measureList[i][0].ParentSourceMeasure === sourceMeasure) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return this.measureList[i][index]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public getMeasureIndex(graphicalMeasure: StaffMeasure, measureIndex: number, inListIndex: number): boolean { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         measureIndex = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         inListIndex = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (; measureIndex < this.measureList.length; measureIndex++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for (let idx: number = 0, len: number = this.measureList[measureIndex].length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let measure: StaffMeasure = this.measureList[measureIndex][idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (measure === graphicalMeasure) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (measure === graphicalMeasure) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     return true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public getMeasureIndex(entry: GraphicalStaffEntry, measureIndex: number, inListIndex: number): boolean { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.getMeasureIndex(entry.ParentMeasure, measureIndex, inListIndex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public GetNearesNote(clickPosition: PointF_2D, maxClickDist: PointF_2D): GraphicalNote { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public GetNearesNote(clickPosition: PointF2D, maxClickDist: PointF2D): GraphicalNote { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let initialSearchArea: number = 10; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let foundNotes: GraphicalNote[] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let region: BoundingBox = new BoundingBox(undefined); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.BorderLeft = clickPosition.X - initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.BorderTop = clickPosition.Y - initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.BorderRight = clickPosition.X + initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.BorderBottom = clickPosition.Y + initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.AbsolutePosition = new PointF_2D(0, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.BorderLeft = clickPosition.x - initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.BorderTop = clickPosition.y - initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.BorderRight = clickPosition.x + initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.BorderBottom = clickPosition.y + initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.AbsolutePosition = new PointF2D(0, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = this.MusicPages.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let graphicalMusicPage: GraphicalMusicPage = this.MusicPages[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let entries: GraphicalNote[] = graphicalMusicPage.PositionAndShape.getObjectsInRegion<GraphicalNote>(region); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            let entriesArr: GraphicalNote[] = __as__<GraphicalNote[]>(entries, GraphicalNote[]) ?? entries; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            let entriesArr: GraphicalNote[] = __as__<GraphicalNote[]>(entries, GraphicalNote[]) ? ? entries; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (entries === undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 for (let idx2: number = 0, len2: number = entriesArr.length; idx2 < len2; ++idx2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     let note: GraphicalNote = entriesArr[idx2]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (Math.abs(note.PositionAndShape.AbsolutePosition.X - clickPosition.X) < maxClickDist.X && Math.abs(note.PositionAndShape.AbsolutePosition.Y - clickPosition.Y) < maxClickDist.Y) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (Math.abs(note.PositionAndShape.AbsolutePosition.x - clickPosition.x) < maxClickDist.x && Math.abs(note.PositionAndShape.AbsolutePosition.y - clickPosition.y) < maxClickDist.y) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         foundNotes.push(note); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let closest: GraphicalNote = undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = foundNotes.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let note: GraphicalNote = foundNotes[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (closest === undefined) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (closest === undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 closest = note; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (note.ParentStaffEntry.RelInMeasureTimestamp === undefined) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (note.ParentStaffEntry.RelInMeasureTimestamp === undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let deltaNew: number = this.CalculateDistance(note.PositionAndShape.AbsolutePosition, clickPosition); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let deltaOld: number = this.CalculateDistance(closest.PositionAndShape.AbsolutePosition, clickPosition); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (deltaNew < deltaOld) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (deltaNew < deltaOld) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     closest = note; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (closest !== undefined) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (closest !== undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return closest; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public GetClickableLabel(clickPosition: PointF_2D): GraphicalLabel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public GetClickableLabel(clickPosition: PointF2D): GraphicalLabel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let initialSearchAreaX: number = 4; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let initialSearchAreaY: number = 4; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let region: BoundingBox = new BoundingBox(undefined); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.BorderLeft = clickPosition.X - initialSearchAreaX; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.BorderTop = clickPosition.Y - initialSearchAreaY; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.BorderRight = clickPosition.X + initialSearchAreaX; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.BorderBottom = clickPosition.Y + initialSearchAreaY; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.AbsolutePosition = new PointF_2D(0, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.BorderLeft = clickPosition.x - initialSearchAreaX; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.BorderTop = clickPosition.y - initialSearchAreaY; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.BorderRight = clickPosition.x + initialSearchAreaX; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.BorderBottom = clickPosition.y + initialSearchAreaY; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.AbsolutePosition = new PointF2D(0, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = this.MusicPages.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let graphicalMusicPage: GraphicalMusicPage = this.MusicPages[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let entries: GraphicalLabel[] = graphicalMusicPage.PositionAndShape.getObjectsInRegion<GraphicalLabel>(region); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -429,15 +497,16 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public GetNearestStaffEntry(clickPosition: PointF_2D): GraphicalStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public GetNearestStaffEntry(clickPosition: PointF2D): GraphicalStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let initialSearchArea: number = 10; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let foundEntries: GraphicalStaffEntry[] = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let region: BoundingBox = new BoundingBox(undefined); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.BorderLeft = clickPosition.X - initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.BorderTop = clickPosition.Y - initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.BorderRight = clickPosition.X + initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.BorderBottom = clickPosition.Y + initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        region.AbsolutePosition = new PointF_2D(0, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.BorderLeft = clickPosition.x - initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.BorderTop = clickPosition.y - initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.BorderRight = clickPosition.x + initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.BorderBottom = clickPosition.y + initialSearchArea; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        region.AbsolutePosition = new PointF2D(0, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = this.MusicPages.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let graphicalMusicPage: GraphicalMusicPage = this.MusicPages[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let entries: GraphicalStaffEntry[] = graphicalMusicPage.PositionAndShape.getObjectsInRegion<GraphicalStaffEntry>(region, false); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -453,118 +522,137 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let closest: GraphicalStaffEntry = undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = foundEntries.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let gse: GraphicalStaffEntry = foundEntries[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (closest === undefined) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (closest === undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 closest = gse; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (gse.RelInMeasureTimestamp === undefined) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (gse.RelInMeasureTimestamp === undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let deltaNew: number = this.CalculateDistance(gse.PositionAndShape.AbsolutePosition, clickPosition); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let deltaOld: number = this.CalculateDistance(closest.PositionAndShape.AbsolutePosition, clickPosition); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (deltaNew < deltaOld) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (deltaNew < deltaOld) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     closest = gse; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (closest !== undefined) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (closest !== undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return closest; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public GetPossibleCommentAnchor(clickPosition: PointF_2D): SourceStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public GetPossibleCommentAnchor(clickPosition: PointF2D): SourceStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let entry: GraphicalStaffEntry = this.GetNearestStaffEntry(clickPosition); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (entry === undefined) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (entry === undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return entry.SourceStaffEntry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public getClickedObjectOfType<T>(positionOnMusicSheet: PointF_2D): T { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public getClickedObjectOfType<T>(positionOnMusicSheet: PointF2D): T { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = this.musicPages.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let page: GraphicalMusicPage = this.musicPages[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let o: Object = page.PositionAndShape.getClickedObjectOfType<T>(positionOnMusicSheet); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (o !== undefined) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (o !== undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return (o as T); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public tryGetTimestampFromPosition(positionOnMusicSheet: PointF_2D): Fraction { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public tryGetTimestampFromPosition(positionOnMusicSheet: PointF2D): Fraction { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let entry: GraphicalStaffEntry = this.getClickedObjectOfType<GraphicalStaffEntry>(positionOnMusicSheet); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (entry === undefined) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (entry === undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return entry.getAbsoluteTimestamp(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public tryGetClickableLabel(positionOnMusicSheet: PointF_2D): GraphicalLabel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public tryGetClickableLabel(positionOnMusicSheet: PointF2D): GraphicalLabel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return this.GetClickableLabel(positionOnMusicSheet); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         catch (ex) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Logger.DefaultLogger.LogError(LogLevel.NORMAL, "GraphicalMusicSheet.tryGetClickableObject", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                "positionOnMusicSheet: " + positionOnMusicSheet, ex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Logging.log("GraphicalMusicSheet.tryGetClickableObject", "positionOnMusicSheet: " + positionOnMusicSheet, ex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public tryGetTimeStampFromPosition(positionOnMusicSheet: PointF_2D): Fraction { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public tryGetTimeStampFromPosition(positionOnMusicSheet: PointF2D): Fraction { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let entry: GraphicalStaffEntry = this.GetNearestStaffEntry(positionOnMusicSheet); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (entry === undefined) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (entry === undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return entry.getAbsoluteTimestamp(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        catch (ex) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Logger.DefaultLogger.LogError(LogLevel.NORMAL, "GraphicalMusicSheet.tryGetTimeStampFromPosition", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } catch (ex) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Logging.log("GraphicalMusicSheet.tryGetTimeStampFromPosition", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 "positionOnMusicSheet: " + positionOnMusicSheet, ex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private CalculateDistance(pt1: PointF_2D, pt2: PointF_2D): number { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        let deltaX: number = pt1.X - pt2.X; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        let deltaY: number = pt1.Y - pt2.Y; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private CalculateDistance(pt1: PointF2D, pt2: PointF2D): number { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        let deltaX: number = pt1.x - pt2.x; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        let deltaY: number = pt1.y - pt2.y; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return (deltaX * deltaX) + (deltaY * deltaY); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public getStaffEntry(index: number): GraphicalStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.getStaffEntry(this.VerticalGraphicalStaffEntryContainers[index]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public getStaffEntry(container: VerticalGraphicalStaffEntryContainer): GraphicalStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let staffEntry: GraphicalStaffEntry = undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for (let idx: number = 0, len: number = container.StaffEntries.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let entry: GraphicalStaffEntry = container.StaffEntries[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (entry === undefined || !entry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (entry === undefined || !entry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (staffEntry === undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     staffEntry = entry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } else if (entry.PositionAndShape !== undefined && staffEntry.PositionAndShape !== undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (staffEntry.PositionAndShape.RelativePosition.X > entry.PositionAndShape.RelativePosition.X) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (staffEntry.PositionAndShape.RelativePosition.x > entry.PositionAndShape.RelativePosition.x) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         staffEntry = entry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        catch (ex) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Logger.DefaultLogger.LogError(LogLevel.NORMAL, "GraphicalMusicSheet.getStaffEntry", ex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } catch (ex) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Logging.log("GraphicalMusicSheet.getStaffEntry", ex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return staffEntry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public GetPreviousVisibleContainerIndex(index: number): number { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let i: number = index - 1; i >= 0; i--) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let entries: GraphicalStaffEntry[] = this.verticalGraphicalStaffEntryContainers[i].StaffEntries; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for (let idx: number = 0, len: number = entries.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let entry: GraphicalStaffEntry = entries[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (entry !== undefined && entry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (entry !== undefined && entry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     return i; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return -1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public GetNextVisibleContainerIndex(index: number): number { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let i: number = index + 1; i < this.verticalGraphicalStaffEntryContainers.length; ++i) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let entries: GraphicalStaffEntry[] = this.verticalGraphicalStaffEntryContainers[i].StaffEntries; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for (let idx: number = 0, len: number = entries.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let entry: GraphicalStaffEntry = entries[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (entry !== undefined && entry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (entry !== undefined && entry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     return i; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return -1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public findClosestLeftStaffEntry(fractionalIndex: number, searchOnlyVisibleEntries: boolean): GraphicalStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let foundEntry: GraphicalStaffEntry = undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let leftIndex: number = <number>Math.floor(fractionalIndex); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -573,27 +661,35 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             foundEntry = this.getStaffEntry(i); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (foundEntry !== undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (searchOnlyVisibleEntries) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (foundEntry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (foundEntry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         return foundEntry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } else return foundEntry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    return foundEntry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public findClosestRightStaffEntry(fractionalIndex: number, returnOnlyVisibleEntries: boolean): GraphicalStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let foundEntry: GraphicalStaffEntry = undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        let rightIndex: number = <number>Math.max(0, Math.ceiling(fractionalIndex)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        let rightIndex: number = <number>Math.max(0, Math.ceil(fractionalIndex)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let i: number = rightIndex; i < this.VerticalGraphicalStaffEntryContainers.length; i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             foundEntry = this.getStaffEntry(i); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (foundEntry !== undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (returnOnlyVisibleEntries) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (foundEntry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (foundEntry.SourceStaffEntry.ParentStaff.ParentInstrument.Visible) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         return foundEntry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } else return foundEntry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    return foundEntry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public calculateXPositionFromTimestamp(timeStamp: Fraction, currentMusicSystem: MusicSystem): number { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let fractionalIndex: number = this.GetInterpolatedIndexInVerticalContainers(timeStamp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let previousStaffEntry: GraphicalStaffEntry = this.findClosestLeftStaffEntry(fractionalIndex, true); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -621,18 +717,20 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let previousStaffEntryPositionX: number; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let nextStaffEntryPositionX: number; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (previousStaffEntry === undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                previousStaffEntryPositionX = nextStaffEntryPositionX = nextStaffEntry.PositionAndShape.AbsolutePosition.X; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                previousStaffEntryPositionX = nextStaffEntryPositionX = nextStaffEntry.PositionAndShape.AbsolutePosition.x; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 fraction = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else if (nextStaffEntry === undefined) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                previousStaffEntryPositionX = previousStaffEntry.PositionAndShape.AbsolutePosition.X; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                previousStaffEntryPositionX = previousStaffEntry.PositionAndShape.AbsolutePosition.x; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 nextStaffEntryPositionX = currentMusicSystem.GetRightBorderAbsoluteXPosition(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 fraction = (currentTimeStamp - previousStaffEntry.getAbsoluteTimestamp().RealValue) / ((previousStaffEntry.ParentMeasure.ParentSourceMeasure.AbsoluteTimestamp + previousStaffEntry.ParentMeasure.ParentSourceMeasure.Duration).RealValue - previousStaffEntry.getAbsoluteTimestamp().RealValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                previousStaffEntryPositionX = previousStaffEntry.PositionAndShape.AbsolutePosition.X; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                nextStaffEntryPositionX = nextStaffEntry.PositionAndShape.AbsolutePosition.X; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (previousStaffEntry === nextStaffEntry) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                previousStaffEntryPositionX = previousStaffEntry.PositionAndShape.AbsolutePosition.x; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                nextStaffEntryPositionX = nextStaffEntry.PositionAndShape.AbsolutePosition.x; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (previousStaffEntry === nextStaffEntry) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     fraction = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                else fraction = (currentTimeStamp - previousStaffEntry.getAbsoluteTimestamp().RealValue) / (nextStaffEntry.getAbsoluteTimestamp().RealValue - previousStaffEntry.getAbsoluteTimestamp().RealValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    fraction = (currentTimeStamp - previousStaffEntry.getAbsoluteTimestamp().RealValue) / (nextStaffEntry.getAbsoluteTimestamp().RealValue - previousStaffEntry.getAbsoluteTimestamp().RealValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             fraction = Math.min(1, Math.max(0, fraction)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let interpolatedXPosition: number = previousStaffEntryPositionX + fraction * (nextStaffEntryPositionX - previousStaffEntryPositionX); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -643,14 +741,14 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let interpolatedXPosition: number; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (currentTimeStamp < nextSystemLeftBorderTimeStamp) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 currentMusicSystem = previousStaffEntryMusicSystem; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                let previousStaffEntryPositionX: number = previousStaffEntry.PositionAndShape.AbsolutePosition.X; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                let previousStaffEntryPositionX: number = previousStaffEntry.PositionAndShape.AbsolutePosition.x; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let previousSystemRightBorderX: number = currentMusicSystem.GetRightBorderAbsoluteXPosition(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 fraction = (currentTimeStamp - previousStaffEntry.getAbsoluteTimestamp().RealValue) / (nextSystemLeftBorderTimeStamp - previousStaffEntry.getAbsoluteTimestamp().RealValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 fraction = Math.min(1, Math.max(0, fraction)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 interpolatedXPosition = previousStaffEntryPositionX + fraction * (previousSystemRightBorderX - previousStaffEntryPositionX); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 currentMusicSystem = nextStaffEntryMusicSystem; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                let nextStaffEntryPositionX: number = nextStaffEntry.PositionAndShape.AbsolutePosition.X; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                let nextStaffEntryPositionX: number = nextStaffEntry.PositionAndShape.AbsolutePosition.x; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let nextSystemLeftBorderX: number = currentMusicSystem.GetLeftBorderAbsoluteXPosition(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 fraction = (currentTimeStamp - nextSystemLeftBorderTimeStamp) / (nextStaffEntry.getAbsoluteTimestamp().RealValue - nextSystemLeftBorderTimeStamp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 fraction = Math.min(1, Math.max(0, fraction)); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -659,52 +757,63 @@ export class GraphicalMusicSheet { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return interpolatedXPosition; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public GetNumberOfVisibleInstruments(): number { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let visibleInstrumentCount: number = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = this.musicSheet.Instruments.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let instrument: Instrument = this.musicSheet.Instruments[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (instrument.Visible === true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (instrument.Visible === true) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 visibleInstrumentCount++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return visibleInstrumentCount; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public GetNumberOfFollowedInstruments(): number { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let followedInstrumentCount: number = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = this.musicSheet.Instruments.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let instrument: Instrument = this.musicSheet.Instruments[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (instrument.Following === true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (instrument.Following === true) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 followedInstrumentCount++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return followedInstrumentCount; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public GetGraphicalFromSourceMeasure(sourceMeasure: SourceMeasure): StaffMeasure[] { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return this.SourceToGraphicalMeasureLinks[sourceMeasure]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public GetGraphicalFromSourceStaffEntry(sourceStaffEntry: SourceStaffEntry): GraphicalStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        let graphicalMeasure: StaffMeasure = this.SourceToGraphicalMeasureLinks[sourceStaffEntry.VerticalContainerParent.ParentMeasure][sourceStaffEntry.ParentStaff.IdInMusicSheet]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        let graphicalMeasure: StaffMeasure = this.SourceToGraphicalMeasureLinks 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            [sourceStaffEntry.VerticalContainerParent.ParentMeasure][sourceStaffEntry.ParentStaff.idInMusicSheet]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return graphicalMeasure.findGraphicalStaffEntryFromTimestamp(sourceStaffEntry.Timestamp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public GetGraphicalFromSourceStaffEntry(voiceEntries: VoiceEntry[]): GraphicalStaffEntry { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (voiceEntries.length === 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (voiceEntries.length === 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let sse: SourceStaffEntry = voiceEntries[0].ParentSourceStaffEntry; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        let graphicalMeasure: StaffMeasure = this.SourceToGraphicalMeasureLinks[sse.VerticalContainerParent.ParentMeasure][sse.ParentStaff.IdInMusicSheet]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        let graphicalMeasure: StaffMeasure = this.SourceToGraphicalMeasureLinks[sse.VerticalContainerParent.ParentMeasure][sse.ParentStaff.idInMusicSheet]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return graphicalMeasure.findGraphicalStaffEntryFromTimestamp(sse.Timestamp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public GetGraphicalNoteFromSourceNote(note: Note, containingGse: GraphicalStaffEntry): GraphicalNote { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         for (let idx: number = 0, len: number = containingGse.Notes.length; idx < len; ++idx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let graphicalNotes: GraphicalNote[] = containingGse.Notes[idx]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for (let idx2: number = 0, len2: number = graphicalNotes.length; idx2 < len2; ++idx2) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let graphicalNote: GraphicalNote = graphicalNotes[idx2]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (graphicalNote.SourceNote === note) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (graphicalNote.SourceNote === note) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     return graphicalNote; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export class SystemImageProperties { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public PositionInPixels: PointF_2D; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public SystemImageId: number; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public System: MusicSystem; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public positionInPixels: PointF2D; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public systemImageId: number; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public system: MusicSystem; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |