From f9f3c477d4398d262a5c018a9d4b07061c04d33e Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Oct 1999 01:50:03 +0000 Subject: [PATCH] lilypond-1.3.0 --- lily/include/moment.hh | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 lily/include/moment.hh diff --git a/lily/include/moment.hh b/lily/include/moment.hh new file mode 100644 index 0000000000..53942657fc --- /dev/null +++ b/lily/include/moment.hh @@ -0,0 +1,53 @@ +/* + moment.hh -- declare Moment + + source file of the GNU LilyPond music typesetter + + (c) 1999 Han-Wen Nienhuys + + */ + +#ifndef MOMENT_HH +#define MOMENT_HH + +#include "smobs.hh" +#include "rational.hh" + +/** + Rationals with glue for Guilification; + */ +struct Moment : public Rational +{ + Moment () { self_scm_ = SCM_EOL; } + Moment (int m) : Rational (m) {self_scm_ = SCM_EOL; } + Moment (int m, int n) : Rational (m,n) {self_scm_ = SCM_EOL; } + Moment (Rational m) : Rational (m) {self_scm_ = SCM_EOL; } + ~Moment (); + + DECLARE_SMOBS; +}; + +IMPLEMENT_ARITHMETIC_OPERATOR (Moment, / ); +IMPLEMENT_ARITHMETIC_OPERATOR (Moment, + ); +IMPLEMENT_ARITHMETIC_OPERATOR (Moment, * ); +IMPLEMENT_ARITHMETIC_OPERATOR (Moment, - ); +IMPLEMENT_ARITHMETIC_OPERATOR (Moment, % ); + +INSTANTIATE_COMPARE (Moment const&, Rational::compare); + + +/** + A really big time-moment. + + Windhoze-suck-suck-suck-suck-suck-thank-you-cygnus + + I get tired of all these incompatibilities. Let's just assume that + INT_MAX is really, really, really big. + + Can't we name this Saint_jut_mom (Sintjuttemis ?) */ + +/* URG ! WE HAVE TWO RATIONAL INFINITIES! */ +const Moment infinity_mom = INT_MAX; + +#endif /* MOMENT_HH */ + -- 2.39.5