]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/system.cc
* lily/system.cc (spanner_count): new function
[lilypond.git] / lily / system.cc
index f1994d21296532758be50914c34ae1b69f56647a..2536331c4cbc64a127cb62a4765085f115818788 100644 (file)
@@ -45,6 +45,22 @@ System::element_count () const
   return scm_ilength (get_grob_property ("all-elements"));
 }
 
+int
+System::spanner_count () const
+{
+  int k =0;
+  for (SCM s = get_grob_property ("all-elements");
+       gh_pair_p (s); s = ly_cdr (s))
+    {
+      if (dynamic_cast<Spanner*> (unsmob_grob (gh_car(s))))
+       k++;
+    }
+
+  return k;
+}
+  
+
+
 void
 System::typeset_grob (Grob * elem)
 {