#include <cctype>
#include <algorithm> // min, max
-using namespace std;
+using namespace std;
#include "directional-element-interface.hh"
#include "staff-symbol.hh"
{
SCM style = me->get_property ("style");
if (!scm_is_symbol (style))
+ style = ly_symbol2scm ("default");
+
+ 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"))
{
- 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));
}
-
- SCM log = scm_int2num (Note_head::get_balltype (me));
- SCM proc = me->get_property ("glyph-name-procedure");
-
- String suffix = to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2));
- if (style != ly_symbol2scm ("default")
- && 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;
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;
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;
}
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;
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");