]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/staff-symbol-engraver.cc
2003 -> 2004
[lilypond.git] / lily / staff-symbol-engraver.cc
index 9f601d155109f8f0e7e5eee76e7584fc470f9446..d71dcb4f2121cb2543ce394258a8dd437b5f24a3 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 
@@ -26,7 +26,7 @@ protected:
   virtual ~Staff_symbol_engraver ();
   virtual void acknowledge_grob (Grob_info);
   virtual void finalize ();
-  virtual void initialize ();
+  virtual void process_music ();
 };
 
 
@@ -41,20 +41,26 @@ Staff_symbol_engraver::Staff_symbol_engraver ()
 }
 
 void
-Staff_symbol_engraver::initialize ()
+Staff_symbol_engraver::process_music ()
 {
-  span_ = new Spanner (get_property ("StaffSymbol"));
+  if (!span_)
+    {
+      span_ = make_spanner ("StaffSymbol");
   
-  span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
+      span_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
 
-  announce_grob(span_, SCM_EOL);
+      announce_grob(span_, SCM_EOL);
+    }
 }
 
 void
 Staff_symbol_engraver::finalize ()
 {
-  span_->set_bound (RIGHT,unsmob_grob (get_property ("currentCommandColumn")));
-  typeset_grob (span_);
+  if (span_)
+    {
+      span_->set_bound (RIGHT,unsmob_grob (get_property ("currentCommandColumn")));
+      typeset_grob (span_);
+    }
   span_ =0;
 }
 
@@ -71,8 +77,8 @@ Staff_symbol_engraver::acknowledge_grob (Grob_info s)
 
 
 ENTER_DESCRIPTION(Staff_symbol_engraver,
-/* descr */       "create the constellation of five (default)
-staff lines.",
+/* descr */       "create the constellation of five (default) "
+"staff lines.",
 /* creats*/       "StaffSymbol",
 /* accepts */     "",
 /* acks  */      "grob-interface",