]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tempo-performer.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / tempo-performer.cc
index e21f617b60f94a5e27e48152452a5a5fdafebae3..9a70f9cdc4d78a4ceec4a45d1249b76587e03656 100644 (file)
@@ -9,10 +9,8 @@
 #include "performer.hh"
 
 #include "audio-item.hh"
+#include "music.hh"
 #include "duration.hh"
-#include "stream-event.hh"
-
-#include "translator.icc"
 
 class Tempo_performer : public Performer
 {
@@ -22,11 +20,12 @@ public:
 
 protected:
 
+  virtual bool try_music (Music *event);
   void stop_translation_timestep ();
   void process_music ();
-  DECLARE_TRANSLATOR_LISTENER (metronome_change);
+
 private:
-  Stream_event *tempo_event_;
+  Music *tempo_event_;
   Audio_tempo *audio_;
 };
 
@@ -68,13 +67,18 @@ Tempo_performer::stop_translation_timestep ()
     }
 }
 
-IMPLEMENT_TRANSLATOR_LISTENER (Tempo_performer, metronome_change);
-void
-Tempo_performer::listen_metronome_change (Stream_event *event)
+bool
+Tempo_performer::try_music (Music *event)
 {
+  if (tempo_event_)
+    return false;
+
   tempo_event_ = event;
+  return true;
 }
 
+#include "translator.icc"
+
 ADD_TRANSLATOR (Tempo_performer, "", "",
                "metronome-change-event",
                "", "");