1 #include "staffline.hh"
2 #include "scoreline.hh"
14 String s("\\vbox to ");
15 s += print_dimen(i.length());
16 s += "{\\vskip "+print_dimen(i.max)+" ";
22 Line_of_staff::TeXstring() const
24 String s("%line_of_staff\n");
25 s+=make_vbox(height());
26 // the staff itself: eg lines, accolades
30 brew_molecule(line_of_score_->pscore_->paper_->linewidth);
32 s+=pstaff_->stafsym->TeXstring();
33 PCursor<const PCol *> cc(line_of_score_->cols);
34 Real lastpos=cc->hpos;
36 // all items in the current line & staff.
37 for (; cc.ok(); cc++) {
38 Real delta=cc->hpos - lastpos;
43 s +=String( "\\kern ") + print_dimen(delta);
45 // now output the items.
47 for (PCursor<const Item *> ic(cc->its); ic.ok(); ic++) {
48 if (ic->pstaff_ == pstaff_)
52 for (PCursor<const Spanner *> sc(cc->starters); sc.ok(); sc++)
53 if (sc->pstaff_ == pstaff_)
61 Line_of_staff::Line_of_staff(Line_of_score * sc, PStaff*st)
67 PCol *linestart = sc->cols.top();
68 PCol *linestop = sc->cols.bottom();
71 for (PCursor<const Spanner*> sp(pstaff_->spans); sp.ok(); sp++) {
72 PCol *brokenstart = &MAX(*linestart, *sp->left);
73 PCol *brokenstop = &MIN(*linestop, *sp->right);
74 if ( *brokenstart < *brokenstop) {
75 line_of_score_->pscore_-> // higghl
76 add_broken(sp->broken_at(brokenstart,brokenstop));
83 Line_of_staff::height() const
87 y = pstaff_->stafsym->extent().y;
89 PCursor<const PCol *> cc(line_of_score_->cols);
91 // all items in the current line & staff.
92 for (; cc.ok(); cc++) {
93 for (PCursor<const Item *> ic(cc->its); ic.ok(); ic++) {
94 if (ic->pstaff_ == pstaff_) {
95 y.unite(ic->height());
99 for (PCursor<const Spanner *> sc(cc->starters); sc.ok(); sc++)
100 if (sc->pstaff_ == pstaff_) {
101 y.unite(sc->height());
109 Line_of_staff::process()
111 if (!pstaff_->stafsym)
112 pstaff_->brew_molecule(line_of_score_->pscore_->