lilypond-1.3.5
[lilypond.git] / lily / bar-number-engraver.cc
blobc8a0aa01bb193d0cdd15682b5f7b8f35afdd2325
1 /*
2 bar-number-grav.cc -- implement Bar_number_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
10 #include "bar-number-engraver.hh"
11 #include "timing-translator.hh"
12 #include "timing-engraver.hh"
13 #include "engraver-group-engraver.hh"
14 #include "text-item.hh"
16 Bar_number_engraver::Bar_number_engraver()
18 axis_ = Y_AXIS;
19 type_ = "barNumber";
20 visibility_lambda_
21 = ly_ch_C_eval_scm ("postbreak-only-visibility");
24 void
25 Bar_number_engraver::do_process_requests ()
27 Translator *tr = daddy_grav_l ()->get_simple_translator ("Timing_engraver");
28 Timing_translator *time = dynamic_cast<Timing_translator*>(tr);
30 // todo include (&&!time->cadenza_b_ )
31 if (!time->measure_position () && now_mom () > Moment (0))
33 create_items (0);
35 text_p_->text_str_ = to_str (time->bars_i ());
39 ADD_THIS_TRANSLATOR(Bar_number_engraver);