2 staff-collecting-engraver.cc -- implement Staff_collecting_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2001--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #include "staff-symbol.hh"
10 #include "engraver.hh"
14 class Staff_collecting_engraver : public Engraver
17 TRANSLATOR_DECLARATIONS (Staff_collecting_engraver);
18 DECLARE_ACKNOWLEDGER (staff_symbol);
19 DECLARE_END_ACKNOWLEDGER (staff_symbol);
22 Staff_collecting_engraver::Staff_collecting_engraver ()
27 Staff_collecting_engraver::acknowledge_staff_symbol (Grob_info gi)
29 SCM staffs = get_property ("stavesFound");
30 staffs = scm_cons (gi.grob ()->self_scm (), staffs);
32 context ()->set_property ("stavesFound", staffs);
36 Staff_collecting_engraver::acknowledge_end_staff_symbol (Grob_info gi)
38 SCM staffs = get_property ("stavesFound");
39 staffs = scm_delq (gi.grob ()->self_scm (), staffs);
41 context ()->set_property ("stavesFound", staffs);
44 #include "translator.icc"
46 ADD_ACKNOWLEDGER (Staff_collecting_engraver, staff_symbol);
47 ADD_END_ACKNOWLEDGER (Staff_collecting_engraver, staff_symbol);
49 ADD_TRANSLATOR (Staff_collecting_engraver,
50 /* doc */ "Maintain the stavesFound variable",
53 /* read */ "stavesFound",
54 /* write */ "stavesFound");