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