2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1999--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
24 #include "rational.hh"
27 Musical timing (Main-timing, grace-timing) with glue for
30 class Moment : public Simple_smob<Moment>
33 static SCM equal_p (SCM, SCM);
34 int print_smob (SCM, scm_print_state *) const;
35 static const char type_p_name_[];
39 Moment (Rational, Rational);
42 Moment operator - () const;
44 void operator += (Moment const &m);
45 void operator -= (Moment const &m);
47 void operator *= (Moment const &m);
48 void operator /= (Moment const &m);
49 void operator %= (Moment const &m);
54 void set_infinite (int k);
56 bool to_bool () const;
60 Deliver a copy of THIS as a smobified SCM
62 string to_string () const;
63 static int compare (Moment const &, Moment const &);
64 SCM as_scheme () const;
67 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, +);
68 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, -);
69 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, / );
70 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, *);
71 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, % );
73 int compare (Moment const &, Moment const &);
74 INSTANTIATE_COMPARE (Moment const &, Moment::compare);
76 Moment robust_scm2moment (SCM, Moment);
79 ostream &operator << (ostream &, Moment const &);
82 bool moment_less (SCM a, SCM b);
84 #endif /* MOMENT_HH */