/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 1997--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
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));
}
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));
}
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"