1 #include "rhythmic-head.hh"
4 #include "score-engraver.hh"
6 class Forbid_line_break_engraver : public Engraver
9 TRANSLATOR_DECLARATIONS (Forbid_line_break_engraver);
10 virtual void start_translation_timestep ();
13 Forbid_line_break_engraver::Forbid_line_break_engraver (){}
16 Forbid_line_break_engraver::start_translation_timestep ()
19 Check for running note heads. This should probably be done elsewhere.
21 SCM busy = get_property ("busyGrobs");
23 Moment now = now_mom ();
24 while (scm_is_pair (busy) && unsmob_moment (scm_caar (busy))->main_part_ == now.main_part_)
25 busy = scm_cdr (busy);
28 while (scm_is_pair (busy))
30 Grob *g = unsmob_grob (scm_cdar (busy));
31 if (Rhythmic_head::has_interface (g))
33 get_score_engraver ()->forbid_breaks ();
35 busy = scm_cdr (busy);
40 ENTER_DESCRIPTION (Forbid_line_break_engraver,
41 /* descr */ "Forbid line breaks when note heads are still playing at some point.",
45 /* reads */ "busyGrobs",