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"
12 #include "general-script-def.hh"
14 Script_engraver::Script_engraver()
16 do_post_move_processing();
20 Script_engraver::do_try_request (Request
*r_l
)
22 if (!r_l
->musical() || ! r_l
->musical ()->musicalscript ())
25 for (int i
=0; i
< script_req_l_arr_
.size(); i
++)
27 if (r_l
->equal_b (script_req_l_arr_
[i
]))
30 script_req_l_arr_
.push (r_l
->script());
36 Script_engraver::do_process_requests()
38 if (script_p_arr_
.size ())
41 for (int i
=0; i
< script_req_l_arr_
.size(); i
++)
43 Script_req
* l
=script_req_l_arr_
[i
];
44 Script
*p
=new Script
;
46 p
->specs_l_
= l
->scriptdef_p_
;
47 script_p_arr_
.push (p
);
48 announce_element (Score_elem_info (p
, l
));
53 Script_engraver::do_pre_move_processing()
55 Staff_symbol
* s_l
= get_staff_info().staff_sym_l_
;
56 for (int i
=0; i
< script_p_arr_
.size(); i
++)
58 Script
*script_p
= script_p_arr_
[i
];
59 if (!script_p
->specs_l_
->inside_b())
60 script_p
->add_support (s_l
);
62 typeset_element (script_p
);
64 script_p_arr_
.clear();
68 Script_engraver::do_post_move_processing()
70 script_req_l_arr_
.clear();
74 IMPLEMENT_IS_TYPE_B1(Script_engraver
,Engraver
);
75 ADD_THIS_TRANSLATOR(Script_engraver
);