2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1999--2011 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
32 DECLARE_SIMPLE_SMOBS (Moment);
37 Moment (Rational, Rational);
40 Moment operator - () const;
42 void operator += (Moment const &m);
43 void operator -= (Moment const &m);
45 void operator *= (Moment const &m);
46 void operator /= (Moment const &m);
47 void operator %= (Moment const &m);
52 void set_infinite (int k);
54 bool to_bool () const;
58 Deliver a copy of THIS as a smobified SCM
60 string to_string () const;
61 static int compare (Moment const &, Moment const &);
62 SCM as_scheme () const;
65 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, +);
66 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, -);
67 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, / );
68 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, *);
69 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, % );
71 DECLARE_UNSMOB (Moment, moment);
72 int compare (Moment const &, Moment const &);
73 INSTANTIATE_COMPARE (Moment const &, Moment::compare);
75 Moment robust_scm2moment (SCM, Moment);
78 ostream &operator << (ostream &, Moment const &);
81 bool moment_less (SCM a, SCM b);
83 #endif /* MOMENT_HH */