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)
29 flag-width-function --
31 damping -- amount of beam slope damping. (int)
32 should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams
34 default-neutral-direction -- which direction to choose if we're in
35 the middle of the staff
37 thickness -- weight of beams, in staffspace
39 space-function -- function of type multiplicity -> real (in staffspace)
41 beamed-stem-shorten --
45 vertical-position-quant-function --
49 damping -- damping factor (real).
51 outer-stem-length-limit -- catch suspect beam slopes, set slope to zero if
52 outer stem is lengthened more than this (in staffspace)
54 slope-limit -- set slope to zero if slope is running away steeper than this.
59 static int visible_stem_count (Score_element*);
60 static Item* first_visible_stem (Score_element*);
61 static Item* last_visible_stem (Score_element*);
62 static bool has_interface (Score_element*);
63 static void set_interface (Score_element*);
64 static Real rest_collision_callback (Score_element *,Axis);
66 static void add_stem (Score_element*,Score_element*);
67 static void set_beaming (Score_element*,Beaming_info_list *);
68 static void set_stemlens (Score_element*);
69 static int get_multiplicity (Score_element*me);
70 static SCM brew_molecule (SCM);
71 static SCM before_line_breaking (SCM);
72 static SCM after_line_breaking (SCM);
73 static Molecule stem_beams (Score_element*,Item *here, Item *next, Item *prev);
76 static Direction get_default_dir (Score_element*);
77 static void set_stem_directions (Score_element*);
78 static void auto_knees (Score_element*);
79 static bool auto_knee (Score_element*,String gap_str, bool interstaff_b);
80 static void set_stem_shorten (Score_element*);
81 static void calc_default_position_and_height (Score_element*,Real* y, Real* dy);
82 static bool suspect_slope_b (Score_element*, Real y, Real dy);
83 static Real calc_slope_damping_f (Score_element*, Real dy);
84 static Real calc_stem_y_f (Score_element*, Item* s, Real y, Real dy);
85 static Real check_stem_length_f (Score_element*, Real y, Real dy);
86 static void set_stem_length (Score_element*, Real y, Real dy);
87 static Real quantise_dy_f (Score_element*, Real dy);
88 static Real quantise_y_f (Score_element*, Real y, Real dy, int quant_dir);
89 static int forced_stem_count (Score_element*);