]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/regression/multi-measure-rest-grace.ly (texidoc): new file
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 10 Apr 2003 19:40:10 +0000 (19:40 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 10 Apr 2003 19:40:10 +0000 (19:40 +0000)
* lily/multi-measure-rest-engraver.cc
(start_translation_timestep): use grace timing too for determining
when to make mmrest.
(start_translation_timestep): clear numbers too.

ChangeLog
input/regression/multi-measure-rest-grace.ly [new file with mode: 0644]
lily/multi-measure-rest-engraver.cc

index 6b474af6081c2fed64061c192a2fb68fc027db27..32a8457829fe9453a068b18a0844fb210568afa3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-04-10  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * input/regression/multi-measure-rest-grace.ly (texidoc): new file
+
+       * lily/multi-measure-rest-engraver.cc
+       (start_translation_timestep): use grace timing too for determining
+       when to make mmrest.
+       (start_translation_timestep): clear numbers too.
+
 2003-04-09  Juergen Reuter  <reuter@ipd.uka.de>
 
        * scm/music-types.scm: compile fix: escape braces
diff --git a/input/regression/multi-measure-rest-grace.ly b/input/regression/multi-measure-rest-grace.ly
new file mode 100644 (file)
index 0000000..06b7551
--- /dev/null
@@ -0,0 +1,10 @@
+\header {
+texidoc= "Grace notes and multi-measure rests."
+}
+
+\score   {
+\notes <
+       \context Staff = SB { R1 R1 R1*3 }
+       \context Staff = SA { \clef bass c1 \grace c8 c2 c2 c1  \grace c16 c2 c2 c1 }
+>
+}
index 72aedc7d2858f476df3cc02b58696d1cc10634f4..a79dd460554a1bdd0a5b46dfff69610ec64ece17 100644 (file)
@@ -38,7 +38,7 @@ private:
   Link_array<Music> text_events_;
   int start_measure_;
   Moment start_moment_;
-  
+  Rational last_main_moment_;
 
   Spanner *mmrest_;
   Link_array<Spanner> numbers_;
@@ -168,6 +168,7 @@ Multi_measure_rest_engraver::process_music ()
          for (int i = 0; i < numbers_.size(); i++)
            add_bound_item (numbers_[i], it);
        }
+      
       if (last_rest_)
        {
          add_bound_item (last_rest_,it);
@@ -232,12 +233,15 @@ Multi_measure_rest_engraver::start_translation_timestep ()
 {
   SCM smp = get_property ("measurePosition");
   Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
-  
-  if (mmrest_ && !mp.to_bool ())
+
+  Moment now =now_mom ();
+  if (mmrest_
+      && now.main_part_ != last_main_moment_
+      && mp.main_part_ == Rational (0))
     {
       last_rest_ = mmrest_;
       last_numbers_ = numbers_;
-
+      
       int cur = gh_scm2int (get_property ("currentBarNumber"));
       int num = cur - start_measure_;
       last_rest_->set_grob_property ("measure-count", gh_int2scm (num));
@@ -250,7 +254,8 @@ Multi_measure_rest_engraver::start_translation_timestep ()
        }
 
       mmrest_ = 0;
-
+      numbers_.clear ();
+      
       Grob * last = last_numbers_.size() ? last_numbers_[0] : 0;
       if (last && last->get_grob_property ("text") == SCM_EOL)
        {
@@ -269,6 +274,8 @@ Multi_measure_rest_engraver::start_translation_timestep ()
            }
        }
     }
+
+  last_main_moment_ = now.main_part_;
 }
 
 void