2 bar-check-iterator.cc -- implement Bar_check_iterator
4 source file of the GNU LilyPond music typesetter
6 (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "simple-music-iterator.hh"
14 Check bar checks. We do this outside the engravers so that you can
15 race through the score using skipTypesetting to correct durations.
17 class Bar_check_iterator : Simple_music_iterator
20 virtual void process (Moment);
21 Bar_check_iterator ( );
22 DECLARE_SCHEME_CALLBACK (constructor, ());
25 IMPLEMENT_CTOR_CALLBACK (Bar_check_iterator);
27 Bar_check_iterator::Bar_check_iterator ()
32 Bar_check_iterator::process (Moment m)
34 Simple_music_iterator::process (m);
37 Context *tr = get_outlet ();
39 SCM mp = tr->get_property ("measurePosition");
40 SCM sync = tr->get_property ("barCheckSynchronize");
42 Moment * where = unsmob_moment (mp);
46 if (where->main_part_)
49 if (to_boolean (sync))
51 tr = tr->where_defined (ly_symbol2scm ("measurePosition"));
53 tr->set_property ("measurePosition", zero.smobbed_copy ());
57 SCM lf = tr->get_property ("barCheckLastFail");
58 if (unsmob_moment (lf)
59 && *unsmob_moment (lf) == *where)
62 tr->set_property ("barCheckLastFail", mp);
66 get_music ()->origin ()->warning (_f ("barcheck failed at: %s",
67 where->to_string ()));