2 localkeyreg.cc -- implement Local_key_register
4 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 #include "localkeyreg.hh"
8 #include "localkeyitem.hh"
9 #include "complexwalker.hh"
11 Local_key_register::Local_key_register(Complex_walker
*w
)
17 Local_key_register::try_request(Request
*)
24 Local_key_register::process_request()
28 Local_key_register::do_pre_move_process()
31 walk_l_
->typeset_element(key_item_p_
);
36 Local_key_register::acknowledge_element(Staff_elem_info info
)
38 if (info
.req_l_
->melodic()) {
39 Melodic_req
* melodic_l_
= info
.req_l_
->melodic();
41 if( melodic_l_
->forceacc
||
42 walk_l_
->local_key_
.oct(melodic_l_
->octave
).acc(melodic_l_
->notename
)
43 != melodic_l_
->accidental
) {
44 Item
* support_l_
= info
.elem_p_
->item();
48 key_item_p_
= new Local_key_item(walk_l_
->clef_
.c0_position_i_
);
49 key_item_p_
->c0_position
= walk_l_
->clef_
.c0_position_i_
;
52 key_item_p_
->add(melodic_l_
);
53 key_item_p_
->add(support_l_
);
54 walk_l_
->local_key_
.oct(melodic_l_
->octave
)
55 .set(melodic_l_
->notename
, melodic_l_
->accidental
);