2 staff-symbol-referencer.cc -- implement Staff_symbol_referencer
4 source file of the GNU LilyPond music typesetter
6 (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
11 #include "staff-symbol-referencer.hh"
12 #include "staff-symbol.hh"
13 #include "paper-def.hh"
14 #include "dimension-cache.hh"
16 Staff_symbol_referencer::Staff_symbol_referencer ()
22 Staff_symbol_referencer::do_substitute_element_pointer (Score_element *o, Score_element*n)
24 if (staff_sym_l_ == o)
26 staff_sym_l_ = dynamic_cast<Staff_symbol*> (n);
31 Staff_symbol_referencer::lines_i () const
33 return (staff_sym_l_) ? staff_sym_l_->no_lines_i_ : 5;
37 Staff_symbol_referencer::set_staff_symbol (Staff_symbol*s)
44 Staff_symbol_referencer::staff_symbol_l () const
50 Staff_symbol_referencer::staff_line_leading_f () const
52 return (staff_sym_l_) ? staff_sym_l_->staff_line_leading_f_ : paper_l ()->get_var ("interline");
56 Staff_symbol_referencer::position_f () const
61 Graphical_element * c = common_refpoint (staff_sym_l_, Y_AXIS);
62 Real y = relative_coordinate (c, Y_AXIS) - staff_sym_l_->relative_coordinate (c, Y_AXIS);
64 return 2.0 * y / staff_line_leading_f ();