2 percent-repeat-iterator.cc -- implement Percent_repeat_iterator
4 source file of the GNU LilyPond music typesetter
6 (c) 2001--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "percent-repeat-iterator.hh"
12 #include "repeated-music.hh"
15 IMPLEMENT_CTOR_CALLBACK (Percent_repeat_iterator);
18 Percent_repeat_iterator::Percent_repeat_iterator ()
24 Percent_repeat_iterator::do_quit ()
31 Percent_repeat_iterator::ok () const
37 Percent_repeat_iterator::construct_children ()
39 Repeated_music * mus = dynamic_cast<Repeated_music *> (get_music ());
40 finish_mom_ = mus->get_length ();
41 child_iter_ = unsmob_iterator (get_iterator (mus->body ()));
46 Percent_repeat_iterator::process (Moment m)
50 Music_iterator *yeah = try_music (get_music ());
52 set_context (yeah->get_outlet ());
54 get_music ()->origin ()->warning ( _ ("no one to print a percent"));
57 if (child_iter_->ok ())
58 child_iter_->process (m);
60 if (finish_mom_ <= m )
68 Percent_repeat_iterator::pending_moment ()const
70 if (child_iter_->ok ())
71 return child_iter_->pending_moment ();
77 Percent_repeat_iterator::try_music_in_children (Music *m) const
79 return child_iter_->try_music (m);
83 Percent_repeat_iterator::derived_mark ()const
86 scm_gc_mark (child_iter_->self_scm ());
90 Percent_repeat_iterator::derived_substitute (Context *f,Context *t )
93 child_iter_->substitute_outlet (f,t);