2 percent-repeat-iterator.cc -- implement Percent_repeat_iterator
4 source file of the GNU LilyPond music typesetter
6 (c) 2001--2003 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 ()
23 Percent_repeat_iterator::do_quit()
28 Percent_repeat_iterator::Percent_repeat_iterator (Percent_repeat_iterator
const & p
)
32 finish_mom_
= p
.finish_mom_
;
36 child_iter_
= p
.child_iter_
->clone ();
37 scm_gc_unprotect_object (child_iter_
->self_scm());
42 Percent_repeat_iterator::ok () const
48 Percent_repeat_iterator::construct_children ()
50 Repeated_music
* mus
=dynamic_cast<Repeated_music
*> (get_music ());
51 finish_mom_
= mus
->get_length ();
52 child_iter_
= unsmob_iterator (get_iterator (mus
->body ()));
57 Percent_repeat_iterator::process (Moment m
)
61 Music_iterator
*yeah
= try_music (get_music ());
63 set_translator (yeah
->report_to ());
65 get_music ()->origin ()->warning ( _ ("no one to print a percent"));
68 if (child_iter_
->ok ())
69 child_iter_
->process (m
);
71 if (finish_mom_
<= m
)
79 Percent_repeat_iterator::pending_moment ()const
81 if (child_iter_
->ok ())
82 return child_iter_
->pending_moment ();
88 Percent_repeat_iterator::try_music_in_children (Music
*m
) const
90 return child_iter_
->try_music (m
);
94 Percent_repeat_iterator::derived_mark()const
97 scm_gc_mark (child_iter_
->self_scm());