]> git.donarmstrong.com Git - lilypond.git/blob - lily/piano-brace.cc
release: 1.0.1
[lilypond.git] / lily / piano-brace.cc
1
2 /*
3   span-score-bar.cc -- implement Span_score_bar
4
5   source file of the GNU LilyPond music typesetter
6
7   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 */
9
10 #include "piano-brace.hh"
11 #include "atom.hh"
12 #include "paper-def.hh"
13 #include "lookup.hh"
14 #include "main.hh"
15
16 Piano_brace::Piano_brace ()
17 {
18   extra_move_left_f_ = 0.0;
19 }
20
21 Atom
22 Piano_brace::get_bar_sym (Real dy) const
23 {
24   Atom a = lookup_l ()->vbrace (dy);
25   a.translate_axis (-extra_move_left_f_, X_AXIS);
26
27       
28   return a;
29 }
30
31 Interval
32 Piano_brace::do_width() const
33 {
34   return Interval (0,0);
35 }
36
37 void
38 Piano_brace::do_post_processing ()
39 {
40   Span_score_bar::do_post_processing();
41   Interval i = Span_score_bar::do_height ();
42   Real staffheight_f = paper ()->staffheight_f ();
43
44   // don't set braces that span only one staff
45   if (i.length () <= 2.0 * staffheight_f)
46     {
47       set_empty (true);
48       transparent_b_ = true;
49     }
50 }
51
52 IMPLEMENT_IS_TYPE_B1(Piano_brace, Span_score_bar);
53
54