]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/stem.hh
release: 0.0.56
[lilypond.git] / lily / include / stem.hh
1 /*
2   stem.hh -- declare Stem
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
14 /**the rule attached to the ball.
15   takes care of:
16
17   \begin{itemize}
18   \item the rule
19   \item the flag
20   \item up/down position.
21   \end{itemize}
22
23   should move beam_{left, right} into Beam
24   */
25 class Stem : public Item {
26     
27     Real stem_bottom_f_, stem_top_f_;
28     
29     
30     /// needed for determining direction/length
31     int staff_size_i_;
32
33     /**extent of the stem (positions).
34       fractional, since Beam has to adapt them.
35       */
36
37
38     /**
39       geen gedonder, jij gaat onder.
40       -1 stem points down, +1: stem points up
41       */
42     Real stem_xoffset_f_;
43     /**
44       store the wholes (for vapourware tremolo)
45      */
46     Array<Notehead*> whole_l_arr_;
47     Array<Notehead*> head_l_arr_;
48     Array<Notehead*> rest_l_arr_;
49     
50 public:
51     /// flagtype? 4 none, 8 8th flag, 0 = beam.
52     int flag_i_;
53
54     int beams_left_i_;
55     int beams_right_i_;
56
57     /// false if in beam
58     bool print_flag_b_;
59     
60     int dir_i_;
61
62     
63     /* *************** */
64     Stem(int staff_size_i);
65     
66     /// ensure that this Stem also encompasses the Notehead #n#
67     void add(Notehead*n);
68
69     NAME_MEMBERS(Stem);
70
71     Real hpos_f()const;
72     
73     void do_print() const;
74     void set_stemend(Real);
75     int get_default_dir();
76     void set_default_dir();
77     void set_default_stemlen();
78     void set_default_extents();
79     void set_noteheads();
80
81     Real stem_length_f()const;
82     Real stem_end_f()const;
83     Real stem_start_f() const;
84
85     bool invisible_b()const;
86     
87     /// heads that the stem encompasses (positions)
88     int max_head_i() const;
89     int min_head_i() const;
90 protected:
91     void do_pre_processing();
92     virtual Interval do_width() const;
93     Molecule* brew_molecule_p() const;
94 };
95 #endif