3 bar-check-iterator.cc -- implement Bar_check_iterator
5 source file of the GNU LilyPond music typesetter
7 (c) 2001--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
11 #include "simple-music-iterator.hh"
16 Check bar checks. We do this outside the engravers so that you can
17 race through the score using skipTypesetting to correct durations.
19 class Bar_check_iterator : Simple_music_iterator
22 virtual void process (Moment);
23 Bar_check_iterator( );
24 DECLARE_SCHEME_CALLBACK(constructor, ());
27 IMPLEMENT_CTOR_CALLBACK(Bar_check_iterator);
29 Bar_check_iterator::Bar_check_iterator()
34 Bar_check_iterator::process (Moment m)
36 Simple_music_iterator::process(m);
39 Context *tr = get_outlet ();
41 SCM mp = tr->get_property ("measurePosition");
42 SCM sync= tr->get_property ("barCheckSynchronize");
44 Moment * where =unsmob_moment (mp);
48 if (where->main_part_)
51 if (to_boolean (sync))
53 tr = tr->where_defined (ly_symbol2scm("measurePosition"));
55 tr->set_property ("measurePosition", zero.smobbed_copy ());
59 SCM lf = tr->get_property ("barCheckLastFail");
60 if (unsmob_moment (lf)
61 && *unsmob_moment (lf) == *where)
64 tr->set_property ("barCheckLastFail", mp);
68 get_music ()->origin ()->warning (_f ("barcheck failed at: %s",
69 where->to_string ()));