2 percent-repeat-iterator.cc -- implement Percent_repeat_iterator
4 source file of the GNU LilyPond music typesetter
6 (c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "percent-repeat-iterator.hh"
11 #include "repeated-music.hh"
14 IMPLEMENT_CTOR_CALLBACK (Percent_repeat_iterator
);
17 Percent_repeat_iterator::Percent_repeat_iterator ()
22 Percent_repeat_iterator::Percent_repeat_iterator (Percent_repeat_iterator
const & p
)
25 child_iter_p_
= p
.child_iter_p_
? p
.child_iter_p_
->clone (): 0;
26 finish_mom_
= p
.finish_mom_
;
30 Percent_repeat_iterator::ok () const
36 Percent_repeat_iterator::construct_children ()
38 Repeated_music
* mus
=dynamic_cast<Repeated_music
*> (music_l_
);
39 finish_mom_
= mus
->length_mom ();
40 child_iter_p_
= get_iterator_p (mus
->body ());
45 Percent_repeat_iterator::process (Moment m
)
49 Music_iterator
*yeah
= try_music (music_l_
);
51 set_translator (yeah
->report_to_l ());
53 music_l_
->origin ()->warning ( _ ("no one to print a percent"));
56 if (child_iter_p_
->ok ())
57 child_iter_p_
->process (m
);
59 if (finish_mom_
<= m
)
67 Percent_repeat_iterator::pending_moment ()const
69 if (child_iter_p_
->ok ())
70 return child_iter_p_
->pending_moment ();
76 Percent_repeat_iterator::try_music_in_children (Music
*m
) const
78 return child_iter_p_
->try_music (m
);
82 Percent_repeat_iterator::~Percent_repeat_iterator ()