]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/beam.hh
release: 0.1.11
[lilypond.git] / lily / include / beam.hh
1 /*
2   beam.hh -- part of GNU LilyPond
3
4   (c) 1996,97 Han-Wen Nienhuys
5 */
6
7 #ifndef BEAM_HH
8 #define BEAM_HH
9 #include "lily-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 class Beam:  public Directional_spanner {
17 public:
18   Link_array<Stem> stems;
19   /// the slope of the beam in posns / point (dimension)   
20   Real slope;
21
22   /// position of leftmost end of beam  
23   Real left_pos;
24    
25
26   /* *************** */
27   DECLARE_MY_RUNTIME_TYPEINFO;
28   Beam();
29   void add (Stem*);
30
31   void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
32   void set_stemlens();
33   SCORE_ELEM_CLONE(Beam);
34 protected:
35   virtual Interval do_width() const;    
36   virtual Offset center() const;
37   virtual void set_default_dir();
38   virtual void do_pre_processing();
39   virtual void do_post_processing();
40   virtual void do_substitute_dependent (Score_elem*, Score_elem*);
41
42   virtual void do_print() const;
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