]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/stem.hh
release: 1.3.68
[lilypond.git] / lily / include / stem.hh
1 /*
2   stem.hh -- declare Stem
3
4   (c) 1996--2000 Han-Wen Nienhuys
5 */
6
7 #ifndef STEM_HH
8 #define STEM_HH
9
10 #include "item.hh"
11 #include "array.hh"
12 #include "moment.hh"
13 #include "molecule.hh"
14 #include "stem-info.hh"
15
16 /**the rule attached to the ball.
17   takes care of:
18
19   \begin{itemize}
20   \item the rule
21   \item the flag
22   \item up/down position.
23   \end{itemize}
24
25   should move beam_{left, right} into Beam
26
27   TODO.
28   
29   Stem size depends on flag.
30
31   elt properties:
32
33   beam_dir: direction of the beam (int)
34
35   dir_force: is direction explicitely specified? (bool)
36
37   /// how many abbrev beam don't reach stem?
38   int beam_gap_i_;
39
40
41   
42   */
43 class Stem : public Item
44 {
45 public:
46  static SCM brew_molecule (SCM);
47   
48
49
50   /// log of the duration. Eg. 4 -> 16th note -> 2 flags
51   int flag_i () const;
52
53   int beam_count (Direction) const;
54   void set_beaming (int,  Direction d);
55   /** 
56     don't print flag when in beam.
57     our beam, for aligning abbrev flags
58    */
59   Beam* beam_l () const;
60   Rhythmic_head * first_head () const;
61   Drul_array<Rhythmic_head*> extremal_heads () const;
62
63   Score_element * support_head () const;
64   Stem (SCM);
65
66   /// ensure that this Stem also encompasses the Notehead #n#
67   void add_head (Rhythmic_head*n);
68
69   Stem_info calc_stem_info () const;
70
71   Real chord_start_f () const;
72   Direction get_direction () const;
73   int type_i () const;
74   void set_stemend (Real);
75   Direction get_default_dir() const;
76
77   int get_center_distance(Direction) const;
78   int heads_i () const;
79
80   bool invisible_b() const;
81     
82   /// heads that the stem encompasses (positions)
83   Interval head_positions() const;
84
85 public:
86   friend class Stem_tremolo;    // ugh.
87   Real get_default_stem_end_position () const;
88   void position_noteheads();
89
90   Real stem_end_position () const;
91   static Real off_callback (Score_element *, Axis);
92   Molecule flag () const;
93
94   SCM member_before_line_breaking ();
95   static SCM before_line_breaking (SCM);
96   static Interval dim_callback (Score_element *,Axis);
97   SCM member_brew_molecule() const;
98
99   void set_spacing_hints () ;
100 };
101 #endif