2 headreg.cc -- part of LilyPond
4 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
10 #include "complexwalker.hh"
13 Notehead_register::Notehead_register(Complex_walker
*w_l
)
14 :Request_register(w_l
)
21 Notehead_register::try_request(Request
*req_l
)
23 if (req_l
->note() || req_l
->rest())
24 accepted_req_arr_
.push(req_l
);
31 Notehead_register::set_dir(int d
)
37 Notehead_register::process_request()
39 if (!accepted_req_arr_
.size())
42 Request
* req_l
= accepted_req_arr_
.top();
44 Notehead
*n_p
= new Notehead(8); // ugh
46 n_p
->set_rhythmic(req_l
->rhythmic());
47 n_p
->position
= req_l
->note()->height() +
48 walk_l_
->clef_
.c0_position_i_
;
50 note_p_
= new Rest ( req_l
->rhythmic()->balltype
,
51 req_l
->rhythmic()->dots
);
52 if (req_l
->rhythmic()->balltype
<= 2)
55 6 * paper()->internote()));
57 Staff_elem_info
itinf(note_p_
,req_l
,this);
58 announce_element(itinf
);
62 Notehead_register::do_pre_move_process()
65 if (dir_i_
&& note_p_
->name() == String("Rest"))
66 note_p_
->translate(Offset(0, 4*dir_i_
* paper()->internote()));
67 typeset_element(note_p_
);