2 repeat-acknowledge-engraver.cc -- implement Repeat_acknowledge_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "translator-group.hh"
11 #include "repeated-music.hh"
17 -- set and reset repeatCommands, so Unfolded_repeat_iterator knows
18 where to set variables.
20 -- collect information passed by Unfolded_repeat_iterator for
21 Bar_engraver: writes whichBar property. (TODO: check for
22 interactions with timing engraver.)
25 class Repeat_acknowledge_engraver : public Engraver
28 VIRTUAL_COPY_CONS (Translator);
29 Repeat_acknowledge_engraver();
31 virtual void do_post_move_processing ();
32 virtual void do_process_music ();
33 virtual void do_creation_processing ();
37 Repeat_acknowledge_engraver::do_creation_processing ()
39 daddy_trans_l_->set_property ("repeatCommands", SCM_EOL);
43 Repeat_acknowledge_engraver::Repeat_acknowledge_engraver()
48 Repeat_acknowledge_engraver::do_post_move_processing ()
50 Translator_group * tr = daddy_trans_l_->where_defined (ly_symbol2scm ("repeatCommands"));
54 tr->set_property ("repeatCommands", SCM_EOL);
58 Repeat_acknowledge_engraver::do_process_music ()
61 At the start of a piece, we don't print any repeat bars.
63 if (now_mom () == Moment (0))
66 SCM cs = get_property ("repeatCommands");
71 bool volta_found = false;
72 while (gh_pair_p (cs))
74 SCM command = gh_car (cs);
75 if (command == ly_symbol2scm ("start-repeat"))
77 else if (command == ly_symbol2scm ("end-repeat"))
79 else if (gh_pair_p (command) && gh_car (command) == ly_symbol2scm ("volta"))
92 TODO: line breaks might be allowed if we set whichBar to "".
94 if (s != "" || (volta_found && !gh_string_p (get_property ("whichBar"))))
96 daddy_trans_l_->set_property ("whichBar", ly_str02scm(s.ch_C()));
101 ADD_THIS_TRANSLATOR(Repeat_acknowledge_engraver);