X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fchord-tremolo-engraver.cc;h=9e48a1a4908d5a21bf0c0e59a9242483979f4dd3;hb=90e4d7057f3857da049dfda3d130017d4719bd6b;hp=95fdaeef9d41a84f30932b169a410356cce2bb7d;hpb=59a6d1a06432fc0ca88c3023c646182f389ec1b5;p=lilypond.git diff --git a/lily/chord-tremolo-engraver.cc b/lily/chord-tremolo-engraver.cc index 95fdaeef9d..9e48a1a490 100644 --- a/lily/chord-tremolo-engraver.cc +++ b/lily/chord-tremolo-engraver.cc @@ -34,8 +34,6 @@ #include "translator.icc" -using std::string; - /** This acknowledges repeated music with "tremolo" style. It typesets @@ -64,18 +62,18 @@ protected: protected: virtual void finalize (); void process_music (); - DECLARE_TRANSLATOR_LISTENER (tremolo_span); - DECLARE_ACKNOWLEDGER (stem); + void listen_tremolo_span (Stream_event *); + void acknowledge_stem (Grob_info); }; -Chord_tremolo_engraver::Chord_tremolo_engraver () +Chord_tremolo_engraver::Chord_tremolo_engraver (Context *c) + : Engraver (c) { beam_ = 0; repeat_ = 0; previous_stem_ = 0; } -IMPLEMENT_TRANSLATOR_LISTENER (Chord_tremolo_engraver, tremolo_span); void Chord_tremolo_engraver::listen_tremolo_span (Stream_event *ev) { @@ -120,9 +118,9 @@ Chord_tremolo_engraver::acknowledge_stem (Grob_info info) if (beam_) { int tremolo_type = robust_scm2int (repeat_->get_property ("tremolo-type"), 1); - int flags = std::max (0, intlog2 (tremolo_type) - 2); + int flags = max (0, intlog2 (tremolo_type) - 2); int repeat_count = robust_scm2int (repeat_->get_property ("repeat-count"), 1); - int gap_count = std::min (flags, intlog2 (repeat_count) + 1); + int gap_count = min (flags, intlog2 (repeat_count) + 1); Grob *s = info.grob (); if (previous_stem_) @@ -160,7 +158,13 @@ Chord_tremolo_engraver::acknowledge_stem (Grob_info info) } } -ADD_ACKNOWLEDGER (Chord_tremolo_engraver, stem); +void +Chord_tremolo_engraver::boot () +{ + ADD_LISTENER (Chord_tremolo_engraver, tremolo_span); + ADD_ACKNOWLEDGER (Chord_tremolo_engraver, stem); +} + ADD_TRANSLATOR (Chord_tremolo_engraver, /* doc */ "Generate beams for tremolo repeats.",