2 moment.hh -- declare Moment
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
13 #include "rational.hh"
16 Musical timing (Main-timing, grace-timing) with glue for
21 DECLARE_SIMPLE_SMOBS (Moment,);
26 Moment (Rational, Rational);
29 Moment operator- () const;
31 void operator+= (Moment const &m);
32 void operator-= (Moment const &m);
34 void operator*= (Moment const &m);
35 void operator/= (Moment const &m);
40 void set_infinite (int k);
42 bool to_bool () const;
46 Deliver a copy of THIS as a smobified SCM
48 String to_string () const;
49 static int compare (Moment const &, Moment const &);
50 SCM as_scheme () const;
52 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, +);
53 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, -);
54 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, /);
55 IMPLEMENT_ARITHMETIC_OPERATOR (Moment, *);
57 DECLARE_UNSMOB (Moment, moment);
58 int compare (Moment const &, Moment const &);
59 INSTANTIATE_COMPARE (Moment const &, Moment::compare);
61 Moment robust_scm2moment (SCM, Moment);
64 std::ostream & operator<< (std::ostream &, Moment const &);
67 bool moment_less (SCM a, SCM b);
69 #endif /* MOMENT_HH */