]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/completion-rest-engraver.cc
Issue 5167/6: Changes: show \markup xxx = ... \etc assignments
[lilypond.git] / lily / completion-rest-engraver.cc
index a60b400efce786fcf6c36de6958f8f61d42e2f82..c3b8b10955d767404e34ee2d87bccc0a005e8e82 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include <cctype>
+using namespace std;
 
 #include "dot-column.hh"
 #include "dots.hh"
@@ -39,8 +40,6 @@
 
 #include "translator.icc"
 
-using std::vector;
-
 /*
   How does this work?
 
@@ -77,7 +76,7 @@ protected:
   void start_translation_timestep ();
   void process_music ();
   void stop_translation_timestep ();
-  DECLARE_TRANSLATOR_LISTENER (rest);
+  void listen_rest (Stream_event *);
 };
 
 void
@@ -86,7 +85,6 @@ Completion_rest_engraver::initialize ()
   is_first_ = false;
 }
 
-IMPLEMENT_TRANSLATOR_LISTENER (Completion_rest_engraver, rest);
 void
 Completion_rest_engraver::listen_rest (Stream_event *ev)
 {
@@ -96,7 +94,7 @@ Completion_rest_engraver::listen_rest (Stream_event *ev)
   Moment now = now_mom ();
   Moment musiclen = get_event_length (ev, now);
 
-  rest_end_mom_ = std::max (rest_end_mom_, (now + musiclen));
+  rest_end_mom_ = max (rest_end_mom_, (now + musiclen));
   do_nothing_until_ = Rational (0, 0);
 }
 
@@ -255,8 +253,15 @@ Completion_rest_engraver::start_translation_timestep ()
                             ly_bool2scm (rest_events_.size ()));
 }
 
-Completion_rest_engraver::Completion_rest_engraver ()
+Completion_rest_engraver::Completion_rest_engraver (Context *c)
+  : Engraver (c)
+{
+}
+
+void
+Completion_rest_engraver::boot ()
 {
+  ADD_LISTENER (Completion_rest_engraver, rest);
 }
 
 ADD_TRANSLATOR (Completion_rest_engraver,