Fixes Issue 1504, allowing feather beam line breaking.
[lilypond/patrick.git] / lily / staff-collecting-engraver.cc
blob29ddd8d70b353ae32f2c2c1eec399d99af7f491f
1 /*
2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2001--2011 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"
22 #include "grob.hh"
23 #include "context.hh"
25 class Staff_collecting_engraver : public Engraver
27 public:
28 TRANSLATOR_DECLARATIONS (Staff_collecting_engraver);
29 DECLARE_ACKNOWLEDGER (staff_symbol);
30 DECLARE_END_ACKNOWLEDGER (staff_symbol);
33 Staff_collecting_engraver::Staff_collecting_engraver ()
37 void
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);
46 void
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,
61 /* doc */
62 "Maintain the @code{stavesFound} variable.",
64 /* create */
65 "",
67 /* read */
68 "stavesFound ",
70 /* write */
71 "stavesFound "