lilypond-0.1.37
[lilypond.git] / lily / change-iterator.cc
blobc6ebf2907f41548c37853df1d4a1341a08cdbc16
1 /*
2 change-iterator.cc -- implement
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #include "change-iterator.hh"
10 #include "translator-group.hh"
11 #include "change-translator.hh"
13 Change_iterator::Change_iterator (Change_translator *change_l)
15 change_l_ = change_l;
19 move to construct_children ?
21 void
22 Change_iterator::process_and_next (Moment m)
24 Translator_group * current = report_to_l ();
25 Translator_group * last = 0;
26 while (current && current->type_str_ != change_l_->change_to_type_str_)
28 last = current;
29 current = current->daddy_trans_l_;
31 if (current)
33 Translator_group * dest =
34 report_to_l ()->find_create_translator_l (change_l_->change_to_type_str_,
35 change_l_->change_to_id_str_);
36 current->remove_translator_p (last);
37 dest->add (last);
40 Music_iterator::process_and_next (m);
43 IMPLEMENT_IS_TYPE_B1 (Change_iterator, Music_iterator);