source file of the GNU LilyPond music typesetter
- (c) 2004--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 2004--2007 Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "paper-book.hh"
#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"
{
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)
void
Paper_book::classic_output (SCM output)
{
+ if (scm_is_pair (performances_))
+ {
+ SCM proc = ly_lily_module_constant ("write-performances-midis");
+
+ scm_call_2 (proc, performances (), output);
+ }
+
/* Generate all stencils to trigger font loads. */
systems ();
{
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);
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))
&& !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_;
return pages_;
pages_ = SCM_EOL;
- SCM proc = paper_->c_variable ("page-breaking");
- pages_ = scm_apply_0 (proc, scm_list_1(self_scm ()));
+ SCM proc = paper_->c_variable ("page-breaking-wrapper");
+ pages_ = scm_apply_0 (proc, scm_list_1 (self_scm ()));
/* set systems_ from the pages */
if (systems_ == SCM_BOOL_F)