#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;
}
+