2 tie-reg.cc -- implement Tie_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
11 #include "note-head.hh"
12 #include "musical-request.hh"
13 #include "music-list.hh"
15 Tie_engraver::Tie_engraver()
23 end_melodic_req_l_
=0;
28 Tie_engraver::do_post_move_processing()
30 if (tie_p_
&& now_moment () == end_mom_
)
34 end_melodic_req_l_
= melodic_req_l_
;
42 Tie_engraver::do_try_request (Request
*r
)
44 if (! (r
->musical() && r
->musical ()->tie ()))
51 req_l_
= r
->musical()->tie ();
52 end_mom_
= r
->parent_music_l_
->time_int().length ()
58 Tie_engraver::do_process_requests()
60 dir_
= (Direction
) int (get_property ("ydirection"));
61 if (req_l_
&& ! tie_p_
)
64 Scalar prop
= get_property ("slurdash");
66 tie_p_
->dash_i_
= prop
;
71 Tie_engraver::acknowledge_element (Score_elem_info i
)
73 if (i
.elem_l_
->is_type_b (Note_head::static_name ()))
77 tie_p_
->set_head (LEFT
, (Note_head
*)i
.elem_l_
->item());
78 melodic_req_l_
= i
.req_l_
->musical()->melodic ();
83 end_tie_p_
->set_head (RIGHT
, (Note_head
*)i
.elem_l_
->item());
84 if (!Melodic_req::compare (*end_melodic_req_l_
, *melodic_req_l_
))
85 end_tie_p_
->same_pitch_b_
= true;
86 announce_element (Score_elem_info (end_tie_p_
,end_req_l_
));
92 Tie_engraver::do_pre_move_processing()
97 end_tie_p_
->dir_
= dir_
;
99 typeset_element (end_tie_p_
);
106 Tie_engraver::do_removal_processing ()
108 do_pre_move_processing ();
111 req_l_
->warning (_("unended Tie"));
119 IMPLEMENT_IS_TYPE_B1(Tie_engraver
,Engraver
);
120 ADD_THIS_TRANSLATOR(Tie_engraver
);