- spanner_duration_ = next_split_mom_ = 0;
-}
-
-
-Moment
-Time_scaled_music_iterator::pending_moment () const
-{
- Moment next_mom = Sequential_iterator::pending_moment ();
-
- if (spanner_duration_.to_bool () &&
- next_mom.main_part_ > next_split_mom_)
- {
- next_mom = next_split_mom_;
- }
-
- return next_mom;
-}
-
-
-void
-Time_scaled_music_iterator::process (Moment m)
-{
- if (spanner_duration_.to_bool () &&
- m.main_part_ == next_split_mom_)
- {
- report_event (stop_);
- report_event (start_);
-
- next_split_mom_ += spanner_duration_;
- /* avoid sending events twice at the end */
- if (next_split_mom_ == get_music ()->get_length ().main_part_)
- next_split_mom_.set_infinite (1);
- }
- Sequential_iterator::process(m);
-}
-
-void
-Time_scaled_music_iterator::construct_children ()
-{
- /*
- Inheritance trickery:
- Time_scaled_music_iterator::construct_children initialises start_
- and stop_, and calls Sequential_music::construct_children, which
- in turn calls Time_scaled_music_iterator::get_music which reads
- start_ and stop_.
- */
-
- Music *mus = get_music ();
- Input *origin = mus->origin ();
-
- SCM tuplet_symbol = ly_symbol2scm ("TupletSpanEvent");
- SCM start_scm = scm_call_2 (ly_lily_module_constant ("make-span-event"), tuplet_symbol, scm_from_int (START));
- start_ = unsmob_music (start_scm);
- start_->set_spot (*origin);
- start_->set_property ("numerator", mus->get_property ("numerator"));
- start_->set_property ("denominator", mus->get_property ("denominator"));
- start_->set_property ("tweaks", mus->get_property ("tweaks"));
-
-
- SCM stop_scm = scm_call_2 (ly_lily_module_constant ("make-span-event"), tuplet_symbol, scm_from_int (STOP));
- stop_ = unsmob_music (stop_scm);
- stop_->set_spot (*origin);
-
- Moment *mp = unsmob_moment (get_outlet ()->get_property ("tupletSpannerDuration"));
-
- if (mp)
- {
- spanner_duration_ = mp->main_part_;
- next_split_mom_ = spanner_duration_;
- }
-
- Sequential_iterator::construct_children ();