2 paper-score.cc -- implement Paper_score
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "all-font-metrics.hh"
10 #include "font-metric.hh"
11 #include "gourlay-breaking.hh"
12 #include "ly-module.hh"
15 #include "output-def.hh"
16 #include "paper-book.hh"
17 #include "paper-column.hh"
18 #include "paper-score.hh"
19 #include "scm-hash.hh"
26 Paper_score::Paper_score ()
32 Paper_score::Paper_score (Paper_score const &s)
39 Paper_score::typeset_line (System *system)
44 systems_ = scm_cons (system->self_scm (), systems_);
45 system->pscore_ = this;
47 scm_gc_unprotect_object (system->self_scm ());
50 Array<Column_x_positions>
51 Paper_score::calc_breaking ()
53 Break_algorithm *algorithm = 0;
54 Array<Column_x_positions> sol;
56 algorithm = new Gourlay_breaking ;
57 algorithm->set_pscore (this);
58 sol = algorithm->solve ();
65 Paper_score::process (String)
68 progress_indication (_f ("Element count %d (spanners %d) ",
69 system_->element_count (),
70 system_->spanner_count ()));
72 progress_indication (_ ("Preprocessing graphical objects...") + " ");
74 /* FIXME: Check out why we need this - removing gives assertion failures
77 doubly, also done in Score_engraver */
78 Link_array<Grob> pc (system_->columns ());
79 pc[0]->set_property ("breakable", SCM_BOOL_T);
80 pc.top ()->set_property ("breakable", SCM_BOOL_T);
82 system_->pre_processing ();
84 Array<Column_x_positions> breaking = calc_breaking ();
85 system_->break_into_pieces (breaking);
86 SCM lines = system_->get_lines ();
88 /* gourlay:do_solve also prints newline. */
89 progress_indication ("\n");
92 /* Only keep result stencils in lines_, *title_; delete all grobs. */