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"
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 ()
30 Percent_repeat_iterator::ok () const
36 Percent_repeat_iterator::construct_children ()
38 Repeated_music * mus =dynamic_cast<Repeated_music *> (get_music ());
39 finish_mom_ = mus->get_length ();
40 child_iter_ = unsmob_iterator (get_iterator (mus->body ()));
45 Percent_repeat_iterator::process (Moment m)
49 Music_iterator *yeah = try_music (get_music ());
51 set_translator (yeah->get_outlet ());
53 get_music ()->origin ()->warning ( _ ("no one to print a percent"));
56 if (child_iter_->ok ())
57 child_iter_->process (m);
59 if (finish_mom_ <= m )
67 Percent_repeat_iterator::pending_moment ()const
69 if (child_iter_->ok ())
70 return child_iter_->pending_moment ();
76 Percent_repeat_iterator::try_music_in_children (Music *m) const
78 return child_iter_->try_music (m);
82 Percent_repeat_iterator::derived_mark ()const
85 scm_gc_mark (child_iter_->self_scm ());
89 Percent_repeat_iterator::derived_substitute (Context *f,Context *t )
92 child_iter_->substitute_outlet (f,t);