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");
56 if (i.elem_l_->has_interface (symbol ("lyric-syllable-interface")))
58 Tried catching lyric items to generate stanza numbers, but it
61 Works, but requires bar_engraver in LyricsVoice context apart
62 from at beginning. Is there any score element we can catch
63 that will do the trick?
65 What happens if we try anything at all EXCEPT a lyric? Is
66 there anything else? Not sure what it's catching, but it
67 still mucks up lyrics.
76 Stanza_number_engraver::stop_translation_timestep ()
86 Stanza_number_engraver::create_text (SCM txt)
90 text_ = new Item (get_property ("StanzaNumber"));
91 text_->set_grob_property ("text", txt);
92 announce_grob (text_,0);