]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lyric-combine-music-iterator.cc
Merge commit 'origin' into beamlets2
[lilypond.git] / lily / lyric-combine-music-iterator.cc
index 7639e03a8f35dcbbfee034d3dae77f81ae08d768..b75d309f2a7c6c79bf7d66a2e1d5269d45023a69 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2004--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2004--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "dispatcher.hh"
@@ -97,13 +97,15 @@ Lyric_combine_music_iterator::set_music_context (Context *to)
 {
   if (music_context_)
     {
-      music_context_->event_source ()->remove_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
+      music_context_->event_source ()->
+       remove_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
     }
 
   music_context_ = to;
   if (to)
     {
-      to->event_source ()->add_listener (GET_LISTENER (set_busy), ly_symbol2scm ("music-event"));
+      to->event_source ()->add_listener (GET_LISTENER (set_busy),
+                                        ly_symbol2scm ("music-event"));
     }
 }
 
@@ -209,6 +211,9 @@ IMPLEMENT_LISTENER (Lyric_combine_music_iterator, check_new_context)
 void
 Lyric_combine_music_iterator::check_new_context (SCM sev)
 {
+  if (!ok ())
+    return ;
+  
   // TODO: Check first if type=Voice and if id matches
   Stream_event * ev = unsmob_stream_event (sev);
   if (ev->get_property ("type") != ly_symbol2scm ("Voice"))
@@ -255,10 +260,8 @@ Lyric_combine_music_iterator::find_voice ()
 }
 
 void
-Lyric_combine_music_iterator::process (Moment when)
+Lyric_combine_music_iterator::process (Moment /* when */)
 {
-  (void) when;
-  
   /* see if associatedVoice has been changed */
   Context *new_voice = find_voice ();
   if (new_voice)