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 "paper-score.hh"
11 #include "all-font-metrics.hh"
12 #include "gourlay-breaking.hh"
13 #include "ly-module.hh"
16 #include "output-def.hh"
17 #include "paper-book.hh"
18 #include "paper-column.hh"
19 #include "scm-hash.hh"
25 Paper_score::Paper_score ()
31 Paper_score::Paper_score (Paper_score const &s)
38 Paper_score::typeset_line (System *system)
43 systems_ = scm_cons (system->self_scm (), systems_);
44 system->pscore_ = this;
46 scm_gc_unprotect_object (system->self_scm ());
49 Array<Column_x_positions>
50 Paper_score::calc_breaking ()
52 Break_algorithm *algorithm = 0;
53 Array<Column_x_positions> sol;
55 algorithm = new Gourlay_breaking ;
56 algorithm->set_pscore (this);
57 sol = algorithm->solve ();
64 Paper_score::process (String)
67 progress_indication (_f ("Element count %d (spanners %d) ",
68 system_->element_count (),
69 system_->spanner_count ()));
71 progress_indication (_ ("Preprocessing graphical objects...") + " ");
73 /* FIXME: Check out why we need this - removing gives assertion failures
76 doubly, also done in Score_engraver */
77 Link_array<Grob> pc (system_->columns ());
78 pc[0]->set_property ("breakable", SCM_BOOL_T);
79 pc.top ()->set_property ("breakable", SCM_BOOL_T);
81 system_->pre_processing ();
83 Array<Column_x_positions> breaking = calc_breaking ();
84 system_->break_into_pieces (breaking);
85 SCM lines = system_->get_lines ();
87 /* gourlay:do_solve also prints newline. */
88 progress_indication ("\n");
91 /* Only keep result stencils in lines_, *title_; delete all grobs. */