]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/beam.hh
patch::: 1.3.11.hwn1
[lilypond.git] / lily / include / beam.hh
1 /*
2   beam.hh -- part of GNU LilyPond
3
4   (c) 1996--1999 Han-Wen Nienhuys
5 */
6
7 #ifndef BEAM_HH
8 #define BEAM_HH
9
10 #include "lily-proto.hh"
11 #include "directional-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
18
19 elt property:
20
21 damping: amount of beam slope damping. (int)
22
23 should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams 
24
25 slope_quantisation: 'none, 'normal or 'traditional
26
27 */
28 class Beam : public Directional_spanner  {
29 public:
30
31   int stem_count () const;
32   Stem* stem (int) const;
33   Stem* stem_top () const;
34   int visible_stem_count () const;
35   Stem* first_visible_stem () const;
36   Stem* last_visible_stem () const;
37
38   /**
39      the slope of the beam in (staffpositions) per (X-dimension, in PT).
40      UGH. standardise this for once and for all.
41    */
42   Real slope_f_;
43
44   /// position of leftmost end of beam  
45   Real left_y_;
46
47   /** 
48    */
49
50   Beam ();
51   void add_stem (Stem*);
52
53   void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
54   void set_beaming (Beaming_info_list *);
55   void set_stemlens ();
56   VIRTUAL_COPY_CONS(Score_element);
57   int multiplicity_i () const;
58
59 protected:
60   Offset center () const;
61   Direction get_default_dir () const;
62   void set_direction (Direction);
63   void set_stem_shorten ();
64   bool auto_knee (SCM gap, bool interstaff_b);
65   bool auto_knees ();
66   
67   virtual void do_pre_processing ();
68   virtual void do_post_processing ();
69   virtual void do_print() const;
70   virtual Molecule*do_brew_molecule_p () const;
71
72   Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
73
74 private:
75   void calculate_slope ();
76   Real check_stemlengths_f (bool set_b);
77   void solve_slope ();
78
79   void quantise_left_y (bool extend_b);
80   void quantise_dy ();
81
82 };
83
84 #endif // BEAM_HH
85