Forráskód Böngészése

fix(invisible notes): do not display invisible notes and double rests. skip parsing them for now.

later on we will have a "display invisible notes" option/DrawingParameter, so this is only a temporary solution.
Eventually, invisible notes should be parsed again.
Still, this is more correct than displaying all invisible notes, as it was before.
sschmidTU 6 éve
szülő
commit
a6ac78c644
1 módosított fájl, 9 hozzáadás és 2 törlés
  1. 9 2
      src/MusicalScore/ScoreIO/InstrumentReader.ts

+ 9 - 2
src/MusicalScore/ScoreIO/InstrumentReader.ts

@@ -132,8 +132,15 @@ export class InstrumentReader {
       const xmlMeasureListArr: IXmlElement[] = this.xmlMeasureList[this.currentXmlMeasureIndex].elements();
       for (const xmlNode of xmlMeasureListArr) {
         if (xmlNode.name === "note") {
-          if (xmlNode.hasAttributes && xmlNode.attribute("print-object") && xmlNode.attribute("print-spacing")) {
-            continue;
+          if (xmlNode.hasAttributes && xmlNode.attribute("print-object") &&
+              xmlNode.attribute("print-object").value === "no") {
+            // TODO handle invisible notes. should be parsed, optionally displayed via DrawingParameter.
+            // if (xmlNode.attribute("print-spacing")) {
+            //   if (xmlNode.attribute("print-spacing").value === "yes" {
+            //     // give spacing for invisible notes even when not displayed
+            //   else {
+            //     // don't print and don't give spacing. might still need to parse to keep measure model intact
+            continue; // TODO for now, just skip invisible notes. remove continue when implementing display invisible notes option
           }
           let noteStaff: number = 1;
           if (this.instrument.Staves.length > 1) {