source file of the GNU LilyPond music typesetter
- (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1999--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include "moment.hh"
}
#include "ly-smobs.icc"
+
IMPLEMENT_SIMPLE_SMOBS (Moment);
IMPLEMENT_TYPE_P (Moment, "ly:moment?");
Moment *r = (Moment *) SCM_CELL_WORD_1 (s);
scm_puts ("#<Mom ", port);
- String str = r->to_string ();
- scm_puts ((char *)str.to_str0 (), port);
+ string str = r->to_string ();
+ scm_puts ((char *)str.c_str (), port);
scm_puts (">", port);
return 1;
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
{
main_part_.set_infinite (k);
}
-String
+string
Moment::to_string () const
{
- String s = main_part_.to_string ();
+ 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;