2 text-reg.cc -- implement Text_engraver
4 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
8 #include "note-column.hh"
9 #include "musical-request.hh"
10 #include "text-grav.hh"
11 #include "text-item.hh"
13 Text_engraver::Text_engraver()
17 do_post_move_processing();
21 Text_engraver::do_try_request (Request
*req_l
)
23 Musical_req
*m
= req_l
->musical();
24 if (!m
|| ! m
->text())
26 if (text_req_l_
&& text_req_l_
->equal_b (m
))
29 text_req_l_
= m
->text();
33 Text_engraver::acknowledge_element (Score_elem_info i
)
35 if (text_p_
&& i
.elem_l_
->name() == Note_column::static_name ())
37 text_p_
->add_support (i
.elem_l_
);
41 Text_engraver::do_process_requests()
45 text_p_
= new Text_item (text_req_l_
->tdef_p_
, text_req_l_
->dir_i_
); // ugh
46 announce_element (Score_elem_info (text_p_
, text_req_l_
));
50 Text_engraver::do_pre_move_processing()
54 if (dir_i_
&& !text_p_
->dir_i_
)
55 text_p_
->dir_i_
= dir_i_
;
56 Staff_symbol
* s_l
= get_staff_info().staff_sym_l_
;
57 text_p_
->set_staffsym (s_l
);
58 typeset_element (text_p_
);
64 Text_engraver::set_feature (Feature i
)
66 if (i
.type_
== "vdir")
70 Text_engraver::do_post_move_processing()
75 IMPLEMENT_IS_TYPE_B1(Text_engraver
,Engraver
);
76 ADD_THIS_ENGRAVER(Text_engraver
);