From: fred Date: Sun, 24 Nov 1996 23:48:35 +0000 (+0000) Subject: lilypond-0.0.11 X-Git-Tag: release/1.5.59~6755 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4db681ec608384ffcd77ff14c83319ba04a68257;p=lilypond.git lilypond-0.0.11 --- diff --git a/hdr/pcol.hh b/hdr/pcol.hh index 7cbf93f2ab..f6a38d57aa 100644 --- a/hdr/pcol.hh +++ b/hdr/pcol.hh @@ -11,11 +11,6 @@ struct PCol { PointerList its; PointerList 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(); diff --git a/hdr/scoreline.hh b/hdr/scoreline.hh index a8ae77a222..5ebb936b1e 100644 --- a/hdr/scoreline.hh +++ b/hdr/scoreline.hh @@ -17,11 +17,11 @@ Line_of_score { // need to store height of each staff. IPointerList staffs; - const PScore * score; // needed to generate staffs + PScore * pscore_; // needed to generate staffs /****************/ - Line_of_score(svec sv, const PScore *); + Line_of_score(svec sv, PScore *); String TeXstring() const; @@ -30,3 +30,4 @@ Line_of_score { }; #endif + diff --git a/hdr/staffline.hh b/hdr/staffline.hh index be5a7de42b..868198b013 100644 --- a/hdr/staffline.hh +++ b/hdr/staffline.hh @@ -15,8 +15,8 @@ /// one broken line of staff. struct Line_of_staff { - IPointerList 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 diff --git a/src/calcideal.cc b/src/calcideal.cc index 051ac4312c..03910ac561 100644 --- a/src/calcideal.cc +++ b/src/calcideal.cc @@ -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! diff --git a/src/sccol.cc b/src/sccol.cc index 417b967e1c..c29d26cf4a 100644 --- a/src/sccol.cc +++ b/src/sccol.cc @@ -10,7 +10,7 @@ Score_column::Score_column(Real w) bool Score_column::used() { - return pcol_->used; + return pcol_->used(); } void diff --git a/src/score.cc b/src/score.cc index 6127196174..f421baaae6 100644 --- a/src/score.cc +++ b/src/score.cc @@ -75,7 +75,7 @@ Score::clean_cols() sc->clean_cols(); for (PCursor c(cols_); c.ok(); ) { - if (!c->pcol_->used) { + if (!c->pcol_->used()) { mtor << "removing : "; c->print(); c.del(); diff --git a/src/scoreline.cc b/src/scoreline.cc index 7e40c6a76a..03d0c8482f 100644 --- a/src/scoreline.cc +++ b/src/scoreline.cc @@ -23,16 +23,16 @@ Line_of_score::TeXstring() const Line_of_score::Line_of_score(svec 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 sc(score->staffs); sc.ok(); sc++) + for (PCursor 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 diff --git a/src/staffline.cc b/src/staffline.cc index c83e904bc6..f0f00f1a83 100644 --- a/src/staffline.cc +++ b/src/staffline.cc @@ -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 cc(scor->cols); + PCursor 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 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 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 cc(scor->cols); + PCursor cc(line_of_score_->cols); // all items in the current line & staff. for (; cc.ok(); cc++) {