]> git.donarmstrong.com Git - lilypond.git/commitdiff
(process_music): move setting
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 2 Oct 2004 12:38:54 +0000 (12:38 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 2 Oct 2004 12:38:54 +0000 (12:38 +0000)
measure-length. This fixes spacing-whole-rest.ly

ChangeLog
lily/break-align-engraver.cc
lily/score-engraver.cc
lily/spacing-spanner.cc
lily/timing-engraver.cc

index 7f0bdb1fed02ddd594f5007b8ad70e0bb6c06571..273ca2efe5d496fdf6311d0e92e6b927d33da930 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-10-02  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/timing-engraver.cc (process_music): move setting
+       measure-length. This fixes spacing-whole-rest.ly
+
        * VERSION (PACKAGE_NAME): release 2.3.20
        
        * input/regression/quote-transposition.ly: update example
index 2dc61c63c54493020f95a0f55f29db53fc14afbd..e16fed2464d1cef09729c25db01568ff1aee239b 100644 (file)
@@ -18,7 +18,7 @@
 class Break_align_engraver : public Engraver
 {
   Item *align_;
-SCM column_alist_;
+  SCM column_alist_;
   Item *left_edge_;
 
   void add_to_group (SCM,Item*);
index a1b1a755761227a3b4d284e278256635f1b3cf9b..e93de9941d146e7ce882600d78d01d6b937144c7 100644 (file)
@@ -79,7 +79,7 @@ Score_engraver::prepare (Moment m)
   SCM w = m.smobbed_copy ();
   command_column_->set_property ("when", w);
   musical_column_->set_property ("when", w);
-  
+
   recurse_over_translators (context (), &Translator::start_translation_timestep, DOWN);
 }
 
index 9e051ec454e395682b8a7f6034cee6a102d009f3..e97605c82b9c790a51c412cf48f61a47a72ff475 100644 (file)
@@ -145,7 +145,7 @@ loose_column (Grob *l, Grob *c, Grob *r)
 
              /*
                ugh. -- fix staff-bar name? 
-              */
+             */
              if (h  && h->get_property ("break-align-symbol") == ly_symbol2scm ("staff-bar"))
                return false;
            }
@@ -185,10 +185,10 @@ Spacing_spanner::prune_loose_columns (Grob*me,Link_array<Grob> *cols, Rational s
          /*
            Either object can be non existent, if the score ends
            prematurely.
-          */
+         */
          rns = ly_car (unsmob_grob (rns)->get_property ("right-items"));
          c->set_property ("between-cols", scm_cons (lns,
-                                                        rns));
+                                                    rns));
 
          /*
            Set distance constraints for loose columns
@@ -290,7 +290,7 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> cols)
 
          /*
            update the left column.
-          */
+         */
          if (right_rank <= min_rank)
            {
              if (right_rank < min_rank)
@@ -302,7 +302,7 @@ Spacing_spanner::set_explicit_neighbor_columns (Link_array<Grob> cols)
 
          /*
            update the right column of the wish.
-          */
+         */
          int maxrank = 0;
          SCM left_neighs = rc->get_property ("left-neighbors");
          if (scm_is_pair (left_neighs)
@@ -346,7 +346,7 @@ Spacing_spanner::set_implicit_neighbor_columns (Link_array<Grob> cols)
 
       /*
        sloppy with typnig left/right-neighbors should take list, but paper-column found instead.
-       */
+      */
       SCM ln = cols[i] ->get_property ("left-neighbors");
       if (!scm_is_pair (ln) && i ) 
        {
@@ -370,7 +370,7 @@ Spacing_spanner::set_springs (SCM smob)
 
   /*
     can't use get_system() ? --hwn.
-   */
+  */
   Link_array<Grob> all (me->pscore_->system_->columns ());
 
   set_explicit_neighbor_columns (all);
@@ -422,7 +422,7 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
 {
   /*
     ascending in duration
-   */
+  */
   Array<Rational> durations; 
   Array<int> counts;
   
@@ -506,7 +506,8 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
   (different time sigs) than others, and should be spaced differently.
  */
 void
-Spacing_spanner::do_measure (Rational global_shortest, Grob*me, Link_array<Grob> *cols) 
+Spacing_spanner::do_measure (Rational global_shortest, Grob*me,
+                            Link_array<Grob> *cols) 
 {
 
   Real headwid = robust_scm2double (me->get_property ("spacing-increment"), 1);
@@ -539,18 +540,16 @@ Spacing_spanner::do_measure (Rational global_shortest, Grob*me, Link_array<Grob>
            breakable_column_spacing (me, l, rb, global_shortest);
          if (lb && rb)
            breakable_column_spacing (me, lb, rb, global_shortest);
-         
-         continue ; 
        }
-
-
-      musical_column_spacing (me, lc, rc, headwid, global_shortest);
-      if (Item *rb = r->find_prebroken_piece (LEFT))
-       musical_column_spacing (me, lc, rb, headwid, global_shortest);
-    }    
+      else
+       {
+         musical_column_spacing (me, lc, rc, headwid, global_shortest);
+         if (Item *rb = r->find_prebroken_piece (LEFT))
+           musical_column_spacing (me, lc, rb, headwid, global_shortest);
+       }    
+    }
 }
 
-
 /*
   Generate the space between two musical columns LC and RC, given
   spacing parameters INCR and SHORTEST.
index ab5bba26c4b6d547012880e279c5f9c10239efa2..468656ffe2ea42022b28cd61157d06cfbc4b1391 100644 (file)
@@ -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");