3 bar-check-iterator.cc -- implement Bar_check_iterator
5 source file of the GNU LilyPond music typesetter
7 (c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
11 #include "simple-music-iterator.hh"
12 #include "command-request.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 static SCM constructor_cxx_function;
28 IMPLEMENT_CTOR_CALLBACK (Bar_check_iterator);
30 Music * get_barcheck ()
32 Music *bc = new Music;
33 bc->set_mus_property ("iterator-ctor", Bar_check_iterator::constructor_cxx_function);
37 Bar_check_iterator::Bar_check_iterator()
42 Bar_check_iterator::process (Moment m)
44 Simple_music_iterator::process(m);
47 Translator_group *tr = report_to_l ();
49 SCM mp = tr->get_property ("measurePosition");
50 SCM sync= tr->get_property ("barCheckNoSynchronize");
52 Moment * where =unsmob_moment (mp);
56 if (where->main_part_)
58 music_l ()->origin ()->warning (_f ("barcheck failed at: %s",
62 if (!to_boolean (sync))
64 tr = tr->where_defined (ly_symbol2scm("measurePosition"));
66 tr->set_property ("measurePosition", zero.smobbed_copy ());