+ Moment mp (robust_scm2moment (get_property ("measurePosition"), Moment (0)));
+
+ Moment now = now_mom ();
+ if (mmrest_
+ && now.main_part_ != last_main_moment_
+ && mp.main_part_ == Rational (0))
+ {
+ last_rest_ = mmrest_;
+ last_numbers_ = numbers_;
+
+ int cur = scm_to_int (get_property ("currentBarNumber"));
+ int num = cur - start_measure_;
+
+ /*
+ We can't plug a markup directly into the grob, since the
+ measure-count determines the formatting of the mmrest.
+ */
+ last_rest_->set_property ("measure-count", scm_int2num (num));
+
+ SCM sml = get_property ("measureLength");
+ Rational ml = (unsmob_moment (sml)) ? unsmob_moment (sml)->main_part_ : Rational (1);
+ if (ml >= Rational (2))
+ {
+ last_rest_->set_property ("use-breve-rest", SCM_BOOL_T);
+ }
+
+ mmrest_ = 0;
+ numbers_.clear ();
+
+ Grob *last = last_numbers_.size () ? last_numbers_[0] : 0;
+ if (last && last->get_property ("text") == SCM_EOL)
+ {
+ SCM thres = get_property ("restNumberThreshold");
+ int t = 1;
+ if (scm_is_number (thres))
+ t = scm_to_int (thres);
+
+ if (num <= t)
+ last->suicide ();
+ else
+ {
+ SCM text
+ = scm_number_to_string (scm_int2num (num), scm_from_int (10));
+ last->set_property ("text", text);
+ }
+ }
+ }
+
+ last_main_moment_ = now.main_part_;
+}