]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-head.cc
* input/regression/hairpin-dashed.ly: new file.
[lilypond.git] / lily / note-head.cc
index 16c58ebaea15aa1137b235a6ea3dc07e50862290..4c291ae32d9c107f799ada95b4daa30724799c13 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 #include <math.h>
 #include <ctype.h>
@@ -14,7 +14,7 @@
 #include "warn.hh"
 #include "font-interface.hh"
 #include "molecule.hh"
-#include "musical-request.hh"
+#include "event.hh"
 #include "rhythmic-head.hh"
 #include "staff-symbol-referencer.hh"
 #include "lookup.hh"
 
 */
 
+/*
+  TODO: ledger lines are also a property of the staff. Maybe move them
+  to there?
+ */
 Molecule
 Note_head::brew_ledger_lines (Grob *me,
                               int pos,
@@ -73,16 +77,16 @@ Note_head::brew_ledger_lines (Grob *me,
   if (lines_i)
     {
       Real ledgerlinethickness =
-       (me->get_paper ()->get_var ("ledgerlinethickness"));
+       (me->get_paper ()->get_realvar (ly_symbol2scm ("ledgerlinethickness")));
       Real blotdiameter = ledgerlinethickness;
-      //       (me->get_paper ()->get_var ("blotdiameter"));
+      //       (me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter")));
       Interval y_extent =
        Interval (-0.5*(ledgerlinethickness),
                  +0.5*(ledgerlinethickness));
       Box ledger_line (x_extent, y_extent);
 
       Molecule proto_ledger_line =
-       Lookup::roundfilledbox (ledger_line, blotdiameter);
+       Lookup::round_filled_box (ledger_line, blotdiameter);
       
       if (!take_space)
         proto_ledger_line.set_empty (true);
@@ -108,19 +112,12 @@ internal_brew_molecule (Grob *me, bool ledger_take_space)
   SCM style  = me->get_grob_property ("style");
   if (!gh_symbol_p (style))
     {
-      return Molecule();
+      return Molecule ();
     }
 
-  /*
-    ugh: use gh_call () / scm_apply ().
-
-    UGH: use grob-property.
-  */
   SCM log = gh_int2scm (Note_head::get_balltype (me));
-  SCM exp = scm_list_n (ly_symbol2scm ("find-notehead-symbol"), log,
-                       ly_quote_scm (style),
-                       SCM_UNDEFINED);
-  SCM scm_font_char = scm_primitive_eval (exp);
+  SCM proc = me->get_grob_property ("glyph-name-procedure");
+  SCM scm_font_char = scm_call_2 (proc, log, style);
   String font_char = "noteheads-" + ly_scm2string (scm_font_char);
 
   Font_metric * fm = Font_interface::get_default_font (me);
@@ -203,7 +200,7 @@ Note_head::brew_ez_molecule (SCM smob)
   Pitch* pit =  unsmob_pitch (spitch);
 
   char s[2] = "a";
-  s[0] = (pit->notename_ + 2)%7 + 'a';
+  s[0] = (pit->get_notename () + 2)%7 + 'a';
   s[0] = toupper (s[0]);
   
   SCM charstr = scm_makfrom0str (s);
@@ -259,5 +256,5 @@ Note_head::get_balltype (Grob*me)
 
 ADD_INTERFACE (Note_head,"note-head-interface",
   "Note head",
-  "accidental-grob style stem-attachment-function");
+  "glyph-name-procedure accidental-grob style stem-attachment-function");