]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/engraver.cc
Emit not-quite-cross-staff beams in the right context.
[lilypond.git] / lily / engraver.cc
index 8e49280fd8f928413eb810b4b1428da66e806691..12615eb8d6cbc780fc96a8e95cdee2fab6984bc8 100644 (file)
@@ -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));
 }