- {
- get_music ()->origin ()->warning (_f ("barcheck failed at: %s",
- where->string ()));
- if (to_boolean (sync))
- {
- tr = tr->where_defined (ly_symbol2scm("measurePosition"));
- Moment zero;
- tr->set_property ("measurePosition", zero.smobbed_copy ());
- }
- }
+ {
+ bool warn = true;
+ if (to_boolean (sync))
+ {
+ SCM mp;
+ tr = tr->where_defined (ly_symbol2scm ("measurePosition"), &mp);
+ Moment zero;
+ tr->set_property ("measurePosition", zero.smobbed_copy ());
+ }
+ else
+ {
+ SCM lf = tr->get_property ("barCheckLastFail");
+ if (unsmob<Moment> (lf)
+ && *unsmob<Moment> (lf) == *where)
+ warn = false;
+ else
+ tr->set_property ("barCheckLastFail", mp);
+ }
+
+ if (warn)
+ get_music ()->origin ()->warning (_f ("barcheck failed at: %s",
+ where->to_string ()));
+ }