]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4423: eliminate part combiner's array of context handles (2/4)
authorDan Eble <nine.fierce.ballads@gmail.com>
Thu, 28 May 2015 00:39:47 +0000 (20:39 -0400)
committerDan Eble <nine.fierce.ballads@gmail.com>
Wed, 3 Jun 2015 22:27:06 +0000 (18:27 -0400)
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.

lily/part-combine-iterator.cc

index 643bb3a972a42c9155ef94271e901a3ac08af263..9702b8358b6cae573fee16bb02b9ac29bccaa66e 100644 (file)
@@ -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<Music_iterator> (get_iterator (unsmob<Music> (scm_car (lst))));
-
-  Context *two = handles_[CONTEXT_TWO].get_context ();
-  set_context (two);
   iterators_[1] = unsmob<Music_iterator> (get_iterator (unsmob<Music> (scm_cadr (lst))));
-
-  // (Explain the purpose of switching to the shared context.)
-  Context *shared = handles_[CONTEXT_SHARED].get_context ();
-  set_context (shared);
 }
 
 void