]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-book.cc
Merge branch 'master' of git://git.sv.gnu.org/lilypond
[lilypond.git] / lily / paper-book.cc
index 926f9f5a962afed18ba94dfdc394ace7df50d5bf..c66d1d6ae989cda7c6392a49a3096a9efea068f8 100644 (file)
@@ -11,6 +11,7 @@
 #include "grob.hh"
 #include "main.hh"
 #include "output-def.hh"
+#include "paper-column.hh"
 #include "paper-score.hh"
 #include "paper-system.hh"
 #include "text-interface.hh"
@@ -90,9 +91,9 @@ Paper_book::output (SCM output_channel)
 {
   if (scm_is_pair (performances_))
     {
-      SCM proc = ly_lily_module_constant ("paper-book-write-midis");
-
-      scm_call_2 (proc, self_scm (), output_channel);
+      SCM proc = ly_lily_module_constant ("write-performances-midis");
+      scm_call_2 (proc, performances (), output_channel);
     }
 
   if (scores_ == SCM_EOL)
@@ -236,7 +237,11 @@ set_system_penalty (SCM sys, SCM header)
            {
              vector<Grob*> cols = ps->get_columns ();
              if (cols.size ())
-               cols.back ()->set_property ("page-break-permission", sym);
+               {
+                 Paper_column *col = dynamic_cast<Paper_column*> (cols.back ());
+                 col->set_property ("page-break-permission", sym);
+                 col->find_prebroken_piece (LEFT)->set_property ("page-break-permission", sym);
+               }
            }
          else if (Prob *pb = unsmob_prob (sys))
            pb->set_property ("page-break-permission", sym);
@@ -370,6 +375,7 @@ Paper_book::systems ()
   
   systems_ = scm_reverse (systems_);
 
+  /* backwards compatibility for the old page breaker */
   int i = 0;
   Prob *last = 0;
   for (SCM s = systems_; scm_is_pair (s); s = scm_cdr (s))
@@ -382,6 +388,16 @@ Paper_book::systems ()
          && !scm_is_number (ps->get_property ("penalty")))
        ps->set_property ("penalty", scm_from_int (10000));
       last = ps;
+
+      if (scm_is_pair (scm_cdr (s)))
+       {
+         SCM perm = ps->get_property ("page-break-permission");
+         Prob *next = unsmob_prob (scm_cadr (s));
+         if (perm == SCM_EOL)
+           next->set_property ("penalty", scm_from_int (10001));
+         else if (perm == ly_symbol2scm ("force"))
+           next->set_property ("penalty", scm_from_int (-10001));
+       }
     }
 
   return systems_;
@@ -395,7 +411,7 @@ Paper_book::pages ()
 
   pages_ = SCM_EOL;
   SCM proc = paper_->c_variable ("page-breaking-wrapper");
-  pages_ = scm_apply_0 (proc, scm_list_1(self_scm ()));
+  pages_ = scm_apply_0 (proc, scm_list_1 (self_scm ()));
 
   /* set systems_ from the pages */
   if (systems_ == SCM_BOOL_F)