2 lyric-number-engraver.cc -- implement Stanza_number_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>, Glen Prideaux <glenprideaux@iname.com>
10 #include "side-position-interface.hh"
12 class Stanza_number_engraver : public Engraver
17 This is naughty, since last_stanza_ may be GCd from under us. But
18 since we don't look at the contents, we are/should be (knock on
23 TRANSLATOR_DECLARATIONS (Stanza_number_engraver);
24 void process_music ();
25 void stop_translation_timestep ();
26 DECLARE_ACKNOWLEDGER (lyric_syllable);
30 TODO: should make engraver that collects all the stanzas on a higher
31 level, and then groups them to the side. Stanza numbers should be
35 Stanza_number_engraver::Stanza_number_engraver ()
41 Stanza_number_engraver::process_music ()
43 SCM stanza = get_property ("stanza");
45 if (scm_is_string (stanza) && stanza != last_stanza_)
47 last_stanza_ = stanza;
49 text_ = make_item ("StanzaNumber", SCM_EOL);
50 text_->set_property ("text", stanza);
55 Stanza_number_engraver::acknowledge_lyric_syllable (Grob_info inf)
59 Side_position_interface::add_support (text_, inf.grob ());
64 Stanza_number_engraver::stop_translation_timestep ()
69 #include "translator.icc"
71 ADD_ACKNOWLEDGER (Stanza_number_engraver,lyric_syllable);
72 ADD_TRANSLATOR (Stanza_number_engraver,
74 /* creats*/ "StanzaNumber",