]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 25 Nov 2005 16:05:11 +0000 (16:05 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 25 Nov 2005 16:05:11 +0000 (16:05 +0000)
input/regression/rehearsal-mark-align.ly [new file with mode: 0644]
lily/mark-engraver.cc
scm/define-context-properties.scm
scm/define-grobs.scm

diff --git a/input/regression/rehearsal-mark-align.ly b/input/regression/rehearsal-mark-align.ly
new file mode 100644 (file)
index 0000000..d37153d
--- /dev/null
@@ -0,0 +1,23 @@
+
+\header {
+
+  texidoc = "The rehearsal mark is put on top a breakable symbol,
+  according to the value of @code{rehearsalMarkAlignSymbol}."
+
+}
+
+\version "2.7.19"
+  
+\relative {
+  c1 \mark "foo"
+  \key cis \major
+  \clef alto
+  \set Score.rehearsalMarkAlignSymbol = #'key-signature
+  \mark "on-key"
+  cis
+ \key ces \major
+  \set Score.rehearsalMarkAlignSymbol = #'clef
+  \clef treble
+  \mark "on clef"
+  ces
+}
index 82fc31ba39acbaf25cadce9efe20271baaf104c4..689eb490136b73158868c90d6e552cf58130d9fb 100644 (file)
@@ -36,7 +36,7 @@ protected:
   void process_music ();
   void stop_translation_timestep ();
 
-  DECLARE_ACKNOWLEDGER (bar_line);
+  DECLARE_ACKNOWLEDGER (break_aligned);
 };
 
 Mark_engraver::Mark_engraver ()
@@ -46,10 +46,12 @@ Mark_engraver::Mark_engraver ()
 }
 
 void
-Mark_engraver::acknowledge_bar_line (Grob_info inf)
+Mark_engraver::acknowledge_break_aligned (Grob_info inf)
 {
   Grob *s = inf.grob ();
-  if (text_)
+  if (text_
+      && (get_property ("rehearsalMarkAlignSymbol")
+         == s->get_property ("break-align-symbol")))
     {
       /*
        TODO: make this configurable. RehearsalMark cannot be
@@ -135,7 +137,7 @@ Mark_engraver::process_music ()
 
 #include "translator.icc"
 
-ADD_ACKNOWLEDGER (Mark_engraver, bar_line);
+ADD_ACKNOWLEDGER (Mark_engraver, break_aligned);
 
 ADD_TRANSLATOR (Mark_engraver,
                /* doc */ "This engraver will create RehearsalMark objects. "
@@ -146,5 +148,5 @@ ADD_TRANSLATOR (Mark_engraver,
                "end up on the same Y-location",
                /* create */ "RehearsalMark",
                /* accept */ "mark-event",
-               /* read */ "rehearsalMark markFormatter stavesFound",
+               /* read */ "rehearsalMark rehearsalMarkAlignSymbol markFormatter stavesFound",
                /* write */ "");
index a206a625a7ce3b4079194b832eca060d3e0ce9bf..0c63d7a0d81177257289f28ec0199a50d5a5a5cf 100644 (file)
@@ -328,6 +328,8 @@ The list of contains entries with start times, music objects and
 whether they are processed in this context.")
 
      (rehearsalMark ,integer? "The last rehearsal mark printed.")
+     (rehearsalMarkAlignSymbol ,symbol? "Which @code{break-align-symbol} to put the mark on?  Example values:  @code{clef}, @code{key-signature}.")
+     
      (repeatCommands ,list? "This property is read to find any command of the form @code{(volta . @var{x})}, where @var{x} is a string or @code{#f}")
      (restNumberThreshold ,number?
                          "If a multimeasure rest has more measures
index 8c5617e661697e04201618c045929722432adb35..dbd1edb04aa2cbee5dc284a68b4c165ea50ea21c 100644 (file)
 
        (stencil . ,Text_interface::print)
 
-       (X-offset . ,Self_alignment_interface::x_aligned_on_self)
+       (X-offset . ,(ly:make-simple-closure
+                     `(,+ ,(ly:make-simple-closure `(,Self_alignment_interface::x_aligned_on_self))
+                          ,(ly:make-simple-closure `(,Self_alignment_interface::centered_on_x_parent)))
+                     ))
        (Y-offset . ,Side_position_interface::y_aligned_side)
 
        (after-line-breaking . ,shift-right-at-line-begin)