]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-head.cc
Issue 4568: Check in Texinfo from upstream svn://svn.savannah.gnu.org/texinfo/trunk...
[lilypond.git] / lily / note-head.cc
index 89c0047c0f4f30ce0dfc45da774ca75e3d488fca..af516bef2b0092a708196b80da510ebf2bb35208 100644 (file)
@@ -23,7 +23,6 @@
 #include <cctype>
 #include <algorithm>            //  min, max
 
-using namespace std;
 
 #include "directional-element-interface.hh"
 #include "font-interface.hh"
@@ -33,12 +32,14 @@ using namespace std;
 #include "staff-symbol-referencer.hh"
 #include "warn.hh"
 
+using std::string;
+
 static Stencil
 internal_print (Grob *me, string *font_char)
 {
   string style = robust_symbol2string (me->get_property ("style"), "default");
 
-  string suffix = ::to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2));
+  string suffix = ::to_string (std::min (robust_scm2int (me->get_property ("duration-log"), 2), 2));
   if (style != "default")
     suffix = robust_scm2string (me->get_property ("glyph-name"), "");
 
@@ -51,7 +52,7 @@ internal_print (Grob *me, string *font_char)
   Stencil out = fm->find_by_name (idx_either + suffix);
   if (out.is_empty ())
     {
-      Grob *stem = Grob::unsmob (me->get_object ("stem"));
+      Grob *stem = unsmob<Grob> (me->get_object ("stem"));
       Direction stem_dir = stem ? get_grob_direction (stem) : CENTER;
 
       if (stem_dir == CENTER)
@@ -83,8 +84,8 @@ internal_print (Grob *me, string *font_char)
   if (style == "kievan"
       && 3 == robust_scm2int (me->get_property ("duration-log"), 2))
     {
-      Grob *stem = Grob::unsmob (me->get_object ("stem"));
-      Grob *beam = Grob::unsmob (stem->get_object ("beam"));
+      Grob *stem = unsmob<Grob> (me->get_object ("stem"));
+      Grob *beam = unsmob<Grob> (stem->get_object ("beam"));
       if (beam)
         out = fm->find_by_name (idx_either + "2kievan");
     }
@@ -109,8 +110,8 @@ MAKE_SCHEME_CALLBACK (Note_head, stem_x_shift, 1);
 SCM
 Note_head::stem_x_shift (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
-  Grob *stem = Grob::unsmob (me->get_object ("stem"));
+  Grob *me = unsmob<Grob> (smob);
+  Grob *stem = unsmob<Grob> (me->get_object ("stem"));
   if (stem)
     (void) stem->get_property ("positioning-done");
 
@@ -121,7 +122,7 @@ MAKE_SCHEME_CALLBACK (Note_head, print, 1);
 SCM
 Note_head::print (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
 
   string idx;
   return internal_print (me, &idx).smobbed_copy ();
@@ -131,7 +132,7 @@ MAKE_SCHEME_CALLBACK (Note_head, include_ledger_line_height, 1);
 SCM
 Note_head::include_ledger_line_height (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
   Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
 
   if (staff)
@@ -144,8 +145,8 @@ Note_head::include_ledger_line_height (SCM smob)
       // The +1 and -1 come from the fact that we only want to add
       // the interval between the note and the first ledger line, not
       // the whole interval between the note and the staff.
-      Interval iv (min (0.0, lines[UP] - my_ext[DOWN] + 1),
-                   max (0.0, lines[DOWN] - my_ext[UP] - 1));
+      Interval iv (std::min (0.0, lines[UP] - my_ext[DOWN] + 1),
+                   std::max (0.0, lines[DOWN] - my_ext[UP] - 1));
       return ly_interval2scm (iv);
     }
 
@@ -190,7 +191,7 @@ MAKE_SCHEME_CALLBACK (Note_head, calc_stem_attachment, 1);
 SCM
 Note_head::calc_stem_attachment (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
   Font_metric *fm = Font_interface::get_default_font (me);
   string key;
   internal_print (me, &key);
@@ -207,6 +208,7 @@ ADD_INTERFACE (Note_head,
                "duration-log "
                "note-names "
                "accidental-grob "
+               "ignore-ambitus "
                "glyph-name "
                "stem-attachment "
                "style "