lilypond-1.1.55
[lilypond.git] / lily / bar-number-engraver.cc
blobce4a0eb9683697baa3c338d75bdfd336fb015f4a
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 "time-description.hh"
12 #include "timing-engraver.hh"
13 #include "engraver-group.hh"
14 #include "g-text-item.hh"
16 Bar_number_engraver::Bar_number_engraver()
18 axis_ = Y_AXIS;
19 type_ = "barNumber";
20 visibility_lambda_
21 = gh_eval_str ("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 *timer = dynamic_cast<Timing_translator*>(tr);
29 Time_description *time = &timer->time_;
31 if (!time->whole_in_measure_ && !time->cadenza_b_ && now_mom () > Moment (0))
33 create_items (0);
35 text_p_->text_str_ = to_str (time->bars_i_);
36 text_p_->style_str_ = "roman";
40 ADD_THIS_TRANSLATOR(Bar_number_engraver);