- handles_[in].get_context ()->event_source ()->broadcast (mmrest_event_);
-}
-
-void
-Part_combine_iterator::unisono (bool silent)
-{
- Status newstate = (silent) ? UNISILENCE : UNISONO;
-
- if (newstate == state_)
- return;
- else
- {
- /*
- If we're coming from SOLO2 state, we might have kill mmrests
- in the 1st voice, so in that case, we use the second voice
- as a basis for events.
- */
- Outlet_type c1 = (last_playing_ == SOLO2) ? CONTEXT_NULL : CONTEXT_SHARED;
- Outlet_type c2 = (last_playing_ == SOLO2) ? CONTEXT_SHARED : CONTEXT_NULL;
- substitute_both (c1, c2);
- kill_mmrest ((last_playing_ == SOLO2) ? CONTEXT_ONE : CONTEXT_TWO);
- kill_mmrest (CONTEXT_SHARED);
-
- if (playing_state_ != UNISONO
- && newstate == UNISONO)
- {
- Context *out = (last_playing_ == SOLO2 ? second_iter_ : first_iter_)
- ->get_outlet ();
- if (!unisono_event_)
- {
- unisono_event_ = new Stream_event
- (out->make_event_class (ly_symbol2scm ("unisono-event")));
- unisono_event_->unprotect ();
- }
-
- out->event_source ()->broadcast (unisono_event_);
- playing_state_ = UNISONO;
- }
- state_ = newstate;
- }
-}
-
-void
-Part_combine_iterator::solo1 ()
-{
- if (state_ == SOLO1)
- return;
- else
- {
- state_ = SOLO1;
- substitute_both (CONTEXT_SOLO, CONTEXT_NULL);
-
- kill_mmrest (CONTEXT_TWO);
- kill_mmrest (CONTEXT_SHARED);
-
- if (playing_state_ != SOLO1)
- {
- if (!solo_one_event_)
- {
- solo_one_event_ = new Stream_event
- (first_iter_->get_outlet ()->make_event_class
- (ly_symbol2scm ("solo-one-event")));
- solo_one_event_->unprotect ();
- }
-
- first_iter_->get_outlet ()->event_source ()->broadcast (solo_one_event_);
- }
- playing_state_ = SOLO1;
- }
-}
-
-void
-Part_combine_iterator::solo2 ()
-{
- if (state_ == SOLO2)
- return;
- else
- {
- state_ = SOLO2;
-
- substitute_both (CONTEXT_NULL, CONTEXT_SOLO);
-
- if (playing_state_ != SOLO2)
- {
- if (!solo_two_event_)
- {
- solo_two_event_ = new Stream_event
- (second_iter_->get_outlet ()->make_event_class
- (ly_symbol2scm ("solo-two-event")));
- solo_two_event_->unprotect ();
- }
-
- second_iter_->get_outlet ()->event_source ()->broadcast (solo_two_event_);
- playing_state_ = SOLO2;
- }
- }
-}
-
-void
-Part_combine_iterator::chords_together ()
-{
- if (state_ == TOGETHER)
- return;
- else
- {
- playing_state_ = TOGETHER;
- state_ = TOGETHER;
-
- substitute_both (CONTEXT_SHARED, CONTEXT_SHARED);
- }
-}
-
-void
-Part_combine_iterator::apart (bool silent)
-{
- if (!silent)
- playing_state_ = APART;
-
- if (state_ == APART)
- return;
- else
- {
- state_ = APART;
- substitute_both (CONTEXT_ONE, CONTEXT_TWO);
- }