2 scoreline.cc -- implement Line_of_score
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "line-of-score.hh"
10 #include "paper-def.hh"
11 #include "paper-outputter.hh"
12 #include "paper-column.hh"
13 #include "paper-score.hh"
17 #include "axis-group-interface.hh"
20 Line_of_score::Line_of_score()
22 set_elt_property ("columns", SCM_EOL);
23 axis_group (this).set_axes (Y_AXIS,X_AXIS);
29 Line_of_score::output_lines ()
31 for (int i=0; i < broken_into_l_arr_.size (); i++)
33 Line_of_score *line_l = dynamic_cast<Line_of_score*> (broken_into_l_arr_[i]);
35 progress_indication ("[");
36 line_l->post_processing ();
37 progress_indication (to_str (i));
38 line_l->output_line (i + 1 == broken_into_l_arr_.size ());
39 progress_indication ("]");
45 Line_of_score::break_into_pieces (Array<Column_x_positions> const &breaking)
47 for (int i=0; i < breaking.size (); i++)
49 Line_of_score *line_l = dynamic_cast <Line_of_score*> (clone());
51 Link_array<Paper_column> c (breaking[i].cols_);
52 pscore_l_->typeset_element (line_l);
53 line_l->set_bound(LEFT,c[0]);
54 line_l->set_bound(RIGHT,c.top ());
55 for (int j=0; j < c.size(); j++)
57 c[j]->translate_axis (breaking[i].config_[j],X_AXIS);
58 c[j]->line_l_ = line_l;
61 broken_into_l_arr_.push (line_l);
66 Line_of_score::add_column (Paper_column*p)
68 set_elt_property ("columns",
69 gh_cons (p->self_scm_, get_elt_property ("columns")));
70 axis_group (this).add_element (p);
74 Line_of_score::do_print() const
77 Axis_group_spanner::do_print ();
81 Line_of_score::output_line (bool last_line)
83 Interval i(extent(Y_AXIS));
85 programming_error ("Huh? Empty Line_of_score?");
87 translate_axis (- i[MAX], Y_AXIS);
89 pscore_l_->outputter_l_->start_line (i.length ());
90 Super_element::output_all ();
92 pscore_l_->outputter_l_->stop_last_line();
94 pscore_l_->outputter_l_->stop_line ();
98 Line_of_score::compare (Line_of_score* const &p1,Line_of_score* const &p2)
100 return p1->rank_i_ - p2->rank_i_;