]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/time-scaled-music-iterator.cc
Update ROADMAP
[lilypond.git] / lily / time-scaled-music-iterator.cc
index f5ca62dbfbc67c215b485092bf5f1822613930e5..d3d54d80554953341f8acd37bc8893da5ee13821 100644 (file)
@@ -1,10 +1,21 @@
 /*
-  time-scaled-music-iterator.cc -- implement Time_scaled_music_iterator
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
-
-  (c) 1998--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>,
+  Copyright (C) 1998--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>,
                  Erik Sandberg <mandolaerik@gmail.com>
+
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "context.hh"
@@ -24,7 +35,7 @@ class Time_scaled_music_iterator : public Music_wrapper_iterator
 public:
   DECLARE_SCHEME_CALLBACK (constructor, ());
   /* construction */
-  DECLARE_CLASSNAME(Time_scaled_music_iterator);
+  DECLARE_CLASSNAME (Time_scaled_music_iterator);
   Time_scaled_music_iterator ();
 protected:
   virtual void process (Moment m);
@@ -96,7 +107,7 @@ Time_scaled_music_iterator::process (Moment m)
       m.main_part_ == next_split_mom_)
     {
       descend_to_bottom_context ();
-      if (tuplet_handler_.get_outlet())
+      if (tuplet_handler_.get_outlet ())
        create_event (STOP)->send_to_context (tuplet_handler_.get_outlet ());
 
       if (m.main_part_ < music_get_length ().main_part_)
@@ -111,7 +122,7 @@ Time_scaled_music_iterator::process (Moment m)
          tuplet_handler_.set_context (0);
        }
     }
-  Music_wrapper_iterator::process(m);
+  Music_wrapper_iterator::process (m);
   if (child_iter_ && child_iter_->ok ())
     descend_to_child (child_iter_->get_outlet ());
   
@@ -120,15 +131,11 @@ Time_scaled_music_iterator::process (Moment m)
 void
 Time_scaled_music_iterator::construct_children ()
 {
+  spanner_duration_ = music_get_length ();
+
   Moment *mp = unsmob_moment (get_outlet ()->get_property ("tupletSpannerDuration"));
   if (mp)
-    {
-      spanner_duration_ = mp->main_part_;
-    }
-  else
-    {
-      spanner_duration_ = music_get_length ();
-    }
+    spanner_duration_ = min (mp->main_part_, spanner_duration_);
   
   Music_wrapper_iterator::construct_children ();