]> git.donarmstrong.com Git - lilypond.git/commitdiff
add new tuplets new_tuplet_ vector. Fixes #159
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 14 Dec 2006 12:44:33 +0000 (13:44 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 14 Dec 2006 12:49:42 +0000 (13:49 +0100)
This ensures we don't accidentally flush a newly started tuplet.

input/regression/quote-tuplet.ly [new file with mode: 0644]
lily/tuplet-engraver.cc

diff --git a/input/regression/quote-tuplet.ly b/input/regression/quote-tuplet.ly
new file mode 100644 (file)
index 0000000..0579d4f
--- /dev/null
@@ -0,0 +1,31 @@
+
+\version "2.10.0"
+
+\header {
+
+  texidoc = "In cue notes, Tuplet stops are handled before new tuplets
+  start."
+
+}
+
+foo = \relative {
+  \times 2/3 { c4 c c } \times 2/3 { c4 c c }
+}
+
+\addquote "foo" { \foo }
+
+\paper {
+  ragged-right = ##t
+}
+
+\new Staff
+<<
+  \new Voice \transpose c c' {
+    \override Stem #'direction = #UP
+    \foo
+  }
+  \new Voice {
+    \cueDuring #"foo" #DOWN { s1 }
+  }
+>>
+  
index 7a3cf534fdbd3717a0a514f9171833fd6640fa31..6021f98e99c0c84b37bbac47919abd6b40018059 100644 (file)
@@ -43,8 +43,10 @@ public:
 
 protected:
   vector<Tuplet_description> tuplets_;
+  vector<Tuplet_description> new_tuplets_;
   vector<Tuplet_description> stopped_tuplets_;
   vector<Spanner*> last_tuplets_;
+  
   DECLARE_ACKNOWLEDGER (note_column);
   DECLARE_TRANSLATOR_LISTENER (tuplet_span);
   virtual void finalize ();
@@ -61,7 +63,7 @@ Tuplet_engraver::listen_tuplet_span (Stream_event *ev)
     {
       Tuplet_description d;
       d.event_ = ev;
-      tuplets_.push_back (d);
+      new_tuplets_.push_back (d);
     }
   else if (dir == STOP && tuplets_.size ())
     {
@@ -104,6 +106,8 @@ Tuplet_engraver::process_music ()
     }
   stopped_tuplets_.clear ();
 
+  concat (tuplets_, new_tuplets_);
+  new_tuplets_.clear ();
   for (vsize j = tuplets_.size (); j > 0; j--)
     {
       /* i goes from size-1 downto 0, inclusively */