]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/auto-change-iterator.cc
po-replace
[lilypond.git] / lily / auto-change-iterator.cc
index d39c10d5d5b3e98de8ee56bc7a56f3d58b2f50e8..56f18919058633d629ce31107532a6574a4f8ca5 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1999--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
@@ -49,7 +49,7 @@ Auto_change_iterator::change_to (Music_iterator *it, String to_type,
        Translator_group * dest = 
          it->report_to_l ()->find_create_translator_l (to_type, to_id);
        current->remove_translator_p (last);
-       dest->add_group_translator (last);
+       dest->add_used_group_translator (last);
       }
     else
       {
@@ -85,8 +85,8 @@ Auto_change_iterator::pending_pitch (Moment m) const
   while (1)
     {
       SCM muses = iter->get_music (m);
-      for (SCM s = muses; gh_pair_p (s); s=gh_cdr (s))
-       if (Note_req* nr = dynamic_cast<Note_req*> (unsmob_music (gh_car (s))))
+      for (SCM s = muses; gh_pair_p (s); s=ly_cdr (s))
+       if (Note_req* nr = dynamic_cast<Note_req*> (unsmob_music (ly_car (s))))
          {
            ps.push (*unsmob_pitch (nr->get_mus_property ("pitch")));
          }
@@ -119,11 +119,18 @@ Auto_change_iterator::process (Moment m)
     {
       Pitch p = ps[0];
       Direction s = Direction (sign (p.steps ()));
-      if (s != where_dir_)
+      /*
+       Don't change for central C.
+
+       TODO: make this tunable somehow. Sometimes, you'd want to
+       switch for C.C. as well.
+
+      */
+      if (s && s != where_dir_)
        {
          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);   
        }
     }