]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/timing-engraver.cc
* make/lilypond.fedora.spec.in (Requires): scrap kpathsea/tex
[lilypond.git] / lily / timing-engraver.cc
index ab5bba26c4b6d547012880e279c5f9c10239efa2..97db20c1bb6eb739e2b7f721fde765eb3ab3cfb7 100644 (file)
@@ -3,10 +3,10 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
+
 #include "context.hh"
-#include "grob-info.hh"
 #include "multi-measure-rest.hh"
 #include "timing-translator.hh"
 #include "engraver.hh"
@@ -23,6 +23,7 @@ protected:
   
   virtual void start_translation_timestep ();
   virtual void initialize ();
+  virtual void process_music();
   virtual void stop_translation_timestep ();
 
 public:
@@ -52,6 +53,26 @@ Timing_engraver::initialize ()
   context ()->set_property ("whichBar", which);
 }
 
+void
+Timing_engraver::process_music()
+{
+  Timing_translator::process_music ();
+
+  bool start_of_measure = (last_moment_.main_part_ != now_mom().main_part_
+                          && !measure_position ().main_part_);
+
+  /*
+    We can't do this in start_translation_timestep(), since time sig
+    changes won't have happened by then.
+   */
+  if (start_of_measure)
+    {
+      Moment mlen = Moment (measure_length ());
+      unsmob_grob (get_property ("currentCommandColumn"))
+       ->set_property ("measure-length", mlen.smobbed_copy ()); 
+    }
+}
+  
 
 void
 Timing_engraver::start_translation_timestep ()
@@ -70,13 +91,6 @@ Timing_engraver::start_translation_timestep ()
   bool start_of_measure = (last_moment_.main_part_ != now.main_part_
                           && !mp.main_part_);
 
-  if (start_of_measure)
-    {
-      Moment mlen = Moment (measure_length ());
-      unsmob_grob (get_property ("currentCommandColumn"))
-       ->set_property ("measure-length", mlen.smobbed_copy ()); 
-    }
-  
   if (!scm_is_string (which) && to_boolean (automatic_bars))
     {
       SCM always = get_property ("barAlways");
@@ -100,7 +114,7 @@ Timing_engraver::stop_translation_timestep ()
 }
 
 
-ENTER_DESCRIPTION (Timing_engraver,
+ADD_TRANSLATOR (Timing_engraver,
 /* descr */       " Responsible for synchronizing timing information from staves.  "
 "Normally in @code{Score}.  In order to create polyrhythmic music, "
 "this engraver should be removed from @code{Score} and placed in "