source file of the GNU LilyPond music typesetter
- (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include "moment.hh"
}
#include "ly-smobs.icc"
+
IMPLEMENT_SIMPLE_SMOBS (Moment);
IMPLEMENT_TYPE_P (Moment, "ly:moment?");
main_part_ += src.main_part_;
grace_part_ += src.grace_part_;
}
+
void
Moment::operator -= (Moment const &src)
{
grace_part_ -= src.grace_part_;
}
-/*
- only take the main part of SRC for multiplication.
-*/
+/* Only take the main part of SRC for multiplication. */
void
Moment::operator *= (Moment const &src)
{
grace_part_ *= src.main_part_;
}
-/*
- only take the main part of SRC for multiplication.
-*/
+/* Only take the main part of SRC for division. */
void
Moment::operator /= (Moment const &src)
{
grace_part_ /= src.main_part_;
}
+/* Only take the main part of SRC for division. */
+void
+Moment::operator %= (Moment const &src)
+{
+ main_part_ %= src.main_part_;
+ grace_part_ %= src.main_part_;
+}
+
int
Moment::den () const
{
{
String s = main_part_.to_string ();
if (grace_part_)
- {
- s += "G" + grace_part_.to_string ();
- }
+ s += "G" + grace_part_.to_string ();
return s;
}
}
#ifdef STREAM_SUPPORT
-std::ostream &
-operator << (std::ostream &os, Moment const &m)
+ostream &
+operator << (ostream &os, Moment const &m)
{
os << m.to_string ();
return os;