]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-score.cc
(mail_address_url): don't add
[lilypond.git] / lily / paper-score.cc
index 5f7e1540df1be0fa81ba6c17826cef5b50d99bda..3e41930daa21b7e6886d9e01a3f531cde9a29346 100644 (file)
@@ -22,6 +22,7 @@
 #include "stencil.hh"
 #include "system.hh"
 #include "warn.hh"
+#include "constrained-breaking.hh"
 
 Paper_score::Paper_score (Output_def *layout)
 {
@@ -58,13 +59,37 @@ Paper_score::typeset_system (System *system)
   system->unprotect ();
 }
 
+
+vector<int>
+Paper_score::find_break_indices () const
+{
+  vector<Grob*> all = root_system ()->columns ();
+  vector<int> retval;
+
+  for (vsize i = 0; i < all.size (); i++)
+    if (Item::is_breakable (all[i]))
+      retval.push_back (i);
+
+  return retval;
+}
+
+
 vector<Column_x_positions>
 Paper_score::calc_breaking ()
 {
   Break_algorithm *algorithm = 0;
   vector<Column_x_positions> sol;
-
-  algorithm = new Gourlay_breaking;
+  
+  int system_count = robust_scm2int (layout ()->c_variable ("system-count"), 0);
+  if (system_count)
+    {
+      Constrained_breaking *b = new Constrained_breaking;
+      b->resize (system_count);
+      algorithm = b;
+    }
+  else
+    algorithm = new Gourlay_breaking;
+  
   algorithm->set_pscore (this);
   sol = algorithm->solve ();
   delete algorithm;