]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/beam.hh
release: 1.3.69
[lilypond.git] / lily / include / beam.hh
1 /*
2   beam.hh -- part of GNU LilyPond
3
4   (c) 1996--2000 Han-Wen Nienhuys
5 */
6
7 #ifndef BEAM_HH
8 #define BEAM_HH
9
10 #include "lily-proto.hh"
11 #include "spanner.hh"
12
13
14 /** a beam connects multiple stems.
15
16   Beam adjusts the stems its owns to make sure that they reach the
17   beam and that point in the correct direction (urg?)
18
19    elt_properties:
20    
21    y-position -- real  (position of left edge)
22
23    height -- real  (dy)
24
25    damping -- amount of beam slope damping. (int)
26    should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams 
27 */
28 class Beam : public Spanner
29 {
30 public:
31
32
33   int visible_stem_count () const;
34   Item* first_visible_stem () const;
35   Item* last_visible_stem () const;
36   static Real rest_collision_callback (Score_element *,Axis);
37   Beam (SCM);
38   void add_stem (Score_element*);
39   void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
40   void set_beaming (Beaming_info_list *);
41   void set_stemlens ();
42   VIRTUAL_COPY_CONS(Score_element);
43
44   int get_multiplicity () const;
45
46   static SCM brew_molecule (SCM);
47   static SCM before_line_breaking (SCM);
48   static SCM after_line_breaking (SCM);
49
50   Molecule stem_beams (Item *here, Item *next, Item *prev) const;
51 private:
52   Direction get_default_dir () const;
53   void set_stem_directions ();
54   void auto_knees ();
55   bool auto_knee (String gap_str, bool interstaff_b);
56   void set_stem_shorten ();
57   void calc_default_position_and_height (Real* y, Real* dy) const;
58   bool suspect_slope_b (Real y, Real dy) const;
59   Real calc_slope_damping_f (Real dy) const;
60   Real calc_stem_y_f (Item* s, Real y, Real dy) const;
61   Real check_stem_length_f (Real y, Real dy) const;
62   void set_stem_length (Real y, Real dy);
63   Real quantise_dy_f (Real dy) const;
64   Real quantise_y_f (Real y, Real dy, int quant_dir);
65   int forced_stem_count () const;
66 };
67
68 #endif // BEAM_HH
69