pl 39
- fixes to Array
+ - fixes to Interval
pl 38
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=
String str() const;
void print () const;
bool elt_b (T r);
+ void negate () {
+ T r = -left;
+ T l = -right;
+ left = l;
+ right =r;
+ }
};
return i;
}
+template<class T>
+inline
+Interval_t<T> operator - (Interval_t<T> i, T a)
+{
+ i += -a;
+ return i;
+}
+
+template<class T>
+inline
+Interval_t<T> operator - (T a,Interval_t<T> i)
+{
+ i.negate ();
+ i += a;
+ return i;
+}
+
template<class T>
inline
Interval_t<T> operator +(Interval_t<T> i,T a){
/// 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; }
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:
#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;
}
item_p->handle_prebroken_dependencies();
new_copies[i] =item_p;
}
- while ((i *= -1) != LEFT);
+ while (flip(&i) != LEFT);
broken_to_drul_= new_copies;
}
}
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
}
attached_span_l_arr_.set_size (0);
}
+
+Paper_column *
+Item::column_l () const
+{
+ return axis_group_l_a_[X_AXIS]->item ()->column_l ();
+}
--- /dev/null
+/*
+ single-malt-grouping-item.cc -- implement Single_malt_grouping_item
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1998 Han-Wen Nienhuys <hanwen@cs.ruu.nl>
+
+ */
+
+#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);
+ }
+}
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());
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);
}
{
spanned_drul_[LEFT] = spanned_drul_[RIGHT] =0;
}
+
+Array<Rod>
+Spanner::get_rods () const
+{
+ Array<Rod> r;
+ return r;
+}
+
+void
+Spanner::do_space_processing ()
+{
+ Array<Rod> rs (get_rods ());
+ for (int i=0; i < rs.size (); i++)
+ {
+ rs[i].add_to_cols ();
+ }
+}