2 bar-number-grav.cc -- implement Bar_number_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
10 #include "bar-number-grav.hh"
12 #include "text-def.hh"
13 #include "command-request.hh"
15 #include "time-description.hh"
17 Bar_number_engraver::Bar_number_engraver()
22 static Command_script_req dummy
;
25 Bar_number_engraver::acknowledge_element (Score_elem_info i
)
27 if (i
.origin_grav_l_arr_
.size() == 1 &&
28 i
.elem_l_
->is_type_b (Bar::static_name()) && !script_p_
)
30 Time_description
const * time
= get_staff_info().time_C_
;
31 if (!time
|| time
->cadenza_b_
)
34 script_p_
= new Script
;
35 Text_def
*td_p
=new Text_def
;
36 td_p
->text_str_
= time
->bars_i_
;
38 script_p_
->specs_l_
= td_p
;
39 script_p_
->breakable_b_
= true;
42 announce_element (Score_elem_info (script_p_
, &dummy
));
47 Bar_number_engraver::do_pre_move_processing()
51 typeset_element (script_p_
);
56 IMPLEMENT_IS_TYPE_B1(Bar_number_engraver
,Engraver
);
57 ADD_THIS_TRANSLATOR(Bar_number_engraver
);