2 tie-reg.cc -- implement Tie_register
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
11 #include "note-head.hh"
12 #include "musical-request.hh"
13 #include "music-list.hh"
15 Tie_register::Tie_register()
23 end_melodic_req_l_
=0;
28 Tie_register::sync_features()
30 dir_i_
= get_feature("vdir");
35 Tie_register::do_post_move_processing()
37 if (tie_p_
&& get_staff_info().when() == end_mom_
) {
40 end_melodic_req_l_
= melodic_req_l_
;
48 Tie_register::acceptable_request_b(Request
*r
)
50 return r
->musical() && r
->musical()->tie();
54 Tie_register::do_try_request(Request
*r
)
56 if(!acceptable_request_b(r
))
61 req_l_
= r
->musical()->tie();
62 end_mom_
= r
->parent_music_l_
->time_int().length()
63 + get_staff_info().when();
68 Tie_register::do_process_requests()
70 if (req_l_
&& ! tie_p_
) {
76 Tie_register::acknowledge_element(Score_elem_info i
)
78 if (i
.elem_l_
->name() == Note_head::static_name()) {
80 tie_p_
->set_head(-1, (Note_head
*)i
.elem_l_
->item());
81 melodic_req_l_
= i
.req_l_
->musical()->melodic();
85 end_tie_p_
->set_head(1, (Note_head
*)i
.elem_l_
->item());
86 if (!Melodic_req::compare ( *end_melodic_req_l_
, *melodic_req_l_
))
87 end_tie_p_
->same_pitch_b_
= true;
88 announce_element(Score_elem_info(end_tie_p_
,end_req_l_
));
94 Tie_register::do_pre_move_processing()
98 end_tie_p_
->dir_i_
= dir_i_
;
100 typeset_element(end_tie_p_
);
107 Tie_register::~Tie_register()
110 req_l_
->warning("unended Tie");
116 Tie_register::set_feature(Feature f
)
118 if (f
.type_
== "vdir")
122 IMPLEMENT_STATIC_NAME(Tie_register
);
123 IMPLEMENT_IS_TYPE_B1(Tie_register
,Request_register
);
124 ADD_THIS_REGISTER(Tie_register
);