]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-head.cc
* lily/tie-column.cc (new_directions): put Tie down on center
[lilypond.git] / lily / note-head.cc
index b2e451e54c977619553a43198e10fb79cb8e21ca..fd7efe124f474765a186de7a150a620826c83b47 100644 (file)
@@ -12,7 +12,7 @@
 #include <cctype>
 #include <algorithm>           //  min, max
 
-using namespace std; 
+using namespace std;
 
 #include "directional-element-interface.hh"
 #include "staff-symbol.hh"
@@ -34,18 +34,16 @@ internal_print (Grob *me, String *font_char)
 {
   SCM style = me->get_property ("style");
   if (!scm_is_symbol (style))
-    {
-      style = ly_symbol2scm ("default");
-    }
+    style = ly_symbol2scm ("default");
 
-  SCM log = scm_int2num (Note_head::get_balltype (me));
-  String suffix =  to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2));
+  SCM log = scm_from_int (Note_head::get_balltype (me));
+  String suffix = to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2));
   if (style != ly_symbol2scm ("default"))
     {
       SCM proc = me->get_property ("glyph-name-procedure");
       if (ly_is_procedure (proc))
        suffix = ly_scm2string (scm_call_2 (proc, log, style));
-    }  
+    }
   Font_metric *fm = Font_interface::get_default_font (me);
 
   String idx = "noteheads.s" + suffix;
@@ -56,7 +54,7 @@ internal_print (Grob *me, String *font_char)
       String prefix = "noteheads.";
       Grob *stem = unsmob_grob (me->get_object ("stem"));
       Direction stem_dir = stem ? get_grob_direction (stem) : CENTER;
-      
+
       if (stem_dir == CENTER)
        programming_error ("must have stem dir for note head");
       String idx = prefix + ((stem_dir == UP) ? "u" : "d") + suffix;
@@ -66,11 +64,10 @@ internal_print (Grob *me, String *font_char)
   if (out.is_empty ())
     {
       me->warning (_f ("note head `%s' not found", idx.to_str0 ()));
+      out = Stencil (Box (Interval (0, 0), Interval (0, 0)), SCM_EOL);
     }
   else
-    {
-      *font_char = idx;
-    }
+    *font_char = idx;
 
   return out;
 }
@@ -114,7 +111,7 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a)
   if (!ly_is_procedure (v))
     return 0.0;
 
-  SCM result = scm_call_2 (v, me->self_scm (), scm_int2num (a));
+  SCM result = scm_call_2 (v, me->self_scm (), scm_from_int (a));
   if (!scm_is_pair (result))
     return 0.0;
 
@@ -132,5 +129,11 @@ Note_head::get_balltype (Grob *me)
 
 ADD_INTERFACE (Note_head, "note-head-interface",
               "Note head",
-              "note-names glyph-name-procedure accidental-grob style stem-attachment-function");
+
+              /* properties */
+              "note-names "
+              "glyph-name-procedure "
+              "accidental-grob "
+              "style "
+              "stem-attachment-function");