2 bar-reg.cc -- implement Bar_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
11 #include "musical-request.hh"
12 #include "multi-measure-rest.hh"
13 #include "command-request.hh"
14 #include "time-description.hh"
15 #include "engraver-group.hh"
17 Bar_engraver::Bar_engraver()
20 do_post_move_processing();
24 Bar_engraver::do_try_request (Request
*r_l
)
26 Command_req
* c_l
= r_l
->command();
27 if (!c_l
|| !c_l
->bar())
29 Bar_req
* b
= c_l
->bar();
30 if (bar_req_l_
&& bar_req_l_
->equal_b (b
))
39 Bar_engraver::create_bar ()
44 bar_p_
->break_priority_i_
= 0;
45 announce_element (Score_elem_info (bar_p_
, bar_req_l_
));
51 Bar_engraver::do_creation_processing ()
54 bar_p_
->type_str_
= "";
58 Bar_engraver::do_removal_processing ()
62 typeset_element (bar_p_
);
68 Bar_engraver::do_process_requests()
75 bar_p_
->type_str_
= bar_req_l_
->type_str_
;
79 Time_description
const *time
= get_staff_info().time_C_
;
80 if (time
&& !time
->whole_in_measure_
)
87 r
.penalty_i_
= Break_req::DISALLOW
;
88 daddy_grav_l ()->try_request (&r
);
94 Bar_engraver::do_pre_move_processing()
98 typeset_element (bar_p_
);
104 Bar_engraver::do_post_move_processing()
110 IMPLEMENT_IS_TYPE_B1(Bar_engraver
,Engraver
);
111 ADD_THIS_TRANSLATOR(Bar_engraver
);