]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/easy-notation.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / easy-notation.cc
index 80ebdca8130bbb579347d9d6e7d99534945d0525..fde65143457560b00f1c4325401cd13f23d558f1 100644 (file)
@@ -3,13 +3,15 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
+  (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "note-head.hh"
 
-#include "text-item.hh"
+#include <cctype>
+using namespace std;
+
+#include "text-interface.hh"
 #include "grob.hh"
 #include "output-def.hh"
 #include "music.hh"
 #include "staff-symbol-referencer.hh"
 #include "stem.hh"
 
+/*
+
+TODO: move to scheme
+
+*/
 MAKE_SCHEME_CALLBACK (Note_head, brew_ez_stencil, 1);
 SCM
 Note_head::brew_ez_stencil (SCM smob)
@@ -29,7 +36,7 @@ Note_head::brew_ez_stencil (SCM smob)
   SCM spitch = unsmob_music (cause)->get_property ("pitch");
   Pitch *pit = unsmob_pitch (spitch);
 
-  SCM idx = scm_int2num (pit->get_notename ());
+  SCM idx = scm_from_int (pit->get_notename ());
   SCM names = me->get_property ("note-names");
   SCM charstr = SCM_EOL;
   if (scm_is_vector (names))
@@ -42,34 +49,30 @@ Note_head::brew_ez_stencil (SCM smob)
       charstr = scm_makfrom0str (s);
     }
 
-  
   SCM letter
-    = Text_interface::interpret_string (me->get_layout()->self_scm (),
+    = Text_interface::interpret_string (me->layout ()->self_scm (),
                                        Font_interface::text_font_alist_chain (me),
                                        charstr);
-  
+
   Stencil l (*unsmob_stencil (letter));
   l.align_to (X_AXIS, CENTER);
   l.align_to (Y_AXIS, CENTER);
 
-  
-  l = Stencil (Box (), l.expr ()); 
+  l = Stencil (Box (), l.expr ());
   Real ss = Staff_symbol_referencer::staff_space (me);
   Real lt = Staff_symbol_referencer::line_thickness (me);
 
   Real radius = (ss + lt) / 2.0;
-  Real stem_thick = 1.3 * lt; 
-  if (Grob *stem = unsmob_grob (me->get_property ("stem")))
-    {
-      stem_thick = Stem::thickness (stem);
-    }
+  Real stem_thick = 1.3 * lt;
+  if (Grob *stem = unsmob_grob (me->get_object ("stem")))
+    stem_thick = Stem::thickness (stem);
 
   int black = (log >= 2);
 
   Stencil head;
   Box extent (Interval (-radius, radius),
              Interval (-radius, radius));
-             
+
   Stencil black_head (extent,
                      scm_list_4 (ly_symbol2scm ("circle"),
                                  scm_from_double (radius),
@@ -77,20 +80,17 @@ Note_head::brew_ez_stencil (SCM smob)
                                  SCM_BOOL_T));
   Stencil white_head;
   if (black)
-    {
-      l = l.in_color (1, 1, 1); 
-    }
+    l = l.in_color (1, 1, 1);
   else
     {
       white_head = Stencil (extent,
                            scm_list_4 (ly_symbol2scm ("circle"),
-                              scm_from_double (radius - stem_thick),
-                              scm_from_double (0.0),
-                              SCM_BOOL_T));
+                                       scm_from_double (radius - stem_thick),
+                                       scm_from_double (0.0),
+                                       SCM_BOOL_T));
 
       white_head = white_head.in_color (1, 1, 1);
     }
-    
 
   Stencil total;
   total.add_stencil (l);