]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/translator-group.cc
Issue 4296: Let \displayLilyMusic print even repeated durations
[lilypond.git] / lily / translator-group.cc
index a1139fe30e2556de0922ae0839a4237d84e5ddeb..5a5b5695f018a5539a3d434f3739e90b2ec02ae2 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>,
+  Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>,
                  Erik Sandberg <mandolaerik@gmail.com>
 
   LilyPond is free software: you can redistribute it and/or modify
@@ -101,7 +101,7 @@ filter_performers (SCM ell)
   SCM *tail = &ell;
   for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p))
     {
-      if (Performer::unsmob (scm_car (*tail)))
+      if (Performer::is_smob (scm_car (*tail)))
         *tail = scm_cdr (*tail);
       else
         tail = SCM_CDRLOC (*tail);
@@ -115,7 +115,7 @@ filter_engravers (SCM ell)
   SCM *tail = &ell;
   for (SCM p = ell; scm_is_pair (p); p = scm_cdr (p))
     {
-      if (Engraver::unsmob (scm_car (*tail)))
+      if (Engraver::is_smob (scm_car (*tail)))
         *tail = scm_cdr (*tail);
       else
         tail = SCM_CDRLOC (*tail);
@@ -226,7 +226,7 @@ Translator_group::create_child_translator (SCM sev)
   recurse_over_translators (new_context,
                             &Translator::initialize,
                             &Translator_group::initialize,
-                            START);
+                            DOWN);
 }
 
 SCM
@@ -241,7 +241,7 @@ precomputed_recurse_over_translators (Context *c, Translator_precompute_index id
   Translator_group *tg
     = dynamic_cast<Translator_group *> (c->implementation ());
 
-  if (tg && dir == START)
+  if (tg && dir == DOWN)
     {
       tg->precomputed_translator_foreach (idx);
       tg->call_precomputed_self_method (idx);
@@ -251,7 +251,7 @@ precomputed_recurse_over_translators (Context *c, Translator_precompute_index id
        s = scm_cdr (s))
     precomputed_recurse_over_translators (Context::unsmob (scm_car (s)), idx, dir);
 
-  if (tg && dir == STOP)
+  if (tg && dir == UP)
     {
       tg->precomputed_translator_foreach (idx);
       tg->call_precomputed_self_method (idx);
@@ -265,7 +265,7 @@ recurse_over_translators (Context *c, Translator_method ptr,
   Translator_group *tg
     = dynamic_cast<Translator_group *> (c->implementation ());
 
-  if (tg && dir == START)
+  if (tg && dir == DOWN)
     {
       (tg->*tg_ptr) ();
       translator_each (tg->get_simple_trans_list (), ptr);
@@ -275,7 +275,7 @@ recurse_over_translators (Context *c, Translator_method ptr,
        s = scm_cdr (s))
     recurse_over_translators (Context::unsmob (scm_car (s)), ptr, tg_ptr, dir);
 
-  if (tg && dir == STOP)
+  if (tg && dir == UP)
     {
       translator_each (tg->get_simple_trans_list (),
                        ptr);
@@ -347,22 +347,19 @@ Translator_group::~Translator_group ()
 const char Translator_group::type_p_name_[] = "ly:translator-group?";
 
 int
-Translator_group::print_smob (SCM s, SCM port, scm_print_state *)
+Translator_group::print_smob (SCM port, scm_print_state *)
 {
-  Translator_group *me = (Translator_group *) SCM_CELL_WORD_1 (s);
   scm_puts ("#<Translator_group ", port);
-  scm_puts (me->class_name (), port);
-  scm_display (me->simple_trans_list_, port);
+  scm_puts (class_name (), port);
+  scm_display (simple_trans_list_, port);
   scm_puts (" >", port);
   return 1;
 }
 
 SCM
-Translator_group::mark_smob (SCM smob)
+Translator_group::mark_smob ()
 {
-  Translator_group *me = (Translator_group *)SCM_CELL_WORD_1 (smob);
-
-  me->derived_mark ();
-  scm_gc_mark (me->protected_events_);
-  return me->simple_trans_list_;
+  derived_mark ();
+  scm_gc_mark (protected_events_);
+  return simple_trans_list_;
 }