2 staff-side.cc -- implement Staff_side
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
9 #include "staff-side.hh"
10 #include "staff-sym.hh"
13 Staff_side::set_staffsym(Staff_symbol* s_l)
18 Staff_side::Staff_side(Staff_elem * elem_l)
23 inside_staff_b_ =false;
28 Staff_side::support_height() const return r;
30 for (int i=0; i < support_l_arr_.size(); i++)
31 r.unite(support_l_arr_[i]->height());
35 Staff_side::add_support(Staff_elem*i)
37 support_l_arr_.push(i);
38 elem_l_->add_dependency(i);
42 Staff_side::get_position_i()const
47 Real inter_f = staff_sym_l_->inter_note_f();
48 int staff_size_i = staff_sym_l_->steps_i();
50 if (!inside_staff_b_) {
51 y = (dir_i_ > 0) ? staff_size_i + 2: -2;
53 Interval v= support_height();
56 y = y >? (v.max() + 2*inter_f);
57 } else if (dir_i_ < 0) {
58 y = y <? (v.min() - 2*inter_f);
61 Interval v= support_height();
62 y = v[dir_i_] + 2*dir_i_*inter_f; // ugh
64 return int(rint(Real(y)/inter_f));