]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/music-iterator.cc
* lily/text-item.cc (interpret_string): new file, select font with
[lilypond.git] / lily / music-iterator.cc
index 9af76a408fd147925d7ca58c9c64a1521f895f79..ce0bf4140e8b0a00b9a78b1ede73431d5fac55a4 100644 (file)
@@ -78,9 +78,9 @@ Music_iterator::get_static_get_iterator (Music *m)
 
   SCM ctor = m->get_property ("iterator-ctor") ;
   SCM iter = SCM_EOL;
-  if (gh_procedure_p (ctor))
+  if (is_procedure (ctor))
     {
-      iter = gh_call0 (ctor);
+      iter = scm_call_0 (ctor);
       p = unsmob_iterator (iter);
     }
   else
@@ -98,6 +98,7 @@ Music_iterator::get_static_get_iterator (Music *m)
   assert (m);
   p->music_length_ = m->get_length ();
   p->start_mom_ = m->start_mom ();
+  
   return iter;
 }
 
@@ -149,7 +150,7 @@ Music_iterator::get_iterator (Music *m) const
 }
 
 /*
-  TODO: rename to prevent confusion between Translator::try_music and
+  TODO: rename to prevent confusion between Context::try_music and
   Iterator::try_music
   
  */
@@ -235,3 +236,27 @@ Music_iterator::run_always ()const
 {
   return false;
 }
+
+
+bool
+is_child_context (Context *me, Context *child)
+{
+  while (child && child != me)
+    {
+      child = child->daddy_context_;
+    }
+  
+  return child == me;
+}
+
+/*
+  move to context of child iterator if it is deeper down in the
+  hierarchy.
+  */
+void
+Music_iterator::descend_to_child (Context * child_report)
+{
+  Context * me_report = get_outlet ();
+  if (is_child_context (me_report, child_report))
+    set_translator (child_report);
+}