2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2001--2015 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 void acknowledge_staff_symbol (Grob_info);
30 void acknowledge_end_staff_symbol (Grob_info);
33 Staff_collecting_engraver::Staff_collecting_engraver (Context *c)
39 Staff_collecting_engraver::acknowledge_staff_symbol (Grob_info gi)
41 SCM staffs = get_property ("stavesFound");
42 staffs = scm_cons (gi.grob ()->self_scm (), staffs);
44 context ()->set_property ("stavesFound", staffs);
48 Staff_collecting_engraver::acknowledge_end_staff_symbol (Grob_info gi)
50 SCM staffs = get_property ("stavesFound");
51 staffs = scm_delq (gi.grob ()->self_scm (), staffs);
53 context ()->set_property ("stavesFound", staffs);
56 #include "translator.icc"
60 Staff_collecting_engraver::boot ()
62 ADD_ACKNOWLEDGER (Staff_collecting_engraver, staff_symbol);
63 ADD_END_ACKNOWLEDGER (Staff_collecting_engraver, staff_symbol);
66 ADD_TRANSLATOR (Staff_collecting_engraver,
68 "Maintain the @code{stavesFound} variable.",