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));
57 PScore::add_line(svec<const PCol *> curline, svec<Real> config)
59 Line_of_score *p = new Line_of_score(curline,this);
60 lines.bottom().add(p);
61 for (int i=0; i < curline.sz(); i++){
62 PCol *c=(PCol *)curline[i]; // so, this isn't really const.
68 PScore::get_spacing(PCol*l, PCol*r)
71 for (PCursor<Idealspacing*> ic (suz); ic.ok(); ic++) {
72 if (ic->left == l && ic->right == r){
77 Idealspacing*ip =new Idealspacing(l,r);
84 PScore::find_breaks() const
86 svec<const PCol *> retval;
87 for (PCursor<PCol *> c(cols); c.ok(); c++)
100 PScore::PScore( Paperdef*p)
106 PScore::output(Tex_stream &ts)
110 for (PCursor<Line_of_score*> lic(lines); lic.ok(); lic++) {
111 ts << "% line of score no. " << l++ <<"\n";
112 ts << lic->TeXstring();
114 ts << "\\interscoreline\n";
119 PScore::select_items(PStaff*ps , PCol*pc)
123 for (PCursor<const Item*> ic(pc->its); ic.ok(); ic++){
124 if (ic->pstaff_ == ps)
125 ret.add((Item*)(const Item*)ic);
134 for (PCursor<PCol*> cc(cols); cc.ok(); cc++)
136 for (PCursor<Idealspacing*> ic(suz); ic.ok(); ic++)
142 PScore::print() const
145 mtor << "PScore { paper ";
147 mtor << "\ncolumns: ";
148 for (PCursor<PCol*> cc(cols); cc.ok(); cc++)
151 mtor << "\nideals: ";
152 for (PCursor<Idealspacing*> ic(suz); ic.ok(); ic++)
162 for (PCursor<Item*> ic(its); ic.ok(); ic++){
169 PScore::postprocess()
171 for (PCursor<Item*> ic(its); ic.ok(); ic++){