#include "engraver.hh"
+#include "context.hh"
+#include "item.hh"
+#include "lilypond-key.hh"
#include "music.hh"
#include "score-engraver.hh"
-#include "warn.hh"
#include "spanner.hh"
-#include "item.hh"
-#include "context.hh"
-#include "score-context.hh"
-#include "lilypond-key.hh"
+#include "stream-event.hh"
+#include "warn.hh"
Engraver_group *
Engraver::get_daddy_engraver () const
get_daddy_engraver ()->announce_grob (inf);
}
+void
+Engraver::announce_end_grob (Grob_info inf)
+{
+ get_daddy_engraver ()->announce_grob (inf);
+}
+
/*
- CAUSE is the object (typically a Music object) that
+ CAUSE is the object (typically a Stream_event object) that
was the reason for making E.
*/
void
Engraver::announce_grob (Grob *e, SCM cause)
{
- if (unsmob_music (cause) || unsmob_grob (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))
e->set_property ("cause", cause);
Grob_info i (this, e);
g->announce_grob (i);
}
-Engraver::Engraver ()
+
+/*
+ CAUSE is the object (typically a Music object) that
+ was the reason for making E.
+*/
+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 (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);
}
-Score_engraver *
-Engraver::get_score_engraver () const
+
+Engraver::Engraver ()
{
- return dynamic_cast<Score_engraver *> (get_score_context ()->implementation ());
}
#include "translator.icc"