source file of the GNU LilyPond music typesetter
- (c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
TODO: This is way too hairy
#include "stem.hh"
-#include <cmath> // rint
+#include <math.h> // rint
#include "lookup.hh"
#include "directional-element-interface.hh"
int
Stem::head_count (Grob *me)
{
- return Pointer_group_interface::count (me, "note-heads");
+ return Pointer_group_interface::count (me, ly_symbol2scm ("note-heads"));
}
/* The note head which forms one end of the stem.
for (int i = 1; i < heads.size (); i ++)
{
Real p = Staff_symbol_referencer::get_position (heads[i]);
- Real dy =fabs (lastpos- p);
+ Real dy = fabs (lastpos- p);
/*
dy should always be 0.5, 0.0, 1.0, but provide safety margin
/*
ugh. - this dependency should be automatic.
*/
- Grob *beam= get_beam (me);
+ Grob *beam = get_beam (me);
if (beam)
{
Beam::after_line_breaking (beam->self_scm ());
}
-
SCM mol = me->get_uncached_stencil ();
Interval iv;
if (mol != SCM_EOL)
iv = unsmob_stencil (mol)->extent (a);
- if (Grob *b =get_beam (me))
+ if (Grob *b = get_beam (me))
{
Direction d = get_direction (me);
+ if (d == CENTER)
+ {
+ programming_error ("No stem direction");
+ d = UP;
+ }
iv[d] += d * Beam::get_thickness (b) * 0.5 ;
}
String font_char = flag_style
+ to_string (dir) + staffline_offs + to_string (duration_log (me));
Font_metric *fm = Font_interface::get_default_font (me);
- Stencil flag = fm->find_by_name ("flags-" + font_char);
+ Stencil flag = fm->find_by_name ("flags." + font_char);
if (flag.is_empty ())
me->warning (_f ("flag `%s' not found", font_char));
if (!stroke_style.is_empty ())
{
String font_char = to_string (dir) + stroke_style;
- Stencil stroke = fm->find_by_name ("flags-" + font_char);
+ Stencil stroke = fm->find_by_name ("flags." + font_char);
if (stroke.is_empty ())
me->warning (_f ("flag stroke `%s' not found", font_char));
else
return flag;
}
-MAKE_SCHEME_CALLBACK (Stem,dim_callback,2);
+MAKE_SCHEME_CALLBACK (Stem,width_callback,2);
SCM
-Stem::dim_callback (SCM e, SCM ax)
+Stem::width_callback (SCM e, SCM ax)
{
Axis a = (Axis) scm_to_int (ax);
assert (a == X_AXIS);
/*
move the stem to right of the notehead if it is up.
*/
-MAKE_SCHEME_CALLBACK (Stem, off_callback, 2);
+MAKE_SCHEME_CALLBACK (Stem, offset_callback, 2);
SCM
-Stem::off_callback (SCM element_smob, SCM)
+Stem::offset_callback (SCM element_smob, SCM)
{
Grob *me = unsmob_grob (element_smob);
Real r = 0.0;
Slice
Stem::beam_multiplicity (Grob *stem)
{
- SCM beaming= stem->get_property ("beaming");
+ SCM beaming = stem->get_property ("beaming");
Slice le = int_list_to_slice (scm_car (beaming));
Slice ri = int_list_to_slice (scm_cdr (beaming));
le.unite (ri);