]> git.donarmstrong.com Git - lilypond.git/blob - hdr/grouping.hh
release: 0.0.26
[lilypond.git] / hdr / grouping.hh
1 /*
2   grouping.hh -- part of LilyPond
3
4   (c) 1996,97 Han-Wen Nienhuys
5 */
6
7 #ifndef GROUPING_HH
8 #define GROUPING_HH
9
10 #include "moment.hh"
11 #include "interval.hh"
12 #include "varray.hh"
13
14 typedef Interval_t<Moment> MInterval;
15
16 /// data structure which represents rhythmic units 
17 struct Rhythmic_grouping {
18     Array<Rhythmic_grouping*> children;
19     MInterval *interval_;
20     
21     /****************/
22
23     Array<MInterval> intervals();
24     MInterval interval()const;
25     Moment length() const;
26     void intersect(MInterval);
27     
28     void operator=(Rhythmic_grouping const&);
29     Rhythmic_grouping(Rhythmic_grouping const&);
30     Rhythmic_grouping(MInterval, int n=1);
31     Rhythmic_grouping();
32     Rhythmic_grouping(Array<Rhythmic_grouping*>);
33     ~Rhythmic_grouping();
34
35     void add_child(Moment start, Moment len);
36     bool child_fit_query(Moment start);
37     void split(Rhythmic_grouping r);
38     void split(Array<MInterval>);
39     void split(int n);
40
41     void print() const;
42     void OK() const;
43
44     Array<int> generate_beams(Array<int>, int&);
45
46     /// multiply self to span #i#
47     void extend(MInterval i);
48     void translate(Moment);
49 private:
50     void init();
51     void junk();
52     void copy(Rhythmic_grouping const&);
53 };
54 /**
55   this is a tree. It groupes notes according to rules
56   
57  */
58
59 #endif