2 scoreline.cc -- implement Line_of_score
4 source file of the GNU LilyPond music typesetter
6 (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "line-of-score.hh"
10 #include "paper-def.hh"
11 #include "paper-outputter.hh"
16 Line_of_score::Line_of_score()
18 set_axes (Y_AXIS,Y_AXIS);
22 Line_of_score::contains_b (Paper_column const* c) const
24 return cols_.find_l ((Paper_column*)(c));
28 Line_of_score::set_breaking (Array<Column_x_positions> const &breaking, int j) const
30 const Link_array<Paper_column> &curline (breaking[j].cols);
31 const Array<Real> &config (breaking[j].config);
32 Line_of_score *line_l=0;
34 line_l = dynamic_cast <Line_of_score*> (clone());
36 line_l->cols_ = curline;
37 line_l->set_bounds(LEFT,curline[0]);
38 line_l->set_bounds(RIGHT,curline.top());
40 for (int i=0; i < curline.size(); i++)
42 curline[i]->translate_axis (config[i],X_AXIS);
43 curline[i]->line_l_ = dynamic_cast<Line_of_score*>(line_l);
46 Breaking_information b;
47 b.bounds_ = line_l->spanned_drul_;
48 b.broken_spanner_l_ = line_l;
51 broken_info_.push (b);
57 Line_of_score::add_column (Paper_column*p)
63 Line_of_score::do_print() const
66 Axis_group_spanner::do_print ();
69 Link_array<Score_element>
70 Line_of_score::get_extra_dependencies () const
72 Link_array<Score_element> r (Axis_group_spanner::get_extra_dependencies ());
73 for (int i=0; i < cols_.size (); i++)
79 Line_of_score::do_substitute_element_pointer (Score_element*o, Score_element*n)
81 if (Paper_column *p = dynamic_cast<Paper_column*>(o))
82 cols_.substitute (p, dynamic_cast<Paper_column*>(n));
86 Line_of_score::output_all ()
88 Interval i(extent(Y_AXIS));
90 warning ("Huh? Empty Line_of_score?");
92 translate_axis (- i[MAX], Y_AXIS);
94 pscore_l_->outputter_l_->start_line (i.length ());
95 Super_element::output_all ();
96 pscore_l_->outputter_l_->stop_line ();