]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/stem.hh
release: 0.1.8
[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   TODO.
26   
27   Stem size depends on flag.
28   */
29 class Stem : public Item {
30     
31     Real stem_bottom_f_, stem_top_f_;
32     
33     
34     /// needed for determining direction/length
35     int staff_size_i_;
36
37     /**extent of the stem (positions).
38       fractional, since Beam has to adapt them.
39       */
40
41
42     /**
43       geen gedonder, jij gaat onder.
44       -1 stem points down, +1: stem points up
45       */
46     Real stem_xoffset_f_;
47     /**
48       store the wholes (for vapourware tremolo)
49      */
50     Link_array<Note_head> whole_l_arr_;
51     Link_array<Note_head> head_l_arr_;
52     Link_array<Note_head> rest_l_arr_;
53     
54 public:
55     /// flagtype? 4 none, 8 8th flag, 0 = beam.
56     int flag_i_;
57
58     int beams_left_i_;
59     int beams_right_i_;
60
61     /// false if in beam
62     bool print_flag_b_;
63     
64     int dir_i_;
65
66     
67     /* *************** */
68     Stem (int staff_size_i);
69     
70     /// ensure that this Stem also encompasses the Notehead #n#
71     void add (Note_head*n);
72
73     DECLARE_MY_RUNTIME_TYPEINFO;
74
75     Real hpos_f()const;
76     
77     void do_print() const;
78     void set_stemend (Real);
79     int get_default_dir();
80     int get_center_distance_from_top();
81     int get_center_distance_from_bottom();
82     void set_default_dir();
83     void set_default_stemlen();
84     void set_default_extents();
85     void set_noteheads();
86
87     Real stem_length_f()const;
88     Real stem_end_f()const;
89     Real stem_start_f() const;
90
91     bool invisible_b()const;
92     
93     /// heads that the stem encompasses (positions)
94     int max_head_i() const;
95     int min_head_i() const;
96 protected:
97     virtual void do_substitute_dependency (Score_elem*,Score_elem*);
98     virtual void do_pre_processing();
99     virtual Interval do_width() const;
100     Molecule* brew_molecule_p() const;
101 };
102 #endif