]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/stem.hh
release: 1.3.54
[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   /// log of the duration. Eg. 4 -> 16th note -> 2 flags
47   int flag_i () const;
48
49   int beam_count (Direction) const;
50   void set_beaming (int,  Direction d);
51   /** 
52     don't print flag when in beam.
53     our beam, for aligning abbrev flags
54    */
55   Beam* beam_l () const;
56   Note_head * first_head () const;
57   Drul_array<Note_head*> extremal_heads () const;
58
59   Score_element * support_head () const;
60   Stem ();
61
62   /// ensure that this Stem also encompasses the Notehead #n#
63   void add_head (Rhythmic_head*n);
64
65   Stem_info calc_stem_info () const;
66
67   Real chord_start_f () const;
68   Direction get_direction () const;
69   int type_i () const;
70   void set_stemend (Real);
71   Direction get_default_dir() const;
72
73   int get_center_distance(Direction) const;
74   int heads_i () const;
75
76   bool invisible_b() const;
77     
78   /// heads that the stem encompasses (positions)
79   Interval head_positions() const;
80
81 protected:
82   friend class Stem_tremolo;    // ugh.
83   Real get_default_stem_end_position () const;
84   void position_noteheads();
85
86
87   Real stem_end_position () const;
88   static Real off_callback (Score_element const*, Axis);
89 protected:
90   Molecule flag () const;
91
92   virtual void before_line_breaking();
93   static Interval dim_callback (Score_element const*,Axis);
94   virtual Molecule do_brew_molecule() const;
95
96   void set_spacing_hints () ;
97 };
98 #endif