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).
47 static int visible_stem_count (Score_element*);
48 static Item* first_visible_stem (Score_element*);
49 static Item* last_visible_stem (Score_element*);
50 static bool has_interface (Score_element*);
51 static void set_interface (Score_element*);
52 static Real rest_collision_callback (Score_element *,Axis);
54 static void add_stem (Score_element*,Score_element*);
55 static void set_beaming (Score_element*,Beaming_info_list *);
56 static void set_stemlens (Score_element*);
57 static int get_multiplicity (Score_element*me);
58 static SCM brew_molecule (SCM);
59 static SCM before_line_breaking (SCM);
60 static SCM after_line_breaking (SCM);
61 static Molecule stem_beams (Score_element*,Item *here, Item *next, Item *prev);
64 static Direction get_default_dir (Score_element*);
65 static void set_stem_directions (Score_element*);
66 static void auto_knees (Score_element*);
67 static bool auto_knee (Score_element*,String gap_str, bool interstaff_b);
68 static void set_stem_shorten (Score_element*);
69 static void calc_default_position_and_height (Score_element*,Real* y, Real* dy);
70 static bool suspect_slope_b (Score_element*, Real y, Real dy);
71 static Real calc_slope_damping_f (Score_element*, Real dy);
72 static Real calc_stem_y_f (Score_element*, Item* s, Real y, Real dy);
73 static Real check_stem_length_f (Score_element*, Real y, Real dy);
74 static void set_stem_length (Score_element*, Real y, Real dy);
75 static Real quantise_dy_f (Score_element*, Real dy);
76 static Real quantise_y_f (Score_element*, Real y, Real dy, int quant_dir);
77 static int forced_stem_count (Score_element*);