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 ()
36 Paper_score::Paper_score (Paper_score const &s)
43 Paper_score::typeset_line (System *system)
48 systems_ = gh_cons (system->self_scm (), systems_);
49 system->pscore_ = this;
51 scm_gc_unprotect_object (system->self_scm ());
54 Array<Column_x_positions>
55 Paper_score::calc_breaking ()
57 Break_algorithm *algorithm=0;
58 Array<Column_x_positions> sol;
60 algorithm = new Gourlay_breaking ;
61 algorithm->set_pscore (this);
62 sol = algorithm->solve ();
69 Paper_score::process (String)
72 progress_indication (_f ("Element count %d (spanners %d) ",
73 system_->element_count (),
74 system_->spanner_count ()));
76 progress_indication (_ ("Preprocessing graphical objects...") + " ");
78 /* FIXME: Check out why we need this - removing gives assertion failures
81 doubly, also done in Score_engraver */
82 Link_array<Grob> pc (system_->columns ());
83 pc[0]->set_property ("breakable", SCM_BOOL_T);
84 pc.top ()->set_property ("breakable", SCM_BOOL_T);
86 system_->pre_processing ();
88 Array<Column_x_positions> breaking = calc_breaking ();
89 system_->break_into_pieces (breaking);
90 SCM lines = system_->get_lines ();
91 progress_indication ("\n");
93 /* Only keep result stencils in lines_, *title_; delete all grobs. */