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::sync_features()
30 dir_i_
= get_feature ("vdir");
35 Tie_engraver::do_post_move_processing()
37 if (tie_p_
&& get_staff_info().when () == end_mom_
)
41 end_melodic_req_l_
= melodic_req_l_
;
49 Tie_engraver::acceptable_request_b (Request
*r
)
51 return r
->musical() && r
->musical ()->tie ();
55 Tie_engraver::do_try_request (Request
*r
)
57 if (!acceptable_request_b (r
))
63 req_l_
= r
->musical()->tie ();
64 end_mom_
= r
->parent_music_l_
->time_int().length ()
65 + get_staff_info().when ();
70 Tie_engraver::do_process_requests()
72 if (req_l_
&& ! tie_p_
)
79 Tie_engraver::acknowledge_element (Score_elem_info i
)
81 if (i
.elem_l_
->name() == Note_head::static_name ())
85 tie_p_
->set_head (-1, (Note_head
*)i
.elem_l_
->item());
86 melodic_req_l_
= i
.req_l_
->musical()->melodic ();
91 end_tie_p_
->set_head (1, (Note_head
*)i
.elem_l_
->item());
92 if (!Melodic_req::compare ( *end_melodic_req_l_
, *melodic_req_l_
))
93 end_tie_p_
->same_pitch_b_
= true;
94 announce_element (Score_elem_info (end_tie_p_
,end_req_l_
));
100 Tie_engraver::do_pre_move_processing()
105 end_tie_p_
->dir_i_
= dir_i_
;
107 typeset_element (end_tie_p_
);
114 Tie_engraver::~Tie_engraver()
118 req_l_
->warning ("unended Tie");
124 Tie_engraver::set_feature (Feature f
)
126 if (f
.type_
== "vdir")
131 IMPLEMENT_IS_TYPE_B1(Tie_engraver
,Engraver
);
132 ADD_THIS_ENGRAVER(Tie_engraver
);