]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.11
authorfred <fred>
Sun, 24 Nov 1996 23:48:35 +0000 (23:48 +0000)
committerfred <fred>
Sun, 24 Nov 1996 23:48:35 +0000 (23:48 +0000)
hdr/pcol.hh
hdr/scoreline.hh
hdr/staffline.hh
src/calcideal.cc
src/sccol.cc
src/score.cc
src/scoreline.cc
src/staffline.cc

index 7cbf93f2ab2fa3e72dbaf4f9f39b11e381ff2623..f6a38d57aab18c8a6ca7742fcbda5f64c1700357 100644 (file)
@@ -11,11 +11,6 @@ struct PCol {
     PointerList<const Item*> its;
     PointerList<const Spanner*> stoppers, starters;
     
-    /// Can this be broken? true eg. for bars. 
-    bool breakable()const;
-
-    /// does this column have items, does it have spacings attached?
-    bool used;
 
     /// prebreak is put before end of line.
     PCol *prebreak;
@@ -28,20 +23,28 @@ struct PCol {
     PCol *postbreak;
     /**  \See{prebreak}
     */
+    
     PCol *daddy;
-    /*
-    if this column is pre or postbreak, then this field points to the parent.
-    */
+    /** if this column is pre or postbreak, then this field points to
+     the parent.  */
+    
     /// if lines are broken then this column is in #line#
     const Line_of_score *line;
 
     /// if lines are broken then this column x-coord #hpos#
     Real hpos;
 
-    
-    /****************************************************************/
+    PScore * pscore_;
+
+    /****************/
 
+    /// does this column have items, does it have spacings attached?
+    bool used() const;
+    
     void add(Item *i);
+
+    /// Can this be broken? true eg. for bars. 
+    bool breakable()const;
     
     Interval width() const;
     ~PCol();
index a8ae77a222f9315a6649787252b2db7588019625..5ebb936b1e1fec0a3fa71bd06852cd1076fd0188 100644 (file)
@@ -17,11 +17,11 @@ Line_of_score {
 
     // need to store height of each staff.
     IPointerList<Line_of_staff*> staffs;
-    const PScore * score;      // needed to generate staffs
+    PScore * pscore_;  // needed to generate staffs
 
     /****************/
     
-    Line_of_score(svec<const PCol *> sv, const PScore *);
+    Line_of_score(svec<const PCol *> sv,  PScore *);
 
     String TeXstring() const;
 
@@ -30,3 +30,4 @@ Line_of_score {
 };
 
 #endif
+
index be5a7de42bf9c87a2ee11bdae28740d3400ada38..868198b01337728fd745408a66bc611c4b8770f6 100644 (file)
@@ -15,8 +15,8 @@
 
 /// one broken line of staff.
 struct Line_of_staff {
-    IPointerList<Spanner *> brokenspans;    
-    Line_of_score const * scor;
+
+    Line_of_score  * line_of_score_;
     const PStaff *pstaff_;
 
     /****************/
@@ -24,6 +24,7 @@ struct Line_of_staff {
     String TeXstring() const;
     Line_of_staff(Line_of_score*, PStaff *);
     Interval height() const;
+
 };
 
 #endif
index 051ac4312c99be55bf39d4fedb618d5a9f94bc58..03910ac561968f1ae2fb59075429ec86fadb4b46 100644 (file)
@@ -21,7 +21,7 @@ Score::do_connect(PCol *c1, PCol *c2, Real d)
 void
 Score::connect_nonmus(PCol* c1, PCol *c2, Real d)
 {
-    if (c2->used && c1->used) {
+    if (c2->used() && c1->used()) {
        do_connect(c1,c2,d);
 
        // alert! this is broken!
index 417b967e1c94588ed0164aae43b1689fcef3d4df..c29d26cf4a3b98e9ca844da4c517bcf1bffc0119 100644 (file)
@@ -10,7 +10,7 @@ Score_column::Score_column(Real w)
 
 bool
 Score_column::used() {
-    return pcol_->used;
+    return pcol_->used();
 }
 
 void
index 61271961743a9ed70e48ce20137abfc4da36dcb6..f421baaae6fd23f3a035fe399d639cba8dcf052f 100644 (file)
@@ -75,7 +75,7 @@ Score::clean_cols()
        sc->clean_cols();
     
     for (PCursor<Score_column*> c(cols_); c.ok(); ) {
-       if (!c->pcol_->used) {
+       if (!c->pcol_->used()) {
            mtor << "removing : ";
            c->print();
            c.del();
index 7e40c6a76a7a23892ef54341f240e9a1f4abd5fc..03d0c8482fe8b02606496e258b06325a789d1af2 100644 (file)
@@ -23,16 +23,16 @@ Line_of_score::TeXstring() const
 
 
 Line_of_score::Line_of_score(svec<const PCol *> sv,
-                            const PScore *ps)
+                            PScore *ps)
 {
-    score = ps;
+    pscore_ = ps;
     for (int i=0; i< sv.sz(); i++) {
        PCol *p=(PCol *) sv[i];
        cols.bottom().add(p);
        p->line=this;
     }
 
-    for (PCursor<PStaff*> sc(score->staffs); sc.ok(); sc++)
+    for (PCursor<PStaff*> sc(pscore_->staffs); sc.ok(); sc++)
        staffs.bottom().add(new Line_of_staff(this, sc));    
 }
 /* construct a line with the named columns. Make the line field
index c83e904bc6fbfbd6c018bffe6557febed8547371..f0f00f1a835037dbb943d01ffc2141b0b348c992 100644 (file)
@@ -25,9 +25,10 @@ Line_of_staff::TeXstring() const
     // the staff itself: eg lines, accolades
     s += "\\hbox{";
     {
-       Symbol sym = pstaff_->get_stafsym(scor->score->paper_->linewidth);
+       Symbol sym = pstaff_->get_stafsym(line_of_score_->pscore_-> // ugh
+                                         paper_->linewidth);
        s+=sym.tex;
-       PCursor<const PCol *> cc(scor->cols);
+       PCursor<const PCol *> cc(line_of_score_->cols);
        Real lastpos=cc->hpos;
 
        // all items in the current line & staff.
@@ -57,22 +58,21 @@ Line_of_staff::TeXstring() const
 
 Line_of_staff::Line_of_staff(Line_of_score * sc, PStaff*st)
 {
-    scor=sc;
+    line_of_score_=sc;
     pstaff_=st;
-#if 0
+
+    
     const PCol *linestart = sc->cols.top();
     const PCol *linestop = sc->cols.bottom();
 
+    
     for (PCursor<const Spanner*> sp(pstaff_->spans); sp.ok(); sp++) {
        const PCol *brokenstart = &MAX(*linestart, *sp->left);
        const PCol *brokenstop = &MIN(*linestop, *sp->right);
-//     if (*brokenstop  < *brokenstart)
-       brokenspans.bottom().add(sp->broken_at(0,0));
-    }
-#endif
-    for (PCursor<const Spanner*> sp(pstaff_->spans); sp.ok(); sp++) {
-
-       brokenspans.bottom().add(sp->broken_at(0,0));
+       if ( *brokenstart < *brokenstop) {
+           line_of_score_->pscore_-> // higghl
+               add_broken(sp->broken_at(brokenstart,brokenstop));
+       }
     }
 }
 
@@ -82,10 +82,11 @@ Line_of_staff::height() const
 {
     Interval y;
     {
-       Symbol s = pstaff_->stafsym->eval(scor->score->paper_->linewidth);
+       Symbol s = pstaff_->stafsym->eval(line_of_score_->pscore_->
+                                         paper_->linewidth);
        y = s.dim.y;
     }
-    PCursor<const PCol *> cc(scor->cols);
+    PCursor<const PCol *> cc(line_of_score_->cols);
     
     // all items in the current line & staff.
     for (; cc.ok(); cc++) {