]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/break-align-engraver.cc
Run grand-replace (issue 3765)
[lilypond.git] / lily / break-align-engraver.cc
index da488be2acf11c60e7e29b4dd723e46a40df31c9..1013ac6e7be4b9a2b164f76dfd7e6c62f1a87145 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1999--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1999--2014 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
@@ -69,6 +69,13 @@ Break_align_engraver::derived_mark () const
 void
 Break_align_engraver::acknowledge_break_alignable (Grob_info inf)
 {
+  /*
+    Special case for MetronomeMark: filter out items which will be aligned
+    on note heads rather than prefatory material
+  */
+  if (!Item::is_non_musical (inf.item ()))
+    return;
+
   if (!align_)
     create_alignment (inf);
 
@@ -84,20 +91,20 @@ Break_align_engraver::acknowledge_break_aligned (Grob_info inf)
   if (Item *item = dynamic_cast<Item *> (inf.grob ()))
     {
       /*
-       Removed check for item->empty (X_AXIS). --hwn 20/1/04
+        Removed check for item->empty (X_AXIS). --hwn 20/1/04
       */
       if (item->get_parent (X_AXIS))
-       return;
+        return;
 
       if (!Item::is_non_musical (item))
-       return;
+        return;
 
       SCM align_name = item->get_property ("break-align-symbol");
       if (!scm_is_symbol (align_name))
-       return;
-         
+        return;
+
       if (!align_)
-       create_alignment (inf);
+        create_alignment (inf);
 
       add_to_group (align_name, item);
     }
@@ -120,7 +127,7 @@ Break_align_engraver::create_alignment (Grob_info inf)
   */
   left_edge_ = random_source->make_item ("LeftEdge", SCM_EOL);
   add_to_group (left_edge_->get_property ("break-align-symbol"),
-               left_edge_);
+                left_edge_);
 }
 
 void
@@ -151,20 +158,20 @@ Break_align_engraver::add_to_group (SCM align_name, Item *item)
 ADD_ACKNOWLEDGER (Break_align_engraver, break_aligned);
 ADD_ACKNOWLEDGER (Break_align_engraver, break_alignable);
 ADD_TRANSLATOR (Break_align_engraver,
-               /* doc */
-               "Align grobs with corresponding @code{break-align-symbols}"
-               " into groups, and order the groups according to"
-               " @code{breakAlignOrder}.  The left edge of the alignment gets"
-               " a separate group, with a symbol @code{left-edge}.",
-
-               /* create */
-               "BreakAlignment "
-               "BreakAlignGroup "
-               "LeftEdge ",
-
-               /* read */
-               "",
-
-               /* write */
-               ""
-               );
+                /* doc */
+                "Align grobs with corresponding @code{break-align-symbols}"
+                " into groups, and order the groups according to"
+                " @code{breakAlignOrder}.  The left edge of the alignment gets"
+                " a separate group, with a symbol @code{left-edge}.",
+
+                /* create */
+                "BreakAlignment "
+                "BreakAlignGroup "
+                "LeftEdge ",
+
+                /* read */
+                "",
+
+                /* write */
+                ""
+               );