]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.0
authorfred <fred>
Sun, 24 Oct 1999 01:50:03 +0000 (01:50 +0000)
committerfred <fred>
Sun, 24 Oct 1999 01:50:03 +0000 (01:50 +0000)
lily/include/moment.hh [new file with mode: 0644]

diff --git a/lily/include/moment.hh b/lily/include/moment.hh
new file mode 100644 (file)
index 0000000..5394265
--- /dev/null
@@ -0,0 +1,53 @@
+/*   
+  moment.hh -- declare Moment
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  
+ */
+
+#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 */
+