]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.5.0
authorfred <fred>
Wed, 27 Mar 2002 01:20:16 +0000 (01:20 +0000)
committerfred <fred>
Wed, 27 Mar 2002 01:20:16 +0000 (01:20 +0000)
20 files changed:
VERSION
lily/auto-change-iterator.cc
lily/change-iterator.cc
lily/chord-tremolo-iterator.cc
lily/folded-repeat-iterator.cc
lily/include/music-iterator.hh
lily/lyric-combine-music-iterator.cc
lily/music-iterator.cc
lily/music-wrapper-iterator.cc
lily/output-property-music-iterator.cc
lily/parser.yy
lily/part-combine-music-iterator.cc
lily/percent-repeat-iterator.cc
lily/property-iterator.cc
lily/request-chord-iterator.cc
lily/sequential-music-iterator.cc
lily/simple-music-iterator.cc
lily/simultaneous-music-iterator.cc
lily/time-scaled-music-iterator.cc
lily/unfolded-repeat-iterator.cc

diff --git a/VERSION b/VERSION
index 69c891282e9968fca7f6c2cf2d46b1e0c289a4e6..b76131dbcc4a5fb95ab17ab0b8dd0bd63adb10c7 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,7 +1,7 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
-MINOR_VERSION=4
-PATCH_LEVEL=4
+MINOR_VERSION=5
+PATCH_LEVEL=0
 MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
index d39c10d5d5b3e98de8ee56bc7a56f3d58b2f50e8..2f29c4be38e47c49f43f0dc175ac84f6840b06b6 100644 (file)
@@ -123,7 +123,7 @@ Auto_change_iterator::process (Moment m)
        {
          where_dir_ = s;
          String to_id = (s >= 0) ?  "up" : "down";
-         String wh = ly_scm2string (music_l_->get_mus_property ("what"));
+         String wh = ly_scm2string (music_l ()->get_mus_property ("what"));
          change_to (child_iter_p_, wh, to_id);   
        }
     }
