]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.29.jcn4: repeat-iter: snapnie
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 10 Feb 1999 17:06:45 +0000 (18:06 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 10 Feb 1999 17:06:45 +0000 (18:06 +0100)
pl 29.jcn4
- unsuccessful try at fixing repeat-iter::ok () constness

---
Generated by janneke@gnu.org using package-diff 0.62,
>From = lilypond-1.1.29.jcn3, To = lilypond-1.1.29.jcn4

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.29.jcn4.diff

Patches do not contain automatically generated files
or (urg) empty directories,
i.e., you should rerun autoconf, configure
and possibly make outdirs.

--state
1.1.29.jcn3
1.1.29.jcn4
++state

NEWS
TODO
VERSION
lily/include/repeated-music-iterator.hh
lily/repeated-music-iterator.cc

diff --git a/NEWS b/NEWS
index 607407ff6e609793b971d14335bbeb6b8c84e13a..c0d39a6dcf7104641acc44c1e76d084a996c0136 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,12 @@
---- ../lilypond-1.1.29.jcn2/NEWS       Tue Feb  9 22:46:07 1999
+--- ../lilypond-1.1.29.jcn3/NEWS       Wed Feb 10 15:21:05 1999
+++ b/NEWS      Wed Feb 10 17:56:14 1999
+@@ -1,3 +1,6 @@
+pl 29.jcn4
+       - unsuccessful try at fixing repeat-iter::ok () constness
+
+ pl 29.jcn3
+       - fix: slur-case3.ly 
+       - init.sly: .fly with linewidt=-1--- ../lilypond-1.1.29.jcn2/NEWS       Tue Feb  9 22:46:07 1999
 ++ b/NEWS      Wed Feb 10 15:21:05 1999
 @@ -1,3 +1,7 @@
 pl 29.jcn3
diff --git a/TODO b/TODO
index a5b256713df2fea94d62d33bc734f8360f589d62..596c8df7a2164683e95928419b5a3f28d93e25d8 100644 (file)
--- a/TODO
+++ b/TODO
@@ -78,7 +78,6 @@ Fix: set bar-number to 0 if first bar is an anacrouse?
 . * make ly2dvi test page.
 . * Try to use Killing_cons iso. Pointer_list
 . * make dependencies () a virtual function.
-. * fix Repeated_music_iterator::ok() (constness.)
 . * one big ly2dvi input that includes *all* tests.
 . * Don't use boolean properties (0,1), instead check existence
 of property.
diff --git a/VERSION b/VERSION
index 537aaa1c96e8ef6f0e9681a118914e4dd3353c1e..f34be36d3f32563b8664c57a7b181cf817f74fc9 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=29
-MY_PATCH_LEVEL=jcn3
+MY_PATCH_LEVEL=jcn4
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 4b42751c0b457ea5d41e246db13a40ab8b6610d5..79f3f3ae150ee7505645d3109bf1270f82f99d41 100644 (file)
@@ -28,6 +28,7 @@ protected:
 private:
   void start_next_element ();
 
+  bool done_b_;
   int unfold_i_;
   Moment here_mom_;
   Music_iterator* repeat_iter_p_;
index 80007e5b131874673eaf172fdbc812b898ed1e3a..15f3caf3346f9252981cfdf718f4c143a1bf7fe4 100644 (file)
@@ -19,6 +19,7 @@ Repeated_music_iterator::Repeated_music_iterator ()
   alternative_iter_p_ = 0;
   here_mom_ = 0;
   unfold_i_ = -1; 
+  done_b_ = false;
 }
 
 Repeated_music_iterator::~Repeated_music_iterator ()
@@ -37,6 +38,7 @@ Repeated_music_iterator::do_print () const
 void
 Repeated_music_iterator::construct_children ()
 {
+  done_b_ = false;
   repeat_iter_p_ = get_iterator_p (dynamic_cast<Repeated_music const*> (music_l_)->repeat_p_);
 }
 
@@ -49,10 +51,20 @@ Repeated_music_iterator::do_process_and_next (Moment m)
       if (!success)
        music_l_->warning ( _("No one to print a volta bracket"));
     }
+
+  if (!ok ())
+    start_next_element ();
+
+  //  if (!ok())
+     // return;
+      
   if (repeat_iter_p_ && repeat_iter_p_->ok ())
     repeat_iter_p_->process_and_next (m - here_mom_);
-  else
+  else if (alternative_iter_p_ && alternative_iter_p_->ok ())
     alternative_iter_p_->process_and_next (m - here_mom_);
+  else
+    return;
+  
   Music_iterator::do_process_and_next (m);
 }
 
@@ -69,34 +81,18 @@ Repeated_music_iterator::next_moment () const
   return r->alternative_p_->length_mom () + here_mom_;
 }
 
-/*
-  FIXME
- */
 bool
 Repeated_music_iterator::ok () const
 {
-  if (!repeat_iter_p_ && !alternative_iter_p_)
-    return false;
-
-  if ((repeat_iter_p_ && repeat_iter_p_->ok ())
-    || (alternative_iter_p_ && alternative_iter_p_->ok ()))
-    return true;
-
-  Repeated_music_iterator *urg = (Repeated_music_iterator*)this;
-  // urg, we're const
-  urg->start_next_element ();
-
-  return ok ();
+  return !done_b_;
 }
 
-
 void
 Repeated_music_iterator::start_next_element ()
 {
   Repeated_music const*rep =dynamic_cast<Repeated_music const*> (music_l_);
 
-
- if (repeat_iter_p_)
+  if (repeat_iter_p_)
     {
       assert (!repeat_iter_p_->ok ());
       assert (!alternative_iter_p_);
@@ -120,17 +116,21 @@ Repeated_music_iterator::start_next_element ()
          unfold_i_--;
          repeat_iter_p_ = get_iterator_p (rep->repeat_p_);
          // urg, assume same length alternatives for now...
-//       here_mom_ += rep->alternative_p_->music_p_list_p_->top ()->length_mom ();
+         //      here_mom_ += rep->alternative_p_->music_p_list_p_->top ()->length_mom ();
          /*
            URG
            this is *wrong* but at least it doesn't dump core
            when unfolding, the alternative (sequential) music 
            shouldn't automatically move to the next alternative
-
+           
            how to intercept this...
-          */
+         */
          here_mom_ += rep->alternative_p_->length_mom ();
        }
     }
+
+  if ((!repeat_iter_p_ || !repeat_iter_p_->ok ())
+      && (!alternative_iter_p_ || !alternative_iter_p_->ok ()))
+    done_b_ = true;
 }