]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/rest-collision.cc
* mf/merge.pe.in: Set font names, version, license GPL.
[lilypond.git] / lily / rest-collision.cc
index 992b12b0e56dd4c59863099206cc5055dd6c1c59..02d1f4e7d7a7a7775d316588c12beaf86337adc5 100644 (file)
@@ -6,10 +6,11 @@
   (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "rest-collision.hh"
+
 #include <math.h>              // ceil.
 
 #include "warn.hh"
-#include "rest-collision.hh"
 #include "note-column.hh"
 #include "stem.hh"
 #include "rhythmic-head.hh"
@@ -25,7 +26,7 @@ SCM
 Rest_collision::force_shift_callback (SCM element_smob, SCM axis)
 {
   Grob *them = unsmob_grob (element_smob);
-  Axis a = (Axis) ly_scm2int (axis);
+  Axis a = (Axis) scm_to_int (axis);
   assert (a == Y_AXIS);
 
   if (Note_column::has_rests (them))
@@ -60,20 +61,6 @@ Rest_collision::add_column (Grob*me,Grob *p)
 }
 
 
-/*
-  Combination of dot-count and duration-log.
- */
-static SCM
-head_characteristic (Grob * col)
-{
-  Grob * s = unsmob_grob (col->get_property ("rest"));
-
-  if (!s)
-    return SCM_BOOL_F;
-  else
-    return scm_cons (s->get_property ("duration-log"),
-                   scm_int2num (Rhythmic_head::dot_count (s)));
-}
 
 /*
   TODO: look at horizontal-shift to determine ordering between rests
@@ -88,9 +75,9 @@ Rest_collision::do_shift (Grob *me)
   Link_array<Grob> rests;
   Link_array<Grob> notes;
 
-  for (SCM s = elts; ly_c_pair_p (s); s = ly_cdr (s))
+  for (SCM s = elts; scm_is_pair (s); s = scm_cdr (s))
     {
-      Grob * e = unsmob_grob (ly_car (s));
+      Grob * e = unsmob_grob (scm_car (s));
       if (unsmob_grob (e->get_property ("rest")))
        {
          /*
@@ -133,7 +120,7 @@ Rest_collision::do_shift (Grob *me)
        center one should be centered on the staff.
        */
       Drul_array< Link_array <Grob > > ordered_rests;
-      for (int i= 0; i < rests.size (); i++)
+      for (int i = 0; i < rests.size (); i++)
        {
          Grob * r = Note_column::get_rest (rests[i]);
          
@@ -155,7 +142,7 @@ Rest_collision::do_shift (Grob *me)
        if (ordered_rests[d].size () < 1)
          {
            if (ordered_rests[-d].size() > 1)
-             ordered_rests[-d][0]->warning (_("Too many colliding rests."));
+             ordered_rests[-d][0]->warning (_ ("too many colliding rests"));
          
            return SCM_UNSPECIFIED;
          }
@@ -203,7 +190,7 @@ Rest_collision::do_shift (Grob *me)
       Grob * rcol = 0;
       Direction dir = CENTER;
 
-      for (int i= rests.size (); !rcol && i--;)
+      for (int i = rests.size (); !rcol && i--;)
        if (Note_column::dir (rests[i]))
          {
            dir = Note_column::dir (rests[i]);