2 Simultaneous_music-iter.cc -- implement Simultaneous_music_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"
17 Simultaneous_music_iterator::construct_children()
20 for (PCursor
<Music
*> i (simultaneous_music_l ()->music_p_list_p_
->top());
23 Music_iterator
* mi
= get_iterator_p (i
.ptr());
26 if (simultaneous_music_l ()->translator_type_str_
.empty_b ())
27 set_translator (mi
->report_to_l()->ancestor_l (0));
28 children_p_list_
.bottom().add (mi
);
37 Simultaneous_music_iterator::do_print() const
40 for (PCursor
<Music_iterator
*> i (children_p_list_
.top()); i
.ok (); i
++)
48 Simultaneous_music_iterator::do_process_and_next (Moment until
)
50 for (PCursor
<Music_iterator
*> i (children_p_list_
.top()); i
.ok ();)
52 if (i
->next_moment() == until
)
54 i
->process_and_next (until
);
61 Music_iterator::do_process_and_next (until
);
68 Simultaneous_music_iterator::next_moment() const
71 next
.set_infinite (1);
72 for (PCursor
<Music_iterator
*> i (children_p_list_
.top()); i
.ok (); i
++)
73 next
= next
<? i
->next_moment() ;
80 Simultaneous_music_iterator::ok() const
82 return children_p_list_
.size();
86 Simultaneous_music_iterator::simultaneous_music_l ()const
88 return ( Simultaneous_music
*) music_l_
;