]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/span-arpeggio-engraver.cc
release: 1.5.13
[lilypond.git] / lily / span-arpeggio-engraver.cc
index d90b51df2479c92d4e9dd7e614d5e8f824558f02..6d59bb277fc0bca1ccfbe70b4a495983a8bc909c 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2000--2001 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "engraver.hh"
 
 
 /** 
-  Make arpeggios that span multiple staffs.  Catch arpeggios, and span a
+  Make arpeggios that span multiple staves.  Catch arpeggios, and span a
   Span_arpeggio over them if we find more than two arpeggios.
   */
 class Span_arpeggio_engraver : public Engraver
 {
 public:
-  VIRTUAL_COPY_CONS (Translator);
-  Span_arpeggio_engraver ();
-
+  TRANSLATOR_DECLARATIONS(Span_arpeggio_engraver);
+  
 protected:
-  virtual void acknowledge_element (Score_element_info);
-  virtual void process_acknowledged ();
-  virtual void do_pre_move_processing ();
+  virtual void acknowledge_grob (Grob_info);
+  virtual void create_grobs ();
+  virtual void stop_translation_timestep ();
 
 private:
   Item *span_arpeggio_;
-  Link_array<Score_element> arpeggios_;
+  Link_array<Grob> arpeggios_;
 };
 
 
@@ -42,17 +41,17 @@ Span_arpeggio_engraver::Span_arpeggio_engraver ()
 }
 
 void
-Span_arpeggio_engraver::acknowledge_element (Score_element_info info)
+Span_arpeggio_engraver::acknowledge_grob (Grob_info info)
 {
     if (info.origin_trans_l_arr (this).size ()
-        && Arpeggio::has_interface (info.elem_l_))
+        && Arpeggio::has_interface (info.grob_l_))
     {
-      arpeggios_.push (info.elem_l_);
+      arpeggios_.push (info.grob_l_);
     }
 }
 
 void
-Span_arpeggio_engraver::process_acknowledged ()
+Span_arpeggio_engraver::create_grobs ()
 {
   /*
     connectArpeggios is slightly brusque; we should really read a elt
@@ -66,12 +65,12 @@ Span_arpeggio_engraver::process_acknowledged ()
       && to_boolean (get_property ("connectArpeggios")))
     {
       span_arpeggio_ = new Item (get_property ("Arpeggio"));
-      announce_element (span_arpeggio_, 0);      
+      announce_grob (span_arpeggio_, 0);      
     }
 }
 
 void
-Span_arpeggio_engraver::do_pre_move_processing ()
+Span_arpeggio_engraver::stop_translation_timestep ()
 {
   if (span_arpeggio_) 
     {
@@ -81,25 +80,31 @@ Span_arpeggio_engraver::do_pre_move_processing ()
        */
       for (int i=0; i < arpeggios_.size (); i ++)
        {
-         for (SCM s = arpeggios_[i]->get_elt_property ("stems");
-              gh_pair_p (s); s = gh_cdr (s))
-           Group_interface::add_thing (span_arpeggio_, "stems", gh_car (s));
-         for (SCM s = arpeggios_[i]->get_elt_property ("side-support-elements");
-              gh_pair_p (s); s = gh_cdr (s))
-           Group_interface::add_thing (span_arpeggio_, "side-support-elements", gh_car (s));
+         for (SCM s = arpeggios_[i]->get_grob_property ("stems");
+              gh_pair_p (s); s = ly_cdr (s))
+           Group_interface::add_thing (span_arpeggio_, "stems", ly_car (s));
+         for (SCM s = arpeggios_[i]->get_grob_property ("side-support-elements");
+              gh_pair_p (s); s = ly_cdr (s))
+           Group_interface::add_thing (span_arpeggio_, "side-support-elements", ly_car (s));
 
          /*
            we can't kill the children, since we don't want to the
            previous note to bump into the span arpeggio; so we make
            it transparent.  */
-         arpeggios_[i]->set_elt_property ("molecule-callback", SCM_BOOL_T);
+         arpeggios_[i]->set_grob_property ("molecule-callback", SCM_BOOL_T);
        }
       
-      typeset_element (span_arpeggio_);
+      typeset_grob (span_arpeggio_);
       span_arpeggio_ = 0;
     }
   arpeggios_.clear ();
 }
 
-ADD_THIS_TRANSLATOR (Span_arpeggio_engraver);
 
+
+ENTER_DESCRIPTION(Span_arpeggio_engraver,
+/* descr */       "",
+/* creats*/       "Arpeggio",
+/* acks  */       "arpeggio-interface",
+/* reads */       "connectArpeggios",
+/* write */       "");