12 Score::do_connect(PCol
*c1
, PCol
*c2
, Real d
)
14 Idealspacing
*sp
=pscore_
->get_spacing(c1
,c2
);
23 Score::connect_nonmus(PCol
* c1
, PCol
*c2
, Real d
)
25 if (c2
->used
&& c1
->used
) {
28 // alert! this is broken!
29 if (c1
->breakable()) {
30 do_connect(c1
->postbreak
, c2
,d
);
32 if (c2
->breakable()) {
33 do_connect(c1
, c2
->prebreak
,d
);
35 if (c1
->breakable() &&c2
->breakable()) {
36 do_connect(c1
->postbreak
, c2
->prebreak
,d
);
40 /* this needs A LOT of rethinking.
42 generate springs between columns.
45 Score::calc_idealspacing()
47 PCursor
<Score_column
*> sc(cols_
);
49 for (; sc
.ok(); sc
++) {
51 for (int i
=0; i
< sc
->durations
.sz(); i
++) {
52 Real d
= sc
->durations
[i
];
53 Real dist
= duration_to_idealspace(d
, paper_
->whole_width
);
54 PCol
* c2
= find_col(sc
->when
+ d
,true)->pcol
;
55 connect_nonmus(sc
->pcol
, c2
, dist
);
56 c2
= find_col(sc
->when
+ d
,false)->pcol
;
57 connect_nonmus(sc
->pcol
, c2
, dist
);
59 else if (sc
->used()) { // ignore empty columns
60 PCol
* c2
= find_col(sc
->when
,true)->pcol
;
61 connect_nonmus(sc
->pcol
,c2
,0.0);