]> git.donarmstrong.com Git - lilypond.git/blob - lib/include/duration.hh
release: 0.1.7
[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 /** 
22   The type and replacement value of a  plet (triplet, quintuplet.) Conceptually the same as a rational, but 4/6 != 2/3.
23   
24   (plet)
25  */
26 struct Plet {
27     Plet();
28     Moment mom()const;
29     bool unit_b()const;
30     int iso_i_;  // 2/3; 2 is not duration, maar of count!
31     int type_i_;
32 };
33
34 /**
35   Class to handle "musical" durations. This means: balltype 1,2,4,etc. and dots.
36    
37   (dur)
38   */
39 struct Duration {
40     /**
41       Ctor of Duration. type_i should be a power of 2. 
42        */
43     Duration();
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_plet(Duration );
49     static bool duration_type_b(int t);
50     void set_ticks( int ticks_i );
51     Moment length() const ;     // zo naai mij
52     static int division_1_i_s;
53     int type_i_;
54     int dots_i_;
55     Plet plet_;
56     int ticks_i_;
57 };
58 #endif // DURATION_HH
59