X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fforbid-break-engraver.cc;h=f44d7bc27fca8656b43df95a881f0fe298a1cb90;hb=7bc7dbd80e0e7b3e16e58f56689d32e06d4af921;hp=66d78a666031ee192483a73d02c1f814ff1e6460;hpb=0d6207e894224577f9879f4036ef8cab4925c4c7;p=lilypond.git diff --git a/lily/forbid-break-engraver.cc b/lily/forbid-break-engraver.cc index 66d78a6660..f44d7bc27f 100644 --- a/lily/forbid-break-engraver.cc +++ b/lily/forbid-break-engraver.cc @@ -4,50 +4,60 @@ source file of the GNU LilyPond music typesetter (c) 2002--_2005 Han-Wen Nienhuys - */ -#include "rhythmic-head.hh" +#include "context.hh" +#include "duration.hh" +#include "engraver.hh" #include "grob.hh" -#include "score-engraver.hh" +#include "input.hh" +#include "pitch.hh" +#include "rhythmic-head.hh" + +#include "translator.icc" class Forbid_line_break_engraver : public Engraver { public: TRANSLATOR_DECLARATIONS (Forbid_line_break_engraver); - virtual void start_translation_timestep (); + void start_translation_timestep (); }; -Forbid_line_break_engraver::Forbid_line_break_engraver (){} +Forbid_line_break_engraver::Forbid_line_break_engraver () +{ +} void Forbid_line_break_engraver::start_translation_timestep () { /* Check for running note heads. This should probably be done elsewhere. - */ + */ SCM busy = get_property ("busyGrobs"); Moment now = now_mom (); while (scm_is_pair (busy) && unsmob_moment (scm_caar (busy))->main_part_ == now.main_part_) busy = scm_cdr (busy); - while (scm_is_pair (busy)) { Grob *g = unsmob_grob (scm_cdar (busy)); - if (Rhythmic_head::has_interface (g)) - { - get_score_engraver ()->forbid_breaks (); - } + if (g->internal_has_interface (ly_symbol2scm ("rhythmic-grob-interface"))) + context ()->get_score_context ()->set_property ("forbidBreak", SCM_BOOL_T); busy = scm_cdr (busy); } } - ADD_TRANSLATOR (Forbid_line_break_engraver, -/* descr */ "Forbid line breaks when note heads are still playing at some point.", -/* creats*/ "", -/* accepts */ "", -/* acks */ "", -/* reads */ "busyGrobs", -/* write */ ""); + /* doc */ + "Forbid line breaks when note heads are still playing at some" + " point.", + + /* create */ + "", + + /* read */ + "busyGrobs ", + + /* write */ + "forbidBreak " + );