2 chord-iter.cc -- implement Chord_iterator
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
9 #include "translator-group.hh"
11 #include "chord-iterator.hh"
13 #include "music-list.hh"
16 Chord_iterator::~Chord_iterator()
20 Chord_iterator::Chord_iterator (Chord const *chord_C)
26 Chord_iterator::construct_children()
29 for (PCursor<Music*> i (chord_C_->music_p_list_.top()); //, int j = 0;
32 Music_iterator * mi = get_iterator_p (i.ptr());
35 set_translator (mi->report_to_l()->ancestor_l (chord_C_->multi_level_i_));
36 children_p_list_.bottom().add (mi);
43 Chord_iterator::do_print() const
46 for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok (); i++)
54 Chord_iterator::process_and_next (Moment until)
56 for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok ();)
58 if (i->next_moment() == until)
60 i->process_and_next (until);
67 Music_iterator::process_and_next (until);
71 IMPLEMENT_IS_TYPE_B1(Chord_iterator,Music_iterator);
74 Chord_iterator::next_moment() const
76 Moment next_ = infinity_mom;
77 for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok (); i++)
78 next_ = next_ <? i->next_moment() ;
85 Chord_iterator::ok() const
87 return children_p_list_.size();