2 timing-grav.cc -- implement Timing_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "translator-group.hh"
10 #include "command-request.hh"
11 #include "score-element-info.hh"
12 #include "multi-measure-rest.hh"
13 #include "timing-translator.hh"
14 #include "engraver.hh"
19 class Timing_engraver : public Timing_translator, public Engraver
23 virtual bool do_try_music (Music * );
24 virtual void do_post_move_processing ();
25 virtual void do_process_music ();
28 VIRTUAL_COPY_CONS(Translator);
31 ADD_THIS_TRANSLATOR(Timing_engraver);
34 Timing_engraver::do_post_move_processing( )
37 Timing_translator::do_post_move_processing ();
39 SCM nonauto = get_property ("barNonAuto");
40 SCM which = now_mom () ? SCM_UNDEFINED : ly_str02scm ("|");
42 if (which == SCM_UNDEFINED && !to_boolean (nonauto))
44 SCM always = get_property ("barAlways");
45 if (!measure_position ()
46 || (to_boolean (always)))
48 which=get_property ("defaultBarType" );
52 daddy_trans_l_->set_property ("whichBar", which);
56 Timing_engraver::do_try_music (Music*m)
58 if (Bar_req * b= dynamic_cast <Bar_req *> (m))
60 if (bar_req_l_ && !bar_req_l_->equal_b (b))
67 return Timing_translator::do_try_music (m);
71 Timing_engraver::do_process_music ()
74 daddy_trans_l_->set_property ("whichBar", bar_req_l_->get_mus_property ("type"));