]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-head.cc
new file, move from
[lilypond.git] / lily / note-head.cc
index 0ec06d5686e148f4bc18fac4e483afa32b48db5c..dfe20fbf5262266d1420b7e7b14ae9c92ef5bdad 100644 (file)
@@ -19,7 +19,7 @@
 #include "rhythmic-head.hh"
 #include "staff-symbol-referencer.hh"
 #include "lookup.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 
 /*
   Note_head contains the code for printing note heads.
@@ -72,12 +72,10 @@ Note_head::brew_ledger_lines (Grob *me,
 {
   Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
   Real inter_f = Staff_symbol_referencer::staff_space (me)/2;
-  int line_count = (abs (pos) < interspaces)
-    ? 0
-    : (abs (pos) - interspaces) / 2;
-  Stencil stencil = Stencil ();
-
-
+  int line_count = ((abs (pos) < interspaces)
+                   ? 0
+                   : (abs (pos) - interspaces) / 2);
+  Stencil stencil;
   if (line_count)
     {
       Real ledgerlinethickness =
@@ -122,12 +120,12 @@ Stencil
 internal_print (Grob *me, bool with_ledgers)
 {
   SCM style  = me->get_property ("style");
-  if (!gh_symbol_p (style))
+  if (!ly_c_symbol_p (style))
     {
       return Stencil ();
     }
 
-  SCM log = gh_int2scm (Note_head::get_balltype (me));
+  SCM log = scm_int2num (Note_head::get_balltype (me));
   SCM proc = me->get_property ("glyph-name-procedure");
   SCM scm_font_char = scm_call_2 (proc, log, style);
   String font_char = "noteheads-" + ly_scm2string (scm_font_char);
@@ -232,7 +230,7 @@ Note_head::extent (SCM smob, SCM axis)
 {
   Grob *me = unsmob_grob (smob);
 
-  return ly_interval2scm (head_extent (me, (Axis) gh_scm2int (axis)));
+  return ly_interval2scm (head_extent (me, (Axis) ly_scm2int (axis)));
 }
 
 MAKE_SCHEME_CALLBACK (Note_head,brew_ez_stencil,1);
@@ -248,10 +246,10 @@ Note_head::brew_ez_stencil (SCM smob)
   SCM spitch = unsmob_music (cause)->get_property ("pitch");
   Pitch* pit =  unsmob_pitch (spitch);
 
-  SCM idx = gh_int2scm (pit->get_notename ());
+  SCM idx = scm_int2num (pit->get_notename ());
   SCM names = me->get_property ("note-names");
   SCM charstr = SCM_EOL;
-  if (gh_vector_p (names))
+  if (ly_c_vector_p (names))
     charstr = scm_vector_ref (names, idx);
   else
     {
@@ -263,8 +261,8 @@ Note_head::brew_ez_stencil (SCM smob)
   
   SCM at = scm_list_n (ly_symbol2scm ("ez-ball"),
                       charstr,
-                      gh_int2scm (b),
-                      gh_int2scm (1-b),
+                      scm_int2num (b),
+                      scm_int2num (1-b),
                       SCM_UNDEFINED);
   Box bx (Interval (0, 1.0), Interval (-0.5, 0.5));
   Stencil m (bx, at);
@@ -291,12 +289,12 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a)
   if (brewer == Note_head::print_proc)
     {
       SCM style  = me->get_property ("style");
-      if (!gh_symbol_p (style))
+      if (!ly_c_symbol_p (style))
        {
          return 0.0;
        }
       
-      SCM log = gh_int2scm (Note_head::get_balltype (me));
+      SCM log = scm_int2num (Note_head::get_balltype (me));
       SCM proc = me->get_property ("glyph-name-procedure");
       SCM scm_font_char = scm_call_2 (proc, log, style);
       String font_char = "noteheads-" + ly_scm2string (scm_font_char);
@@ -317,11 +315,11 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a)
     Fallback
    */
   SCM v = me->get_property ("stem-attachment-function");
-  if (!gh_procedure_p (v))
+  if (!ly_c_procedure_p (v))
     return 0.0;
   
-  SCM result = scm_call_2 (v, me->self_scm (), gh_int2scm (a));
-  if (!gh_pair_p (result))
+  SCM result = scm_call_2 (v, me->self_scm (), scm_int2num (a));
+  if (!ly_c_pair_p (result))
     return 0.0;
 
   result = (a == X_AXIS) ? ly_car (result) : ly_cdr (result);
@@ -333,7 +331,7 @@ int
 Note_head::get_balltype (Grob*me) 
 {
   SCM s = me->get_property ("duration-log");
-  return gh_number_p (s) ? gh_scm2int (s) <? 2 : 0;
+  return ly_c_number_p (s) ? ly_scm2int (s) <? 2 : 0;
 }
 
 ADD_INTERFACE (Note_head,"note-head-interface",