2 beam.hh -- part of GNU LilyPond
4 source file of the LilyPond music typesetter
6 (c) 1996--2005 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"
20 static int visible_stem_count (Grob *);
21 static Grob *first_visible_stem (Grob *);
22 static Grob *last_visible_stem (Grob *);
23 static bool has_interface (Grob *);
24 DECLARE_SCHEME_CALLBACK (rest_collision_callback, (SCM element, SCM axis));
26 static void add_stem (Grob *, Grob *);
27 static bool is_knee (Grob *);
28 static void set_beaming (Grob *, Beaming_info_list *);
29 static void set_stemlens (Grob *);
30 static int get_beam_count (Grob *me);
31 static void position_beam (Grob *me);
32 static Real get_beam_translation (Grob *me);
33 static Real get_thickness (Grob *me);
35 static void connect_beams (Grob *me);
36 DECLARE_SCHEME_CALLBACK (space_function, (SCM, SCM));
37 DECLARE_SCHEME_CALLBACK (print, (SCM));
38 DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
39 DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
41 /* position callbacks */
42 DECLARE_SCHEME_CALLBACK (least_squares, (SCM));
43 DECLARE_SCHEME_CALLBACK (check_concave, (SCM));
44 DECLARE_SCHEME_CALLBACK (slope_damping, (SCM));
45 DECLARE_SCHEME_CALLBACK (shift_region_to_valid, (SCM));
46 DECLARE_SCHEME_CALLBACK (quanting, (SCM));
47 static Real score_slopes_dy (Real, Real, Real, Real, Real, bool);
49 static Real score_stem_lengths (Link_array<Grob> const &stems,
50 Array<Stem_info> const &stem_infos,
51 Array<Real> const &base_stem_ys,
52 Array<Real> const &stem_xs,
56 static Real score_forbidden_quants (Real, Real,
57 Real, Real, Real, Real,
58 Drul_array<int>, Direction, Direction);
60 static int get_direction_beam_count (Grob *me, Direction d);
62 static Direction get_default_dir (Grob *);
63 static void set_stem_directions (Grob *, Direction);
64 static void consider_auto_knees (Grob *);
65 static void set_stem_shorten (Grob *);
66 static Real calc_stem_y (Grob *, Grob *s, Grob **c,
68 Drul_array<Real> pos, bool french);
69 static void set_stem_lengths (Grob *);
70 static int forced_stem_count (Grob *);
73 const int REGION_SIZE = 2;
76 #define DEBUG_QUANTING 1