]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/beaming-pattern.hh
Run `make grand-replace'.
[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--2008 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 Beaming_options
17 {
18   SCM grouping_;
19   bool subdivide_beams_;
20   Moment beat_length_;
21   Moment measure_length_;
22
23   Beaming_options ();
24   void from_context (Context*);  
25 };
26
27 struct Beam_rhythmic_element
28 {
29   Moment start_moment_;
30   Drul_array<int> beam_count_drul_;
31
32   int rhythmic_importance_;
33   bool invisible_;
34   
35   Beam_rhythmic_element (Moment, int, bool);
36   Beam_rhythmic_element ();
37
38   int count (Direction d) const;
39   void de_grace ();
40 };
41
42 /*
43   Generate beaming given durations of notes. Beam uses this to
44   set_beaming () for each of its stems.
45 */
46 class Beaming_pattern
47 {
48 public:
49   Beaming_pattern ();
50   
51   void beamify (Beaming_options const&);
52   void de_grace ();
53   void add_stem (Moment d, int beams, bool invisible);
54   int beamlet_count (int idx, Direction d) const;
55   
56 private:
57   vector<Beam_rhythmic_element> infos_;
58   Direction flag_direction (Beaming_options const&, vsize) const;
59   void find_rhythmic_importance (Beaming_options const&);
60   void unbeam_invisible_stems ();
61 };
62
63 #endif /* BEAMING_PATTERN_HH */