2 engraver.cc -- implement Engraver
4 Sourcefile of GNU LilyPond music type setter
6 (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
13 #include "lilypond-key.hh"
15 #include "score-engraver.hh"
17 #include "stream-event.hh"
21 Engraver::get_daddy_engraver () const
23 return dynamic_cast<Engraver_group *> (get_daddy_translator ());
27 Engraver::announce_grob (Grob_info inf)
29 get_daddy_engraver ()->announce_grob (inf);
33 Engraver::announce_end_grob (Grob_info inf)
35 get_daddy_engraver ()->announce_grob (inf);
39 CAUSE is the object (typically a Stream_event object) that
40 was the reason for making E.
43 Engraver::announce_grob (Grob *e, SCM cause)
45 /* TODO: Remove Music code when it's no longer needed */
46 if (Music *m = unsmob_music (cause))
48 cause = m->to_event ()->unprotect ();
50 if (unsmob_stream_event (cause) || unsmob_grob (cause))
51 e->set_property ("cause", cause);
53 Grob_info i (this, e);
55 Engraver_group *g = get_daddy_engraver ();
62 CAUSE is the object (typically a Music object) that
63 was the reason for making E.
66 Engraver::announce_end_grob (Grob *e, SCM cause)
68 /* TODO: Remove Music code when it's no longer needed */
69 if (Music *m = unsmob_music (cause))
71 cause = m->to_event ()->unprotect ();
73 if (unsmob_stream_event (cause) || unsmob_grob (cause))
74 e->set_property ("cause", cause);
76 Grob_info i (this, e);
79 Engraver_group *g = get_daddy_engraver ();
89 #include "translator.icc"
91 ADD_TRANSLATOR (Engraver,
92 "Base class for engravers. Does nothing, so it is not used.",