2004-10-09 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/*.cc: use robust_scm2moment() where appropriate.
+
+ * lily/tuplet-engraver.cc (try_music):
+
* lily/moment.cc (robust_scm2moment): new function.
* scm/titling.scm (default-score-title): remove caps for piece.
int bn = robust_scm2int (barnum, 0);
- Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
+ Moment mp = robust_scm2moment (smp, Moment (0));
if (mp.main_part_ < Rational (0))
bn--;
/* end beam at end of beat */
if (dir == STOP)
{
- SCM beat (get_property ("beatLength"));
-
- if (unsmob_moment (beat))
- moment = *unsmob_moment (beat);
+ moment = robust_scm2moment (get_property ("beatLength"), moment)
}
/* second guess: property generic time exception */
if (scm_is_string (wb))
{
- SCM smp = get_property ("measurePosition");
-
- Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
+ Moment mp (robust_scm2moment (get_property ("measurePosition"),Moment (0));
if (mp.main_part_ == Rational (0))
{
SCM bn = get_property ("currentBarNumber");
set_melisma (true);
prev_start_ev_ = start_ev_;
beam_ = make_spanner ("Beam", start_ev_->self_scm ());
- SCM smp = get_property ("measurePosition");
- Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
+ Moment mp (robust_scm2moment (get_property ("measurePosition"), Moment (0));
beam_start_location_ = mp;
beam_start_mom_ = now_mom ();
set_melisma (true);
subdivide_beams_ = to_boolean (get_property ("subdivideBeams"));
- beat_length_ = *unsmob_moment (get_property ("beatLength"));
+ beat_length_ = robust_scm2moment (get_property ("beatLength"), Moment (1,4));
}
}
beam_ = make_spanner ("Beam", repeat_->self_scm ());
beam_->set_property ("chord-tremolo", SCM_BOOL_T);
- SCM smp = get_property ("measurePosition");
- Moment mp
- = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
- beam_start_location_ = mp;
+ SCM smp =
+ beam_start_location_ = robust_scm2moment (get_property ("measurePosition"), Moment (0));
}
}
}
- SCM smp = get_property ("measurePosition");
- Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
+
+ Moment mp(robust_scm2moment (get_property ("measurePosition"), Moment (0));
if (last_rest_)
{
bar_seen_ = false;
- SCM smp = get_property ("measurePosition");
- Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
+ Moment mp(robust_scm2moment (get_property ("measurePosition"), Moment (0));
Moment now =now_mom ();
if (mmrest_
stop_mom_ = start_mom_ + Moment (count) * body_length_;
next_moment_ = start_mom_ + body_length_;
- SCM m = get_property ("measureLength");
- Moment meas_len;
- if (unsmob_moment (m))
- meas_len = *unsmob_moment (m);
-
+ Moment meas_len (robust_scm2moment (get_property ("measureLength"), Moment (1)));
if (meas_len == body_length_)
repeat_sign_type_ = MEASURE;
else if (Moment (2)* meas_len == body_length_)
{
measposp = now;
context ()->set_property ("measurePosition",
- measposp.smobbed_copy ());
+ measposp.smobbed_copy ());
}
measposp += dt;