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>
12 #include "font-metric.hh"
14 #include "paper-def.hh"
16 #include "paper-column.hh"
17 #include "paper-score.hh"
18 #include "paper-column.hh"
19 #include "scm-hash.hh"
20 #include "gourlay-breaking.hh"
21 //#include "paper-outputter.hh"
22 #include "input-file-results.hh"
24 #include "all-font-metrics.hh"
27 #include "paper-book.hh"
28 #include "ly-module.hh"
30 Paper_score::Paper_score ()
37 Paper_score::Paper_score (Paper_score const &s)
44 Paper_score::typeset_line (System *system)
49 score_ = gh_cons (system->self_scm (), score_);
50 system->pscore_ = this;
52 scm_gc_unprotect_object (system->self_scm ());
55 Array<Column_x_positions>
56 Paper_score::calc_breaking ()
58 Break_algorithm *algorithm=0;
59 Array<Column_x_positions> sol;
61 algorithm = new Gourlay_breaking ;
62 algorithm->set_pscore (this);
63 sol = algorithm->solve ();
70 Paper_score::process (String)
73 progress_indication (_f ("Element count %d (spanners %d) ",
74 system_->element_count (),
75 system_->spanner_count ()));
77 progress_indication (_ ("Preprocessing graphical objects...") + " ");
79 /* FIXME: Check out why we need this - removing gives assertion failures
82 doubly, also done in Score_engraver */
83 Link_array<Grob> pc (system_->columns ());
84 pc[0]->set_property ("breakable", SCM_BOOL_T);
85 pc.top ()->set_property ("breakable", SCM_BOOL_T);
87 system_->pre_processing ();
89 Array<Column_x_positions> breaking = calc_breaking ();
90 system_->break_into_pieces (breaking);
91 SCM lines = system_->get_lines ();
92 progress_indication ("\n");
94 /* Only keep result stencils in lines_, *title_; delete all grobs. */