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>
8 #include "grace-iterator.hh"
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 ()
30 Sequential_music_iterator::construct_children()
32 cursor_ = dynamic_cast<Music_sequence const*> (music_l_)->music_p_list_p_->head_;
43 set_sequential_music_translator();
50 Sequential_music_iterator::leave_element()
54 Moment elt_time = cursor_->car_->length_mom ();
55 here_mom_ += elt_time;
56 cursor_ =cursor_->next_;
60 Sequential_music_iterator::start_next_element()
63 iter_p_ = get_iterator_p (cursor_->car_);
67 Sequential_music_iterator::set_sequential_music_translator()
69 if (iter_p_->report_to_l()->depth_i () > report_to_l ()->depth_i ()
70 && ! dynamic_cast<Grace_iterator*> (iter_p_)) // UGH.!
71 set_translator (iter_p_->report_to_l());
74 Sequential_music_iterator::~Sequential_music_iterator()
83 Sequential_music_iterator::do_process_and_next (Moment until)
90 Moment local_until = until - here_mom_;
93 Moment here = iter_p_->next_moment();
94 if (here != local_until)
97 iter_p_->process_and_next (local_until);
106 start_next_element();
107 set_sequential_music_translator();
110 goto loopexit; // ugh.
121 Music_iterator::do_process_and_next (until);
125 Sequential_music_iterator::next_moment() const
127 return iter_p_->next_moment() + here_mom_;
131 Sequential_music_iterator::ok() const