6 Line_of_staff::TeXstring() const
8 String
s("%line_of_staff\n\\vbox to ");
9 s
+= String(height
* VERT_TO_PT
) +"pt{";
12 s
+= vstrut(base
* VERT_TO_PT
);
14 // the staff itself: eg lines, accolades
17 s
+=(*pstaff_
->stafsym
)(scor
->score
->linewidth
);
18 PCursor
<const PCol
*> cc(scor
->cols
);
19 Real lastpos
=cc
->hpos
;
21 // all items in the current line & staff.
22 for (; cc
.ok(); cc
++) {
23 Real delta
=cc
->hpos
- lastpos
;
27 s
+=String( "\\kern ") + HOR_TO_PT
*delta
+ "pt ";
29 // now output the items.
31 for (PCursor
<const Item
*> ic(cc
->its
); ic
.ok(); ic
++) {
32 if (ic
->pstaff_
== pstaff_
)
36 for (PCursor
<const Spanner
*> sc(cc
->starters
); sc
.ok(); sc
++)
37 if (sc
->pstaff_
== pstaff_
)
46 Line_of_score::TeXstring() const
49 for (PCursor
<Line_of_staff
*> sc(staffs
); sc
.ok(); sc
++)
55 /// testing this entry
56 Line_of_score::Line_of_score(svec
<const PCol
*> sv
,
60 for (int i
=0; i
< sv
.sz(); i
++) {
61 PCol
*p
=(PCol
*) sv
[i
];
66 for (PCursor
<PStaff
*> sc(score
->staffs
); sc
.ok(); sc
++)
67 staffs
.bottom().add(new Line_of_staff(this, sc
));
69 /** construct a line with the named columns. Make the line field
70 in each column point to this
72 #sv# isn't really const!!
75 Line_of_staff::Line_of_staff(Line_of_score
* sc
, PStaff
*st
)
77 // [don't know how to calc dimensions yet.]
84 const PCol
*linestart
= sc
->cols
.top();
85 const PCol
*linestop
=sc
->cols
.bottom();
87 for (PCursor
<const Spanner
*> sp(pstaff_
->spans
); sp
.ok(); sp
++) {
88 const PCol
*brokenstart
= &MAX(*linestart
, *sp
->left
);
89 const PCol
*brokenstop
= &MIN(*linestop
, *sp
->right
);
91 if (*brokenstop
< *brokenstart
)
92 brokenspans
.bottom().add(sp
->broken_at(brokenstop
, brokenstart
));