]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-column.cc
* scm/output-svg.scm:
[lilypond.git] / lily / note-column.cc
index 84ac1db2dfbb5f2ca48183edafc1a0ff6b6ce8a2..a576939ae16542c0ce1769c404201a842c5554a1 100644 (file)
@@ -5,14 +5,15 @@
 
   (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
+
+#include "note-column.hh"
+
 #include <math.h>              // ceil
 
 #include "axis-group-interface.hh"
-#include "note-column.hh"
 #include "stem.hh"
 #include "warn.hh"
-#include "paper-def.hh"
-#include "group-interface.hh"
+#include "output-def.hh"
 #include "staff-symbol-referencer.hh"
 #include "rest.hh"
 #include "note-head.hh"
@@ -35,8 +36,8 @@ Note_column::shift_compare (Grob *const &p1, Grob *const&p2)
   SCM s1 = p1->get_property ("horizontal-shift");
   SCM s2 = p2->get_property ("horizontal-shift");
 
-  int h1 = (gh_number_p (s1))?  gh_scm2int (s1) :0;
-  int h2 = (gh_number_p (s2)) ? gh_scm2int (s2):0;
+  int h1 = (scm_is_number (s1))?  scm_to_int (s1) :0;
+  int h2 = (scm_is_number (s2)) ? scm_to_int (s2):0;
   return h1 - h2;
 }
 
@@ -55,11 +56,11 @@ Note_column::head_positions_interval (Grob *me)
   iv.set_empty ();
 
   SCM h = me->get_property ("note-heads");
-  for (; gh_pair_p (h); h = ly_cdr (h))
+  for (; scm_is_pair (h); h = scm_cdr (h))
     {
-      Grob *se = unsmob_grob (ly_car (h));
+      Grob *se = unsmob_grob (scm_car (h));
       
-      int j = int (Staff_symbol_referencer::get_position (se));
+      int j = Staff_symbol_referencer::get_rounded_position (se);
       iv.unite (Slice (j,j));
     }
   return iv;
@@ -71,7 +72,7 @@ Note_column::dir (Grob*  me)
   Grob *stem = unsmob_grob (me->get_property ("stem"));
   if (stem && Stem::has_interface (stem))
     return Stem::get_direction (stem);
-  else if (gh_pair_p (me->get_property ("note-heads")))
+  else if (scm_is_pair (me->get_property ("note-heads")))
     return (Direction)sign (head_positions_interval (me).center ());
 
   programming_error ("Note column without heads and stem!");
@@ -100,7 +101,7 @@ Note_column::add_head (Grob*me,Grob *h)
   bool both = false;
   if (Rest::has_interface (h))
     {
-      if (gh_pair_p (me->get_property ("note-heads")))
+      if (scm_is_pair (me->get_property ("note-heads")))
        both = true;
       else
        me->set_property ("rest", h->self_scm ());
@@ -126,7 +127,7 @@ void
 Note_column::translate_rests (Grob*me, int dy)
 {
   Grob * r = unsmob_grob (me->get_property ("rest"));
-  if (r && !gh_number_p (r->get_property ("staff-position")))
+  if (r && !scm_is_number (r->get_property ("staff-position")))
     {
       r->translate_axis (dy * Staff_symbol_referencer::staff_space (r)/2.0, Y_AXIS);
     }
@@ -158,9 +159,9 @@ Note_column::accidentals (Grob *me)
 {
   SCM heads = me->get_property ("note-heads");
   Grob * acc = 0;
-  for (;gh_pair_p (heads); heads =gh_cdr (heads))
+  for (;scm_is_pair (heads); heads = scm_cdr (heads))
     {
-      Grob * h = unsmob_grob (gh_car (heads));
+      Grob * h = unsmob_grob (scm_car (heads));
       acc = h ? unsmob_grob (h->get_property ("accidental-grob")) : 0;
       if (acc)
        break;