static int compare(Score_column & c1, Score_column &c2) {
return sgn(c1.when - c2.when);
}
+ void add_duration(Real );
+ void preprocess();
void set_breakable() {
pcol_->set_breakable();
}
bool mus() const;
Real when() const;
void add(Voice_element*ve);
+
/****************************************************************
VIRTUAL
****************************************************************/
mtor << "}\n";
#endif
}
+
+int
+Real_compare(Real &a , Real& b)
+{
+ return sgn(a-b);
+}
+
+void
+Score_column::preprocess()
+{
+ durations.sort(Real_compare);
+}
+void
+Score_column::add_duration(Real d)
+{
+ for (int i = 0; i< durations.sz(); i++) {
+ if (d == durations[i])
+ return ;
+ }
+ durations.add(d);
+}
{
Real d= ve->duration;
if (d){
- score_column->durations.add(d);
+ score_column->add_duration(d);
}
v_elts.add(ve);
Staff_column::Staff_column(Score_column*s) {
score_column = s;
}
+