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);
47 Tie::set_default_dir()
49 int m= (left_head_l_->position_i_ + right_head_l_->position_i_) /2 ;
50 dir_i_ = (m < 5)? -1:1; // ugh
55 Tie::do_add_processing()
57 assert(left_head_l_ && right_head_l_);
58 left_col_l_ = left_head_l_ -> pcol_l_;
59 right_col_l_ = right_head_l_ -> pcol_l_;
63 Tie::do_post_processing()
65 assert(left_head_l_ || right_head_l_);
66 left_pos_i_ = (left_head_l_)?
67 left_head_l_->position_i_ : right_head_l_->position_i_;
68 right_pos_i_ = (right_head_l_) ?
69 right_head_l_->position_i_ : left_head_l_->position_i_;
71 if ( right_head_l_ && right_head_l_->extremal_i_) {
72 right_pos_i_ += 2*dir_i_;
77 if (left_head_l_ && left_head_l_->extremal_i_) {
78 left_pos_i_ += 2*dir_i_;