]> git.donarmstrong.com Git - lilypond.git/blob - lib/include/duration.hh
release: 0.0.44
[lilypond.git] / lib / include / duration.hh
1 /*
2   duration.hh -- declare Duration Plet
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
7
8 */
9
10 // split into 4?
11
12 #ifndef DURATION_HH
13 #define DURATION_HH
14
15 #include "fproto.hh"
16 #include "moment.hh"
17
18 // ugh, to get me in lily lib
19 extern bool no_triplets_bo_g;
20
21 /** (plet)
22   The type and replacement value of a  plet (triplet, quintuplet.) Conceptually the same as a rational, but 4/6 != 2/3 
23  */
24 struct Plet {
25     Plet( int replace_i, int type_i );
26     Plet();
27     Moment mom()const;
28     bool unit_b()const;
29     int iso_i_;  // 2/3; 2 is not duration, maar of count!
30     int type_i_;
31 };
32
33 /**
34   Class to handle "musical" durations. This means: balltype 1,2,4,etc. and dots.
35    
36   (dur)
37   */
38 struct Duration {
39     /* actually i hate it when other people use default arguments,
40        because it makes you easily loose track of what-s really
41        happening; in the routine-s implementation you-re not aware
42        of this defaultness (who sets this stupid value?).*/
43     Duration( int type_i = 1, int dots_i = 0);
44     /// is the "plet factor" of this note != 1 ?
45     bool plet_b();
46     String str()const;
47     void set_plet(int,int );
48     void set_ticks( int ticks_i );
49     Moment length() const ;     // zo naai mij
50     static int division_1_i_s;
51     int type_i_;
52     int dots_i_;
53     Plet plet_;
54     int ticks_i_;
55 };
56 #endif // DURATION_HH
57