]> git.donarmstrong.com Git - lilypond.git/blob - hdr/stem.hh
8788d5a53dc1331d4337e6ffa457121b649b03bf
[lilypond.git] / hdr / stem.hh
1 /*
2   stem.hh -- 
3
4   (c) 1996,97 Han-Wen Nienhuys
5 */
6
7 #ifndef STEM_HH
8 #define STEM_HH
9 #include "item.hh"
10 #include "varray.hh"
11 #include "moment.hh"
12
13 /// the rule attached to the ball
14 struct Stem : public Item {
15     /// rhythmical length
16     Moment note_length;
17     
18     // heads the stem encompasses (positions)
19     int minnote, maxnote;
20
21     /// false if in beam
22     bool print_flag;
23     
24     int beams_left;
25     int beams_right;
26     
27     /// needed for determining direction/length
28     int staff_center;
29
30     // extent of the stem (positions)
31     Real bot, top;
32     /**
33       fractional, since Beam has to adapt them.
34       */
35
36     Real stemlen;
37     
38     /// flagtype? 4 none, 8 8th flag, 0 = beam.
39     int flag;
40
41     ///geen gedonder, jij gaat onder
42     int dir;
43     /**
44        -1 stem points down, +1: stem points up
45        */
46
47     Real stem_xoffset;
48     
49     Array<Notehead*> heads;
50
51     /****************/
52     Stem(int center, Moment duration);
53     
54     /// ensure that this Stem also encompasses the Notehead #n#
55     void add(Notehead*n);
56
57     Real hpos()const;
58     void print() const;
59     void set_stemend(Real);
60     void set_default_dir();
61     void set_default_stemlen();
62     void set_default_extents();
63     void set_noteheads();
64     
65
66     void do_pre_processing();
67
68     Interval width() const;
69
70     Molecule* brew_molecule_p() const;
71 };
72 /**
73   takes care of:
74
75   \begin{itemize}
76   \item the rule
77   \item the flag
78   \item up/down position.
79   \end{itemize}
80   */
81
82 #endif