2 scoreline.cc -- implement Line_of_score
4 source file of the GNU LilyPond music typesetter
6 (c) 1996, 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "line-of-score.hh"
10 #include "dimension.hh"
13 #include "paper-def.hh"
18 Line_of_score::Line_of_score()
24 IMPLEMENT_IS_TYPE_B1(Line_of_score,Spanner);
27 Line_of_score::add_element (Score_element*e)
29 // avoid excess dependencies.
30 if (!(e->axis_group_l_a_[0] || e->axis_group_l_a_[1]))
35 Line_of_score::contains_b (Paper_column const* c) const
37 return cols.find_l ((Paper_column*)c);
41 Line_of_score::set_breaking (Array<Column_x_positions> const &breaking, int j) const
43 const Array<Paper_column*> &curline (breaking[j].cols);
44 const Array<Paper_column*> &errors (breaking[j].error_col_l_arr_);
45 const Array<Real> &config (breaking[j].config);
47 for (int i=0; i < errors.size(); i++)
48 errors[i]->error_mark_b_ = true;
50 const Line_of_score *line_l=0;
52 if (breaking.size() >1)
54 line_l = (Line_of_score*)clone()->access_Spanner ();
59 ((Array<Paper_column*> &)line_l->cols) = curline;
60 line_l->set_bounds(LEFT,curline[0]);
62 line_l->set_bounds(RIGHT,curline.top());
64 for (int i=0; i < curline.size(); i++)
66 curline[i]->translate_axis (config[i],X_AXIS);
67 curline[i]->line_l_ = (Line_of_score*)line_l;
77 Line_of_score::do_print() const
83 Line_of_score::do_width() const
85 return Spanner::do_width();
88 Link_array<Score_element>
89 Line_of_score::get_extra_dependencies () const
91 Link_array<Score_element> r;
92 for (int i=0; i < cols.size (); i++)
98 Line_of_score::do_unlink ()
100 Spanner::do_unlink ();
101 for (int i=0; i < cols.size (); i++)
108 Line_of_score::do_junk_links ()