written for the GNU LilyPond music typesetter
-TODO: --> see breathing-sign-engraver.cc
+ TODO: --> see breathing-sign-engraver.cc
*/
-#include "staff-symbol-referencer.hh"
+#include "staff-symbol-referencer.hh"
+#include "directional-element-interface.hh"
#include "breathing-sign.hh"
#include "string.hh"
#include "molecule.hh"
#include "direction.hh"
-Breathing_sign::Breathing_sign ()
+Breathing_sign::Breathing_sign (SCM s)
+ : Item (s)
{
- set_direction (UP);
- set_elt_property ("breakable", SCM_BOOL_T);
}
-Molecule*
-Breathing_sign::do_brew_molecule_p () const
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Breathing_sign);
+
+Molecule
+Breathing_sign::do_brew_molecule () const
{
Staff_symbol_referencer_interface si (this);
- Real dl = si.staff_space();
- Interval i1(0, dl / 6), i2(-dl / 2, dl / 2);
- Box b(i1, i2);
+ Real space = si.staff_space();
- Molecule *output = new Molecule (lookup_l()->filledbox(b));
+ // todo: cfg'able.
+ Interval i1(0, space / 6), i2(-space / 2, space / 2);
+ Box b(i1, i2);
- return output;
+ return lookup_l()->filledbox(b);
}
void
-Breathing_sign::do_post_processing()
+Breathing_sign::after_line_breaking ()
{
- Real dl = Staff_symbol_referencer_interface (this).staff_space();
-
- translate_axis(2.0 * dl * get_direction (), Y_AXIS);
+ Real space = staff_symbol_referencer (this).staff_space();
+ Direction d = directional_element (this). get ();
+ if (!d)
+ {
+ d = UP;
+ directional_element(this).set (d);
+ }
+
+ translate_axis(2.0 * space * d, Y_AXIS);
}