]> git.donarmstrong.com Git - lilypond.git/blob - lily/staff-sym.cc
4542d2e3dcfc0acb8aceb5ce7f2546b79786e412
[lilypond.git] / lily / staff-sym.cc
1 /*
2   staffsym.cc -- implement Staff_symbol
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8 #include "staff-sym.hh"
9 #include "lookup.hh"
10 #include "paper-def.hh"
11 #include "molecule.hh"
12 #include "debug.hh"
13
14
15
16 Staff_symbol::Staff_symbol (int l)
17 {
18   no_lines_i_ = l;
19 }
20
21
22 IMPLEMENT_IS_TYPE_B1(Staff_symbol,Spanner);
23
24 void
25 Staff_symbol::do_print()const
26 {
27 #ifndef NPRINT
28   Spanner::do_print();
29   DOUT << "lines: " << no_lines_i_;
30 #endif
31 }
32
33 Molecule*
34 Staff_symbol::brew_molecule_p() const
35 {
36   Atom a  = paper()->lookup_l ()->linestaff (no_lines_i_, width ().length ());
37   return new Molecule (a);
38 }
39
40 void
41 Staff_symbol::set_extent (PCol*p1, PCol*p2)
42 {
43   assert (p1&&p2);
44   left_col_l_ = p1;
45   right_col_l_ = p2;
46 }
47
48 Real
49 Staff_symbol::inter_note_f()const
50 {
51   return paper()->internote_f ();
52 }
53
54 int
55 Staff_symbol::steps_i() const
56 {
57   return no_lines_i_*2;
58 }