]> git.donarmstrong.com Git - lilypond.git/commitdiff
Metronome mark: check for interface rather than grob name in non-break-aligned.
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 29 Aug 2010 18:51:49 +0000 (20:51 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 29 Aug 2010 18:51:58 +0000 (20:51 +0200)
This remove the usage of grob_name so so we can easily swap in and out
implementations of formatting behavior.

lily/metronome-engraver.cc
scm/define-grob-properties.scm
scm/define-grobs.scm

index 7eaf3145ad2086308997e38c09bf5d10a2fd0b6f..aed027544c498ac6a65fe607f9e74b740b57283c 100644 (file)
@@ -99,24 +99,17 @@ Metronome_mark_engraver::acknowledge_break_aligned (Grob_info info)
     }
 }
 
-SCM
-grob_name_scm (Grob *g)
-{
-  SCM name_pair = scm_assq (ly_symbol2scm ("name"), g->get_property ("meta"));
-  return (scm_is_pair (name_pair)
-         ? ly_camel_case_2_lisp_identifier (scm_cdr (name_pair))
-         : SCM_EOL);
-}
-
 void
 Metronome_mark_engraver::acknowledge_grob (Grob_info info)
 {
   Grob *g = info.grob ();
 
-  if (text_
-      && safe_is_member (grob_name_scm (g),
-                        text_->get_property ("non-break-align-symbols")))
-    text_->set_parent (g, X_AXIS);
+  if (text_)
+    for (SCM s = text_->get_property ("non-break-align-symbols");
+        scm_is_pair (s);
+        s = scm_cdr (s))
+      if (g->internal_has_interface (scm_car (s)))
+       text_->set_parent (g, X_AXIS);
 }
 
 void
index d4ee62b815053ad67a0a5a1e68e2721f17f66608..4202b26b96080da12ae992b1da4338808cac8e30 100644 (file)
@@ -608,7 +608,7 @@ staff is crucial for @var{padding}).
 @code{VerticalAlignment}; rather, place it using its own
 @code{Y-offset} callback.")
      (non-break-align-symbols ,list? "A list of symbols that determine
-which NON-break-aligned grobs to align this to.")
+which NON-break-aligned interfaces to align this to.")
      (no-ledgers ,boolean? "If set, don't draw ledger lines on this
 object.")
      (no-stem-extend ,boolean? "If set, notes with ledger lines do not
index 38bd6eb6302eba8b2ebb81c4a9b46d6b6881e79e..71a167d80af153b6a179d0664ed6725067cbc21f 100644 (file)
                          (list ly:self-alignment-interface::x-aligned-on-self)))))
        (self-alignment-X . ,LEFT)
        (break-align-symbols . (key-signature time-signature))
-       (non-break-align-symbols . (multi-measure-rest))
+       (non-break-align-symbols . (multi-measure-rest-interface))
        (non-musical . #t)
        (meta . ((class . Item)
                 (interfaces . (break-alignable-interface