]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/stem.hh
release: 1.3.16
[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 "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   Real hpos_f () const;
66   Stem_info calc_stem_info () const;
67
68   Real chord_start_f () const;
69   Direction get_direction () const;
70   int type_i () const;
71   void set_stemend (Real);
72   Direction get_default_dir() const;
73
74   int get_center_distance(Direction) const;
75   int heads_i () const;
76
77   bool invisible_b() const;
78     
79   /// heads that the stem encompasses (positions)
80   Interval head_positions() const;
81
82 protected:
83   friend class Stem_tremolo;    // ugh.
84   Real  get_default_stem_end_position () const;
85   void position_noteheads();
86
87
88   Real stem_end_position () const;
89   // todo: cleanup, naming
90   Real note_delta_f () const;
91 protected:
92   Molecule flag () const;
93
94   virtual void do_pre_processing();
95   static Interval dim_callback (Dimension_cache const*);
96   virtual Molecule* do_brew_molecule_p() const;
97
98   void set_spacing_hints () ;
99 };
100 #endif