2 chord-iter.cc -- implement Chord_iterator
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.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());
32 Music_iterator * mi = get_iterator_p (i.ptr());
35 if (chord_C_->translator_type_str_.empty_b ())
36 set_translator (mi->report_to_l()->ancestor_l (chord_C_->multi_level_i_));
37 children_p_list_.bottom().add (mi);
46 Chord_iterator::do_print() const
49 for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok (); i++)
57 Chord_iterator::process_and_next (Moment until)
59 for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok ();)
61 if (i->next_moment() == until)
63 i->process_and_next (until);
70 Music_iterator::process_and_next (until);
74 IMPLEMENT_IS_TYPE_B1(Chord_iterator,Music_iterator);
77 Chord_iterator::next_moment() const
80 next.set_infinite (1);
81 for (PCursor<Music_iterator*> i (children_p_list_.top()); i.ok (); i++)
82 next = next <? i->next_moment() ;
89 Chord_iterator::ok() const
91 return children_p_list_.size();