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@xs4all.nl>
9 #include "simple-music-iterator.hh"
15 Check bar checks. We do this outside the engravers so that you can
16 race through the score using skipTypesetting to correct durations.
18 class Bar_check_iterator : Simple_music_iterator
21 virtual void process (Moment);
22 Bar_check_iterator ();
23 DECLARE_SCHEME_CALLBACK (constructor, ());
26 IMPLEMENT_CTOR_CALLBACK (Bar_check_iterator);
28 Bar_check_iterator::Bar_check_iterator ()
33 Bar_check_iterator::process (Moment m)
35 Simple_music_iterator::process (m);
38 Context *tr = get_outlet ();
40 SCM check = tr->get_property ("ignoreBarChecks");
41 if (to_boolean (check))
44 SCM mp = tr->get_property ("measurePosition");
45 SCM sync = tr->get_property ("barCheckSynchronize");
47 Moment *where = unsmob_moment (mp);
51 if (where->main_part_)
54 if (to_boolean (sync))
57 tr = tr->where_defined (ly_symbol2scm ("measurePosition"), &mp);
59 tr->set_property ("measurePosition", zero.smobbed_copy ());
63 SCM lf = tr->get_property ("barCheckLastFail");
64 if (unsmob_moment (lf)
65 && *unsmob_moment (lf) == *where)
68 tr->set_property ("barCheckLastFail", mp);
72 get_music ()->origin ()->warning (_f ("barcheck failed at: %s",
73 where->to_string ()));