2 beam.hh -- part of GNU LilyPond
4 source file of the LilyPond music typesetter
6 (c) 1996--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 Jan Nieuwenhuizen <janneke@gnu.org>
13 #include "lily-proto.hh"
14 #include "lily-guile.hh"
15 #include "stem-info.hh"
21 static int visible_stem_count (Grob*);
22 static Grob* first_visible_stem (Grob*);
23 static Grob* last_visible_stem (Grob*);
24 static bool has_interface (Grob*);
25 DECLARE_SCHEME_CALLBACK (rest_collision_callback, (SCM element, SCM axis));
27 static void add_stem (Grob*,Grob*);
28 static bool knee_b (Grob*);
29 static void set_beaming (Grob*,Beaming_info_list *);
30 static void set_stemlens (Grob*);
31 static int get_beam_count (Grob*me);
32 static void position_beam (Grob* me);
33 static Real get_beam_translation (Grob*me);
34 static Real get_thickness (Grob*me);
36 static void connect_beams (Grob*me);
37 DECLARE_SCHEME_CALLBACK (space_function, (SCM, SCM));
38 DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
39 DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
40 DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
42 /* position callbacks */
43 DECLARE_SCHEME_CALLBACK (least_squares, (SCM));
44 DECLARE_SCHEME_CALLBACK (check_concave, (SCM));
45 DECLARE_SCHEME_CALLBACK (slope_damping, (SCM));
46 DECLARE_SCHEME_CALLBACK (shift_region_to_valid, (SCM));
47 DECLARE_SCHEME_CALLBACK (quanting, (SCM));
48 static Real score_slopes_dy (Real, Real, Real, Real, Real, bool);
50 static Real score_stem_lengths (Link_array<Grob> const &stems,
51 Array<Stem_info> const &stem_infos,
52 Array<Real> const &base_stem_ys,
53 Array<Real> const &stem_xs,
57 static Real score_forbidden_quants (Real, Real,
58 Real, Real, Real, Real,
59 int, Direction, Direction);
62 static int get_direction_beam_count (Grob *me, Direction d);
64 static Direction get_default_dir (Grob*);
65 static void set_stem_directions (Grob*, Direction );
66 static void consider_auto_knees (Grob*);
67 static void set_stem_shorten (Grob*);
68 static Real calc_stem_y (Grob*, Grob* s, Grob**c,
70 Interval pos, bool french);
71 static void set_stem_lengths (Grob*);
72 static int forced_stem_count (Grob*);
75 const int REGION_SIZE = 2;
77 #define DEBUG_QUANTING 1