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;
57 Rational main_part () const;
58 Rational grace_part () 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 DECLARE_UNSMOB (Moment, moment);
74 int compare (Moment const &, Moment const &);
75 INSTANTIATE_COMPARE (Moment const &, Moment::compare);
77 Moment robust_scm2moment (SCM, Moment);
80 ostream &operator << (ostream &, Moment const &);
83 bool moment_less (SCM a, SCM b);
85 #endif /* MOMENT_HH */