From a04a2e6a7d25ddda4fbc41188c15c5c5f960fba3 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 7 Jun 2004 22:50:23 +0000 Subject: [PATCH] (do_quit): put warning in do_quit() --- ChangeLog | 5 +++++ lily/new-lyric-combine-music-iterator.cc | 26 ++++++++++++++++-------- scripts/mup2ly.py | 2 +- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ebbab8f16..96341faaa5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-06-08 Han-Wen Nienhuys + + * lily/new-lyric-combine-music-iterator.cc (do_quit): put warning + in do_quit() + 2004-06-07 Han-Wen Nienhuys * ly/book-paper-defaults.ly: set optimal-page-breaks as default diff --git a/lily/new-lyric-combine-music-iterator.cc b/lily/new-lyric-combine-music-iterator.cc index e8f225c5f6..ff658fc8fa 100644 --- a/lily/new-lyric-combine-music-iterator.cc +++ b/lily/new-lyric-combine-music-iterator.cc @@ -34,7 +34,7 @@ private: bool start_new_syllable () ; void find_voice (); - bool warned_; + bool music_found_; bool made_association_; Context * lyrics_context_; Context * music_context_; @@ -50,7 +50,7 @@ static Music *melisma_playing_ev; New_lyric_combine_music_iterator::New_lyric_combine_music_iterator () { - warned_ = false; + music_found_ = false; made_association_ = false; lyric_iter_ =0; music_context_ =0; @@ -170,13 +170,7 @@ New_lyric_combine_music_iterator::find_voice () 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; } @@ -217,12 +211,26 @@ New_lyric_combine_music_iterator::process (Moment ) { 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 (); } diff --git a/scripts/mup2ly.py b/scripts/mup2ly.py index 195b633007..e6e1050baf 100644 --- a/scripts/mup2ly.py +++ b/scripts/mup2ly.py @@ -1290,7 +1290,7 @@ if not files: files = ['-'] for f in files: - + h = None if f == '-': h = sys.stdin elif f and not os.path.isfile (f): -- 2.39.5