]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/arpeggio-engraver.cc
updates
[lilypond.git] / lily / arpeggio-engraver.cc
index 8aee3f93971f5e926fd883dd18e83fbb0dc85a15..de5eb15e1c3bb559dab68e1c4ac88b40950b6560 100644 (file)
@@ -3,13 +3,13 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 2000--2002 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2000--2003 Jan Nieuwenhuizen <janneke@gnu.org>
  */
 
 #include "engraver.hh"
 #include "group-interface.hh"
 #include "item.hh"
-#include "musical-request.hh"
+#include "event.hh"
 #include "arpeggio.hh"
 #include "stem.hh"
 #include "rhythmic-head.hh"
@@ -29,7 +29,7 @@ protected:
 
 private:
   Item* arpeggio_; 
-  Arpeggio_req *arpeggio_req_;
+  Music *arpeggio_req_;
 };
 
 Arpeggio_engraver::Arpeggio_engraver ()
@@ -43,13 +43,9 @@ Arpeggio_engraver::try_music (Music* m)
 {
   if (!arpeggio_req_)
     {
-      if (Arpeggio_req *a = dynamic_cast<Arpeggio_req*> (m))
-       {
-         arpeggio_req_ = a;
-         return true;
-       }
+      arpeggio_req_ = m;
     }
-  return false;
+  return true;
 }
 
 void
@@ -57,25 +53,25 @@ Arpeggio_engraver::acknowledge_grob (Grob_info info)
 {
   if (arpeggio_)
     {
-      if (Stem::has_interface (info.grob_l_))
+      if (Stem::has_interface (info.grob_))
        {
          if (!arpeggio_->get_parent  (Y_AXIS))
-           arpeggio_->set_parent (info.grob_l_, Y_AXIS);
+           arpeggio_->set_parent (info.grob_, Y_AXIS);
       
-         Pointer_group_interface::add_grob (arpeggio_, ly_symbol2scm ("stems"), info.grob_l_);
+         Pointer_group_interface::add_grob (arpeggio_, ly_symbol2scm ("stems"), info.grob_);
        }
       
       /*
        We can't catch local key items (accidentals) from Voice context,
        see Local_key_engraver
       */
-      else if (Rhythmic_head::has_interface (info.grob_l_))
+      else if (Rhythmic_head::has_interface (info.grob_))
        {
-         Side_position_interface::add_support (arpeggio_, info.grob_l_);
+         Side_position_interface::add_support (arpeggio_, info.grob_);
        }
-      else if (Note_column::has_interface (info.grob_l_ ))
+      else if (Note_column::has_interface (info.grob_ ))
        {
-         info.grob_l_->set_grob_property ("arpeggio", arpeggio_->self_scm ());
+         info.grob_->set_grob_property ("arpeggio", arpeggio_->self_scm ());
        }
     }
 }
@@ -107,6 +103,7 @@ Arpeggio_engraver::stop_translation_timestep ()
 ENTER_DESCRIPTION(Arpeggio_engraver,
 /* descr */       "Generate an Arpeggio from a Arpeggio_req",
 /* creats*/       "Arpeggio",
+/* accepts */     "arpeggio-event",
 /* acks  */       "stem-interface rhythmic-head-interface note-column-interface",
 /* reads */       "",
 /* write */       "");