2 span-bar-grav.cc -- implement Span_bar_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
10 #include "span-bar-grav.hh"
11 #include "vertical-align-spanner.hh"
13 Span_bar_engraver::Span_bar_engraver()
20 Span_bar_engraver::get_span_bar_p() const
26 Span_bar_engraver::acknowledge_element (Score_elem_info i
)
28 int depth
= i
.origin_grav_l_arr_
.size();
30 && i
.elem_l_
->is_type_b (Bar::static_name()))
32 bar_l_arr_
.push ((Bar
*)i
.elem_l_
->item());
34 if (bar_l_arr_
.size() >= 2 && !spanbar_p_
)
36 spanbar_p_
= get_span_bar_p();
37 announce_element (Score_elem_info (spanbar_p_
,0));
38 spanbar_p_
-> type_str_
= bar_l_arr_
[0]->type_str_
;
41 else if (i
.elem_l_
->is_type_b (Vertical_align_spanner::static_name())
42 && i
.origin_grav_l_arr_
.size() <= 2)
44 valign_l_
= (Vertical_align_spanner
*)i
.elem_l_
->spanner();
49 Span_bar_engraver::do_pre_move_processing()
53 for (int i
=0; i
< bar_l_arr_
.size() ; i
++)
54 spanbar_p_
->add (bar_l_arr_
[i
]);
55 spanbar_p_
->set (valign_l_
);
56 typeset_element (spanbar_p_
);
59 bar_l_arr_
.set_size (0);
64 IMPLEMENT_IS_TYPE_B1(Span_bar_engraver
,Engraver
);
65 ADD_THIS_TRANSLATOR(Span_bar_engraver
);