]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/beam.hh
release: 1.3.68
[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    y-position: real  (position of left edge)
21    height: real  (dy)
22
23    damping: amount of beam slope damping. (int)
24    should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams 
25 */
26 class Beam : public Spanner
27 {
28 public:
29   static SCM brew_molecule (SCM);
30   
31
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;
38   static Real rest_collision_callback (Score_element *,Axis);
39   Beam (SCM);
40   void add_stem (Stem*);
41   void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
42   void set_beaming (Beaming_info_list *);
43   void set_stemlens ();
44   VIRTUAL_COPY_CONS(Score_element);
45
46   int get_multiplicity () const;
47
48 public:
49  
50   SCM member_before_line_breaking ();
51   static SCM before_line_breaking (SCM);
52   SCM member_after_line_breaking ();
53   static SCM after_line_breaking (SCM);
54   SCM member_brew_molecule () const;
55
56   Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
57 private:
58   Direction get_default_dir () const;
59   void set_stem_directions ();
60   void auto_knees ();
61   bool auto_knee (String gap_str, bool interstaff_b);
62   void set_stem_shorten ();
63   void calc_default_position_and_height (Real* y, Real* dy) const;
64   bool suspect_slope_b (Real y, Real dy) const;
65   Real calc_slope_damping_f (Real dy) const;
66   Real calc_stem_y_f (Stem* s, Real y, Real dy) const;
67   Real check_stem_length_f (Real y, Real dy) const;
68   void set_stem_length (Real y, Real dy);
69   Real quantise_dy_f (Real dy) const;
70   Real quantise_y_f (Real y, Real dy, int quant_dir);
71   int forced_stem_count () const;
72 };
73
74 #endif // BEAM_HH
75