2 tie-reg.cc -- implement Tie_engraver
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_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::acceptable_request_b (Request
*r
)
44 return r
->musical() && r
->musical ()->tie ();
48 Tie_engraver::do_try_request (Request
*r
)
50 if (!acceptable_request_b (r
))
56 req_l_
= r
->musical()->tie ();
57 end_mom_
= r
->parent_music_l_
->time_int().length ()
63 Tie_engraver::do_process_requests()
65 dir_
= (Direction
) int (get_property ("ydirection"));
66 if (req_l_
&& ! tie_p_
)
73 Tie_engraver::acknowledge_element (Score_elem_info i
)
75 if (i
.elem_l_
->name() == Note_head::static_name ())
79 tie_p_
->set_head (LEFT
, (Note_head
*)i
.elem_l_
->item());
80 melodic_req_l_
= i
.req_l_
->musical()->melodic ();
85 end_tie_p_
->set_head (RIGHT
, (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_engraver::do_pre_move_processing()
99 end_tie_p_
->dir_
= dir_
;
101 typeset_element (end_tie_p_
);
108 Tie_engraver::do_removal_processing ()
110 do_pre_move_processing ();
113 req_l_
->warning ("unended Tie");
121 IMPLEMENT_IS_TYPE_B1(Tie_engraver
,Engraver
);
122 ADD_THIS_TRANSLATOR(Tie_engraver
);