]> git.donarmstrong.com Git - lilypond.git/blob - hdr/beam.hh
release: 0.0.21
[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     Rhythmic_grouping *group;
22
23     /****************/
24     
25     virtual Interval width()const;    
26     Offset center() const;
27     Spanner *do_break_at(PCol *,  PCol *) const;
28     Beam();
29     void add(Stem*);
30     
31
32     void set_default_dir();
33     void do_pre_processing();
34     void do_post_processing();
35
36     void print() const;
37     void set_grouping(Rhythmic_grouping def, Rhythmic_grouping current);
38     void set_stemlens();
39     ~Beam();
40
41 private:
42     Molecule stem_beams(Stem *here, Stem *next, Stem *prev)const;
43     void solve_slope();
44     Molecule*brew_molecule()const;
45 };
46 /** Beam adjusts the stems its owns to make sure that they reach the
47   beam and that point in the correct direction */
48
49 #endif // BEAM_HH
50