2 note-column.cc -- implement Note_column
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
9 #include "note-column.hh"
12 #include "note-head.hh"
15 IMPLEMENT_STATIC_NAME(Note_column);
16 IMPLEMENT_IS_TYPE_B1(Note_column,Script_column);
19 Note_column::add(Stem*stem_l)
26 Note_column::add(Note_head* n_l)
28 assert(!n_l->rest_b_);
29 head_l_arr_.push(n_l);
33 Note_column::Note_column()
43 head_l_arr_.sort( Note_head::compare);
47 Note_column::head_positions_interval()const
49 ( (Note_column*)this)->sort();
50 return Interval_t<int> ( head_l_arr_[0]->position_i_,
51 head_l_arr_.top()->position_i_);
57 Note_column::do_pre_processing()
61 dir_i_ = stem_l_->dir_i_;
63 dir_i_ = (head_positions_interval().center() >= 5) ? -1 : 1;
65 Script_column::do_pre_processing();
71 Note_column::do_substitute_dependency(Score_elem*o,Score_elem*n)
73 Script_column::do_substitute_dependency(o,n);
74 if (o->name() == Note_head::static_name()) {
75 head_l_arr_.substitute( (Note_head*)o->item(),
76 (n)? (Note_head*)n->item() : 0);
79 stem_l_ = n ? (Stem*)n->item():0;