]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/rest.cc
release: 1.3.4
[lilypond.git] / lily / rest.cc
index 50eed01303e2ee47fc2319e16092159c28f18b88..a7974c5ead393a78206aa057c0b456130525cfd5 100644 (file)
 #include "rest.hh"
 #include "dots.hh"
 #include "axis-group-element.hh"
-#include "p-score.hh"
+#include "paper-score.hh"
 
 void
 Rest::do_add_processing ()
 {
-  if (balltype_i_ > 1)
-    position_i_ -= 4;
-  else if (balltype_i_ == 0)
-    position_i_ += 2;
+  if (balltype_i_ == 0)
+    position_i_ += 2;          // guh.
 
   Rhythmic_head::do_add_processing ();
-  if (dots_l_ && balltype_i_ > 1)
-    {
-      dots_l_->position_i_ = position_i_ + 4;
-    }
 }
 
-Rest::Rest ()
+void
+Rest::do_post_processing ()
 {
-  position_i_ =0;
+  Rhythmic_head::do_post_processing ();
+  if (dots_l_
+      && balltype_i_ > 4) // UGH.
+    {
+      /*
+       UGH. 
+       */
+      if (balltype_i_ == 7)
+       dots_l_->set_position (4);
+      else
+       dots_l_->set_position (3);
+    }
 }
 
+
 Molecule *
 Rest::do_brew_molecule_p () const
 {
-  bool streepjes_b = abs(position_i_) > lines_i () / 2 &&  
-    (balltype_i_ == 0 || balltype_i_ == 1);
+  bool ledger_b =false;
+
+  if (balltype_i_ == 0 || balltype_i_ == 1)
+    ledger_b = abs(position_f ()  - (2* balltype_i_ - 1)) > lines_i (); 
+
+  
+  String style; 
+  SCM style_sym =get_elt_property ("style");
+  if (balltype_i_ >= 2 && style_sym != SCM_UNDEFINED)
+    {
+      style = ly_scm2string (style_sym);
+    }
   
-  Molecule s(lookup_l ()->rest (balltype_i_, streepjes_b));
+  Molecule s(lookup_l ()->rest (balltype_i_, ledger_b, style));
   Molecule * m = new Molecule ( Molecule (s));
-  m->translate_axis (position_i_ *  staff_line_leading_f ()/2.0, Y_AXIS);
+
   return m;
 }
 
 
+