]> git.donarmstrong.com Git - lilypond.git/commitdiff
(start_new_syllable):
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 1 Feb 2004 10:35:05 +0000 (10:35 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 1 Feb 2004 10:35:05 +0000 (10:35 +0000)
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).

ChangeLog
THANKS
lily/new-lyric-combine-music-iterator.cc
lily/translator-group.cc

index e2100aa0d247be41f5bfd005b7e16fc99fdd3831..89ddc56e6d6ca1695f8a5be20915ca2a4669a87f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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.
diff --git a/THANKS b/THANKS
index 7404cba212034a69634ebe058e8c509a09d7dc4c..d52980667e8766ce6d88a1c720198cb0e8844733 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -13,6 +13,7 @@ Werner Lemberg
 Nicolas Sceaux 
 Nick Busigin
 Matthias Kilian
+Erik Sandberg
 
 Release 2.0
 ***********
index f2eff8b6f327bc1c8447c02655b1b52baa279bd9..b5d0729108c5381cb2cef56b4bda519aa1546380 100644 (file)
@@ -71,6 +71,9 @@ New_lyric_combine_music_iterator::start_new_syllable ()
   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);
@@ -159,12 +162,15 @@ New_lyric_combine_music_iterator::construct_children ()
   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
@@ -180,19 +186,21 @@ New_lyric_combine_music_iterator::find_thread ()
          while (t && t->daddy_trans_)
            t = t->daddy_trans_;
 
-         String name =  ly_scm2string (voice_name);
-         Translator_groupvoice = 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 ());
        }
     }
 }
index 87bede03b8ee279e58c774e0ad9178f9789aed0a..9d0ab733be6c62360bb519622c2c2e4652360157 100644 (file)
@@ -169,7 +169,8 @@ Translator_group::find_create_translator (SCM n, String id, SCM operations)
     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;