index 96e7affd0741d01717ed08479ca35315fe43f278..727cb9b681804bff75be9a519e9b355867944514 100644 (file)
@@ -15,8 +15,8 @@
 void
 Change_iterator::error (String reason)
 {
-  String to_type = ly_scm2string (music_l_->get_mus_property ("change-to-type"));
-  String to_id =  ly_scm2string (music_l_->get_mus_property ("change-to-id"));
+  String to_type = ly_scm2string (music_l ()->get_mus_property ("change-to-type"));
+  String to_id =  ly_scm2string (music_l ()->get_mus_property ("change-to-id"));
 
   String warn1 = _f ("can't change `%s' to `%s'", to_type, to_id) 
     + ": " + reason;
@@ -27,7 +27,7 @@ Change_iterator::error (String reason)
     + report_to_l ()->type_str_ + " = `"
     + report_to_l ()->id_str_ + "': ";
   warning (warn2);
-  music_l_->origin ()->warning (warn1);
+  music_l ()->origin ()->warning (warn1);
 }
 
 /*
@@ -39,8 +39,8 @@ Change_iterator::process (Moment m)
   Translator_group * current = report_to_l ();
   Translator_group * last = 0;
 
-  String to_type = ly_scm2string (music_l_->get_mus_property ("change-to-type"));
-  String to_id =  ly_scm2string (music_l_->get_mus_property ("change-to-id"));
+  String to_type = ly_scm2string (music_l ()->get_mus_property ("change-to-type"));
+  String to_id =  ly_scm2string (music_l ()->get_mus_property ("change-to-id"));
 
 
   /* find the type  of translator that we're changing.
index 9c2aaf4a77278b708ea27d14cd20650ab932fae8..ea1d410b6bf2f797b15e2f98e0620c8f021dd6d7 100644 (file)
@@ -19,7 +19,7 @@
 void
 Chord_tremolo_iterator::construct_children ()
 {
-  Repeated_music * rep = dynamic_cast<Repeated_music*> (music_l_);
+  Repeated_music * rep = dynamic_cast<Repeated_music*> (music_l ());
   factor_  = Moment (1, rep->repeat_count ());
   child_iter_p_ = get_iterator_p (rep->body ());
 }
@@ -41,11 +41,11 @@ Chord_tremolo_iterator::process (Moment m)
 {
   if (!m)
     {
-      Music_iterator *yeah = try_music (music_l_);
+      Music_iterator *yeah = try_music (music_l ());
       if (yeah)
        set_translator (yeah->report_to_l ());
       else
-       music_l_->origin ()->warning (_ ("no one to print a tremolos"));
+       music_l ()->origin ()->warning (_ ("no one to print a tremolos"));
     }
 
   child_iter_p_->process (factor_ * m);
index 16454dba80f3d296a1dc2b761d16f80c2eb5617e..3012c6642912e1e78c257b08ac6022c93a00c21e 100644 (file)
@@ -59,7 +59,7 @@ Folded_repeat_iterator::pending_moment () const
 void
 Folded_repeat_iterator::construct_children ()
 {
-  Repeated_music  *  mus = dynamic_cast<Repeated_music*> (music_l_);
+  Repeated_music  *  mus = dynamic_cast<Repeated_music*> (music_l ());
   main_iter_p_ = get_iterator_p (mus->body ());
   if (!main_iter_p_->ok ())
     {
@@ -73,9 +73,9 @@ Folded_repeat_iterator::process (Moment m)
 {
   if (!m)
     {
-      bool success = try_music (music_l_);
+      bool success = try_music (music_l ());
       if (!success)
-       music_l_->origin ()->warning (_ ("no one to print a repeat brace"));
+       music_l ()->origin ()->warning (_ ("no one to print a repeat brace"));
     }
   
   if (main_iter_p_)
@@ -104,7 +104,7 @@ Folded_repeat_iterator::process (Moment m)
 void
 Folded_repeat_iterator::leave_body ()
 {
-  Repeated_music *  mus = dynamic_cast<Repeated_music *> (music_l_);
+  Repeated_music *  mus = dynamic_cast<Repeated_music *> (music_l ());
   delete main_iter_p_;
   main_iter_p_ = 0;
   main_length_mom_ +=  mus->body ()->length_mom ();
@@ -113,7 +113,7 @@ Folded_repeat_iterator::leave_body ()
 void
 Folded_repeat_iterator::enter_alternative ()
 {
-  Repeated_music *  mus = dynamic_cast<Repeated_music *> (music_l_);  
+  Repeated_music *  mus = dynamic_cast<Repeated_music *> (music_l ());  
   if (mus->alternatives ())
     {
       Simultaneous_music_iterator * s = new Simultaneous_music_iterator;
index 4041b5d028f46cd442b269108b762f1c7b86afdc..bc99f499d3422fb3eb20cb60378729ebe977d64b 100644 (file)
@@ -52,11 +52,12 @@ class Music_iterator
 {
 protected:
   Moment music_length_;
-
+  Moment start_mom_;
 public:
   VIRTUAL_COPY_CONS (Music_iterator);
 
   Moment music_length_mom () const;
+  Moment music_start_mom () const;
   Music_iterator ();
   Music_iterator (Music_iterator const&);
   virtual ~Music_iterator ();
@@ -93,9 +94,6 @@ public:
   virtual void construct_children ();
   static SCM constructor_cxx_function;
   
-protected:
-  Music  * music_l_;
-
   /**
     Get an iterator for MUS, inheriting the translation unit from THIS.
    */
@@ -103,8 +101,10 @@ protected:
 
   virtual Music_iterator* try_music_in_children (Music *) const;
 
+  Music * music_l () const;
 private:
   Interpretation_context_handle handle_;
+  Music  * music_l_;
 };
 
 
index 3d9eecc7e0e2a660af7572575bc60e748d6a1bf0..6052b89ffd8e80577b71bfe46617d68e27449ea9 100644 (file)
@@ -53,7 +53,7 @@ Lyric_combine_music_iterator::ok () const
 void
 Lyric_combine_music_iterator::construct_children ()
 {
-  Lyric_combine_music const * m = dynamic_cast<Lyric_combine_music const*> (music_l_);
+  Lyric_combine_music const * m = dynamic_cast<Lyric_combine_music const*> (music_l ());
   
   music_iter_p_ = get_iterator_p (m->music_l ());
   lyric_iter_p_ = get_iterator_p (m->lyrics_l ());
index 7d5a5155be7a2a0af340e5950efc6833b4447e13..f27f2f0d7775dc839427044aa4f3a44ba3d52228 100644 (file)
@@ -26,6 +26,7 @@ Music_iterator::Music_iterator (Music_iterator const& src)
   handle_ = *src.handle_.clone ();
   music_l_ = src.music_l_;
   music_length_ = src.music_length_;
+  start_mom_ = src.start_mom_;
 }
 
 Music_iterator::~Music_iterator ()
