]> git.donarmstrong.com Git - lilypond.git/blob - hdr/beam.hh
release: 0.0.22
[lilypond.git] / hdr / beam.hh
1 /*
2   beam.hh -- part of LilyPond
3
4   (c) 1996 Han-Wen Nienhuys
5 */
6
7 #ifndef BEAM_HH
8 #define BEAM_HH
9 #include "proto.hh"
10 #include "directionalspanner.hh"
11 #include "plist.hh"
12
13 /// a beam connects multiple stems 
14 struct Beam:  public Directional_spanner {
15     PointerList<Stem*> stems;
16     Real slope;
17     Real left_pos;
18     /// dir: -1 below heads, +1 above heads.
19
20     /****************/
21     
22     virtual Interval width()const;    
23     Offset center() const;
24     Spanner *do_break_at(PCol *,  PCol *) const;
25     Beam();
26     void add(Stem*);
27     
28
29     void set_default_dir();
30     void do_pre_processing();
31     void do_post_processing();
32
33     void print() const;
34     void set_grouping(Rhythmic_grouping def, Rhythmic_grouping current);
35     void set_stemlens();
36     ~Beam();
37
38 private:
39     Molecule stem_beams(Stem *here, Stem *next, Stem *prev)const;
40     void solve_slope();
41     Molecule*brew_molecule()const;
42 };
43 /** Beam adjusts the stems its owns to make sure that they reach the
44   beam and that point in the correct direction */
45
46 #endif // BEAM_HH
47