2 lyric-number-engraver.cc -- implement Stanza_number_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>, Glen Prideaux <glenprideaux@iname.com>
10 #include "side-position-interface.hh"
11 #include "text-interface.hh"
13 class Stanza_number_engraver : public Engraver
19 TRANSLATOR_DECLARATIONS (Stanza_number_engraver);
20 void process_music ();
21 virtual void derived_mark () const;
22 void stop_translation_timestep ();
23 DECLARE_ACKNOWLEDGER (lyric_syllable);
27 Stanza_number_engraver::derived_mark () const
29 scm_gc_mark (last_stanza_);
33 TODO: should make engraver that collects all the stanzas on a higher
34 level, and then groups them to the side. Stanza numbers should be
38 Stanza_number_engraver::Stanza_number_engraver ()
41 last_stanza_ = SCM_EOL;
45 Stanza_number_engraver::process_music ()
47 SCM stanza = get_property ("stanza");
49 if (Text_interface::is_markup (stanza)
50 && stanza != last_stanza_)
52 last_stanza_ = stanza;
54 text_ = make_item ("StanzaNumber", SCM_EOL);
55 text_->set_property ("text", stanza);
60 Stanza_number_engraver::acknowledge_lyric_syllable (Grob_info inf)
63 Side_position_interface::add_support (text_, inf.grob ());
67 Stanza_number_engraver::stop_translation_timestep ()
72 #include "translator.icc"
74 ADD_ACKNOWLEDGER (Stanza_number_engraver, lyric_syllable);
75 ADD_TRANSLATOR (Stanza_number_engraver,
77 /* create */ "StanzaNumber",