+ // Do nothing if we already did our processing here.
+ if (!scm_is_pair (child_list_))
+ {
+ Sequential_iterator::next_element (side_effect);
+ return;
+ }
+
+ Music *mus = get_music ();
+
+ Music *child = Repeated_music::body (mus);
+ SCM length = child->get_length ().smobbed_copy ();
+
+ int current_bar = -1;
+ if (!measure_position (get_outlet ()).main_part_)
+ current_bar =
+ robust_scm2int (get_outlet ()->get_property ("internalBarNumber"), 0);
+
+ SCM child_list = SCM_EOL;
+
+ string event_type;
+ SCM slash_count = SCM_EOL;
+
+ if (starting_bar_ >= 0 && current_bar == starting_bar_ + 1)
+ event_type = "PercentEvent";
+ else if (starting_bar_ >=0 && current_bar == starting_bar_ + 2)
+ event_type = "DoublePercentEvent";
+ else
+ {
+ slash_count = Lily::calc_repeat_slash_count (child->self_scm ());
+ event_type = "RepeatSlashEvent";
+ }
+
+ 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 (event_type.c_str ()));
+ percent->set_spot (*mus->origin ());
+ percent->set_property ("length", length);
+ if (repeats > 1)
+ {
+ percent->set_property ("repeat-count", scm_from_int (i));
+ if (event_type == "RepeatSlashEvent")
+ percent->set_property ("slash-count", slash_count);
+ }
+
+ child_list = scm_cons (percent->unprotect (), child_list);
+ }
+
+ scm_set_cdr_x (child_list_, child_list);
+ child_list_ = SCM_EOL;
+
+ Sequential_iterator::next_element (side_effect);