]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/breathing-sign.cc
release: 1.3.38
[lilypond.git] / lily / breathing-sign.cc
index 4c36f261aa4e3c564bc00a430a1c5f3434c13852..2c1f5152491c973f261c2823915eebed4e5502df 100644 (file)
@@ -5,9 +5,11 @@
 
   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 "directional-element-interface.hh"
 
 #include "breathing-sign.hh"
 #include "string.hh"
@@ -18,42 +20,35 @@ TODO: --> see breathing-sign-engraver.cc
 #include "dimensions.hh"
 #include "direction.hh"
 
-#include <iostream.h>
 
 Breathing_sign::Breathing_sign ()
 {
-  dir_ = UP;
-  set_elt_property (breakable_scm_sym, SCM_BOOL_T);
-  set_elt_property (break_priority_scm_sym, gh_int2scm (-4));
-  set_elt_property (visibility_lambda_scm_sym,
-                   ly_ch_C_eval_scm ("non_postbreak_visibility"));
+  set_elt_property ("breakable", SCM_BOOL_T);
 }
 
-void
-Breathing_sign::set_vertical_position (Direction updown)
-{
-  assert(updown >= -1 && updown <= +1);
-
-  if(updown != 0)
-    dir_ = updown;
-}
-
-Molecule*
-Breathing_sign::do_brew_molecule_p () const
+Molecule 
+Breathing_sign::do_brew_molecule () const
 {
-  Real dl = staff_line_leading_f();
-  Interval i1(0, dl / 6), i2(-dl / 2, dl / 2);
+  Staff_symbol_referencer_interface si (this);
+  
+  Real space = si.staff_space();
+  Interval i1(0, space / 6), i2(-space / 2, space / 2);
   Box b(i1, i2);
 
-  Molecule *output = new Molecule (lookup_l()->filledbox(b));
-
-  return output;
+  return lookup_l()->filledbox(b);
 }
 
 void
-Breathing_sign::do_post_processing()
+Breathing_sign::after_line_breaking ()
 {
-  Real dl = staff_line_leading_f();
-
-  translate_axis(2.0 * dl * dir_, 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);
 }
+