]> git.donarmstrong.com Git - lilypond.git/blob - lily/breathing-sign.cc
release: 1.3.56
[lilypond.git] / lily / breathing-sign.cc
1 /*
2   breathing_sign.cc -- implement Breathing_sign
3
4   Copyright (C) 1999 Michael Krause
5
6   written for the GNU LilyPond music typesetter
7
8   TODO: --> see breathing-sign-engraver.cc
9
10 */
11
12 #include "staff-symbol-referencer.hh"
13 #include "directional-element-interface.hh"
14 #include "breathing-sign.hh"
15 #include "string.hh"
16 #include "molecule.hh"
17 #include "paper-def.hh"
18 #include "lookup.hh"
19 #include "debug.hh"
20 #include "dimensions.hh"
21 #include "direction.hh"
22
23
24 Breathing_sign::Breathing_sign (SCM  s)
25   : Item (s)
26 {
27 }
28
29
30
31 MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Breathing_sign);
32
33 Molecule 
34 Breathing_sign::do_brew_molecule () const
35 {
36   Staff_symbol_referencer_interface si (this);
37   
38   Real space = si.staff_space();
39
40   // todo: cfg'able.
41   Interval i1(0, space / 6), i2(-space / 2, space / 2);
42   Box b(i1, i2);
43
44   return lookup_l()->filledbox(b);
45 }
46
47 void
48 Breathing_sign::after_line_breaking ()
49 {
50   Real space = staff_symbol_referencer (this).staff_space();
51   Direction d = directional_element (this). get ();
52   if (!d)
53     {
54       d = UP;
55       directional_element(this).set (d);
56     }
57
58   translate_axis(2.0 * space * d, Y_AXIS);
59 }
60