From: Dan Eble Date: Thu, 28 May 2015 00:39:47 +0000 (-0400) Subject: Issue 4423: eliminate part combiner's array of context handles (2/4) X-Git-Tag: release/2.19.22-1~68^2~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=44f56926a4590e46e64b041ce5ee12de264b8a73;p=lilypond.git Issue 4423: eliminate part combiner's array of context handles (2/4) Create child iterators in parent context. Add an initial split state to ensure that the first split-list entry, whatever it is, will redirect the outlets for the child iterators. --- diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc index 643bb3a972..9702b8358b 100644 --- a/lily/part-combine-iterator.cc +++ b/lily/part-combine-iterator.cc @@ -63,6 +63,7 @@ private: enum Status { + INITIAL, APART, TOGETHER, SOLO, @@ -108,7 +109,7 @@ Part_combine_iterator::Part_combine_iterator () for (size_t i = 0; i < NUM_PARTS; i++) iterators_[i] = 0; split_list_ = SCM_EOL; - state_ = APART; + state_ = INITIAL; chosen_part_ = 1; } @@ -280,18 +281,8 @@ Part_combine_iterator::construct_children () } SCM lst = get_music ()->get_property ("elements"); - - Context *one = handles_[CONTEXT_ONE].get_context (); - set_context (one); iterators_[0] = unsmob (get_iterator (unsmob (scm_car (lst)))); - - Context *two = handles_[CONTEXT_TWO].get_context (); - set_context (two); iterators_[1] = unsmob (get_iterator (unsmob (scm_cadr (lst)))); - - // (Explain the purpose of switching to the shared context.) - Context *shared = handles_[CONTEXT_SHARED].get_context (); - set_context (shared); } void