+2004-02-01 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * lily/new-lyric-combine-music-iterator.cc (start_new_syllable):
+ Construct children before accessing property from emtpy
+ lyrics_context_.
+ (construct_children): Find thread before finding LyricsVoice.
+ Create LyricsVoice one if none found, fixes crash (thanks Erik
+ Sandberg).
+
2004-01-31 Jan Nieuwenhuizen <janneke@gnu.org>
* cygwin/: Forward port.
if (!b)
return false;
+ if (!lyrics_context_)
+ construct_children ();
+
if (!to_boolean (lyrics_context_->get_property ("ignoreMelismata")))
{
bool m = music_context_->try_music (melisma_playing_ev);
Music *m = unsmob_music (get_music ()->get_mus_property ("element"));
lyric_iter_ = unsmob_iterator (get_iterator (m));
- if (lyric_iter_)
- {
- lyrics_context_ = find_context_below (lyric_iter_->report_to (), "LyricsVoice", "");
- }
-
find_thread ();
+
+ if (lyric_iter_)
+ lyrics_context_ = find_context_below (lyric_iter_->report_to (),
+ "LyricsVoice", "");
+
+ if (music_context_ && !lyrics_context_)
+ lyrics_context_ = music_context_
+ ->find_create_translator (ly_symbol2scm ("LyricsVoice"), "", SCM_EOL);
}
void
while (t && t->daddy_trans_)
t = t->daddy_trans_;
- String name = ly_scm2string (voice_name);
- Translator_group* voice = find_context_below (t, "Voice", name);
+ String name = ly_scm2string (voice_name);
+ Translator_group *voice = find_context_below (t, "Voice", name);
Translator_group *thread = 0;
if (voice)
thread = find_context_below (voice, "Thread", "");
else
- get_music ()->origin ()->warning (_f("Cannot find Voice: %s\n", name.to_str0()));
+ get_music ()->origin ()->warning (_f ("Cannot find Voice: %s\n",
+ name.to_str0 ()));
if (thread)
music_context_ = thread;
if (lyrics_context_ && voice)
- lyrics_context_->set_property ("associatedVoiceContext", voice->self_scm ());
+ lyrics_context_->set_property ("associatedVoiceContext",
+ voice->self_scm ());
}
}
}
ret = daddy_trans_->find_create_translator (n, id, operations);
else
{
- warning (_f ("can't find or create `%s' called `%s'", ly_symbol2string (n).to_str0 (), id));
+ warning (_f ("Cannot find or create `%s' called `%s'",
+ ly_symbol2string (n).to_str0 (), id));
ret =0;
}
return ret;