]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lyric-engraver.cc
Release: bump Welcome versions.
[lilypond.git] / lily / lyric-engraver.cc
index fadb35d6b4c8dd3d10e7a541b5bdabc80da2d1b7..bad1203266f75b43842e6bdea358b6a734dc339f 100644 (file)
@@ -36,7 +36,7 @@ class Lyric_engraver : public Engraver
 protected:
   void stop_translation_timestep ();
   void process_music ();
-  DECLARE_TRANSLATOR_LISTENER (lyric);
+  void listen_lyric (Stream_event *);
 
 public:
   TRANSLATOR_DECLARATIONS (Lyric_engraver);
@@ -49,14 +49,14 @@ private:
   Context *get_voice_context ();
 };
 
-Lyric_engraver::Lyric_engraver ()
+Lyric_engraver::Lyric_engraver (Context *c)
+  : Engraver (c)
 {
   text_ = 0;
   last_text_ = 0;
   event_ = 0;
 }
 
-IMPLEMENT_TRANSLATOR_LISTENER (Lyric_engraver, lyric);
 void
 Lyric_engraver::listen_lyric (Stream_event *ev)
 {
@@ -96,7 +96,10 @@ get_voice_to_lyrics (Context *lyrics)
 
   SCM avc = lyrics->get_property ("associatedVoiceContext");
   if (Context *c = unsmob<Context> (avc))
-    return c;
+    {
+      if (!c->is_removable ())
+        return c;
+    }
 
   SCM voice_name = lyrics->get_property ("associatedVoice");
   string nm = lyrics->id_string ();
@@ -155,7 +158,7 @@ get_current_note_head (Context *voice)
       // here.  Not with this mechanism.
       if ((*end_mom == end_from_now)
           && dynamic_cast<Item *> (g)
-          && Note_head::has_interface (g))
+          && has_interface<Note_head> (g))
         {
           return g;
         }
@@ -191,6 +194,12 @@ Lyric_engraver::stop_translation_timestep ()
   event_ = 0;
 }
 
+void
+Lyric_engraver::boot ()
+{
+  ADD_LISTENER (Lyric_engraver, lyric);
+}
+
 ADD_TRANSLATOR (Lyric_engraver,
                 /* doc */
                 "Engrave text for lyrics.",