2 staffsym.cc -- implement Staff_symbol
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 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"
17 Staff_symbol::Staff_symbol ()
20 staff_line_leading_f_
= 5.0 PT
;
24 Staff_symbol::do_print() const
28 DEBUG_OUT
<< "lines: " << no_lines_i_
;
34 Staff_symbol::do_brew_molecule_p() const
36 Score_element
* common
37 = spanned_drul_
[LEFT
]->common_refpoint (spanned_drul_
[RIGHT
], X_AXIS
);
40 Interval r
= spanned_drul_
[RIGHT
]->extent (X_AXIS
);
41 Interval l
= spanned_drul_
[LEFT
]->extent (X_AXIS
);
43 Real left_shift
=l
.empty_b () ? 0.0: l
[LEFT
];
44 Real right_shift
=r
.empty_b () ? 0.0: r
[RIGHT
];
47 // right_shift - left_shift
48 + spanned_drul_
[RIGHT
]->relative_coordinate (common
, X_AXIS
)
49 - spanned_drul_
[LEFT
]->relative_coordinate (common
, X_AXIS
)
52 Real t
= paper_l ()->get_var ("stafflinethickness");
53 Molecule rule
= lookup_l ()->filledbox (Box (Interval (0,width
),
54 Interval (-t
/2, t
/2)));
56 Real height
= (no_lines_i_
-1) * staff_line_leading_f_
/2;
57 Molecule
* m
= new Molecule
;
58 for (int i
=0; i
< no_lines_i_
; i
++)
61 a
.translate_axis (height
- i
* staff_line_leading_f_
, Y_AXIS
);
65 // m->translate_axis (left_shift, X_AXIS);
71 Staff_symbol::steps_i() const