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_p_ = new PCursor<Music*> (dynamic_cast<Sequential_music const*> (music_l_)->music_p_list_p_->top ());
33 while (cursor_p_->ok())
42 set_Sequential_music_translator();
49 Sequential_music_iterator::leave_element()
53 Moment elt_time = cursor_p_->ptr()->length_mom ();
54 here_mom_ += elt_time;
59 Sequential_music_iterator::start_next_element()
62 iter_p_ = get_iterator_p ( cursor_p_->ptr());
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()
82 Sequential_music_iterator::do_process_and_next (Moment until)
86 Moment local_until = until - here_mom_;
89 Moment here = iter_p_->next_moment();
90 if (here != local_until)
93 iter_p_->process_and_next (local_until);
102 start_next_element();
103 set_Sequential_music_translator();
114 Music_iterator::do_process_and_next (until);
118 Sequential_music_iterator::next_moment() const
120 return iter_p_->next_moment() + here_mom_;
124 Sequential_music_iterator::ok() const