From: fred Date: Sun, 24 Mar 2002 19:48:00 +0000 (+0000) Subject: lilypond-0.0.76 X-Git-Tag: release/1.5.59~4460 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ca88359cbe787fa2aed397f39362b6b3074d2070;p=lilypond.git lilypond-0.0.76 --- diff --git a/lily/include/note-column.hh b/lily/include/note-column.hh index 805b969bbc..3065642be6 100644 --- a/lily/include/note-column.hh +++ b/lily/include/note-column.hh @@ -9,36 +9,25 @@ #ifndef NOTE_COLUMN_HH #define NOTE_COLUMN_HH + #include "item.hh" -#include "script-column.hh" +#include "head-column.hh" /** a struct for treating a group of noteheads (noteheads, stem (chord) and scripts ) as a single entity. */ -class Note_column : public Script_column { +class Note_column : public Head_column { protected: virtual void do_pre_processing(); - virtual void do_substitute_dependency(Score_elem*,Score_elem*); -public: - /// link to the stem. For setting default direction - Stem * stem_l_; +public: bool h_shift_b_; - Link_array head_l_arr_; Interval_t head_positions_interval()const; - - /** The relative position of the "voice" containing this - chord. Normally this would be the same as the stem direction, - but rests do not have stems. */ - int dir_i_; - NAME_MEMBERS(); Note_column(); - void add(Note_head *); - void add(Stem *); + virtual void set(Stem *); void sort(); - void add(Script* s) { Script_column::add(s);} }; #endif // NOTE_COLUMN_HH diff --git a/lily/note-column.cc b/lily/note-column.cc index fab25c79ce..8d7d7f7e2b 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -7,34 +7,23 @@ */ #include "note-column.hh" -#include "debug.hh" #include "script.hh" #include "note-head.hh" #include "stem.hh" IMPLEMENT_STATIC_NAME(Note_column); -IMPLEMENT_IS_TYPE_B1(Note_column,Script_column); +IMPLEMENT_IS_TYPE_B1(Note_column,Head_column); void -Note_column::add(Stem*stem_l) +Note_column::set(Stem*s) { - stem_l_ = stem_l; - add_support(stem_l); -} - -void -Note_column::add(Note_head* n_l) -{ - assert(!n_l->rest_b_); - head_l_arr_.push(n_l); - add_support(n_l); + stem_l_ = s; + add_support(s); } Note_column::Note_column() { - stem_l_ = 0; h_shift_b_ =false; - dir_i_ =0; } void @@ -46,7 +35,7 @@ Note_column::sort() Interval_t Note_column::head_positions_interval()const { - ( (Note_column*)this)->sort(); + ((Note_column*)this)->sort(); return Interval_t ( head_l_arr_[0]->position_i_, head_l_arr_.top()->position_i_); @@ -56,26 +45,10 @@ Note_column::head_positions_interval()const void Note_column::do_pre_processing() { - if (!dir_i_){ - if (stem_l_) - dir_i_ = stem_l_->dir_i_; - else - dir_i_ = (head_positions_interval().center() >= 5) ? -1 : 1; + if (!dir_i_&& !stem_l_){ + dir_i_ = (head_positions_interval().center() >= 5) ? -1 : 1; } - Script_column::do_pre_processing(); + Head_column::do_pre_processing(); } - -void -Note_column::do_substitute_dependency(Score_elem*o,Score_elem*n) -{ - Script_column::do_substitute_dependency(o,n); - if (o->name() == Note_head::static_name()) { - head_l_arr_.substitute( (Note_head*)o->item(), - (n)? (Note_head*)n->item() : 0); - } - if (stem_l_ == o) { - stem_l_ = n ? (Stem*)n->item():0; - } -}