*** empty log message ***
[lilypond.git] / lily / staff-collecting-engraver.cc
blobf9b97e4c67ff70b0dde52a9c8cc3a5721323ceac
1 /*
2 staff-collecting-engraver.cc -- implement Staff_collecting_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
9 #include "staff-symbol.hh"
10 #include "engraver.hh"
11 #include "grob.hh"
12 #include "context.hh"
14 class Staff_collecting_engraver : public Engraver
16 public:
17 TRANSLATOR_DECLARATIONS (Staff_collecting_engraver);
18 virtual void acknowledge_grob (Grob_info);
21 Staff_collecting_engraver::Staff_collecting_engraver ()
25 void
26 Staff_collecting_engraver::acknowledge_grob (Grob_info gi)
28 if (Staff_symbol::has_interface (gi.grob ()))
30 SCM staffs = get_property ("stavesFound");
31 staffs = scm_cons (gi.grob ()->self_scm (), staffs);
33 context ()->set_property ("stavesFound", staffs);
37 ADD_TRANSLATOR (Staff_collecting_engraver,
38 /* descr */ "Maintain the stavesFound variable",
40 /* creats*/ "",
41 /* accepts */ "",
42 /* acks */ "staff-symbol-interface",
43 /* reads */ "stavesFound",
44 /* write */ "stavesFound");