]> 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:44:33 +0000 (13:44 +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 946fd1d80272e03d4266f024a8b7e25891d6acbd..441fdd7610783a45c8644aa662bf96fca5cb72aa 100644 (file)
@@ -44,8 +44,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 ();
@@ -62,7 +64,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 ())
     {
@@ -105,6 +107,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 */