(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
+#include "interval.hh"
#include "paper-def.hh"
#include "dimen.hh"
#include "staff-side.hh"
Staff_side::set_staffsym(Staff_symbol* s_l)
{
staff_sym_l_ = s_l;
+ add_dependency( s_l );
}
Staff_side::Staff_side()
{
+ pos_i_ =0;
+ sym_int_ = Interval(0,0);
staff_size_i_ = 0;
staff_sym_l_=0;
dir_i_ =0;
return int(rint(Real(y)/inter_f)); // should ret a float?
}
-int
-Staff_side::get_position_i(Interval sym_dim) const
-{
- int i= get_position_i();
- return i+ int(rint(- sym_dim[-dir_i_] / paper()->internote_f()));
+Interval
+Staff_side::symbol_height() const
+{
+ return Interval(0,0);
}
+void
+Staff_side::do_post_processing()
+{
+ sym_int_ = symbol_height();
+ pos_i_ = get_position_i( );
+ if (dir_i_)
+ pos_i_ += int(rint(- sym_int_[-dir_i_] / paper()->internote_f()));
+}
void
-Staff_side::do_substitute_dependency(Score_elem*o, Score_elem*n )
+Staff_side::do_substitute_dependency(Score_elem*o, Score_elem*n)
{
- int i;
- while ((i=support_l_arr_.find_i(o) ) >=0)
- if (n)
- support_l_arr_[i] = n;
- else
- support_l_arr_.del(i);
-
+ support_l_arr_.unordered_substitute(o,n);
if (staff_sym_l_ == o)
staff_sym_l_ = n ? (Staff_symbol*) n->spanner():0;
}
+
+
+IMPLEMENT_IS_TYPE_B1(Staff_side, Score_elem);