@@ -59,7 +60,6 @@ Music_iterator::pending_moment () const
   return 0;
 }
 
-
 void
 Music_iterator::process (Moment)
 {
@@ -102,8 +102,9 @@ Music_iterator::static_get_iterator_p (Music *m)
     }
 
   p->music_l_ = m;
+  assert (m);
   p->music_length_ = m->length_mom ();
-  
+  p->start_mom_ = m->start_mom ();
   return p;
 }
 
@@ -112,12 +113,20 @@ Moment
 Music_iterator::music_length_mom () const
 {
   return music_length_;
+
+}
+
+Moment
+Music_iterator::music_start_mom ()const
+{
+  return start_mom_;
 }
 
 void
 Music_iterator::init_translator (Music *m, Translator_group *report_l)
 {
   music_l_ = m;
+  assert (m);
   if (Context_specced_music * csm =dynamic_cast<Context_specced_music *> (m))
     {
       SCM ct = csm->get_mus_property ("context-type");
@@ -169,3 +178,9 @@ Music_iterator::try_music_in_children (Music *) const
 }
 
 IMPLEMENT_CTOR_CALLBACK (Music_iterator);
+
+Music *
+Music_iterator::music_l () const
+{
+  return music_l_;
+}
index a80577f387ebae0cfcb65c780ed94923c3ecb2fd..c5f72417c9a417583572a1ffda6158bee51d6477 100644 (file)
@@ -34,7 +34,7 @@ void
 Music_wrapper_iterator::construct_children ()
 {
   child_iter_p_ =
-    get_iterator_p (dynamic_cast<Music_wrapper const*> (music_l_)->element ());
+    get_iterator_p (dynamic_cast<Music_wrapper const*> (music_l ())->element ());
 }
 
 bool
index 5759b85b42874f2d39620bb0059cf259fdc34a32..47ec4d784f8ea40b0f3eba037e328cf3dc85f240 100644 (file)
@@ -15,10 +15,10 @@ Output_property_music_iterator::process (Moment m)
 {
   if (last_processed_mom_ < Moment (0))
     {
-      bool accepted = try_music (music_l_);
+      bool accepted = try_music (music_l ());
       if (!accepted)
-       music_l_->origin ()->warning (_f ("Junking request: `%s'",
-                                         classname (music_l_)));
+       music_l ()->origin ()->warning (_f ("Junking request: `%s'",
+                                         classname (music_l ())));
     }
 
   skip (m);
index eacdc63aa8b7ca18f18f8f6d32188d5cc7c149f7..95caa860e01fdfcc8c474f096d477a2cc9ab0f20 100644 (file)
@@ -188,7 +188,7 @@ yylex (YYSTYPE *s,  void * v_l)
 %token EXTENDER
 %token FONT
 %token GLISSANDO
-%token GRACE
+%token GRACE NGRACE
 %token HEADER
 %token HYPHEN
 %token IN_T
@@ -806,9 +806,43 @@ Composite_music:
                chm->set_spot (*$3->origin ());
        }
        | GRACE Music {
-               $$ = new Grace_music (SCM_EOL);
+#if 1
+       /*
+               The other version is for easier debugging  of
+               Sequential_music_iterator in combination with grace notes.
+       */
+
+               SCM start = THIS->lexer_p_->lookup_identifier ("startGraceMusic");
+               SCM stop = THIS->lexer_p_->lookup_identifier ("stopGraceMusic");
+               Music *startm = unsmob_music (start);
+               Music *stopm = unsmob_music (stop);
+
+               SCM ms = SCM_EOL;
+               if (stopm) {
+                       stopm = stopm->clone ();
+                       ms = gh_cons (stopm->self_scm (), ms);
+                       scm_unprotect_object (stopm->self_scm ());
+               }
+               ms = gh_cons ($2->self_scm (), ms);
+               scm_unprotect_object ($2->self_scm());
+               if (startm) {
+                       startm = startm->clone ();
+                       ms = gh_cons (startm->self_scm () , ms);
+                       scm_unprotect_object (startm->self_scm ());
+               }
+
+               Music* seq = new Sequential_music (SCM_EOL);
+               seq->set_mus_property ("elements", ms);
+
+               $$ = new New_grace_music (SCM_EOL);
+               $$->set_mus_property ("element", seq->self_scm ());
+               scm_unprotect_object (seq->self_scm ());
+#else
+               $$ = new New_grace_music (SCM_EOL);
                $$->set_mus_property ("element", $2->self_scm ());
                scm_unprotect_object ($2->self_scm ());
+#endif
+
 
        }
        | CONTEXT string '=' string Music {
@@ -1604,7 +1638,7 @@ multiplied_duration:
                $$ = unsmob_duration ($$)->compressed ( $3) .smobbed_copy ();
        }
        | multiplied_duration '*' FRACTION {
-               Moment m (gh_scm2int (gh_car ($3)), gh_scm2int (gh_cdr ($3)));
+               Rational  m (gh_scm2int (gh_car ($3)), gh_scm2int (gh_cdr ($3)));
 
                $$ = unsmob_duration ($$)->compressed (m).smobbed_copy ();
        }
index 043f83c55725c3e46e20afe39b152921e10e85ab..68d0516ff515527eecd06b299881d9438d45f9a3 100644 (file)
@@ -62,7 +62,7 @@ Part_combine_music_iterator::ok () const
 void
 Part_combine_music_iterator::construct_children ()
 {
-  Part_combine_music const * m = dynamic_cast<Part_combine_music const*> (music_l_);
+  Part_combine_music const * m = dynamic_cast<Part_combine_music const*> (music_l ());
   
   first_iter_p_ = get_iterator_p (m->first_l ());
   second_iter_p_ = get_iterator_p (m->second_l ());
@@ -141,7 +141,7 @@ int
 Part_combine_music_iterator::get_state (Moment)
 {
   int state = UNKNOWN;
-  Part_combine_music const *p = dynamic_cast<Part_combine_music const* > (music_l_);
+  Part_combine_music const *p = dynamic_cast<Part_combine_music const* > (music_l ());
 
   String w = ly_scm2string (p->get_mus_property ("what"));
     
@@ -157,7 +157,7 @@ Part_combine_music_iterator::get_state (Moment)
   
   Moment now = pending_moment ();
 
-  if (!now.mod_rat (change_mom))
+  if (!now.main_part_.mod_rat (change_mom.main_part_))
     {
       SCM interval = SCM_BOOL_F;
       if (first_until_ < now)
@@ -341,7 +341,7 @@ Part_combine_music_iterator::process (Moment m)
   else
     state = state_;
   
-  Part_combine_music const *p = dynamic_cast<Part_combine_music const* > (music_l_);
+  Part_combine_music const *p = dynamic_cast<Part_combine_music const* > (music_l ());
 
 
   bool previously_combined_b = first_iter_p_->report_to_l ()->daddy_trans_l_
index b9248bb7a862869cccce52e5c04ca4c4a0a169a3..3d1120981b578146a4e1de32cade848101b9feaa 100644 (file)
@@ -35,7 +35,7 @@ Percent_repeat_iterator::ok () const
 void
 Percent_repeat_iterator::construct_children ()
 {
-  Repeated_music * mus =dynamic_cast<Repeated_music *> (music_l_);
+  Repeated_music * mus =dynamic_cast<Repeated_music *> (music_l ());
   finish_mom_ = mus->length_mom ();
   child_iter_p_ = get_iterator_p (mus->body ());
 }
@@ -46,11 +46,11 @@ Percent_repeat_iterator::process (Moment m)
 {
   if (!m)
     {
-      Music_iterator *yeah = try_music (music_l_);
+      Music_iterator *yeah = try_music (music_l ());
       if (yeah)
        set_translator (yeah->report_to_l ());
       else
-       music_l_->origin ()->warning ( _ ("no one to print a percent"));
+       music_l ()->origin ()->warning ( _ ("no one to print a percent"));
     }
   
   if (child_iter_p_->ok ())
index 84c8486d0b2086c5e469b35e2591d1edd937f7f7..cea57f3dc3b75a3cc8894bf1f53e1122c7fda42d 100644 (file)
 void
 Property_iterator::process (Moment m)
 {
-  SCM sym = music_l_->get_mus_property ("symbol");
+  SCM sym = music_l ()->get_mus_property ("symbol");
   if (gh_symbol_p (sym))
     {
-      SCM val = music_l_->get_mus_property ("value");
+      SCM val = music_l ()->get_mus_property ("value");
       bool ok= true;
       if (val != SCM_EOL)
        ok = type_check_assignment (val, sym, ly_symbol2scm ("translation-type?"));
@@ -34,7 +34,7 @@ Property_iterator::process (Moment m)
 void
 Property_unset_iterator::process (Moment m)
 {
-  SCM sym = music_l_->get_mus_property ("symbol");
+  SCM sym = music_l ()->get_mus_property ("symbol");
   if (gh_symbol_p (sym))
     {
       report_to_l ()->unset_property (sym);
@@ -46,11 +46,11 @@ Property_unset_iterator::process (Moment m)
 void
 Push_property_iterator::process (Moment m)
 {
-  SCM syms = music_l_->get_mus_property ("symbols");
-  SCM eprop = music_l_->get_mus_property ("grob-property");
-  SCM val = music_l_->get_mus_property ("grob-value");
+  SCM syms = music_l ()->get_mus_property ("symbols");
+  SCM eprop = music_l ()->get_mus_property ("grob-property");
+  SCM val = music_l ()->get_mus_property ("grob-value");
 
-  if (to_boolean (music_l_->get_mus_property ("pop-first")))
+  if (to_boolean (music_l ()->get_mus_property ("pop-first")))
     Translator_def::apply_pushpop_property (report_to_l (),
                                            syms, eprop, SCM_UNDEFINED);
 
@@ -62,8 +62,8 @@ Push_property_iterator::process (Moment m)
 void
 Pop_property_iterator::process (Moment m)
 {
-  SCM syms = music_l_->get_mus_property ("symbols");
-  SCM eprop = music_l_->get_mus_property ("grob-property");
+  SCM syms = music_l ()->get_mus_property ("symbols");
+  SCM eprop = music_l ()->get_mus_property ("grob-property");
   Translator_def::apply_pushpop_property (report_to_l (), syms, eprop, SCM_UNDEFINED);
   
   Simple_music_iterator::process (m);
index 55372a463f680725fb5c1c01ea5b2cfc53224092..9cee9ae4f40b38fb28145a2c5d45ba5521493063 100644 (file)
@@ -42,7 +42,7 @@ Request_chord_iterator::construct_children ()
 Request_chord*
 Request_chord_iterator::elt_l () const
 {
-  return (Request_chord*) music_l_;
+  return (Request_chord*) music_l ();
 }
 
 SCM
@@ -51,7 +51,7 @@ Request_chord_iterator::get_music (Moment) const
   SCM s = SCM_EOL;
   if (last_processed_mom_ < Moment (0))
     {
-      Music_sequence * ms = dynamic_cast<Music_sequence*> (music_l_);
+      Music_sequence * ms = dynamic_cast<Music_sequence*> (music_l ());
      
       for (SCM m = ms->music_list (); gh_pair_p (m); m = gh_cdr (m))
        {
@@ -66,7 +66,7 @@ Request_chord_iterator::process (Moment m)
 {
   if (last_processed_mom_ < Moment (0))
     {
-      for (SCM s = dynamic_cast<Music_sequence *> (music_l_)->music_list ();
+      for (SCM s = dynamic_cast<Music_sequence *> (music_l ())->music_list ();
           gh_pair_p (s);  s = gh_cdr (s))
        {
          Music *mus = unsmob_music (gh_car (s));
index ad1ae7b934d41bf2dd83018001779bcb6a95aef1..0f0f82d89886f97546419266aed3786cd8fad560 100644 (file)
@@ -33,13 +33,14 @@ Sequential_music_iterator::Sequential_music_iterator ()
 {
   cursor_ = SCM_EOL;
   here_mom_ = Moment (0);
-
+  grace_skips_ = 0;
   iter_p_ =0;
 }
 
 Sequential_music_iterator::Sequential_music_iterator (Sequential_music_iterator const &src)
   : Music_iterator (src)
 {
+  grace_skips_ = src.grace_skips_;
   cursor_ = src.cursor_;
   here_mom_ = src.here_mom_;
   if (src.iter_p_)
@@ -53,10 +54,46 @@ Sequential_music_iterator::~Sequential_music_iterator ()
   delete iter_p_;
 }
 
+
+Grace_skip *
+get_grace_skips (SCM cursor)
+{
+  Moment here (0);
+  Moment last (here);
+  Grace_skip *head = 0;
+  Grace_skip **tail = &head;
+  bool first = true; 
+
+  
+  for (; gh_pair_p (cursor); cursor = gh_cdr (cursor))
+    {
+      Music * mus = unsmob_music (gh_car (cursor));
+      Moment l =mus->length_mom ();
+      if (l.main_part_)
+       {
+         first = false;
+         last = here;
+         here += l;
+       }
+      else if(l.grace_mom_ && !first)
+       {
+         assert (!l.main_part_);
+         Grace_skip *p =new Grace_skip;
+         p->start_ = last;
+         p->length_ = (here - last).main_part_;
+         p->grace_length_ = l.grace_mom_;
+         p->next_ = 0;
+         *tail = p;
+         tail = &(*tail)->next_; 
+       }
+    }
+  return  head;
+}
+
 void
 Sequential_music_iterator::construct_children ()
 {
-  cursor_ = dynamic_cast<Music_sequence const*> (music_l_)->music_list ();
+  cursor_ = dynamic_cast<Music_sequence const*> (music_l ())->music_list ();
 
   iter_p_ = gh_pair_p (cursor_) ?  get_iterator_p (unsmob_music (gh_car (cursor_))) : 0;
   while (iter_p_ && !iter_p_->ok ())
@@ -64,12 +101,15 @@ Sequential_music_iterator::construct_children ()
       next_element ();
     }
 
+  grace_skips_ = get_grace_skips (cursor_);
+
+  here_mom_ = music_l ()->start_mom ();
+
   /*
     iter_p_->ok () is tautology, but what the heck.
    */
   if (iter_p_ && iter_p_->ok ()) 
     descend_to_child ();
-
 }
 
 
@@ -80,7 +120,30 @@ Sequential_music_iterator::construct_children ()
 void
 Sequential_music_iterator::next_element ()
 {
-  here_mom_ += iter_p_->music_length_mom ();
+  Moment len =iter_p_->music_length_mom ();
+  Moment start  = iter_p_->music_start_mom ();
+  assert (!grace_skips_  || grace_skips_->start_ >= here_mom_);
+
+  if (len.main_part_ && grace_skips_ && grace_skips_->start_ == here_mom_)
+    {
+      Moment sk;
+      sk.main_part_ = grace_skips_->length_;
+      here_mom_ +=  sk;
+      here_mom_.grace_mom_ = - grace_skips_->grace_length_;
+
+      Grace_skip * n =grace_skips_->next_;
+      delete       grace_skips_;
+      grace_skips_ = n;
+    }
+  else if (len.grace_mom_)
+    {
+      here_mom_.grace_mom_ =0;
+    }
+  else
+    {
+      here_mom_ += len - start;
+    }
+  
   delete iter_p_;
   cursor_ = gh_cdr (cursor_);
 
@@ -159,9 +222,9 @@ Sequential_music_iterator::get_music (Moment until)const
   return s;
 }
 /*
-  Skip events till UNTIL. We don't do any other side effects (such as
-  moving descending to child iterator contexts, because they might
-  depend on \context specs and \translator changes being executed
+  Skip events till UNTIL. We don't do any other side effects such as
+  descending to child iterator contexts, because they might depend on
+  \context specs and \translator changes being executed
     
  */
 void
@@ -185,7 +248,20 @@ Sequential_music_iterator::process (Moment until)
 {
   while (iter_p_)
     {
-      iter_p_->process (until - here_mom_);
+      if (grace_skips_ &&
+         grace_skips_->start_ == here_mom_
+         && (grace_skips_->start_ + grace_skips_->length_).main_part_ ==
+         until.main_part_)
+       {
+         /*
+           do the stuff/note/rest preceding a grace.
+          */
+         Moment u = until;
+         u.grace_mom_ = 0;
+         iter_p_->process (u - here_mom_);
+       }
+      else
+       iter_p_->process (until - here_mom_ + iter_p_->music_start_mom ());
 
       /*
        if the iter is still OK, there must be events left that have
@@ -204,7 +280,18 @@ Sequential_music_iterator::process (Moment until)
 Moment
 Sequential_music_iterator::pending_moment () const
 {
-  return iter_p_->pending_moment () + here_mom_;
+  Moment cp = iter_p_->pending_moment ();
+
+  if (grace_skips_
+      && here_mom_ == grace_skips_->start_
+      && cp.main_part_ >=  grace_skips_->length_)
+    {
+      cp += here_mom_ ;
+      cp.grace_mom_ = - grace_skips_->grace_length_;
+      return cp;
+    }
+  else
+    return cp + here_mom_ - iter_p_->music_start_mom ();
 }
 
 
index ef83a5abda1a3de36eb1a633c2fb50b4b8b406a7..002f070009baf856273bc00c32c5b19ffb4f2fe7 100644 (file)
@@ -41,7 +41,11 @@ Simple_music_iterator::pending_moment ()const
 void
 Simple_music_iterator::skip (Moment m)
 {
-  music_l_ = 0;
+  /*
+    docme??!!
+   */
+  //  music_l_ = 0;
+  
   last_processed_mom_ = m;
 }
 
index 3265bee03d2c01f7f229cdcb1c0ce61ca99dec2d..d72c81cea183196fa4275896625b2078833e3f40 100644 (file)
@@ -12,6 +12,7 @@
 #include "music-list.hh"
 #include "killing-cons.tcc"
 
+
 Simultaneous_music_iterator::Simultaneous_music_iterator ()
 {
   separate_contexts_b_ = false;
@@ -48,7 +49,7 @@ void
 Simultaneous_music_iterator::construct_children ()
 {
   int j = 0;
-  Music_sequence const *sim = dynamic_cast<Music_sequence const*> (music_l_);
+  Music_sequence const *sim = dynamic_cast<Music_sequence const*> (music_l ());
 
   SCM i = sim->music_list ();
   for (; gh_pair_p (i); i = gh_cdr (i), j++)
index ee8074c6bc0497b676df5e8d6dde3f181070bd9d..b666f766bd929659016df64acd405407b211ad30 100644 (file)
@@ -18,11 +18,11 @@ Time_scaled_music_iterator::process (Moment m)
 {
   if (!m)
     {
-      Music_iterator *yeah = try_music (music_l_);
+      Music_iterator *yeah = try_music (music_l ());
       if (yeah)
        set_translator (yeah->report_to_l ());
       else
-       music_l_->origin ()->warning (_ ("no one to print a tuplet start bracket"));
+       music_l ()->origin ()->warning (_ ("no one to print a tuplet start bracket"));
     }
 
   Music_wrapper_iterator::process (m);
index 93bc97d5f3042fcbec3ec69fe1d01e3e6d401a6b..56c6195aed0864c6da2c0528019674d6f0232ee5 100644 (file)
@@ -120,7 +120,7 @@ the  alternative just set.
 void
 Unfolded_repeat_iterator::next_element (bool side_effect) 
 {
-  Repeated_music * repmus =dynamic_cast<Repeated_music *> (music_l_);
+  Repeated_music * repmus =dynamic_cast<Repeated_music *> (music_l ());
   delete current_iter_p_;
   current_iter_p_ =0;
 
@@ -256,7 +256,7 @@ Unfolded_repeat_iterator::pending_moment () const
 void
 Unfolded_repeat_iterator::construct_children ()
 {
-  Repeated_music * mus =dynamic_cast<Repeated_music *> (music_l_);
+  Repeated_music * mus =dynamic_cast<Repeated_music *> (music_l ());
   
   alternative_cons_ = (mus->alternatives ())
     ? mus->alternatives ()->music_list ()