Correct left text alignment of DynamicTextSpanner.
[lilypond.git] / lily / include / duration.hh
blob0914e754e3171ae1e28f958d74558159eb4577b2
1 /*
2 duration.hh -- declare Duration
4 source file of the LilyPond music typesetter
6 (c) 1997--2007 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
9 #ifndef DURATION_HH
10 #define DURATION_HH
12 #include "moment.hh"
14 /**
15 A musical duration.
17 struct Duration
19 public:
21 Duration ();
22 Duration (int, int);
23 Duration (Rational, bool scale);
24 string to_string () const;
26 Duration compressed (Rational) const;
27 Rational get_length () const;
28 Rational factor () const { return factor_; }
29 int duration_log () const;
30 int dot_count () const;
32 static int compare (Duration const &, Duration const &);
34 DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b));
35 DECLARE_SIMPLE_SMOBS (Duration);
37 private:
38 /// Logarithm of the base duration.
39 int durlog_;
40 int dots_;
42 Rational factor_;
45 INSTANTIATE_COMPARE (Duration, Duration::compare);
46 DECLARE_UNSMOB (Duration, duration);
48 #endif // DURATION_HH