|
@@ -71,26 +71,27 @@ export class OpenSheetMusicDisplay {
|
|
|
|
|
|
public cursor: Cursor;
|
|
|
public zoom: number = 1.0;
|
|
|
- private zoomUpdated: boolean = false;
|
|
|
+ protected zoomUpdated: boolean = false;
|
|
|
/** Timeout in milliseconds used in osmd.load(string) when string is a URL. */
|
|
|
public loadUrlTimeout: number = 5000;
|
|
|
|
|
|
- private container: HTMLElement;
|
|
|
- private backendType: BackendType;
|
|
|
- private needBackendUpdate: boolean;
|
|
|
- private sheet: MusicSheet;
|
|
|
- private drawer: VexFlowMusicSheetDrawer;
|
|
|
- private drawBoundingBox: string;
|
|
|
- private drawSkyLine: boolean;
|
|
|
- private drawBottomLine: boolean;
|
|
|
- private graphic: GraphicalMusicSheet;
|
|
|
- private renderingManager: SheetRenderingManager;
|
|
|
- private interactionManager: AbstractDisplayInteractionManager;
|
|
|
- private drawingParameters: DrawingParameters;
|
|
|
- private rules: EngravingRules;
|
|
|
- private autoResizeEnabled: boolean;
|
|
|
+ protected container: HTMLElement;
|
|
|
+ protected backendType: BackendType;
|
|
|
+ protected needBackendUpdate: boolean;
|
|
|
+ protected sheet: MusicSheet;
|
|
|
+ protected drawer: VexFlowMusicSheetDrawer;
|
|
|
+ protected drawBoundingBox: string;
|
|
|
+ protected drawSkyLine: boolean;
|
|
|
+ protected drawBottomLine: boolean;
|
|
|
+ protected graphic: GraphicalMusicSheet;
|
|
|
+ protected renderingManager: SheetRenderingManager;
|
|
|
+ protected interactionManager: AbstractDisplayInteractionManager;
|
|
|
+ protected drawingParameters: DrawingParameters;
|
|
|
+ protected rules: EngravingRules;
|
|
|
+ protected autoResizeEnabled: boolean;
|
|
|
private resizeHandlerAttached: boolean;
|
|
|
- private followCursor: boolean;
|
|
|
+ protected followCursor: boolean;
|
|
|
+ protected OnXMLRead: Function;
|
|
|
public set PlaybackManager(manager: PlaybackManager) {
|
|
|
if (this.renderingManager) {
|
|
|
this.renderingManager.PlaybackManager = manager;
|
|
@@ -148,8 +149,6 @@ export class OpenSheetMusicDisplay {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private OnXMLRead: Function;
|
|
|
-
|
|
|
/**
|
|
|
* Load a MusicXML file
|
|
|
* @param content is either the url of a file, or the root node of a MusicXML document, or the string content of a .xml/.mxl file
|
|
@@ -324,7 +323,7 @@ export class OpenSheetMusicDisplay {
|
|
|
//console.log("[OSMD] render finished");
|
|
|
}
|
|
|
|
|
|
- private createOrRefreshRenderBackend(): void {
|
|
|
+ protected createOrRefreshRenderBackend(): void {
|
|
|
// console.log("[OSMD] createOrRefreshRenderBackend()");
|
|
|
|
|
|
// Remove old backends
|
|
@@ -435,8 +434,7 @@ export class OpenSheetMusicDisplay {
|
|
|
return;
|
|
|
}
|
|
|
this.OnXMLRead = function(xml): string {return xml;};
|
|
|
- if (options.onXMLRead)
|
|
|
- {
|
|
|
+ if (options.onXMLRead) {
|
|
|
this.OnXMLRead = options.onXMLRead;
|
|
|
}
|
|
|
if (options.drawingParameters) {
|
|
@@ -727,7 +725,7 @@ export class OpenSheetMusicDisplay {
|
|
|
* Initialize this object to default values
|
|
|
* FIXME: Probably unnecessary
|
|
|
*/
|
|
|
- private reset(): void {
|
|
|
+ protected reset(): void {
|
|
|
if (this.drawingParameters.drawCursors && this.cursor) {
|
|
|
this.cursor.hide();
|
|
|
}
|
|
@@ -739,7 +737,7 @@ export class OpenSheetMusicDisplay {
|
|
|
/**
|
|
|
* Attach the appropriate handler to the window.onResize event
|
|
|
*/
|
|
|
- private autoResize(): void {
|
|
|
+ protected autoResize(): void {
|
|
|
|
|
|
const self: OpenSheetMusicDisplay = this;
|
|
|
this.handleResize(
|
|
@@ -774,7 +772,7 @@ export class OpenSheetMusicDisplay {
|
|
|
* @param startCallback is the function called when resizing starts
|
|
|
* @param endCallback is the function called when resizing (kind-of) ends
|
|
|
*/
|
|
|
- private handleResize(startCallback: () => void, endCallback: () => void): void {
|
|
|
+ protected handleResize(startCallback: () => void, endCallback: () => void): void {
|
|
|
let rtime: number;
|
|
|
let timeout: number = undefined;
|
|
|
const delta: number = 200;
|