lilypond-1.0.19
[lilypond.git] / lily / include / grouping.hh
blobada7b4ab5c4ca221eca375a5b2867e8ca21b26a0
1 /*
2 grouping.hh -- part of GNU LilyPond
4 (c) 1996--1998 Han-Wen Nienhuys
5 */
7 #ifndef GROUPING_HH
8 #define GROUPING_HH
10 #include "minterval.hh"
11 #include "array.hh"
13 /** data structure which represents rhythmic units this is a tree. It groupes notes according to rules
15 TODO Documentation. Unhairing
17 struct Rhythmic_grouping {
18 Array<Rhythmic_grouping*> children;
19 MInterval *interval_;
22 Array<MInterval> intervals();
23 MInterval interval() const;
24 Moment length() const;
25 void intersect (MInterval);
27 void operator=(Rhythmic_grouping const&);
28 Rhythmic_grouping (Rhythmic_grouping const&);
29 Rhythmic_grouping (MInterval, int n=1);
30 Rhythmic_grouping();
31 Rhythmic_grouping (Array<Rhythmic_grouping*>);
32 ~Rhythmic_grouping();
34 void add_child (Moment start, Moment len);
35 bool child_fit_b (Moment start);
36 void split (Rhythmic_grouping r);
37 void split (Array<MInterval>);
38 void split (int n);
40 void print() const;
41 void OK() const;
43 Array<int> generate_beams (Array<int>, int&);
45 /** multiply self to span #i#.
46 In implementation, this isn't really const, but conceptually it is.
48 void extend (MInterval i) const;
49 void translate (Moment);
50 private:
51 void init();
52 void junk();
53 void copy (Rhythmic_grouping const&);
57 Rhythmic_grouping parse_grouping (Array<int> beat_i_arr, Array<Moment> elt_length_arr);
60 #endif