1 // utility functions for PScore
13 for (PCursor<PCol *> c(cols); c.ok(); )
22 PScore::add(PStaff *s)
24 staffs.bottom().add(s);
28 PScore::typeset_item(Item *i, PCol *c, PStaff *s, int breakstat)
31 // assert(!breakstat != 4 || c->breakable() );
33 typeset_item(i, c->prebreak, s);
38 typeset_item(i, c->postbreak, s);
41 if (c->daddy && c == c->daddy->prebreak) { // makeshift.
42 Interval iv (i->width());
44 svec<Item*> col_its (select_items(s, c));
45 for (int j =0; j < col_its.sz(); j++)
46 col_its[j]->output->translate(Offset(-iv.length(),0));
47 i->output->translate (Offset(-iv.max, 0));
56 PScore::add_line(svec<const PCol *> curline, svec<Real> config)
58 Line_of_score *p = new Line_of_score(curline,this);
59 lines.bottom().add(p);
60 for (int i=0; i < curline.sz(); i++){
61 PCol *c=(PCol *)curline[i]; // so, this isn't really const.
67 PScore::get_spacing(PCol*l, PCol*r)
70 for (PCursor<Idealspacing*> ic (suz); ic.ok(); ic++) {
71 if (ic->left == l && ic->right == r){
76 Idealspacing*ip =new Idealspacing(l,r);
83 PScore::find_breaks() const
85 svec<const PCol *> retval;
86 for (PCursor<PCol *> c(cols); c.ok(); c++)
99 PScore::PScore( Paperdef*p)
105 PScore::output(Tex_stream &ts)
109 for (PCursor<Line_of_score*> lic(lines); lic.ok(); lic++) {
110 ts << "% line of score no. " << l++ <<"\n";
111 ts << lic->TeXstring();
113 ts << "\\interscoreline\n";
118 PScore::select_items(PStaff*ps , PCol*pc)
122 for (PCursor<const Item*> ic(pc->its); ic.ok(); ic++){
123 if (ic->pstaff_ == ps)
124 ret.add((Item*)(const Item*)ic);
133 for (PCursor<PCol*> cc(cols); cc.ok(); cc++)
135 for (PCursor<Idealspacing*> ic(suz); ic.ok(); ic++)
141 PScore::print() const
144 mtor << "PScore { paper ";
146 mtor << "\ncolumns: ";
147 for (PCursor<PCol*> cc(cols); cc.ok(); cc++)
150 mtor << "\nideals: ";
151 for (PCursor<Idealspacing*> ic(suz); ic.ok(); ic++)