2 lyric-engraver.cc -- implement Lyric_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 Jan Nieuwenhuizen <janneke@gnu.org>
10 #include "engraver.hh"
13 #include "paper-def.hh"
14 #include "font-metric.hh"
15 #include "side-position-interface.hh"
18 Generate texts for lyric syllables. We only do one lyric at a time.
19 Multiple copies of this engraver should be used to do multiple voices.
21 class Lyric_engraver
: public Engraver
24 virtual void stop_translation_timestep ();
25 virtual bool try_music (Music
*);
26 virtual void process_acknowledged_grobs ();
27 virtual void start_translation_timestep ();
30 TRANSLATOR_DECLARATIONS(Lyric_engraver
);
39 Lyric_engraver::Lyric_engraver ()
46 Lyric_engraver::try_music (Music
*r
)
48 if (r
->is_mus_type ("lyric-event"))
59 Lyric_engraver::process_acknowledged_grobs ()
63 text_
= new Item (get_property ("LyricText"));
65 text_
->set_grob_property ("text", req_
->get_mus_property ("text"));
68 We can't reach the notehead where we're centered from here. So
71 (UGH UGH, pulled amount of space out of thin air)
74 text_
->translate_axis (0.66, X_AXIS
);
76 announce_grob(text_
, req_
->self_scm());
82 Lyric_engraver::stop_translation_timestep ()
92 Lyric_engraver::start_translation_timestep ()
98 ENTER_DESCRIPTION(Lyric_engraver
,
101 /* accepts */ "lyric-event",