]> git.donarmstrong.com Git - lilypond.git/blobdiff - src/score.cc
release: 0.0.20
[lilypond.git] / src / score.cc
index 57336936b5c2f0ec40c2308e020ad42cd9be531c..1593f7be162074892807336c19ef3d5076ebd3d8 100644 (file)
 void
 Score::process()
 {
-    *mlog << "Processing ... ";
+    *mlog << "\nProcessing ... ";
     
-    if (!paper_)
-       paper_ = new Paperdef;
+    assert (paper_);
     
     /// distribute commands to disciples
     pscore_ = new PScore(paper_);
@@ -25,8 +24,9 @@ Score::process()
 
     // 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
@@ -68,7 +68,7 @@ Score::clean_cols()
   */
 // 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);
@@ -76,41 +76,41 @@ Score::create_cols(Real 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
@@ -121,12 +121,12 @@ Score::do_pcols()
        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;
 }