2 span-bar-grav.cc -- implement Span_bar_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 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
27 Span_bar_engraver::do_creation_processing ()
32 Span_bar_engraver::do_removal_processing ()
37 Span_bar_engraver::acknowledge_element (Score_elem_info i
)
39 int depth
= i
.origin_grav_l_arr_
.size();
41 && i
.elem_l_
->is_type_b (Bar::static_name()))
43 bar_l_arr_
.push ((Bar
*)i
.elem_l_
->item());
45 if (bar_l_arr_
.size() >= 2 && !spanbar_p_
)
47 spanbar_p_
= get_span_bar_p();
48 announce_element (Score_elem_info (spanbar_p_
,0));
49 spanbar_p_
-> type_str_
= bar_l_arr_
[0]->type_str_
;
52 else if (i
.elem_l_
->is_type_b (Vertical_align_spanner::static_name())
53 && i
.origin_grav_l_arr_
.size() <= 2)
55 valign_l_
= (Vertical_align_spanner
*)i
.elem_l_
->spanner();
60 Span_bar_engraver::do_pre_move_processing()
64 for (int i
=0; i
< bar_l_arr_
.size() ; i
++)
65 spanbar_p_
->add (bar_l_arr_
[i
]);
66 spanbar_p_
->set (valign_l_
);
67 typeset_element (spanbar_p_
);
70 bar_l_arr_
.set_size (0);
74 IMPLEMENT_IS_TYPE_B1(Span_bar_engraver
,Engraver
);
75 ADD_THIS_TRANSLATOR(Span_bar_engraver
);