]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/sequential-iterator.cc
Fix 1141 and 1142.
[lilypond.git] / lily / sequential-iterator.cc
index cf88a52d1dd1248b1e2d90b75da654b850f1a4a4..65c67b96ee8be502dd23b9a4fa088939e7957b87 100644 (file)
@@ -1,9 +1,20 @@
 /*
-  sequential-iterator.cc -- implement Sequential_iterator
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
+  Copyright (C) 1997--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
-  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "sequential-iterator.hh"
@@ -42,7 +53,12 @@ Sequential_iterator::Sequential_iterator ()
 SCM
 Sequential_iterator::get_music_list () const
 {
-  return SCM_EOL;
+  Music *m = get_music ();
+  SCM proc = m->get_property ("elements-callback");
+  if (scm_procedure_p (proc))
+    return scm_call_1 (proc, m->self_scm ());
+  else
+    return SCM_EOL;
 }
 
 void
@@ -52,7 +68,6 @@ Sequential_iterator::do_quit ()
     iter_->quit ();
 }
 
-
 void
 Sequential_iterator::derived_mark () const
 {
@@ -124,9 +139,7 @@ Sequential_iterator::construct_children ()
     }
 
   while (iter_ && !iter_->ok ())
-    {
-      next_element (true);
-    }
+    next_element (true);
 
   last_mom_ = Moment (-1);
   here_mom_ = get_music ()->start_mom ();
@@ -174,7 +187,7 @@ Sequential_iterator::next_element (bool)
        in that chunk should be in len.grace_part_
 
       */
-      last_mom_ = here_mom_;;
+      last_mom_ = here_mom_;
       here_mom_ += len;
     }
 
@@ -233,9 +246,7 @@ Sequential_iterator::pending_moment () const
   Grace_fixup *gf = get_grace_fixup ();
   if (gf
       && gf->length_ + iter_->music_start_mom () == cp)
-    {
-      return here_mom_ + gf->length_ + Moment (0, gf->grace_start_);
-    }
+    return here_mom_ + gf->length_ + Moment (0, gf->grace_start_);
 
   /*
     Fix-up a grace note at  the start of the music.
@@ -249,12 +260,6 @@ Sequential_iterator::ok () const
   return iter_;
 }
 
-Music_iterator *
-Sequential_iterator::try_music_in_children (Music *m) const
-{
-  return iter_ ? iter_->try_music (m) : 0;
-}
-
 IMPLEMENT_CTOR_CALLBACK (Sequential_iterator);
 
 bool