]> git.donarmstrong.com Git - lilypond.git/commitdiff
(do_quit): put warning
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 7 Jun 2004 22:50:23 +0000 (22:50 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 7 Jun 2004 22:50:23 +0000 (22:50 +0000)
in do_quit()

ChangeLog
lily/new-lyric-combine-music-iterator.cc
scripts/mup2ly.py

index 3ebbab8f1664a2760c9542a11d3433cfaf80fde2..96341faaa58b15bb8f40156ab7dbb3db62aef49e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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
index e8f225c5f6a16634cb0c63cf13196d15c41ed896..ff658fc8fac039adb3dd52f8bc472313e699429a 100644 (file)
@@ -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 ();
 }
index 195b6330077856972c4c12a57a0bacf6ac918039..e6e1050bafdcc5bbcbee39cecaad14af6e4404ee 100644 (file)
@@ -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):