+2004-06-08 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/new-lyric-combine-music-iterator.cc (do_quit): put warning
+ in do_quit()
+
2004-06-07 Han-Wen Nienhuys <hanwen@xs4all.nl>
* ly/book-paper-defaults.ly: set optimal-page-breaks as default
bool start_new_syllable () ;
void find_voice ();
- bool warned_;
+ bool music_found_;
bool made_association_;
Context * lyrics_context_;
Context * music_context_;
New_lyric_combine_music_iterator::New_lyric_combine_music_iterator ()
{
- warned_ = false;
+ music_found_ = false;
made_association_ = false;
lyric_iter_ =0;
music_context_ =0;
String name = ly_scm2string (voice_name);
Context *voice = find_context_below (t, ly_symbol2scm ("Voice"), name);
- if (!voice && !warned_)
- {
- warned_ = true;
- get_music ()->origin ()->warning (_f ("cannot find Voice: %s",
- name.to_str0 ()) + "\n");
- }
- else
+ if (voice)
music_context_ = voice;
}
{
Moment m= lyric_iter_->pending_moment ();
lyric_iter_->process (m);
+
+ music_found_ = true;
}
}
void
New_lyric_combine_music_iterator::do_quit ()
{
+ if (!music_found_)
+ {
+ SCM voice_name = get_music ()->get_property ("associated-context");
+
+ String name;
+ if (ly_c_string_p (voice_name))
+ name = ly_scm2string (voice_name);
+
+ get_music ()->origin ()->warning (_f ("Haven't found Voice `%s'.",
+ name.to_str0 ()) + "\n");
+ }
+
if (lyric_iter_)
lyric_iter_->quit ();
}