]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/chord-tremolo-engraver.cc
Merge remote-tracking branch 'origin/release/unstable' into HEAD
[lilypond.git] / lily / chord-tremolo-engraver.cc
index 95fdaeef9d41a84f30932b169a410356cce2bb7d..7a17c1350e36567857acb983eeda04695df3827f 100644 (file)
@@ -34,8 +34,6 @@
 
 #include "translator.icc"
 
-using std::string;
-
 /**
 
 This acknowledges repeated music with "tremolo" style.  It typesets
@@ -64,8 +62,8 @@ 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 ()
@@ -75,7 +73,6 @@ Chord_tremolo_engraver::Chord_tremolo_engraver ()
   previous_stem_ = 0;
 }
 
-IMPLEMENT_TRANSLATOR_LISTENER (Chord_tremolo_engraver, tremolo_span);
 void
 Chord_tremolo_engraver::listen_tremolo_span (Stream_event *ev)
 {
@@ -120,9 +117,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 +157,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.",