2 Sequential_music_iterator.cc -- implement Sequential_music_iterator
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "translator-group.hh"
11 #include "sequential-music-iterator.hh"
12 #include "music-list.hh"
15 Sequential_music_iterator::do_print() const
21 Sequential_music_iterator::Sequential_music_iterator ()
29 Sequential_music_iterator::construct_children()
31 cursor_ = dynamic_cast<Music_sequence const*> (music_l_)->music_p_list_p_->head_;
42 set_sequential_music_translator();
49 Sequential_music_iterator::leave_element()
53 Moment elt_time = cursor_->car_->length_mom ();
54 here_mom_ += elt_time;
55 cursor_ =cursor_->next_;
59 Sequential_music_iterator::start_next_element()
62 iter_p_ = get_iterator_p (cursor_->car_);
66 Sequential_music_iterator::set_sequential_music_translator()
68 if (iter_p_->report_to_l()->depth_i () > report_to_l ()->depth_i ())
69 set_translator (iter_p_->report_to_l());
72 Sequential_music_iterator::~Sequential_music_iterator()
81 Sequential_music_iterator::do_process_and_next (Moment until)
85 Moment local_until = until - here_mom_;
88 Moment here = iter_p_->next_moment();
89 if (here != local_until)
92 iter_p_->process_and_next (local_until);
101 start_next_element();
102 set_sequential_music_translator();
113 Music_iterator::do_process_and_next (until);
117 Sequential_music_iterator::next_moment() const
119 return iter_p_->next_moment() + here_mom_;
123 Sequential_music_iterator::ok() const