2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2001--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #include "staff-symbol.hh"
21 #include "engraver.hh"
25 class Staff_collecting_engraver : public Engraver
28 TRANSLATOR_DECLARATIONS (Staff_collecting_engraver);
29 DECLARE_ACKNOWLEDGER (staff_symbol);
30 DECLARE_END_ACKNOWLEDGER (staff_symbol);
33 Staff_collecting_engraver::Staff_collecting_engraver ()
38 Staff_collecting_engraver::acknowledge_staff_symbol (Grob_info gi)
40 SCM staffs = get_property ("stavesFound");
41 staffs = scm_cons (gi.grob ()->self_scm (), staffs);
43 context ()->set_property ("stavesFound", staffs);
47 Staff_collecting_engraver::acknowledge_end_staff_symbol (Grob_info gi)
49 SCM staffs = get_property ("stavesFound");
50 staffs = scm_delq (gi.grob ()->self_scm (), staffs);
52 context ()->set_property ("stavesFound", staffs);
55 #include "translator.icc"
57 ADD_ACKNOWLEDGER (Staff_collecting_engraver, staff_symbol);
58 ADD_END_ACKNOWLEDGER (Staff_collecting_engraver, staff_symbol);
60 ADD_TRANSLATOR (Staff_collecting_engraver,
62 "Maintain the @code{stavesFound} variable.",