From: fred Date: Sun, 24 Mar 2002 20:07:32 +0000 (+0000) Subject: lilypond-0.1.52 X-Git-Tag: release/1.5.59~3336 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7808920be4682d20da8432b1d3f97045681ef55c;p=lilypond.git lilypond-0.1.52 --- diff --git a/flower/NEWS b/flower/NEWS index 13485d6a14..351d36c051 100644 --- a/flower/NEWS +++ b/flower/NEWS @@ -1,6 +1,7 @@ pl 39 - fixes to Array + - fixes to Interval pl 38 diff --git a/flower/VERSION b/flower/VERSION index d2435e2970..ff98ffea7a 100644 --- a/flower/VERSION +++ b/flower/VERSION @@ -1,6 +1,7 @@ MAJOR_VERSION=1 MINOR_VERSION=1 -PATCH_LEVEL=38 +PATCH_LEVEL=39 # use to send patches, always empty for released version: -MY_PATCH_LEVEL=# include separator: "-1" or ".a" +# include separator: "-1" or ".a" # +MY_PATCH_LEVEL= diff --git a/flower/include/interval.hh b/flower/include/interval.hh index b0207e0556..7a868a31ab 100644 --- a/flower/include/interval.hh +++ b/flower/include/interval.hh @@ -86,6 +86,12 @@ struct Interval_t { String str() const; void print () const; bool elt_b (T r); + void negate () { + T r = -left; + T l = -right; + left = l; + right =r; + } }; @@ -121,6 +127,23 @@ Interval_t operator +(T a,Interval_t i) return i; } +template +inline +Interval_t operator - (Interval_t i, T a) +{ + i += -a; + return i; +} + +template +inline +Interval_t operator - (T a,Interval_t i) +{ + i.negate (); + i += a; + return i; +} + template inline Interval_t operator +(Interval_t i,T a){ diff --git a/lily/include/item.hh b/lily/include/item.hh index df5b6757ec..64bcca5e70 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -31,12 +31,12 @@ public: /// should be put in a breakable col. bool breakable_b_; - int break_status_i_; + Direction break_status_i_; int break_priority_i_; /// nobreak = 0, pre = -1, post = 1 int break_status_i() const; - Item * find_prebroken_piece (int) const; + Item * find_prebroken_piece (Direction) const; Item * find_prebroken_piece (Line_of_score*) const; virtual Item *item() { return this; } @@ -44,6 +44,7 @@ public: Real hpos_f() const; DECLARE_MY_RUNTIME_TYPEINFO; virtual Line_of_score * line_l() const; + virtual Paper_column * column_l () const; static int left_right_compare (Item const *, Item const*); protected: diff --git a/lily/item.cc b/lily/item.cc index daaf880a96..11d4568635 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -10,14 +10,14 @@ #include "debug.hh" #include "item.hh" #include "p-col.hh" -#include "elem-group.hh" +// #include "elem-group.hh" #include "spanner.hh" Item::Item() { break_priority_i_ = 0; breakable_b_ = false; - break_status_i_ = 0; + break_status_i_ = CENTER; broken_to_drul_[LEFT] = broken_to_drul_[RIGHT]=0; } @@ -67,7 +67,7 @@ Item::copy_breakable_items() item_p->handle_prebroken_dependencies(); new_copies[i] =item_p; } - while ((i *= -1) != LEFT); + while (flip(&i) != LEFT); broken_to_drul_= new_copies; } @@ -102,12 +102,12 @@ Item::find_prebroken_piece (Line_of_score*l) const } Item* -Item::find_prebroken_piece (int breakstatus) const +Item::find_prebroken_piece (Direction breakstatus) const { if (!breakstatus) return (Item *) this; // ugh else - return (Item*) broken_to_drul_[(Direction)breakstatus]; + return (Item*) broken_to_drul_[breakstatus]; } void @@ -158,3 +158,9 @@ Item::do_unlink() } attached_span_l_arr_.set_size (0); } + +Paper_column * +Item::column_l () const +{ + return axis_group_l_a_[X_AXIS]->item ()->column_l (); +} diff --git a/lily/single-malt-grouping-item.cc b/lily/single-malt-grouping-item.cc new file mode 100644 index 0000000000..f6975f77c5 --- /dev/null +++ b/lily/single-malt-grouping-item.cc @@ -0,0 +1,50 @@ +/* + single-malt-grouping-item.cc -- implement Single_malt_grouping_item + + source file of the GNU LilyPond music typesetter + + (c) 1998 Han-Wen Nienhuys + + */ + +#include "single-malt-grouping-item.hh" +#include "p-col.hh" + +Single_malt_grouping_item ::Single_malt_grouping_item() +{ + transparent_b_ = true; +} + +void +Single_malt_grouping_item::add (Item* i) +{ + assert (i); + item_l_arr_.push (i); + add_dependency (i); +} + +Interval +Single_malt_grouping_item::do_width () const +{ + Paper_column * pc = column_l (); + Interval w; + for (int i=0; i < item_l_arr_.size (); i++) + { + Item *il = item_l_arr_[i]; + assert (pc == il->column_l ()); + w.unite (il->width () + il->relative_coordinate (pc, X_AXIS)); + } + + return w + (- relative_coordinate (pc, X_AXIS)); // TODO +} + +IMPLEMENT_IS_TYPE_B1(Single_malt_grouping_item, Item); + +void +Single_malt_grouping_item::do_substitute_dependency (Score_elem*o, Score_elem*n) +{ + if (o->item ()) + { + item_l_arr_.unordered_substitute (o->item (), n ? n->item () : 0); + } +} diff --git a/lily/spanner.cc b/lily/spanner.cc index a10cf1446f..85221d3c94 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -46,9 +46,9 @@ Spanner::break_into_pieces () left = break_cols[i-1]; right = break_cols[i]; if (!right->line_l()) - right = right->find_prebroken_piece(-1); + right = right->find_prebroken_piece(LEFT); if (!left->line_l()) - left = left->find_prebroken_piece(1); + left = left->find_prebroken_piece(RIGHT); assert (left&&right && left->line_l() == right->line_l()); @@ -69,9 +69,9 @@ Spanner::set_my_columns() do { if (!spanned_drul_[i]->line_l()) - set_bounds(i,spanned_drul_[i]->find_prebroken_piece(-i)); + set_bounds(i,spanned_drul_[i]->find_prebroken_piece((Direction)-i)); } - while ((i*=-1) != 1); + while (flip(&i) != 1); } @@ -172,3 +172,20 @@ Spanner::do_junk_links() { spanned_drul_[LEFT] = spanned_drul_[RIGHT] =0; } + +Array +Spanner::get_rods () const +{ + Array r; + return r; +} + +void +Spanner::do_space_processing () +{ + Array rs (get_rods ()); + for (int i=0; i < rs.size (); i++) + { + rs[i].add_to_cols (); + } +}