]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/staff-collecting-engraver.cc
Run `make grand-replace'.
[lilypond.git] / lily / staff-collecting-engraver.cc
index fe522a049747284eb8efd91dbf59442173a5e533..3ecee7ba23f172f9e6eeb335cc1ac04580b852a7 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2001--2006  Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2001--2008  Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "staff-symbol.hh"
@@ -16,6 +16,7 @@ class Staff_collecting_engraver : public Engraver
 public:
   TRANSLATOR_DECLARATIONS (Staff_collecting_engraver);
   DECLARE_ACKNOWLEDGER (staff_symbol);
+  DECLARE_END_ACKNOWLEDGER (staff_symbol);
 };
 
 Staff_collecting_engraver::Staff_collecting_engraver ()
@@ -31,13 +32,30 @@ Staff_collecting_engraver::acknowledge_staff_symbol (Grob_info gi)
   context ()->set_property ("stavesFound", staffs);
 }
 
+void
+Staff_collecting_engraver::acknowledge_end_staff_symbol (Grob_info gi)
+{
+  SCM staffs = get_property ("stavesFound");
+  staffs = scm_delq (gi.grob ()->self_scm (), staffs);
+
+  context ()->set_property ("stavesFound", staffs);
+}
+
 #include "translator.icc"
+
 ADD_ACKNOWLEDGER (Staff_collecting_engraver, staff_symbol);
+ADD_END_ACKNOWLEDGER (Staff_collecting_engraver, staff_symbol);
 
 ADD_TRANSLATOR (Staff_collecting_engraver,
-               /* doc */ "Maintain the stavesFound variable",
+               /* doc */
+               "Maintain the @code{stavesFound} variable.",
+
+               /* create */
+               "",
+
+               /* read */
+               "stavesFound ",
 
-               /* create */ "",
-               /* accept */ "",
-               /* read */ "stavesFound",
-               /* write */ "stavesFound");
+               /* write */
+               "stavesFound "
+               );