Sfoglia il codice sorgente

feat(ChordSymbols): Add osmd.rules.RenderChordSymbols (false now supported)

sschmid 4 anni fa
parent
commit
fe19427f31

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

@@ -268,6 +268,7 @@ export class EngravingRules {
     public RenderMeasureNumbersOnlyAtSystemStart: boolean;
     public UseXMLMeasureNumbers: boolean;
     public RenderLyrics: boolean;
+    public RenderChordSymbols: boolean;
     public RenderMultipleRestMeasures: boolean;
     public AutoGenerateMutipleRestMeasuresFromRestMeasures: boolean;
     public RenderRehearsalMarks: boolean;
@@ -576,6 +577,7 @@ export class EngravingRules {
         this.RenderMeasureNumbersOnlyAtSystemStart = false;
         this.UseXMLMeasureNumbers = true;
         this.RenderLyrics = true;
+        this.RenderChordSymbols = true;
         this.RenderMultipleRestMeasures = true;
         this.AutoGenerateMutipleRestMeasuresFromRestMeasures = true;
         this.RenderRehearsalMarks = true;

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

@@ -2248,7 +2248,7 @@ export abstract class MusicSheetCalculator {
                     const clefInstruction: ClefInstruction = <ClefInstruction>sourceStaffEntry.Instructions[0];
                     MusicSheetCalculator.symbolFactory.createInStaffClef(graphicalStaffEntry, clefInstruction);
                 }
-                if (sourceStaffEntry.ChordContainers && sourceStaffEntry.ChordContainers.length > 0) {
+                if (this.rules.RenderChordSymbols && sourceStaffEntry.ChordContainers?.length > 0) {
                     sourceStaffEntry.ParentStaff.ParentInstrument.HasChordSymbols = true;
                     MusicSheetCalculator.symbolFactory.createChordSymbols(
                         sourceStaffEntry,