#include "engraver-group-engraver.hh"
#include "warn.hh"
#include "misc.hh"
-#include "note-head.hh"
#include "spanner.hh"
#include "item.hh"
#include "chord-tremolo-iterator.hh"
virtual void finalize ();
virtual bool try_music (Music *);
virtual void acknowledge_grob (Grob_info);
- virtual void stop_translation_timestep ();
- virtual void start_translation_timestep ();
- virtual void process_music ();
+ PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
+ PRECOMPUTED_VIRTUAL void start_translation_timestep ();
+ PRECOMPUTED_VIRTUAL void process_music ();
};
Chord_tremolo_engraver::Chord_tremolo_engraver ()
Rational total_dur = l.main_part_;
Rational note_dur = total_dur / Rational (elt_count * Repeated_music::repeat_count (repeat_));
- total_duration_flags_ = 0 >? (intlog2 (total_dur.den ()) - 2);
+ total_duration_flags_ = max (0, (intlog2 (total_dur.den ()) - 2));
flags_ = intlog2 (note_dur.den ()) -2;
void
Chord_tremolo_engraver::acknowledge_grob (Grob_info info)
{
- if (beam_ && Stem::has_interface (info.grob_))
+ if (beam_ && Stem::has_interface (info.grob ()))
{
- Grob *s = info.grob_;
+ Grob *s = info.grob ();
if (start_mom_ == now_mom ())
Stem::set_beaming (s, flags_, RIGHT);
}
}
else if (repeat_
- && flags_ && !body_is_sequential_ && Stem::has_interface (info.grob_))
+ && flags_
+ && !body_is_sequential_
+ && Stem::has_interface (info.grob ()))
{
stem_tremolo_ = make_item ("StemTremolo", repeat_->self_scm ());
stem_tremolo_->set_property ("flag-count",
scm_int2num (flags_));
- stem_tremolo_->set_property ("stem",
- info.grob_->self_scm ());
- stem_tremolo_->set_parent (info.grob_, X_AXIS);
+ stem_tremolo_->set_object ("stem",
+ info.grob ()->self_scm ());
+ stem_tremolo_->set_parent (info.grob (), X_AXIS);
}
}
typeset_beam ();
}
+#include "translator.icc"
+
ADD_TRANSLATOR (Chord_tremolo_engraver,
/* descr */ "Generates beams for tremolo repeats.",
/* creats*/ "Beam",
/* accepts */ "repeated-music",
- /* acks */ "stem-interface note-head-interface",
+ /* acks */ "stem-interface",
/* reads */ "",
/* write */ "");