]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/beam.hh
release: 0.1.39
[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.
14
15   Beam adjusts the stems its owns to make sure that they reach the
16   beam and that point in the correct direction */
17 class Beam:  public Directional_spanner {
18 public:
19   enum Pos { NONE, SIT = 1, STRADDLE = 2, HANG = 4, INTER = 8 };
20   // ugh, silly C++
21   enum Quantise { NUN, NORMAL, TRADITIONAL };
22
23   Link_array<Stem> stems_;
24   /// the slope of the beam in posns / point (dimension)   
25   Real slope_f_;
26
27   /// position of leftmost end of beam  
28   Real left_y_;
29   /// should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams
30   int damping_i_;
31   /// should beam pos / slope be quantised? 0: no, 1: yes, 2: traditional
32   Quantise quantisation_;
33   /// maximum number of beams (for opening-up of beam-spacing)
34   int multiple_i_;
35
36
37   DECLARE_MY_RUNTIME_TYPEINFO;
38   Beam();
39   void add (Stem*);
40
41   void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
42   void set_stemlens ();
43   SCORE_ELEM_CLONE (Beam);
44
45 protected:
46   virtual Interval do_width () const;    
47   Offset center () const;
48   void set_default_dir ();
49   virtual void do_pre_processing ();
50   virtual void do_post_processing ();
51   virtual void do_substitute_dependent (Score_elem*, Score_elem*);
52
53   virtual void do_print() const;
54
55   virtual void quantise_left_y (Beam::Pos pos, bool extend_b);
56   virtual Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
57   virtual void solve_slope ();
58   virtual void quantise_yspan ();
59   virtual Molecule*brew_molecule_p () const;
60 };
61
62 #endif // BEAM_HH
63