2 staffsym.cc -- implement Staff_symbol
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 #include "staff-symbol.hh"
10 #include "dimensions.hh"
11 #include "paper-def.hh"
12 #include "molecule.hh"
19 Staff_symbol::do_brew_molecule() const
21 Score_element * common
22 = spanned_drul_[LEFT]->common_refpoint (spanned_drul_[RIGHT], X_AXIS);
25 // right_shift - left_shift
26 + spanned_drul_[RIGHT]->relative_coordinate (common , X_AXIS)
27 - spanned_drul_[LEFT]->relative_coordinate (common, X_AXIS)
30 Real t = paper_l ()->get_var ("stafflinethickness");
31 int l = line_count ();
33 Real height = (l-1) * staff_space () /2;
35 for (int i=0; i < l; i++)
38 lookup_l ()->filledbox (Box (Interval (0,width),
39 Interval (-t/2, t/2)));
41 a.translate_axis (height - i * staff_space (), Y_AXIS);
49 Staff_symbol::steps_i() const
51 return line_count () * 2;
55 Staff_symbol::line_count () const
57 return gh_scm2int (get_elt_property ("line-count"));
61 Staff_symbol::staff_space ()const
63 return gh_scm2double (get_elt_property ("staff-space"));