]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/beam.hh
patch::: 0.1.37.jcn2: biem pats
[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   enum Pos { NONE, SIT = 1, STRADDLE = 2, HANG = 4, INTER = 8 };
19
20   Link_array<Stem> stems;
21   /// the slope of the beam in posns / point (dimension)   
22   Real slope_f;
23
24   /// position of leftmost end of beam  
25   Real left_y;
26    
27
28   /* *************** */
29   DECLARE_MY_RUNTIME_TYPEINFO;
30   Beam();
31   void add (Stem*);
32
33   void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
34   void set_stemlens ();
35   SCORE_ELEM_CLONE (Beam);
36
37 protected:
38   virtual Interval do_width () const;    
39   Offset center () const;
40   void set_default_dir ();
41   virtual void do_pre_processing ();
42   virtual void do_post_processing ();
43   virtual void do_substitute_dependent (Score_elem*, Score_elem*);
44
45   virtual void do_print() const;
46
47   virtual void quantise_left_y (Beam::Pos pos, bool extend_b);
48   virtual Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
49   virtual void solve_slope ();
50   virtual void quantise_yspan ();
51   virtual Molecule*brew_molecule_p () const;
52 };
53
54 #endif // BEAM_HH
55