/*
- 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--2010 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"
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);
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_)
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 ());
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 ();