]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/beam.hh
patch::: 0.1.38.jcn1: 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   // ugh, silly C++
20   enum Quantise { NUN, NORMAL, TRADITIONAL };
21
22   Link_array<Stem> stems;
23   /// the slope of the beam in posns / point (dimension)   
24   Real slope_f;
25
26   /// position of leftmost end of beam  
27   Real left_y;
28   /// should beam slope be damped? 0: no, 1: yes, 100000: horizontal beams
29   int damping_i_;
30   /// should beam pos / slope be quantised? 0: no, 1: yes, 2: traditional
31   Quantise quantisation_;
32   /// maximum number of beams (for opening-up of beam-spacing)
33   int multiple_i_;
34
35   /* *************** */
36   DECLARE_MY_RUNTIME_TYPEINFO;
37   Beam();
38   void add (Stem*);
39
40   void set_grouping (Rhythmic_grouping def, Rhythmic_grouping current);
41   void set_stemlens ();
42   SCORE_ELEM_CLONE (Beam);
43
44 protected:
45   virtual Interval do_width () const;    
46   Offset center () const;
47   void set_default_dir ();
48   virtual void do_pre_processing ();
49   virtual void do_post_processing ();
50   virtual void do_substitute_dependent (Score_elem*, Score_elem*);
51
52   virtual void do_print() const;
53
54   virtual void quantise_left_y (Beam::Pos pos, bool extend_b);
55   virtual Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const;
56   virtual void solve_slope ();
57   virtual void quantise_yspan ();
58   virtual Molecule*brew_molecule_p () const;
59 };
60
61 #endif // BEAM_HH
62