1 #include "rhythmic-head.hh"
3 #include "score-engraver.hh"
5 class Forbid_line_break_engraver : public Engraver
8 TRANSLATOR_DECLARATIONS (Forbid_line_break_engraver);
9 virtual void start_translation_timestep ();
12 Forbid_line_break_engraver::Forbid_line_break_engraver (){}
15 Forbid_line_break_engraver::start_translation_timestep ()
18 Check for running note heads. This should probably be done elsewhere.
20 SCM busy = get_property ("busyGrobs");
22 Moment now = now_mom ();
23 while (scm_is_pair (busy) && unsmob_moment (scm_caar (busy))->main_part_ == now.main_part_)
24 busy = scm_cdr (busy);
27 while (scm_is_pair (busy))
29 Grob *g = unsmob_grob (scm_cdar (busy));
30 if (Rhythmic_head::has_interface (g))
32 get_score_engraver ()->forbid_breaks ();
34 busy = scm_cdr (busy);
39 ADD_TRANSLATOR (Forbid_line_break_engraver,
40 /* descr */ "Forbid line breaks when note heads are still playing at some point.",
44 /* reads */ "busyGrobs",