lilypond-1.3.145
[lilypond.git] / lily / timing-engraver.cc
blobba462c16739e30e746a78f6dda43df3052db7d43
1 /*
2 timing-grav.cc -- implement Timing_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8 #include "translator-group.hh"
9 #include "command-request.hh"
10 #include "grob-info.hh"
11 #include "multi-measure-rest.hh"
12 #include "timing-translator.hh"
13 #include "engraver.hh"
15 /**
16 Do time bookkeeping
18 class Timing_engraver : public Timing_translator, public Engraver
20 protected:
21 virtual void start_translation_timestep ();
22 virtual void stop_translation_timestep ();
23 virtual void process_music ();
24 public:
25 VIRTUAL_COPY_CONS (Translator);
28 ADD_THIS_TRANSLATOR (Timing_engraver);
30 void
31 Timing_engraver::start_translation_timestep ()
33 Timing_translator::start_translation_timestep ();
35 SCM nonauto = get_property ("barNonAuto");
37 SCM which = get_property ("whichBar");
38 if (!gh_string_p (which))
39 which = now_mom ()
40 ? SCM_EOL : ly_str02scm ("|");
42 if (!gh_string_p (which) && !to_boolean (nonauto))
44 SCM always = get_property ("barAlways");
45 if (!measure_position ()
46 || (to_boolean (always)))
48 /* should this work, or be junked? See input/bugs/no-bars.ly */
49 which=get_property ("defaultBarType");
53 daddy_trans_l_->set_property ("whichBar", which);
56 void
57 Timing_engraver::stop_translation_timestep ()
59 Timing_translator::stop_translation_timestep ();
60 daddy_trans_l_->set_property ("whichBar", SCM_EOL);
65 ugh. Translator doesn't do process_music ().
67 void
68 Timing_engraver::process_music ()
70 Timing_translator::process_music ();