- finish_mom_ = mus->get_length ();
- child_iter_ = unsmob_iterator (get_iterator (Repeated_music::body (mus)));
-}
-
-
-void
-Percent_repeat_iterator::process (Moment m)
-{
- if (!m.to_bool ())
- {
- Music_iterator *yeah = try_music (get_music ());
- if (yeah)
- set_context (yeah->get_outlet ());
- else
- get_music ()->origin ()->warning ( _ ("no one to print a percent"));
- }
+ Music *child = Repeated_music::body (mus);
+ SCM length = child->get_length ().smobbed_copy ();
+ SCM child_list = SCM_EOL;
+
+ int repeats = scm_to_int (mus->get_property ("repeat-count"));
+ for (int i = repeats; i > 1; i--)
+ {
+ Music *percent = make_music_by_name (ly_symbol2scm ("PercentEvent"));
+ percent->set_spot (*mus->origin ());
+ percent->set_property ("length", length);
+ if (repeats > 1)
+ percent->set_property ("repeat-count", scm_int2num (i));
+
+ child_list = scm_cons (percent->unprotect (), child_list);
+ }