]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/part-combine-engraver.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / part-combine-engraver.cc
index 6e4d63d12df9961207c384a6a6220483914c6ea7..016b08598e3e3ebe9600dcf6d210ea80e34e7994 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2000--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2000--2006 Jan Nieuwenhuizen <janneke@gnu.org>
 
   Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
@@ -20,9 +20,11 @@ class Part_combine_engraver : public Engraver
   TRANSLATOR_DECLARATIONS (Part_combine_engraver);
 
 protected:
-  virtual void acknowledge_grob (Grob_info);
-  PRECOMPUTED_VIRTUAL void process_music ();
-  PRECOMPUTED_VIRTUAL void stop_translation_timestep ();
+  DECLARE_ACKNOWLEDGER (note_head);
+  DECLARE_ACKNOWLEDGER (stem);
+
+  void process_music ();
+  void stop_translation_timestep ();
   virtual bool try_music (Music *);
 private:
   Item *text_;
@@ -57,7 +59,7 @@ Part_combine_engraver::process_music ()
       else if (what == ly_symbol2scm ("unisono"))
        text = get_property ("aDueText");
 
-      if (Text_interface::markup_p (text))
+      if (Text_interface::is_markup (text))
        {
          text_ = make_item ("CombineTextScript", event_->self_scm ());
          text_->set_property ("text", text);
@@ -66,25 +68,25 @@ Part_combine_engraver::process_music ()
 }
 
 void
-Part_combine_engraver::acknowledge_grob (Grob_info i)
+Part_combine_engraver::acknowledge_note_head (Grob_info i)
 {
   if (text_)
     {
-      if (Note_head::has_interface (i.grob ()))
-       {
-         Grob *t = text_;
-         Side_position_interface::add_support (t, i.grob ());
-         if (Side_position_interface::get_axis (t) == X_AXIS
-             && !t->get_parent (Y_AXIS))
-           t->set_parent (i.grob (), Y_AXIS);
-       }
-      if (Stem::has_interface (i.grob ()))
-       {
-         Side_position_interface::add_support (text_, i.grob ());
-       }
+      Grob *t = text_;
+      Side_position_interface::add_support (t, i.grob ());
+      if (Side_position_interface::get_axis (t) == X_AXIS
+         && !t->get_parent (Y_AXIS))
+       t->set_parent (i.grob (), Y_AXIS);
     }
 }
 
+void
+Part_combine_engraver::acknowledge_stem (Grob_info i)
+{
+  if (text_)
+    Side_position_interface::add_support (text_, i.grob ());
+}
+
 void
 Part_combine_engraver::stop_translation_timestep ()
 {
@@ -93,14 +95,13 @@ Part_combine_engraver::stop_translation_timestep ()
 }
 
 #include "translator.icc"
-
+ADD_ACKNOWLEDGER (Part_combine_engraver, note_head);
+ADD_ACKNOWLEDGER (Part_combine_engraver, stem);
 ADD_TRANSLATOR (Part_combine_engraver,
-               /* descr */ "Part combine engraver for orchestral scores:               "
+               /* doc */ "Part combine engraver for orchestral scores:         "
                "Print markings a2, Solo, Solo II, and unisono ",
-               /* creats*/ "CombineTextScript",
-               /* accepts */ "part-combine-event",
-               /* acks  */ "multi-measure-rest-interface "
-               "slur-interface stem-interface note-head-interface",
-               /* reads */ "printPartCombineTexts soloText soloIIText "
+               /* create */ "CombineTextScript",
+               /* accept */ "part-combine-event",
+               /* read */ "printPartCombineTexts soloText soloIIText "
                "aDueText",
                /* write */ "");