]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/glissando-engraver.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / glissando-engraver.cc
index c1288efaf352a7c6aa9e6572efb8947e4e3af56a..f5b0527bd170350bc634cb14a51d5bd64828636c 100644 (file)
@@ -3,13 +3,14 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2000--2006 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
-#include "warn.hh"
-#include "spanner.hh"
-#include "rhythmic-head.hh"
 #include "engraver.hh"
+#include "international.hh"
+#include "rhythmic-head.hh"
+#include "spanner.hh"
+#include "warn.hh"
 
 /**
    Create line-spanner grobs for glissandi lines that connect note
@@ -21,11 +22,12 @@ public:
   TRANSLATOR_DECLARATIONS (Glissando_engraver);
 
 protected:
-  virtual void acknowledge_grob (Grob_info);
+  DECLARE_ACKNOWLEDGER (rhythmic_head);
   virtual void finalize ();
-  virtual void stop_translation_timestep ();
   virtual bool try_music (Music *);
-  virtual void process_music ();
+
+  void stop_translation_timestep ();
+  void process_music ();
 private:
   Spanner *line_;
   Spanner *last_line_;
@@ -53,32 +55,25 @@ void
 Glissando_engraver::process_music ()
 {
   if (event_)
-    {
-      line_ = make_spanner ("Glissando", event_->self_scm ());
-    }
+    line_ = make_spanner ("Glissando", event_->self_scm ());
 }
 
 void
-Glissando_engraver::acknowledge_grob (Grob_info info)
+Glissando_engraver::acknowledge_rhythmic_head (Grob_info info)
 {
-  if (Rhythmic_head::has_interface (info.grob ()))
-    {
-      Grob *g = info.grob ();
-      if (line_)
-       line_->set_bound (LEFT, g);
+  Grob *g = info.grob ();
+  if (line_)
+    line_->set_bound (LEFT, g);
 
-      if (last_line_)
-       last_line_->set_bound (RIGHT, g);
-    }
+  if (last_line_)
+    last_line_->set_bound (RIGHT, g);
 }
 
 void
 Glissando_engraver::stop_translation_timestep ()
 {
   if (last_line_ && last_line_->get_bound (RIGHT))
-    {
-      last_line_ = 0;
-    }
+    last_line_ = 0;
   if (line_)
     {
       if (last_line_)
@@ -94,7 +89,7 @@ Glissando_engraver::finalize ()
 {
   if (line_)
     {
-      String msg = _ ("unterminated glissando");
+      string msg = _ ("unterminated glissando");
 
       if (event_)
        event_->origin ()->warning (msg);
@@ -106,10 +101,12 @@ Glissando_engraver::finalize ()
     }
 }
 
+#include "translator.icc"
+
+ADD_ACKNOWLEDGER (Glissando_engraver, rhythmic_head);
 ADD_TRANSLATOR (Glissando_engraver,
-               /* descr */ "Engrave a glissandi",
-               /* creats*/ "Glissando",
-               /* accepts */ "glissando-event",
-               /* acks  */ "rhythmic-head-interface",
-               /* reads */ "followVoice",
+               /* doc */ "Engrave a glissandi",
+               /* create */ "Glissando",
+               /* accept */ "glissando-event",
+               /* read */ "followVoice",
                /* write */ "");