lilypond-0.1.11
[lilypond.git] / lily / include / stem.hh
blob4cf67df0e2daec57075d467984c161f6c2c9b317
1 /*
2 stem.hh -- declare Stem
4 (c) 1996,97 Han-Wen Nienhuys
5 */
7 #ifndef STEM_HH
8 #define STEM_HH
9 #include "item.hh"
10 #include "varray.hh"
11 #include "moment.hh"
14 /**the rule attached to the ball.
15 takes care of:
17 \begin{itemize}
18 \item the rule
19 \item the flag
20 \item up/down position.
21 \end{itemize}
23 should move beam_{left, right} into Beam
25 TODO.
27 Stem size depends on flag.
29 class Stem : public Item {
31 Real stem_bottom_f_, stem_top_f_;
34 /// needed for determining direction/length
35 int staff_size_i_;
37 /**extent of the stem (positions).
38 fractional, since Beam has to adapt them.
42 /**
43 geen gedonder, jij gaat onder.
44 -1 stem points down, +1: stem points up
46 Real stem_xoffset_f_;
47 /**
48 store the wholes (for vapourware tremolo)
50 Link_array<Note_head> whole_l_arr_;
51 Link_array<Note_head> head_l_arr_;
52 Link_array<Note_head> rest_l_arr_;
54 public:
55 /// flagtype? 4 none, 8 8th flag, 0 = beam.
56 int flag_i_;
58 int beams_left_i_;
59 int beams_right_i_;
61 /// false if in beam
62 bool print_flag_b_;
64 Direction dir_;
67 /* *************** */
68 Stem ();
70 /// ensure that this Stem also encompasses the Notehead #n#
71 void add (Note_head*n);
73 DECLARE_MY_RUNTIME_TYPEINFO;
75 Real hpos_f() const;
77 void do_print() const;
78 void set_stemend (Real);
79 Direction 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();
87 Real stem_length_f() const;
88 Real stem_end_f() const;
89 Real stem_start_f() const;
91 bool invisible_b() const;
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;
102 #endif