X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fengraver.cc;h=12615eb8d6cbc780fc96a8e95cdee2fab6984bc8;hb=cf3642858a2340bb39ee56739f34c799946d4454;hp=4e0ea654337118d8e3a057310c24c046e5be7f61;hpb=e18531db1f79fb685fbd16d6a2a67bf4b6c09915;p=lilypond.git diff --git a/lily/engraver.cc b/lily/engraver.cc index 4e0ea65433..12615eb8d6 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2010 Han-Wen Nienhuys + Copyright (C) 1997--2011 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 @@ -43,29 +43,33 @@ Engraver::announce_grob (Grob_info inf) void Engraver::announce_end_grob (Grob_info inf) { + inf.start_end_ = STOP; get_daddy_engraver ()->announce_grob (inf); } -/* - CAUSE is the object (typically a Stream_event object) that - was the reason for making E. -*/ -void -Engraver::announce_grob (Grob *e, SCM cause) +Grob_info +Engraver::make_grob_info(Grob *e, SCM cause) { /* TODO: Remove Music code when it's no longer needed */ if (Music *m = unsmob_music (cause)) { cause = m->to_event ()->unprotect (); } - if (unsmob_stream_event (cause) || unsmob_grob (cause)) + if (e->get_property ("cause") == SCM_EOL + && (unsmob_stream_event (cause) || unsmob_grob (cause))) e->set_property ("cause", cause); - Grob_info i (this, e); + return Grob_info (this, e); +} - Engraver_group *g = get_daddy_engraver (); - if (g) - g->announce_grob (i); +/* + CAUSE is the object (typically a Stream_event object) that + was the reason for making E. +*/ +void +Engraver::announce_grob (Grob *e, SCM cause) +{ + announce_grob (make_grob_info (e, cause)); } @@ -75,21 +79,7 @@ Engraver::announce_grob (Grob *e, SCM cause) void Engraver::announce_end_grob (Grob *e, SCM cause) { - /* TODO: Remove Music code when it's no longer needed */ - if (Music *m = unsmob_music (cause)) - { - cause = m->to_event ()->unprotect (); - } - if (e->get_property ("cause") == SCM_EOL - && (unsmob_stream_event (cause) || unsmob_grob (cause))) - e->set_property ("cause", cause); - - Grob_info i (this, e); - - i.start_end_ = STOP; - Engraver_group *g = get_daddy_engraver (); - if (g) - g->announce_grob (i); + announce_end_grob (make_grob_info (e, cause)); } @@ -191,7 +181,7 @@ unsmob_engraver (SCM eng) bool ly_is_grob_cause (SCM obj) { - return unsmob_grob (obj) || unsmob_stream_event (obj); + return unsmob_grob (obj) || unsmob_stream_event (obj) || (obj == SCM_EOL); } #include "translator.icc"