]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/translation-functions.scm (format-metronome-markup): make
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 10 Jul 2004 09:49:03 +0000 (09:49 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 10 Jul 2004 09:49:03 +0000 (09:49 +0000)
note smaller, align to bottom.

* scm/define-grobs.scm (all-grob-descriptions): noone

* lily/metronome-engraver.cc (stop_translation_timestep): attach
metronome to musical column. Don't ack time sigs or bar lines.

ChangeLog
lily/metronome-engraver.cc
scm/define-grobs.scm
scm/define-markup-commands.scm
scm/translation-functions.scm

index 23ac8873b297885bca2a01e65294a9bdcb2423e3..8726291358f2dabd5a155e813846c6481d0a84d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-07-10  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * scm/translation-functions.scm (format-metronome-markup): make
+       note smaller, align to bottom.
+
+       * scm/define-grobs.scm (all-grob-descriptions): noone
+
+       * lily/metronome-engraver.cc (stop_translation_timestep): attach
+       metronome to musical column. Don't ack time sigs or bar lines.
+
 2004-07-10  Heikki Junes  <hjunes@cc.hut.fi>
 
        * THANKS: sort, add David. Kristof contributed code, he is a
index 2f0cdf5804d00b29c4a8d8d1129806ba0e83693d..449834390f00495b1ed3e143e7ecee3f94f04b25 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <ctype.h>
 
+#include "note-column.hh"
 #include "bar-line.hh"
 #include "time-signature.hh"
 #include "engraver.hh"
@@ -26,16 +27,13 @@ public:
 protected:
   Item *text_;
   Grob *bar_line_;
+  Music *mark_ev_;
   
+  void create_items (Music*);
 protected:
   virtual void stop_translation_timestep ();
-  virtual void acknowledge_grob (Grob_info);
-  void create_items (Music*);
   virtual bool try_music (Music *ev);
   virtual void process_music ();
-  
-private:
-  Music *mark_ev_;
 };
 
 Metronome_mark_engraver::Metronome_mark_engraver ()
@@ -44,27 +42,13 @@ Metronome_mark_engraver::Metronome_mark_engraver ()
   mark_ev_ = 0;
 }
 
-void
-Metronome_mark_engraver::acknowledge_grob (Grob_info inf)
-{
-  if (Bar_line::has_interface (inf.grob_))
-    {
-      bar_line_ = inf.grob_;
-    }
-  else if (text_ && Time_signature::has_interface (inf.grob_))
-    {
-      text_->set_parent (inf.grob_, X_AXIS);
-    }
-}
-
 void 
 Metronome_mark_engraver::stop_translation_timestep ()
 {
   if (text_)
     {
-      if (bar_line_ && !text_->get_parent (X_AXIS))
-       text_->set_parent (bar_line_, X_AXIS);
-      
+      Grob*mc = unsmob_grob (get_property( "currentMusicalColumn"));
+      text_->set_parent (mc, X_AXIS);
       text_->set_property ("side-support-elements" , get_property ("stavesFound"));
       
       text_ =0;
@@ -116,6 +100,6 @@ ENTER_DESCRIPTION (Metronome_mark_engraver,
                   ,
 /* creats*/       "MetronomeMark",
 /* accepts */     "metronome-change-event",
-/* acks  */       "time-signature-interface bar-line-interface",
+                  /* acks  */       "",
 /* reads */       "stavesFound metronomeMarkFormatter",
 /* write */       "");
index 8d18393e7c296811bf5e74cb74ea3143ea82123e..ba92517312e0239df8ec7d77af730998cf1628d0 100644 (file)
        (print-function . ,Text_item::print)
        (Y-offset-callbacks . (,Side_position_interface::aligned_side)) 
        (direction . 1)
-       (breakable . #t)
-       (break-visibility . ,end-of-line-invisible)
        (padding . 0.8)
        (meta . ((interfaces . (text-interface side-position-interface font-interface metronome-mark-interface item-interface))))
        ))
index 1acf6f7e8b6767e9078f8ae18571bca411de4eca..637c76055e4d69d1c6ed63ff79a59edf1321ac1b 100644 (file)
@@ -278,6 +278,14 @@ of the @code{#'direction} layout property."
     (ly:stencil-align-to! m X LEFT)
     m))
 
+(def-markup-command (general-align paper props axis dir arg)  (integer? number? markup?)
+  "Align @var{arg} in @var{axis} direction to the @var{dir} side."
+  (let* ((m (interpret-markup paper props arg)))
+
+    (ly:stencil-align-to! m axis dir)
+    m
+  ))
+
 (def-markup-command (halign paper props dir arg) (number? markup?)
   "Set horizontal alignment. If @var{dir} is -1, then it is
 left-aligned, while+1 is right. Values in between interpolate alignment
index ded01eadfcd587ccd5e8888221e31eb28d389597..fe29e44515f65c7bae863c32760124ec34be3f2e 100644 (file)
   (let*
       ((dur  (ly:music-property event 'tempo-unit))
        (count (ly:music-property event 'metronome-count))
-       (note-mark (make-note-by-number-markup (ly:duration-log dur)
-                                             (ly:duration-dot-count dur)
-                                             1) ) ) 
+       (note-mark (make-smaller-markup
+                  (make-note-by-number-markup (ly:duration-log dur)
+                                              (ly:duration-dot-count dur)
+                                              1))))  
     (make-line-markup
      (list
-      note-mark
+      (make-general-align-markup Y DOWN note-mark)
       (make-simple-markup  "=")
       (make-simple-markup (number->string count))