2 script-reg.cc -- implement Script_engraver
4 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 #include "script-grav.hh"
9 #include "musical-request.hh"
11 #include "staff-sym.hh"
13 Script_engraver::Script_engraver()
15 do_post_move_processing();
19 Script_engraver::do_try_request (Request
*r_l
)
21 if (!r_l
->musical() || ! r_l
->musical ()->musicalscript ())
24 for (int i
=0; i
< script_req_l_arr_
.size(); i
++)
26 if (r_l
->equal_b (script_req_l_arr_
[i
]))
29 script_req_l_arr_
.push (r_l
->script());
35 Script_engraver::do_process_requests()
37 if (script_p_arr_
.size ())
40 for (int i
=0; i
< script_req_l_arr_
.size(); i
++)
42 Script_req
* l
=script_req_l_arr_
[i
];
43 Script
*p
=new Script
;
45 p
->specs_l_
= l
->scriptdef_p_
;
46 script_p_arr_
.push (p
);
47 announce_element (Score_elem_info (p
, l
));
52 Script_engraver::do_pre_move_processing()
54 Staff_symbol
* s_l
= get_staff_info().staff_sym_l_
;
55 for (int i
=0; i
< script_p_arr_
.size(); i
++)
57 Script
*script_p
= script_p_arr_
[i
];
58 script_p
->set_staffsym (s_l
);
59 typeset_element (script_p
);
61 script_p_arr_
.clear();
65 Script_engraver::do_post_move_processing()
67 script_req_l_arr_
.clear();
71 IMPLEMENT_IS_TYPE_B1(Script_engraver
,Engraver
);
72 ADD_THIS_TRANSLATOR(Script_engraver
);