]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/folded-repeat-iterator.cc
2003 -> 2004
[lilypond.git] / lily / folded-repeat-iterator.cc
index 06fefb1f4a80b8948a1e30c2c9e6cc8f5540b4fa..8f0a89f0ce9be681cebabe8088651af892628510 100644 (file)
@@ -3,16 +3,11 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 
-/*
-   Folded repeats are a stupid idea at this point, so we refrain from
-   implementing get_pending_events () and skip ().
-*/
-
 #include "folded-repeat-iterator.hh"
 #include "repeated-music.hh"
 #include "music-list.hh"
@@ -37,24 +32,6 @@ Folded_repeat_iterator::do_quit()
   if (alternative_iter_)alternative_iter_->quit();
 }
 
-Folded_repeat_iterator::Folded_repeat_iterator (Folded_repeat_iterator const &src)
-  : Music_iterator (src)
-{
-  main_iter_ = 0;
-  alternative_iter_ = 0;
-  main_length_mom_ = src.main_length_mom_;
-
-  if (src.alternative_iter_)
-    alternative_iter_ = src.alternative_iter_->clone ();
-  if (src.main_iter_)
-    main_iter_ = src.main_iter_->clone ();
-  
-  if (main_iter_)
-    scm_gc_unprotect_object (main_iter_->self_scm());
-  if (alternative_iter_)
-    scm_gc_unprotect_object (alternative_iter_->self_scm());
-}
-
 Moment
 Folded_repeat_iterator::pending_moment () const
 {
@@ -127,12 +104,12 @@ Folded_repeat_iterator::enter_alternative ()
   Repeated_music *  mus = dynamic_cast<Repeated_music *> (get_music ());  
   if (mus->alternatives ())
     {
-  /*
-    ugh.
-   */ 
+      /*
+       ugh.
+      */ 
       Simultaneous_music_iterator * s = new Simultaneous_music_iterator;
       s->separate_contexts_b_ = true;
-      s->init_translator (mus, report_to ());
+      s->init_translator (mus, get_outlet ());
       
       alternative_iter_ = s;
       alternative_iter_->construct_children ();
@@ -161,4 +138,14 @@ Folded_repeat_iterator::derived_mark()const
   if (alternative_iter_)
     scm_gc_mark (alternative_iter_->self_scm());
 }
+
+void
+Folded_repeat_iterator::derived_substitute (Translator_group*f, Translator_group*t) 
+{
+  if (main_iter_)
+    main_iter_->substitute_outlet (f,t);
+  if (alternative_iter_)
+    alternative_iter_->substitute_outlet (f,t);
+}
+
 IMPLEMENT_CTOR_CALLBACK (Folded_repeat_iterator);