1 // utility functions for PScore
12 for (PCursor
<PCol
*> c(cols
); c
.ok(); )
21 PScore::add(PStaff
*s
)
23 staffs
.bottom().add(s
);
27 PScore::typeset_item(Item
*i
, PCol
*c
, PStaff
*s
, int breakstat
)
30 // assert(!breakstat != 4 || c->breakable() );
32 typeset_item(i
, c
->prebreak
, s
);
37 typeset_item(i
, c
->postbreak
, s
);
40 if (c
->daddy
&& c
== c
->daddy
->prebreak
) { // makeshift.
41 Interval
iv (i
->width());
43 svec
<Item
*> col_its (select_items(s
, c
));
44 for (int j
=0; j
< col_its
.sz(); j
++)
45 col_its
[j
]->output
->translate(Offset(-iv
.length(),0));
46 i
->output
->translate (Offset(-iv
.max
, 0));
55 PScore::add_line(svec
<const PCol
*> curline
, svec
<Real
> config
)
57 Line_of_score
*p
= new Line_of_score(curline
,this);
58 lines
.bottom().add(p
);
59 for (int i
=0; i
< curline
.sz(); i
++){
60 PCol
*c
=(PCol
*)curline
[i
]; // so, this isn't really const.
66 PScore::get_spacing(PCol
*l
, PCol
*r
)
69 for (PCursor
<Idealspacing
*> ic (suz
); ic
.ok(); ic
++) {
70 if (ic
->left
== l
&& ic
->right
== r
){
75 Idealspacing
*ip
=new Idealspacing(l
,r
);
82 PScore::find_breaks() const
84 svec
<const PCol
*> retval
;
85 for (PCursor
<PCol
*> c(cols
); c
.ok(); c
++)
100 linewidth
= convert_dimen(15,"cm"); // default
104 PScore::output(Tex_stream
&ts
)
107 ts
<< "% linewidth " << print_dimen(linewidth
)+"\n";
108 for (PCursor
<Line_of_score
*> lic(lines
); lic
.ok(); lic
++) {
109 ts
<< "% line of score no. " << l
++ <<"\n";
110 ts
<< lic
->TeXstring();
112 ts
<< "\\interscoreline\n";
117 PScore::select_items(PStaff
*ps
, PCol
*pc
)
121 for (PCursor
<const Item
*> ic(pc
->its
); ic
.ok(); ic
++){
122 if (ic
->pstaff_
== ps
)
123 ret
.add((Item
*)(const Item
*)ic
);
132 for (PCursor
<PCol
*> cc(cols
); cc
.ok(); cc
++)
134 for (PCursor
<Idealspacing
*> ic(suz
); ic
.ok(); ic
++)
139 PScore::print() const
142 mtor
<< "PScore { width "<<print_dimen(linewidth
);
143 mtor
<< "\ncolumns: ";
144 for (PCursor
<PCol
*> cc(cols
); cc
.ok(); cc
++)
147 mtor
<< "\nideals: ";
148 for (PCursor
<Idealspacing
*> ic(suz
); ic
.ok(); ic
++)