]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/duration.hh
(open_request_parens): add input locations to
[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 public:
22   
23   Duration ();
24   Duration (int, int);
25   String str () const;
26
27   Duration compressed (Rational) const;
28   Rational length_mom () const ;
29
30
31   int duration_log ()const;
32   int dot_count () const;
33
34   static int compare (Duration const&, Duration const&);
35
36   SCM smobbed_copy () const;
37   DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
38   DECLARE_SIMPLE_SMOBS (Duration,);
39   
40 private:
41     /// Logarithm of the base duration.
42   int durlog_i_;
43   int dots_i_;
44
45   Rational factor_;
46 };
47
48 #include "compare.hh"
49 INSTANTIATE_COMPARE (Duration, Duration::compare);
50 DECLARE_UNSMOB(Duration,duration);
51
52
53 #endif // DURATION_HH
54