12 Score::do_connect(PCol *c1, PCol *c2, Real d, Real h)
16 Idealspacing*sp=pscore_->get_spacing(c1,c2);
25 Score::connect(PCol* c1, PCol *c2, Real d, Real h)
27 do_connect(c1,c2,d,h);
28 do_connect(c1->postbreak, c2,d,h);
29 do_connect(c1, c2->prebreak,d,h);
30 do_connect(c1->postbreak, c2->prebreak,d,h);
33 /* this needs A LOT of rethinking.
35 generate springs between columns.
38 Score::calc_idealspacing()
41 PCursor<Score_column*> i(cols_);
45 PCursor<Score_column*> j (i+1);
47 for (int n=0; n < i->durations.sz(); n++) {
48 Real d = i->durations[n];
49 Real dist = paper_->duration_to_dist(d);
50 while (j->when < d + i->when)
53 assert(j->when == d+i->when);
55 connect(i->pcol_, j->pcol_, dist);
56 if (!j->musical && (j+1).ok()
57 && (j+1)->when == j->when) {
59 connect(i->pcol_, j->pcol_, dist);
64 /* attach i to the next column in use. This exists, since
65 the last col is breakable, and therefore in use
68 Real d = j->when - i->when;
69 Real dist = (d) ? paper_->duration_to_dist(d) :
70 convert_dimen(2,"pt");
72 connect(i->pcol_, j->pcol_, dist, (d) ? 1.0:1.0);
74 // !j.ok() might hold if we're at the last col.
78 PCursor<Score_column*> sc(cols_);
80 for (; sc.ok(); sc++) {
82 for (int i=0; i < sc->durations.sz(); i++) {
83 Real d = sc->durations[i];
84 Real dist = paper_->duration_to_dist(d);
85 PCol * c2 = find_col(sc->when + d,true)->pcol_;
86 connect(sc->pcol_, c2, dist);
87 c2 = find_col(sc->when + d,false)->pcol_;
88 connect(sc->pcol_, c2, dist);
90 else if (sc->used()) { // ignore empty columns
91 PCol * c2 = find_col(sc->when,true)->pcol_;
92 connect(sc->pcol_, c2, 0.0);