summaryrefslogtreecommitdiff
path: root/lily/include/beam.hh
blob: a85858bad82c9c62d78ca0b0056c2778c9a61118 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
  beam.hh -- part of LilyPond

  (c) 1996,97 Han-Wen Nienhuys
*/

#ifndef BEAM_HH
#define BEAM_HH
#include "proto.hh"
#include "directional-spanner.hh"
#include "plist.hh"

/** a beam connects multiple stems Beam adjusts the stems its owns to
  make sure that they reach the beam and that point in the correct
  direction */
struct Beam:  public Directional_spanner {
    PointerList<Stem*> stems;
    /// the slope of the beam in posns / point (dimension)   
    Real slope;

    /// position of leftmost end of beam  
    Real left_pos;
   

    /* *************** */
NAME_MEMBERS(Beam);
    
    virtual Interval do_width()const;    
    Offset center() const;
    Spanner *do_break_at(PCol *,  PCol *) const;
    Beam();
    void add(Stem*);
    

    void set_default_dir();
    void do_pre_processing();
    void do_post_processing();

    void do_print() const;
    void set_grouping(Rhythmic_grouping def, Rhythmic_grouping current);
    void set_stemlens();
    ~Beam();

private:
    Molecule stem_beams(Stem *here, Stem *next, Stem *prev)const;
    void solve_slope();
    Molecule*brew_molecule_p()const;
};

#endif // BEAM_HH