]> git.donarmstrong.com Git - lilypond.git/blob - hdr/beam.hh
be2cb8f94c01e1d6e79a6a5f683b963258ce7e3a
[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 "spanner.hh"
11 #include "plist.hh"
12
13 /// a beam connects multiple stems 
14 struct Beam: public Spanner {
15     PointerList<Stem*> stems;
16     Real slope;
17     Real left_pos;
18     /// -1 below heads, +1 above heads.
19     int dir;   
20
21     /****************/
22     
23     virtual Interval width()const;    
24
25     Spanner *broken_at(const PCol *, const PCol *) const;
26     Beam();
27     void add(Stem*);
28     void process();
29     void calculate();
30     void set_default_dir();
31     void preprocess();
32     Interval height()const;
33     void print() const;
34     
35     void set_stemlens();
36 private:
37     Molecule stem_beams(Stem *here, Stem *next, Stem *prev);
38     void solve_slope();
39     void brew_molecule();
40 };
41 /** Beam adjusts the stems its owns to make sure that they reach the
42   beam and that point in the correct direction */
43
44 #endif // BEAM_HH
45