2 headreg.cc -- part of LilyPond
4 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
9 #include "paper-def.hh"
10 #include "complex-walker.hh"
11 #include "musical-request.hh"
13 Notehead_register::Notehead_register()
16 set_feature(Features::dir(0));
17 post_move_processing();
21 Notehead_register::try_request(Request
*req_l
)
23 if (req_l
->note() || req_l
->rest())
24 note_req_l_
=req_l
->rhythmic();
31 Notehead_register::set_feature(Features d
)
33 if(d
.direction_i_
|| d
.initialiser_b_
)
34 dir_i_
= d
.direction_i_
;
38 Notehead_register::process_requests()
43 Notehead
*n_p
= new Notehead(8); // ugh
45 n_p
->set_rhythmic(note_req_l_
->rhythmic());
47 if (note_req_l_
->note()) {
48 n_p
->position
= note_req_l_
->note()->height() +
49 *get_staff_info().c0_position_i_l_
;
50 } else if (note_req_l_
->rest()) {
52 if (note_req_l_
->rhythmic()->duration_
.type_i_
<= 2)
55 6 * paper()->internote()));
58 Staff_elem_info
itinf(note_p_
,note_req_l_
);
59 announce_element(itinf
);
63 Notehead_register::pre_move_processing()
66 if (dir_i_
&& note_p_
->rest_b_
&& note_p_
->balltype
<= 2) {
67 note_p_
->position
+=4*dir_i_
;
69 typeset_element(note_p_
);
74 Notehead_register::post_move_processing()
79 IMPLEMENT_STATIC_NAME(Notehead_register
);
80 ADD_THIS_REGISTER(Notehead_register
);