2 tie-reg.cc -- implement Tie_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 #include "tie-engraver.hh"
14 #include "note-head.hh"
15 #include "musical-request.hh"
16 #include "music-list.hh"
18 Tie_engraver::Tie_engraver()
26 end_melodic_req_l_ =0;
31 Tie_engraver::do_post_move_processing()
33 if (tie_p_ && now_moment () == end_mom_)
37 end_melodic_req_l_ = melodic_req_l_;
45 Tie_engraver::do_try_request (Request*r)
47 if (! (r->access_Musical_req () && r->access_Musical_req ()->access_Tie_req ()))
54 req_l_ = r->access_Musical_req ()->access_Tie_req ();
55 end_mom_ = r->parent_music_l_->time_int().length ()
61 Tie_engraver::do_process_requests()
63 Scalar dir (get_property ("tieydirection"));
64 Scalar dir2 (get_property ("ydirection"));
65 if (!dir.length_i () && dir2.length_i ())
67 dir_ = (Direction) int(dir2);
69 else if (dir.length_i ())
70 dir_ = (Direction) int (dir);
72 if (req_l_ && ! tie_p_)
75 Scalar prop = get_property ("tiedash");
77 tie_p_->dash_i_ = prop;
82 Tie_engraver::acknowledge_element (Score_element_info i)
84 if (i.elem_l_->is_type_b (Note_head::static_name ()))
88 tie_p_->set_head (LEFT, (Note_head*)i.elem_l_->access_Item ());
89 melodic_req_l_ = i.req_l_->access_Musical_req ()->access_Melodic_req ();
94 end_tie_p_->set_head (RIGHT, (Note_head*)i.elem_l_->access_Item ());
95 if (!Melodic_req::compare (*end_melodic_req_l_, *melodic_req_l_))
96 end_tie_p_->same_pitch_b_ = true;
97 announce_element (Score_element_info (end_tie_p_,end_req_l_));
103 Tie_engraver::do_pre_move_processing()
108 end_tie_p_->dir_ = dir_;
110 typeset_element (end_tie_p_);
117 Tie_engraver::do_removal_processing ()
119 do_pre_move_processing ();
122 req_l_->warning (_ ("lonely tie"));
131 IMPLEMENT_IS_TYPE_B1(Tie_engraver,Engraver);
132 ADD_THIS_TRANSLATOR(Tie_engraver);