]> git.donarmstrong.com Git - lilypond.git/commitdiff
(struct Tuplet_description): read
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 20 Jul 2006 09:29:42 +0000 (09:29 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 20 Jul 2006 09:29:42 +0000 (09:29 +0000)
tupletFullLengthNote too. Choose right bound depending on value.

ChangeLog
lily/tuplet-engraver.cc
scm/define-context-properties.scm

index b75ac3fd9f5167d94083814badd0f48ab3c8cc04..e65e10d455a49b664614d04c22577645bbffc36e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-07-20  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * lily/tuplet-engraver.cc (struct Tuplet_description): read
+       tupletFullLengthNote too. Choose right bound depending on value.
+
+       * input/regression/tuplet-full-length-note.ly: new file.
+
 2006-07-19  Erik Sandberg  <mandolaerik@gmail.com>
 
        * lily/*-performer.cc: Converted try_music to listen_*
@@ -11,8 +18,8 @@
 2006-07-19  Mats Bengtsson  <mabe@drongo.s3.kth.se>
 
        * Documentation/user/advanced-notation.itely (Font selection):
-       Document how to get a list of available fonts using
-       'lilypond -dshow-available-fonts blabla'.
+       Document how to get a list of available fonts using 'lilypond
+       -dshow-available-fonts blabla'.
 
 2006-07-19  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
index 53d85bd933df13c31fc3d2b3c028b24ba5b14184..a588f48571403c23328565c8f5eec51e5776d2ba 100644 (file)
@@ -19,8 +19,14 @@ struct Tuplet_description
   Music *music_;
   Spanner *bracket_;
   Spanner *number_;
+
+  bool full_length_;
+  bool full_length_note_;
+  
   Tuplet_description ()
   {
+    full_length_note_ = false;
+    full_length_ = false;
     music_ = 0;
     bracket_ = 0;
     number_ = 0;
@@ -70,12 +76,14 @@ Tuplet_engraver::process_music ()
 {
   for (vsize i = 0; i < stopped_tuplets_.size (); i++)
     {
-      bool full_length = to_boolean (get_property ("tupletFullLength"));
       if (stopped_tuplets_[i].bracket_)
        {
-         if (full_length)
+         if (stopped_tuplets_[i].full_length_)
            {
-             Item *col = unsmob_item (get_property ("currentMusicalColumn"));
+             Item *col =
+               unsmob_item (stopped_tuplets_[i].full_length_note_
+                            ? get_property ("currentMusicalColumn")
+                            : get_property ("currentCommandColumn"));
              
              stopped_tuplets_[i].bracket_->set_bound (RIGHT, col);
              stopped_tuplets_[i].number_->set_bound (RIGHT, col);
@@ -100,9 +108,14 @@ Tuplet_engraver::process_music ()
       /* i goes from size-1 downto 0, inclusively */
       vsize i = j - 1;
 
+            
       if (tuplets_[i].bracket_)
        continue;
 
+      tuplets_[i].full_length_ = to_boolean (get_property ("tupletFullLength"));
+      tuplets_[i].full_length_note_
+       = to_boolean (get_property ("tupletFullLengthNote"));
+      
       tuplets_[i].bracket_ = make_spanner ("TupletBracket",
                                           tuplets_[i].music_->self_scm ());
       tuplets_[i].number_ = make_spanner ("TupletNumber",
@@ -141,13 +154,11 @@ void
 Tuplet_engraver::finalize ()
 {
   if (to_boolean (get_property ("tupletFullLength")))
-    {
-      for (vsize i = 0; i < last_tuplets_.size (); i++)
-       {
-         Item *col = unsmob_item (get_property ("currentCommandColumn"));
-         last_tuplets_[i]->set_bound (RIGHT, col);
-       }
-    }
+    for (vsize i = 0; i < last_tuplets_.size (); i++)
+      {
+       Item *col = unsmob_item (get_property ("currentCommandColumn"));
+       last_tuplets_[i]->set_bound (RIGHT, col);
+      }
 }
 
 Tuplet_engraver::Tuplet_engraver ()
index 8efe40eb5be90464cbaa592ed999a1f7e5c39ecd..9576f697fbeba153390307b470f7eb2bdf7f5227 100644 (file)
@@ -412,6 +412,7 @@ number is specified.")
 
      (tupletFullLength ,boolean? "If set, the tuplet is printed up to
 the start of the next note.")
+     (tupletFullLengthNote ,boolean? "If set, end at the next note, otherwise end on the matter (time sigs, etc.) before the note.")
      (tupletSpannerDuration ,ly:moment? "
 Normally a tuplet bracket is as wide as the
 @code{\\times} expression that gave rise to it.  By setting this