#include <fstream.h>
#include "dictionary-iter.hh"
#include "dstream.hh"
-#include "scalar.hh"
+
#include "text-db.hh"
#include "string-convert.hh"
#include "rational.hh"
}
Dstream &
-Dstream::operator <<(Scalar s)
+Dstream::operator <<(String s)
{
output (s);
return *this;
return *this;
}
+Dstream &
+Dstream::operator <<(char c)
+{
+ output (to_str (c));
+ return *this;
+}
+
+Dstream&
+Dstream::operator << (Real r)
+{
+ output (to_str (r));
+ return *this;
+}
+Dstream &
+Dstream::operator <<(Rational c)
+{
+ output (c.str ());
+ return *this;
+}
+Dstream &
+Dstream::operator <<(int i)
+{
+ output (to_str(i));
+ return *this;
+}
+
void
Dstream::output (String s)
{
r.message (_ ("not enough fields in Dstream init"));
continue;
}
- (*silent_dict_p_)[r[0]] = (bool)(int)(Scalar (r[1]));
+ (*silent_dict_p_)[r[0]] = r[1] == "1";
}
if ((*silent_dict_p_).elem_b ("Dstream_default_silence"))
--- /dev/null
+/*
+ moment.cc -- implement Moment
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+
+#include "lily-guile.hh"
+#include "moment.hh"
+#include "warn.hh"
+
+SCM
+Moment::mark_smob (SCM s)
+{
+ return SCM_EOL;
+}
+
+
+Moment::~Moment()
+{
+ self_scm_ = SCM_EOL;
+}
+
+int
+Moment::print_smob (SCM s, SCM port, scm_print_state *)
+{
+ Moment *r = (Moment *) SCM_CDR (s);
+
+ scm_puts ("#<Mom ", port);
+ String str(r->str());
+ scm_puts ((char *)str.ch_C(), port);
+ scm_puts (" >", port);
+
+ return 1;
+}
+
+void
+Moment::do_smobify_self ()
+{}
+
+SCM
+make_rational (SCM n, SCM d)
+{
+ if (SCM_INUMP (n) && SCM_INUMP(d))
+ {
+ Moment *r = new Moment (gh_scm2int (n), gh_scm2int (d));
+ return r->smobify_self ();
+ }
+ else
+ {
+ ::error ("Not a number");
+ assert(false);
+ }
+}
+
+#include "ly-smobs.icc"
+
+IMPLEMENT_SMOBS(Moment);
+
+void
+init_moments ()
+{
+ scm_make_gsubr ("make-moment", 2 , 0, 0, (SCM(*)(...)) make_rational);
+}
+
+ADD_SCM_INIT_FUNC(moms,init_moments);
#include "translation-property.hh"
#include "debug.hh"
-
-
void
Translation_property::do_print () const
{
#ifndef NPRINT
- DEBUG_OUT << "." << var_str_ << " = " << value_;
+ DEBUG_OUT << "." << var_str_ << " = " ;
+ if (flower_dstream && !flower_dstream->silent_b ("Translation_property"))
+ ly_display_scm (value_);
#endif
}