summaryrefslogtreecommitdiff
path: root/lily/include/stem.hh
blob: e64aafdd6958cd6ca5e4f0c6b9626732ae478f95 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
  stem.hh -- declare Stem

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

#ifndef STEM_HH
#define STEM_HH
#include "item.hh"
#include "varray.hh"
#include "moment.hh"


/**the rule attached to the ball.
  takes care of:

  \begin{itemize}
  \item the rule
  \item the flag
  \item up/down position.
  \end{itemize}
  */

struct Stem : Item {
    /// heads that the stem encompasses (positions)
    int minnote, maxnote;

    /// false if in beam
    bool print_flag;
    
    int beams_left;
    int beams_right;
    
    /// needed for determining direction/length
    int staff_center;


    /**extent of the stem (positions).
      fractional, since Beam has to adapt them.
      */

    Real bot, top;
    Real stemlen;
    
    /// flagtype? 4 none, 8 8th flag, 0 = beam.
    int flag;


    /**
      geen gedonder, jij gaat onder.
       -1 stem points down, +1: stem points up
       */

    int dir_i_;
    Real stem_xoffset;
    
    Array<Notehead*> heads;

    /* *************** */
    Stem(int center); //, Moment duration);
    
    /// ensure that this Stem also encompasses the Notehead #n#
    void add(Notehead*n);

    NAME_MEMBERS(Stem);

    Real hindex()const;
    void do_print() const;
    void set_stemend(Real);
    int get_default_dir();
    void set_default_dir();
    void set_default_stemlen();
    void set_default_extents();
    void set_noteheads();
    void do_pre_processing();

    virtual Interval do_width() const;

    Molecule* brew_molecule_p() const;
};
#endif