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?");
}
void
-Moment::operator+= (Moment const &src)
+Moment::operator += (Moment const &src)
{
main_part_ += src.main_part_;
grace_part_ += src.grace_part_;
}
+
void
-Moment::operator-= (Moment const &src)
+Moment::operator -= (Moment const &src)
{
main_part_ -= src.main_part_;
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)
+Moment::operator *= (Moment const &src)
{
main_part_ *= src.main_part_;
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)
+Moment::operator /= (Moment const &src)
{
main_part_ /= src.main_part_;
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;
}
Moment
-Moment::operator- () const
+Moment::operator - () const
{
Moment m;
m.grace_part_ = -grace_part_;
- m. main_part_ = -main_part_;
+ m.main_part_ = -main_part_;
return m;
}
#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;