Procházet zdrojové kódy

SourceStaffEntry: add hasOnlyRests() getter

sschmid před 4 roky
rodič
revize
85be243e8f
1 změnil soubory, kde provedl 11 přidání a 0 odebrání
  1. 11 0
      src/MusicalScore/VoiceData/SourceStaffEntry.ts

+ 11 - 0
src/MusicalScore/VoiceData/SourceStaffEntry.ts

@@ -266,4 +266,15 @@ export class SourceStaffEntry {
             }
         }
     }
+
+    public get hasOnlyRests(): boolean {
+        for (const voiceEntry of this.voiceEntries) {
+            for (const note of voiceEntry.Notes) {
+                if (!note.isRest) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
 }