-
- delete iter_p_;
- cursor_ = ly_cdr (cursor_);
-
- if (gh_pair_p (cursor_))
- iter_p_ = get_iterator_p (unsmob_music (ly_car (cursor_)));
- else
- iter_p_ = 0;
-}
-
-/*
- move to context of child iterator if it is deeper down in the
- hierarchy.
- */
-void
-Sequential_iterator::descend_to_child ()
-{
-}
-
-
-/*
- Retrieve all music (starting at HERE), until a music with length L >
- 0 is found. From the precondition, we know that UNTIL is later than
- the earliest event. Hence we know
-
- L >= (UNTIL - HERE)
-
- so something that comes after this thing with L > 0 happens after
-
- HERE + L >= HERE + (UNTIL - HERE) = UNTIL
-
- Hence all events after the one with L>0 are uninteresting, so we
- ignore them.
-
-*/
-
-SCM
-Sequential_iterator::get_music (Moment until)const
-{
- SCM s = SCM_EOL;
- if (until < pending_moment ())
- return s;
-
- Sequential_iterator * me =
- dynamic_cast<Sequential_iterator*> (clone ());
- while (me->ok ())
- {
- SCM nm = me->iter_p_->get_music (until - me->here_mom_);
- s = gh_append2 (nm, s);
-
- Moment m = 0;
- for (SCM i = nm; gh_pair_p (i); i = ly_cdr (i))
- {
- Music *mus=unsmob_music (ly_car (i));
- m = m >? (mus->length_mom () - mus->start_mom ());
- }
- if (m > Moment (0))
- break ;
- else
- me->next_element (false);
- }
- delete me;
-
- return s;
-}
-