2 paper-score.cc -- implement Paper_score
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
13 #include "paper-def.hh"
14 #include "line-of-score.hh"
15 #include "paper-column.hh"
16 #include "paper-score.hh"
17 #include "paper-column.hh"
19 #include "gourlay-breaking.hh"
20 #include "paper-stream.hh"
21 #include "paper-outputter.hh"
22 #include "file-results.hh"
24 #include "all-font-metrics.hh"
26 Paper_score::Paper_score ()
35 Paper_score::typeset_line (Line_of_score *l)
41 main_smob_ = gh_cons (l->self_scm_, main_smob_);
45 Paper_score::Paper_score (Paper_score const &s)
51 Array<Column_x_positions>
52 Paper_score::calc_breaking ()
54 Break_algorithm *algorithm_p=0;
55 Array<Column_x_positions> sol;
57 algorithm_p = new Gourlay_breaking ;
58 algorithm_p->set_pscore (this);
59 sol = algorithm_p->solve ();
71 Paper_score::process ()
74 progress_indication ( _f("Element count %d ", line_l_->element_count ()));
77 progress_indication (_ ("Preprocessing elements...") + " ");
80 Be sure to set breakability on first & last column.
82 Link_array<Score_element> pc (line_l_->column_l_arr ());
84 pc[0]->set_elt_property ("breakable", SCM_BOOL_T);
85 pc.top ()->set_elt_property ("breakable", SCM_BOOL_T);
87 line_l_->pre_processing ();
89 Array<Column_x_positions> breaking = calc_breaking ();
90 line_l_->break_into_pieces (breaking);
92 outputter_l_ = new Paper_outputter (paper_l_->paper_stream_p ());
94 outputter_l_->output_header ();
95 outputter_l_->output_version();
98 outputter_l_->output_scope (header_global_p, "mudela");
100 outputter_l_->output_scope (header_l_, "mudela");
102 outputter_l_->output_comment (_ ("Outputting Score, defined at: "));
103 outputter_l_->output_comment (origin_str_);
105 if (paper_l_->scope_p_)
106 outputter_l_->output_scope (paper_l_->scope_p_, "mudelapaper");
109 if(experimental_features_global_b)
111 SCM scm = gh_list (ly_symbol2scm ("experimental-on"), SCM_UNDEFINED);
112 outputter_l_->output_scheme (scm);
114 scm = gh_list (ly_symbol2scm ("header-end"), SCM_UNDEFINED);
115 outputter_l_->output_scheme (scm);
117 line_l_->output_lines ();
120 scm = gh_list (ly_symbol2scm ("end-output"), SCM_UNDEFINED);
121 outputter_l_->output_scheme (scm);