2 paper-score.cc -- implement Paper_score
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "paper-score.hh"
11 #include "all-font-metrics.hh"
12 #include "gourlay-breaking.hh"
15 #include "output-def.hh"
16 #include "paper-book.hh"
17 #include "paper-column.hh"
18 #include "scm-hash.hh"
24 Paper_score::Paper_score (Output_def *layout)
29 paper_systems_ = SCM_EOL;
32 Paper_score::Paper_score (Paper_score const &s)
39 Paper_score::derived_mark () const
42 scm_gc_mark (layout_->self_scm ());
43 scm_gc_mark (systems_);
44 scm_gc_mark (paper_systems_);
48 Paper_score::typeset_system (System *system)
53 systems_ = scm_cons (system->self_scm (), systems_);
54 system->pscore_ = this;
59 Array<Column_x_positions>
60 Paper_score::calc_breaking ()
62 Break_algorithm *algorithm = 0;
63 Array<Column_x_positions> sol;
65 algorithm = new Gourlay_breaking;
66 algorithm->set_pscore (this);
67 sol = algorithm->solve ();
74 Paper_score::process ()
76 if (be_verbose_global)
77 message (_f ("Element count %d (spanners %d) ",
78 system_->element_count (),
79 system_->spanner_count ()));
81 message (_ ("Preprocessing graphical objects...") + " ");
83 /* FIXME: Check out why we need this - removing gives assertion failures
86 doubly, also done in Score_engraver */
87 Link_array<Grob> pc (system_->columns ());
88 pc[0]->set_property ("breakable", SCM_BOOL_T);
89 pc.top ()->set_property ("breakable", SCM_BOOL_T);
91 system_->pre_processing ();
93 Array<Column_x_positions> breaking = calc_breaking ();
94 system_->break_into_pieces (breaking);
96 paper_systems_ = system_->get_paper_systems ();
100 Paper_score::root_system () const
106 Paper_score::layout () const
112 Paper_score::get_paper_systems () const
114 return paper_systems_;