3 bar-check-iterator.cc -- implement Bar_check_iterator
5 source file of the GNU LilyPond music typesetter
7 (c) 2001--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
11 #include "simple-music-iterator.hh"
13 #include "translator-group.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_COPY_CONS(Bar_check_iterator
);
23 virtual void process (Moment
);
24 Bar_check_iterator( );
25 DECLARE_SCHEME_CALLBACK(constructor
, ());
28 IMPLEMENT_CTOR_CALLBACK(Bar_check_iterator
);
30 Bar_check_iterator::Bar_check_iterator()
35 Bar_check_iterator::process (Moment m
)
37 Simple_music_iterator::process(m
);
40 Translator_group
*tr
= report_to ();
42 SCM mp
= tr
->get_property ("measurePosition");
43 SCM sync
= tr
->get_property ("barCheckSynchronize");
45 Moment
* where
=unsmob_moment (mp
);
49 if (where
->main_part_
)
51 get_music ()->origin ()->warning (_f ("barcheck failed at: %s",
52 where
->to_string ()));
53 if (to_boolean (sync
))
55 tr
= tr
->where_defined (ly_symbol2scm("measurePosition"));
57 tr
->set_property ("measurePosition", zero
.smobbed_copy ());