2 lyric-number-engraver.cc -- implement Stanza_number_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>, Glen Prideaux <glenprideaux@iname.com>
8 Similar to (and derived from) Instrument_name_engraver.
11 #include "engraver.hh"
13 //#include "system-start-delimiter.hh"
14 //#include "side-position-interface.hh"
15 //#include "staff-symbol-referencer.hh"
18 class Stanza_number_engraver : public Engraver
23 void create_text (SCM s);
25 VIRTUAL_COPY_CONS (Translator);
26 Stanza_number_engraver ();
28 virtual void acknowledge_grob (Grob_info);
29 virtual void stop_translation_timestep ();
32 ADD_THIS_TRANSLATOR (Stanza_number_engraver);
34 Stanza_number_engraver::Stanza_number_engraver ()
41 Stanza_number_engraver::acknowledge_grob (Grob_info i)
43 if (gh_string_p (get_property ("whichBar")))
45 SCM s = get_property ("stanza");
47 if (now_mom () > Moment (0))
48 s = get_property ("stz");
53 if (i.elem_l_->has_interface (symbol ("lyric-syllable-interface")))
55 Tried catching lyric items to generate stanza numbers, but it
58 Works, but requires bar_engraver in LyricsVoice context apart
59 from at beginning. Is there any score element we can catch
60 that will do the trick?
62 What happens if we try anything at all EXCEPT a lyric? Is
63 there anything else? Not sure what it's catching, but it
64 still mucks up lyrics.
73 Stanza_number_engraver::stop_translation_timestep ()
83 Stanza_number_engraver::create_text (SCM txt)
87 text_ = new Item (get_property ("StanzaNumber"));
88 text_->set_grob_property ("text", txt);
89 announce_grob (text_,0);