2 beam.hh -- part of GNU LilyPond
4 (c) 1996--1999 Han-Wen Nienhuys
10 #include "lily-proto.hh"
11 #include "directional-spanner.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 damping: amount of beam slope damping. (int)
23 should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams
25 slope_quantisation: 'none, 'normal or 'traditional
28 class Beam : public Directional_spanner
32 int stem_count () const;
33 Stem* stem (int) const;
34 Stem* stem_top () const;
35 int visible_stem_count () const;
36 Stem* first_visible_stem () const;
37 Stem* last_visible_stem () const;
40 the slope of the beam in dy/dx
44 /// position of leftmost end of beam
48 void add_stem (Stem*);
49 void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
50 void set_beaming (Beaming_info_list *);
52 VIRTUAL_COPY_CONS(Score_element);
54 int get_multiplicity () const;
58 virtual void do_pre_processing ();
59 virtual void do_post_processing ();
60 virtual Molecule*do_brew_molecule_p () const;
62 Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
64 Direction calc_default_dir () const;
65 void set_stem_directions ();
67 bool auto_knee (String gap_str, bool interstaff_b);
68 void set_stem_shorten ();
69 void calc_position_and_height (Real* y, Real* dy) const;
70 bool suspect_slope_b (Real y, Real dy) const;
71 Real calc_slope_damping_f (Real dy) const;
72 Real calc_stem_y_f (Stem* s, Real y, Real dy) const;
73 Real check_stem_length_f (Real y, Real dy) const;
74 void set_stem_length (Real y, Real dy);
75 Real quantise_dy_f (Real dy) const;
76 Real quantise_y_f (Real y, Real dy, int quant_dir);
77 int forced_stem_count () const;