]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/stem.hh
patch::: 1.3.14.hwn1
[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 public:
48   /// log of the duration. Eg. 4 -> 16th note -> 2 flags
49   int flag_i () const;
50
51   int beam_count (Direction) const;
52   void set_beaming (int,  Direction d);
53   /** 
54     don't print flag when in beam.
55     our beam, for aligning abbrev flags
56    */
57   Beam* beam_l () const;
58   Note_head * first_head () const;
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   Real hpos_f () const;
66   Stem_info calc_stem_info () const;
67
68   Real chord_start_f () const;
69   
70   int type_i () const;
71   void set_stemend (Real);
72   Direction get_default_dir() const;
73   int get_center_distance(Direction) const;
74   Real  get_default_stemlen() const;
75
76   void position_noteheads();
77
78   Real stem_end_position () const;
79
80   // todo: cleanup, naming
81   Real note_delta_f () const;
82
83   bool invisible_b() const;
84     
85   /// heads that the stem encompasses (positions)
86   Interval_t<int> head_positions() const;
87
88 protected:
89   Molecule flag () const;
90
91   virtual void do_pre_processing();
92   static Interval dim_callback (Dimension_cache const*);
93   virtual Molecule* do_brew_molecule_p() const;
94
95   void set_spacing_hints () ;
96 };
97 #endif