]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/beaming-pattern.hh
* input/regression/beaming-ternary-metrum.ly: update doc.
[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 };
30
31 /*
32   Generate beaming given durations of notes. Beam uses this to
33   set_beaming () for each of its stems.
34 */
35 class Beaming_pattern
36 {
37 public:
38   Beaming_pattern ();
39   
40   void beamify (Context*);
41   void add_stem (Moment d, int beams);
42   int beamlet_count (int idx, Direction d) const;
43   
44 private:
45   vector<Beam_rhythmic_element> infos_;
46   void beamify (bool);
47   int beam_extend_count (Direction) const;
48   int best_splitpoint_index (bool *split) const;
49 };
50
51 #endif /* BEAMING_PATTERN_HH */