2 beam.hh -- part of GNU LilyPond
4 (c) 1996--2000 Han-Wen Nienhuys
10 #include "lily-proto.hh"
11 #include "lily-guile.hh"
14 /** a beam connects multiple stems.
16 Beam adjusts the stems its owns to make sure that they reach the
17 beam and that point in the correct direction (urg?)
21 y-position -- real (position of left edge)
25 damping -- amount of beam slope damping. (int)
26 should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams
31 beam-thickness -- weight of beams, in staffspace
33 beam-space-function -- function of type multiplicity -> real (in staffspace)
35 default-neutral-direction -- which direction to choose if we're in
36 the middle of the staff
38 after-line-breaking-callback --
40 damping -- damping factor (real).
42 outer-stem-length-limit -- catch suspect beam slopes, set slope to zero if
43 outer stem is lengthened more than this (in staffspace)
45 slope-limit -- set slope to zero if slope is running away steeper than this.
51 static int visible_stem_count (Score_element*);
52 static Item* first_visible_stem (Score_element*);
53 static Item* last_visible_stem (Score_element*);
54 static bool has_interface (Score_element*);
55 static void set_interface (Score_element*);
56 static Real rest_collision_callback (Score_element *,Axis);
58 static void add_stem (Score_element*,Score_element*);
59 static void set_beaming (Score_element*,Beaming_info_list *);
60 static void set_stemlens (Score_element*);
61 static int get_multiplicity (Score_element*me);
62 static SCM brew_molecule (SCM);
63 static SCM before_line_breaking (SCM);
64 static SCM after_line_breaking (SCM);
65 static Molecule stem_beams (Score_element*,Item *here, Item *next, Item *prev);
68 static Direction get_default_dir (Score_element*);
69 static void set_stem_directions (Score_element*);
70 static void auto_knees (Score_element*);
71 static bool auto_knee (Score_element*,String gap_str, bool interstaff_b);
72 static void set_stem_shorten (Score_element*);
73 static void calc_default_position_and_height (Score_element*,Real* y, Real* dy);
74 static bool suspect_slope_b (Score_element*, Real y, Real dy);
75 static Real calc_slope_damping_f (Score_element*, Real dy);
76 static Real calc_stem_y_f (Score_element*, Item* s, Real y, Real dy);
77 static Real check_stem_length_f (Score_element*, Real y, Real dy);
78 static void set_stem_length (Score_element*, Real y, Real dy);
79 static Real quantise_dy_f (Score_element*, Real dy);
80 static Real quantise_y_f (Score_element*, Real y, Real dy, int quant_dir);
81 static int forced_stem_count (Score_element*);