2 slur.cc -- implement Slur
4 source file of the LilyPond music typesetter
6 (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
13 think about crossing stems.
14 Begin and end should be treated as a Script.
20 #include "paper-def.hh"
21 #include "note-column.hh"
24 #include "molecule.hh"
31 Slur::add(Note_column*n)
33 encompass_arr_.push(n);
38 Slur::set_default_dir()
41 for (int i=0; i < encompass_arr_.size(); i ++) {
42 if (encompass_arr_[i]->dir_i_ < 0) {
50 Slur::do_pre_processing()
52 right_col_l_ = encompass_arr_.top()->pcol_l_;
53 left_col_l_ = encompass_arr_[0]->pcol_l_;
57 Slur::do_break_at(PCol*l, PCol*r) const
59 assert(l->line_l_ == r->line_l_);
60 Slur*ret = new Slur(*this);
62 ret->encompass_arr_.set_size(0);
63 for (int i =0; i < encompass_arr_.size(); i++) {
64 if (encompass_arr_[i]->pcol_l_->line_l_==l->line_l_)
65 ret->encompass_arr_.push(encompass_arr_[i]);
72 Slur::do_post_processing()
76 Real inter_f = paper()->internote();
77 if (encompass_arr_[0]->stem_l_)
78 left_pos_i_ = rint(encompass_arr_[0]->stem_l_->height()[dir_i_]/inter_f);
81 if (encompass_arr_.top()->stem_l_)
82 right_pos_i_ = rint(encompass_arr_.top()->stem_l_->height()[dir_i_]/inter_f);
86 left_pos_i_ += dir_i_;
87 right_pos_i_ += dir_i_;
89 IMPLEMENT_STATIC_NAME(Slur);