+ /* see if associatedVoice has been changed */
+ Context *new_voice = find_voice ();
+ if (new_voice)
+ set_music_context (new_voice);
+
+ lyrics_found_ = true;
+ if (!music_context_)
+ return;
+
+ if (!music_context_->get_parent_context ())
+ {
+ /*
+ The melody has died.
+ We die too.
+ */
+ if (lyrics_context_)
+ lyrics_context_->unset_property (ly_symbol2scm ("associatedVoiceContext"));
+ lyric_iter_ = 0;
+ set_music_context (0);
+ }
+
+ if (music_context_
+ && (start_new_syllable ()
+ || (busy_moment_ >= pending_grace_moment_))
+ && lyric_iter_->ok ())
+ {
+ Moment now = music_context_->now_mom ();
+ if (now.grace_part_ && !to_boolean (lyrics_context_->get_property ("includeGraceNotes")))
+ {
+ pending_grace_moment_ = now;
+ pending_grace_moment_.grace_part_ = Rational (0);
+ return;
+ }
+ else
+ {
+ pending_grace_moment_.set_infinite (1);
+ }
+
+ Moment m = lyric_iter_->pending_moment ();
+ lyrics_context_->set_property (ly_symbol2scm ("associatedVoiceContext"),
+ music_context_->self_scm ());
+ lyric_iter_->process (m);
+
+ music_found_ = true;
+ }
+
+ new_voice = find_voice ();
+ if (new_voice)
+ set_music_context (new_voice);
+}
+
+void
+Lyric_combine_music_iterator::do_quit ()
+{
+ if (!music_found_)
+ {
+ SCM voice_name = get_music ()->get_property ("associated-context");
+ SCM voice_type = get_music ()->get_property ("associated-context-type");
+ string name, type;
+ if (scm_is_string (voice_name))
+ name = ly_scm2string (voice_name);
+ type = robust_symbol2string (voice_type, "Voice");
+ /* Don't print a warning for empty lyrics (in which case we don't try
+ to find the proper voice, so it will not be found) */
+ if (lyrics_found_)
+ get_music ()->origin ()->warning (_f ("cannot find %s `%s'",
+ type.c_str (), name.c_str ()) + "\n");
+ }
+
+ if (lyric_iter_)
+ lyric_iter_->quit ();