]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/duration.hh
release: 1.5.29
[lilypond.git] / lily / include / duration.hh
1 /*
2   duration.hh -- declare Duration
3   
4   source file of the LilyPond music typesetter
5
6   (c)  1997--2002 Jan Nieuwenhuizen <janneke@gnu.org>
7
8 */
9
10 #ifndef DURATION_HH
11 #define DURATION_HH
12
13 #include "flower-proto.hh"
14 #include "moment.hh"
15 #include "smobs.hh"
16
17 /**
18    A musical duration.
19   */
20 struct Duration {
21   Duration ();
22   Duration (int, int);
23   String str () const;
24   void set_plet (int,int );
25   Duration compressed (Rational) const;
26   Rational length_mom () const ;
27   static int compare (Duration const&, Duration const&);
28
29   SCM smobbed_copy () const;
30   DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
31   DECLARE_SIMPLE_SMOBS (Duration,);
32
33 public:
34   int duration_log ()const;
35   int dot_count () const;
36   
37 private:
38     /// Logarithm of the base duration.
39   int durlog_i_;
40   int dots_i_;
41
42   Rational factor_;
43 };
44
45 #include "compare.hh"
46 INSTANTIATE_COMPARE (Duration, Duration::compare);
47 DECLARE_UNSMOB(Duration,duration);
48 // int compare (Array<Duration>*, Array<Duration>*);
49
50 #endif // DURATION_HH
51