2 bar-number-grav.cc -- implement Bar_number_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
10 #include "bar-number-grav.hh"
12 #include "text-def.hh"
13 #include "command-request.hh"
16 #include "time-description.hh"
18 Bar_number_engraver::Bar_number_engraver()
23 static Command_script_req dummy
;
27 Bar_number_engraver::acknowledge_element (Score_elem_info i
)
29 if (i
.origin_grav_l_arr_
.size() == 1 &&
30 i
.elem_l_
->is_type_b (Bar::static_name()) && !script_p_
)
32 Time_description
const * time
= get_staff_info().time_C_
;
33 if (!time
|| time
->cadenza_b_
)
36 script_p_
= new Script
;
37 Text_def
*td_p
=new Text_def
;
38 td_p
->text_str_
= time
->bars_i_
;
39 td_p
->align_i_
= LEFT
;
41 script_p_
->specs_l_
= td_p
;
42 script_p_
->breakable_b_
= true;
44 // ugh, howto move this up?
46 //// script_p_->y_ += 2;
50 support
.set_stemend (10);
51 script_p_
->set_stem (&support
);
53 announce_element (Score_elem_info (script_p_
, &dummy
));
58 Bar_number_engraver::do_pre_move_processing()
62 typeset_element (script_p_
);
67 IMPLEMENT_IS_TYPE_B1(Bar_number_engraver
,Engraver
);
68 ADD_THIS_TRANSLATOR(Bar_number_engraver
);