]> git.donarmstrong.com Git - lilypond.git/blob - lily/staff-symbol-referencer.cc
release: 1.1.35
[lilypond.git] / lily / staff-symbol-referencer.cc
1 /*   
2   staff-symbol-referencer.cc -- implement Staff_symbol_referencer
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7  */
8
9 #include "staff-symbol-referencer.hh"
10 #include "staff-symbol.hh"
11 #include "paper-def.hh"
12
13 Staff_symbol_referencer::Staff_symbol_referencer ()
14 {
15   staff_sym_l_ =0;
16 }
17
18 void
19 Staff_symbol_referencer::do_substitute_element_pointer (Score_element *o, Score_element*n)
20 {
21   if (staff_sym_l_ == o)
22     {
23       staff_sym_l_ = dynamic_cast<Staff_symbol*> (n);
24     }
25 }
26
27 int
28 Staff_symbol_referencer::lines_i () const
29 {
30   return (staff_sym_l_) ?  staff_sym_l_->no_lines_i_ : 5;
31 }
32
33 void
34 Staff_symbol_referencer::set_staff_symbol (Staff_symbol*s)
35 {
36   staff_sym_l_ =s;
37   add_dependency (s);
38 }
39
40 Staff_symbol*
41 Staff_symbol_referencer::staff_symbol_l () const
42 {
43   return staff_sym_l_;
44 }
45
46 Real
47 Staff_symbol_referencer::staff_line_leading_f () const
48 {
49   return (staff_sym_l_) ? staff_sym_l_->staff_line_leading_f_ : paper_l ()->get_realvar (interline_scm_sym);
50 }