2 tie.cc -- implement Tie
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
9 #include "paper-def.hh"
11 #include "notehead.hh"
15 Tie::do_break_at(PCol*l, PCol*r) const
17 Tie * tie_p = new Tie(*this);
18 Line_of_score const *line_C=l->line_l_;
19 tie_p->left_head_l_ = (left_head_l_->line_l()== line_C) ?
21 tie_p->right_head_l_ = (right_head_l_->line_l() == line_C)?
28 Tie::set_head(int x_pos, Notehead * head_l)
31 assert(!right_head_l_);
32 right_head_l_ = head_l;
34 assert(!left_head_l_);
35 left_head_l_ = head_l;
37 add_dependency(head_l);
48 Tie::set_default_dir()
50 int m= (left_head_l_->position_i_ + right_head_l_->position_i_) /2 ;
51 dir_i_ = (m < 5)? -1:1; // ugh
56 Tie::do_add_processing()
58 assert(left_head_l_ && right_head_l_);
59 left_col_l_ = left_head_l_ -> pcol_l_;
60 right_col_l_ = right_head_l_ -> pcol_l_;
64 Tie::do_post_processing()
66 assert(left_head_l_ || right_head_l_);
67 left_pos_i_ = (left_head_l_)?
68 left_head_l_->position_i_ : right_head_l_->position_i_;
69 right_pos_i_ = (right_head_l_) ?
70 right_head_l_->position_i_ : left_head_l_->position_i_;
72 if ( right_head_l_ && right_head_l_->extremal_i_) {
73 right_pos_i_ += 2*dir_i_;
78 if (left_head_l_ && left_head_l_->extremal_i_) {
79 left_pos_i_ += 2*dir_i_;