- if (repmus->volta_fold_b_)
- {
- String repstr = to_str (done_count_ + 1);
- if (do_repcommands)
- add_repeat_command (gh_list (ly_symbol2scm ("volta"),
- gh_str02scm (repstr.ch_C()), SCM_UNDEFINED));
- }
- }
- else if (done_count_ < repmus->repeats_i_ && !repmus->volta_fold_b_)
- {
- current_iter_p_ = get_iterator_p (repmus->body ());
- do_main_b_ = true;
- }
- }
- else
- {
- /*
- we're not in the main part. So we're either in an alternative, or
- we just finished.
- */
-
- /*
- we're in the alternatives. We move the pointer to the
- next alternative.
- */
- if (alternative_cons_)
- {
- here_mom_ += unsmob_music (gh_car (alternative_cons_))->length_mom ();
-
- if (repmus->volta_fold_b_ ||
- repmus->repeats_i_ - done_count_ < alternative_count_i_)
- alternative_cons_ = gh_cdr (alternative_cons_);
-
- if (do_repcommands)
- add_repeat_command (gh_list (ly_symbol2scm ("volta"), SCM_BOOL_F, SCM_UNDEFINED));
-
-
-
- /*
- we've done the main body as well, but didn't go over the other
- increment. */
- if (repmus->volta_fold_b_)
- done_count_ ++;
- }
-
- /*
- We still have alternatives left, so
-
- if we're volta: traverse them
-
- if we're full unfold: go back to main body.
- */
-
- if (done_count_ < repmus->repeats_i_ && gh_pair_p (alternative_cons_))
- {
- if (do_repcommands)
- {
- String repstr = to_str (done_count_ + 1);
- add_repeat_command (gh_list (ly_symbol2scm ("volta"),
- gh_str02scm (repstr.ch_C()), SCM_UNDEFINED));
- add_repeat_command (ly_symbol2scm ("end-repeat"));
- }
-
-
- if (repmus->volta_fold_b_)
- current_iter_p_ = get_iterator_p (unsmob_music (gh_car (alternative_cons_)));
- else
- {
- current_iter_p_ = get_iterator_p (repmus->body ());
- do_main_b_ = true;
- }
- }
- }
-}