X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fforbid-break-engraver.cc;h=a0e45c84241b5495cacf5cbe10f8ed16a496cca5;hb=9fa898402775060cc74c8d986263c5a2a59a707f;hp=2db24f41da1486dcf640127c313ffafda89368a5;hpb=91821bd59959b1289f2d711509017a4dacebecd2;p=lilypond.git diff --git a/lily/forbid-break-engraver.cc b/lily/forbid-break-engraver.cc index 2db24f41da..a0e45c8424 100644 --- a/lily/forbid-break-engraver.cc +++ b/lily/forbid-break-engraver.cc @@ -1,17 +1,28 @@ /* - 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 "duration.hh" -#include "moment.hh" +#include "rhythmic-head.hh" #include "translator.icc" @@ -35,25 +46,29 @@ Forbid_line_break_engraver::start_translation_timestep () SCM busy = get_property ("busyGrobs"); Moment now = now_mom (); - while (scm_is_pair (busy) && unsmob_moment (scm_caar (busy))->main_part_ == now.main_part_) + while (scm_is_pair (busy) && Moment::unsmob (scm_caar (busy))->main_part_ == now.main_part_) busy = scm_cdr (busy); while (scm_is_pair (busy)) { - Grob *g = unsmob_grob (scm_cdar (busy)); + Grob *g = Grob::unsmob (scm_cdar (busy)); if (g->internal_has_interface (ly_symbol2scm ("rhythmic-grob-interface"))) - { - get_score_engraver ()->forbid_breaks (); - } + context ()->get_score_context ()->set_property ("forbidBreak", SCM_BOOL_T); busy = scm_cdr (busy); } } - ADD_TRANSLATOR (Forbid_line_break_engraver, - /* doc */ "Forbid line breaks when note heads " - "are still playing at some point.", - /* create */ "", - /* accept */ "", - /* read */ "busyGrobs", - /* write */ ""); + /* doc */ + "Forbid line breaks when note heads are still playing at some" + " point.", + + /* create */ + "", + + /* read */ + "busyGrobs ", + + /* write */ + "forbidBreak " + );