X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fforbid-break-engraver.cc;h=b1d89ddf24380ade44a7adba2a249e4542d7229d;hb=cc5223ac26a5713c5901c02edf2868c26be10542;hp=fa4138bc48739631c785ea60cbfe94725b350182;hpb=58bcc84c9480dae1b21bc24d8396b91fe19e0131;p=lilypond.git diff --git a/lily/forbid-break-engraver.cc b/lily/forbid-break-engraver.cc index fa4138bc48..b1d89ddf24 100644 --- a/lily/forbid-break-engraver.cc +++ b/lily/forbid-break-engraver.cc @@ -1,22 +1,41 @@ /* - forbid-break-engraver.cc -- implement Forbid_line_break_engraver + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2002--_2005 Han-Wen Nienhuys - (c) 2002--_2005 Han-Wen Nienhuys + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ -#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 () @@ -33,18 +52,23 @@ Forbid_line_break_engraver::start_translation_timestep () 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 " + );