Browse Source

merge osmd-public 1.8.2: add rules.RenderCount

sschmidTU 1 year ago
parent
commit
eb83d35ce1

+ 2 - 2
package.json

@@ -1,6 +1,6 @@
 {
   "name": "osmd-extended",
-  "version": "1.8.1",
+  "version": "1.8.2",
   "description": "Private / sponsor exclusive OSMD mirror/audio player.",
   "main": "build/opensheetmusicdisplay.min.js",
   "types": "build/dist/src/index.d.ts",
@@ -68,7 +68,7 @@
   "bugs": {
     "url": "https://github.com/opensheetmusicdisplay/opensheetmusicdisplay/issues"
   },
-  "homepage": "http://opensheetmusicdisplay.org",
+  "homepage": "https://opensheetmusicdisplay.org",
   "dependencies": {
     "@types/vexflow": "^1.2.38",
     "d-path-parser": "^1.0.0",

+ 5 - 0
src/MusicalScore/Graphical/EngravingRules.ts

@@ -435,6 +435,11 @@ export class EngravingRules {
     public NoteToGraphicalNoteMap: Dictionary<number, GraphicalNote>;
     // this is basically a WeakMap, except we save the id in the Note instead of using a WeakMap.
     public NoteToGraphicalNoteMapObjectCount: number = 0;
+    /** How many times osmd.render() was already called on the currently loaded score.
+     * Resets after osmd.load() (via osmd.reset()).
+     * Can be relevant for transposition or generally informative.
+     */
+    public RenderCount: number = 0;
 
     /** The skyline and bottom-line batch calculation algorithm to use.
      *  Note that this can be overridden if AlwaysSetPreferredSkyBottomLineBackendAutomatically is true (which is the default).

+ 3 - 1
src/OpenSheetMusicDisplay/OpenSheetMusicDisplay.ts

@@ -35,7 +35,7 @@ import { DynamicsCalculator } from "../MusicalScore/ScoreIO/MusicSymbolModules/D
  * After the constructor, use load() and render() to load and render a MusicXML file.
  */
 export class OpenSheetMusicDisplay {
-    private version: string = "1.8.1-audio-extended"; // getter: this.Version
+    private version: string = "1.8.2-audio-extended"; // getter: this.Version
     // at release, bump version and change to -release, afterwards to -dev again
 
     /**
@@ -344,6 +344,7 @@ export class OpenSheetMusicDisplay {
         this.zoomUpdated = false;
         //need to init values
         this.interactionManager.displaySizeChanged(this.container.clientWidth, this.container.clientHeight);
+        this.rules.RenderCount++;
         //console.log("[OSMD] render finished");
     }
 
@@ -810,6 +811,7 @@ export class OpenSheetMusicDisplay {
         this.sheet = undefined;
         this.graphic = undefined;
         this.zoom = 1.0;
+        this.rules.RenderCount = 0;
     }
 
     /**