void
Score::process()
{
- *mlog << "Processing ... ";
+ *mlog << "\nProcessing ... ";
- if (!paper_)
- paper_ = new Paperdef;
+ assert (paper_);
/// distribute commands to disciples
pscore_ = new PScore(paper_);
// do this after processing, staffs first have to generate PCols.
do_pcols();
- // ugh. Would want to clean the columns before anything else.
- clean_cols();
+
+ clean_cols(); // can't move this farther up.
+
calc_idealspacing();
// debugging
*/
// todo
PCursor<Score_column*>
-Score::create_cols(Real w)
+Score::create_cols(Moment w)
{
Score_column* c1 = new Score_column(w);
Score_column* c2 = new Score_column(w);
c1->musical = false;
c2->musical = true;
- PCursor<Score_column*> scc(cols_);
+ PCursor<Score_column*> i(cols_);
- for (; scc.ok(); scc++) {
- assert(scc->when != w);
- if (scc->when > w)
+ for (; i.ok(); i++) {
+ assert(i->when != w);
+ if (i->when > w)
break;
}
- if (!scc.ok()) {
+ if (!i.ok()) {
cols_.bottom().add(c1);
cols_.bottom().add(c2);
- scc = cols_.bottom();
- scc --;
+ i = cols_.bottom();
+ i --;
} else {
- scc.insert(c1);
- scc.insert(c2);
- scc -= 2;
+ i.insert(c1);
+ i.insert(c2);
+ i -= 2;
}
- return scc;
+ return i;
}
PCursor<Score_column*>
-Score::find_col(Real w,bool mus)
+Score::find_col(Moment w,bool mus)
{
- PCursor<Score_column*> scc(cols_);
- for (; scc.ok(); scc++) {
- if (scc->when == w && scc->musical == mus)
- return scc;
- if (scc->when > w)
+ PCursor<Score_column*> i(cols_);
+ for (; i.ok(); i++) {
+ if (i->when == w && i->musical == mus)
+ return i;
+ if (i->when > w)
break;
}
- scc = create_cols(w);
+ i = create_cols(w);
if (mus)
- scc++;
- return scc;
+ i++;
+ return i;
}
void
pscore_->add(i->pcol_);
}
}
-Real
+Moment
Score::last() const
{
- Real l = 0;
- for (PCursor<Staff*> stc(staffs_); stc.ok(); stc++) {
- l = MAX(l, stc->last());
+ Moment l = 0;
+ for (PCursor<Staff*> i(staffs_); i.ok(); i++) {
+ l = l>? i->last();
}
return l;
}