2 lyric-number-engraver.cc -- implement Stanza_number_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>, Glen Prideaux <glenprideaux@iname.com>
10 #include "side-position-interface.hh"
11 #include "text-interface.hh"
14 class Stanza_number_engraver
: public Engraver
20 TRANSLATOR_DECLARATIONS (Stanza_number_engraver
);
21 void process_music ();
22 virtual void derived_mark () const;
23 void stop_translation_timestep ();
24 DECLARE_ACKNOWLEDGER (lyric_syllable
);
28 Stanza_number_engraver::derived_mark () const
30 scm_gc_mark (last_stanza_
);
34 TODO: should make engraver that collects all the stanzas on a higher
35 level, and then groups them to the side. Stanza numbers should be
39 Stanza_number_engraver::Stanza_number_engraver ()
42 last_stanza_
= SCM_EOL
;
46 Stanza_number_engraver::process_music ()
48 SCM stanza
= get_property ("stanza");
50 if (Text_interface::is_markup (stanza
)
51 && stanza
!= last_stanza_
)
53 last_stanza_
= stanza
;
55 text_
= make_item ("StanzaNumber", SCM_EOL
);
56 text_
->set_property ("text", stanza
);
61 Stanza_number_engraver::acknowledge_lyric_syllable (Grob_info inf
)
64 Side_position_interface::add_support (text_
, inf
.grob ());
68 Stanza_number_engraver::stop_translation_timestep ()
73 #include "translator.icc"
75 ADD_ACKNOWLEDGER (Stanza_number_engraver
, lyric_syllable
);
76 ADD_TRANSLATOR (Stanza_number_engraver
,
78 "Engrave stanza numbers.",