]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/moment.hh
patch::: 1.3.59.uu2.jcn1
[lilypond.git] / lily / include / moment.hh
1 /*   
2   moment.hh -- declare Moment
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #ifndef MOMENT_HH
11 #define MOMENT_HH
12
13 #include "smobs.hh"
14 #include "rational.hh"
15
16 /**
17    Rationals with glue for Guilification;
18  */
19 struct Moment : public Rational
20 {
21   Moment () { self_scm_ = SCM_EOL; }
22   Moment (int m) : Rational (m) {self_scm_ = SCM_EOL; }
23   Moment (int m, int n) : Rational (m,n) {self_scm_ = SCM_EOL; }
24   Moment (Rational m) : Rational (m) {self_scm_ = SCM_EOL; }
25   ~Moment ();
26   
27   DECLARE_SMOBS;
28 };
29
30 SCM smobify (Moment*);
31 Moment * unsmob_moment (SCM);
32
33 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, / );
34 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, + );
35 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, * );
36 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, - );
37 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, % );
38
39 INSTANTIATE_COMPARE (Moment const&, Rational::compare);
40
41
42 /**
43   A really big time-moment.
44
45   Windhoze-suck-suck-suck-suck-suck-thank-you-cygnus
46
47   I get tired of all these incompatibilities.  Let's just assume that
48   INT_MAX is really, really, really big.
49
50   Can't we name this Saint_jut_mom (Sintjuttemis ?)  */
51   
52 /* URG ! WE HAVE TWO RATIONAL INFINITIES! */
53 const Moment infinity_mom = INT_MAX;
54
55 #endif /* MOMENT_HH */
56