]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/stem.hh
release: 1.3.12
[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   int beam_count (Direction) const;
58   void set_beaming (int,  Direction d);
59   /** 
60     don't print flag when in beam.
61     our beam, for aligning abbrev flags
62    */
63   Beam* beam_l () const;
64   Note_head * first_head () const;
65   Score_element * support_head () const;
66   Stem ();
67   /// ensure that this Stem also encompasses the Notehead #n#
68   void add_head (Rhythmic_head*n);
69
70   Real hpos_f () const;
71   Stem_info calc_stem_info () const;
72
73   Real chord_start_f () const;
74   
75   int type_i () const;
76   void set_stemend (Real);
77   Direction get_default_dir() const;
78
79   int get_center_distance(Direction) const;
80
81   void set_default_stemlen();
82   void set_default_extents();
83   void set_noteheads();
84
85   Real stem_end_f() const;
86   Real stem_begin_f() const;
87   Real note_delta_f () const;
88
89   bool invisible_b() const;
90     
91   /// heads that the stem encompasses (positions)
92   Interval_t<int> head_positions() const;
93
94 protected:
95   Molecule flag () const;
96
97   virtual void do_pre_processing();
98   static Interval dim_callback (Dimension_cache const*);
99   virtual Molecule* do_brew_molecule_p() const;
100
101   void set_spacing_hints () ;
102 };
103 #endif