]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/beaming-pattern.hh
5e0c7c30ecd98004b776fc7fc40603772dae6d67
[lilypond.git] / lily / include / beaming-pattern.hh
1 /*
2   beaming-pattern.hh -- declare beaming-pattern.hh
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef BEAMING_PATTERN_HH
10 #define BEAMING_PATTERN_HH
11
12 #include "std-vector.hh"
13 #include "moment.hh"
14 #include "lily-proto.hh"
15
16 struct Beam_rhythmic_element
17 {
18   Moment start_moment_;
19   Drul_array<int> beam_count_drul_;
20
21   Moment beat_start_;
22   Moment beat_length_;
23   Moment group_start_;
24   
25   Beam_rhythmic_element (Moment, int);
26   Beam_rhythmic_element ();
27
28   int count (Direction d);
29   void de_grace ();
30 };
31
32 /*
33   Generate beaming given durations of notes. Beam uses this to
34   set_beaming () for each of its stems.
35 */
36 class Beaming_pattern
37 {
38 public:
39   Beaming_pattern ();
40   
41   void beamify (Context*);
42   void de_grace ();
43   void add_stem (Moment d, int beams);
44   int beamlet_count (int idx, Direction d) const;
45   
46 private:
47   vector<Beam_rhythmic_element> infos_;
48   void beamify (bool);
49   int beam_extend_count (Direction) const;
50   int best_splitpoint_index (bool *split) const;
51 };
52
53 #endif /* BEAMING_PATTERN_HH */