X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Fforbid-break-engraver.cc;h=9599d8e28fd1c72b71e2d398b34d62a119ff0ca7;hb=eb72c0f066957c3e71d336db0f72814e34d3964d;hp=20714ec9590fbbf860b118045c844c3c1de1e023;hpb=28976d28a04cfb9abe97af7214d7dce11f732604;p=lilypond.git diff --git a/lily/forbid-break-engraver.cc b/lily/forbid-break-engraver.cc index 20714ec959..9599d8e28f 100644 --- a/lily/forbid-break-engraver.cc +++ b/lily/forbid-break-engraver.cc @@ -1,46 +1,56 @@ +/* + forbid-break-engraver.cc -- implement Forbid_line_break_engraver + + source file of the GNU LilyPond music typesetter + + (c) 2002--_2005 Han-Wen Nienhuys +*/ #include "rhythmic-head.hh" -#include "engraver.hh" #include "grob.hh" #include "score-engraver.hh" +#include "input.hh" +#include "pitch.hh" +#include "duration.hh" +#include "moment.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 (is_pair (busy) && unsmob_moment (ly_caar (busy))->main_part_ == now.main_part_) - busy = ly_cdr (busy); + while (scm_is_pair (busy) && unsmob_moment (scm_caar (busy))->main_part_ == now.main_part_) + busy = scm_cdr (busy); - - while (is_pair (busy)) + while (scm_is_pair (busy)) { - Grob *g = unsmob_grob (ly_cdar (busy)); - if (Rhythmic_head::has_interface (g)) - { - get_score_engraver ()->forbid_breaks (); - } - busy = ly_cdr (busy); + Grob *g = unsmob_grob (scm_cdar (busy)); + if (g->internal_has_interface (ly_symbol2scm ("rhythmic-grob-interface"))) + get_score_engraver ()->forbid_breaks (); + busy = scm_cdr (busy); } } - -ENTER_DESCRIPTION (Forbid_line_break_engraver, -/* descr */ "Forbid line breaks when note heads are still playing at some point.", -/* creats*/ "", -/* accepts */ "", -/* acks */ "", -/* reads */ "busyGrobs", -/* write */ ""); +ADD_TRANSLATOR (Forbid_line_break_engraver, + /* doc */ "Forbid line breaks when note heads " + "are still playing at some point.", + /* create */ "", + /* accept */ "", + /* read */ "busyGrobs", + /* write */ "");