X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fforbid-break-engraver.cc;h=0ba34fec52818234c12a7b4e0280a68ae154f738;hb=fc9660e70c14140d16608855332f9b31697bc5ad;hp=207e30284908e9c5825ec886aa922c6816775e28;hpb=1e1fa5221ca359326b073626168c6b7cda6453e1;p=lilypond.git diff --git a/lily/forbid-break-engraver.cc b/lily/forbid-break-engraver.cc index 207e302849..0ba34fec52 100644 --- a/lily/forbid-break-engraver.cc +++ b/lily/forbid-break-engraver.cc @@ -1,34 +1,47 @@ +/* + 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 (); + PRECOMPUTED_VIRTUAL 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)) + if (g->internal_has_interface (ly_symbol2scm ("rhythmic-grob-interface"))) { get_score_engraver ()->forbid_breaks (); } @@ -37,10 +50,10 @@ Forbid_line_break_engraver::start_translation_timestep () } -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, + /* descr */ "Forbid line breaks when note heads are still playing at some point.", + /* creats*/ "", + /* accepts */ "", + /* acks */ "", + /* reads */ "busyGrobs", + /* write */ "");