]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/stem.hh
release: 1.3.11
[lilypond.git] / lily / include / stem.hh
1 /*
2   stem.hh -- declare Stem
3
4   (c) 1996--1999 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 "directional-element.hh"
15 #include "stem-info.hh"
16
17 /**the rule attached to the ball.
18   takes care of:
19
20   \begin{itemize}
21   \item the rule
22   \item the flag
23   \item up/down position.
24   \end{itemize}
25
26   should move beam_{left, right} into Beam
27
28   TODO.
29   
30   Stem size depends on flag.
31
32   elt properties:
33
34   beam_dir: direction of the beam (int)
35
36   dir_force: is direction explicitely specified? (bool)
37
38   /// how many abbrev beam don't reach stem?
39   int beam_gap_i_;
40
41
42   
43   */
44 class Stem : public Item,
45              public Directional_element
46 {
47
48   /**extent of the stem (positions).
49     fractional, since Beam has to adapt them.
50     */
51   Interval yextent_;
52
53 public:
54   /// log of the duration. Eg. 4 -> 16th note -> 2 flags
55   int flag_i () const;
56
57   Drul_array<int> beams_i_drul_;
58
59
60   /** 
61     don't print flag when in beam.
62     our beam, for aligning abbrev flags
63    */
64   Beam* beam_l () const;
65   Note_head * first_head () const;
66   Stem ();
67     
68   /// ensure that this Stem also encompasses the Notehead #n#
69   void add_head (Rhythmic_head*n);
70
71   Real hpos_f () const;
72   Stem_info calc_stem_info () const;
73
74   Real chord_start_f () const;
75   
76   int type_i () const;
77   void set_stemend (Real);
78   Direction get_default_dir() const;
79
80   int get_center_distance(Direction) const;
81
82   void set_default_stemlen();
83   void set_default_extents();
84   void set_noteheads();
85
86   Real stem_length_f() const;
87   Real stem_end_f() const;
88   Real stem_begin_f() const;
89   Real note_delta_f () const;
90
91   bool invisible_b() const;
92     
93   /// heads that the stem encompasses (positions)
94   Interval_t<int> head_positions() const;
95
96 protected:
97   Molecule flag () const;
98
99   virtual void do_pre_processing();
100   static Interval dim_callback (Dimension_cache const*);
101   virtual Molecule* do_brew_molecule_p() const;
102
103   void set_spacing_hints () ;
104 };
105 #endif