]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tuplet-iterator.cc
unsmob_pitch -> Pitch::unsmob and related
[lilypond.git] / lily / tuplet-iterator.cc
index 872ccae48d662215f64c844b5f4b9cadc920062c..56973e8f2deebd5690bdeaabe8dfc64cbfa8a5a4 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1998--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>,
+  Copyright (C) 1998--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>,
                  Erik Sandberg <mandolaerik@gmail.com>
 
   LilyPond is free software: you can redistribute it and/or modify
@@ -126,12 +126,17 @@ Tuplet_iterator::process (Moment m)
 void
 Tuplet_iterator::construct_children ()
 {
-  spanner_duration_ = music_get_length ();
+  if (Duration *d = Duration::unsmob (get_music ()->get_property ("duration")))
+    spanner_duration_ = d->get_length ();
+  else
+    {
+      spanner_duration_ = music_get_length ();
 
-  Moment *mp
-    = unsmob_moment (get_outlet ()->get_property ("tupletSpannerDuration"));
-  if (mp)
-    spanner_duration_ = min (mp->main_part_, spanner_duration_);
+      Moment *mp
+        = Moment::unsmob (get_outlet ()->get_property ("tupletSpannerDuration"));
+      if (mp)
+        spanner_duration_ = min (mp->main_part_, spanner_duration_);
+    }
 
   Music_wrapper_iterator::construct_children ();