1 // utility functions for PScore
11 for (PCursor
<PCol
*> c(cols
); c
.ok(); )
14 mtor
<< "removing pcol\n";
21 PScore::add(PStaff
*s
)
23 staffs
.bottom().add(s
);
27 PScore::typeset_item(Item
*i
, PCol
*c
, PStaff
*s
, int breakstat
)
30 if (breakstat
== 1 ) {
31 typeset_item(i
, c
->prebreak
, s
, 0);
33 typeset_item(i
, c
->prebreak
, s
, 0 );
42 PScore::add_line(svec
<const PCol
*> curline
, svec
<Real
> config
)
44 Line_of_score
*p
= new Line_of_score(curline
,this);
45 lines
.bottom().add(p
);
46 for (int i
=0; i
< curline
.sz(); i
++){
47 PCol
*c
=(PCol
*)curline
[i
]; // so, this isn't really const.
53 PScore::get_spacing(PCol
*l
, PCol
*r
)
56 for (PCursor
<Idealspacing
*> ic (suz
); ic
.ok(); ic
++) {
57 if (ic
->left
== l
&& ic
->right
== r
){
62 Idealspacing
*ip
=new Idealspacing(l
,r
);
69 PScore::find_breaks() const
71 svec
<const PCol
*> retval
;
72 for (PCursor
<PCol
*> c(cols
); c
.ok(); c
++)
87 linewidth
= convert_dimen(15,"cm");
91 PScore::output(Tex_stream
&ts
)
94 ts
<< "% linewidth " << print_dimen(linewidth
)+"\n";
95 for (PCursor
<Line_of_score
*> lic(lines
); lic
.ok(); lic
++) {
96 ts
<< "% line of score no. " << l
++ <<"\n";
97 ts
<< lic
->TeXstring();
99 ts
<< "\\interscoreline\n";
104 PScore::select_items(PStaff
*ps
, PCol
*pc
)
108 for (PCursor
<const Item
*> ic(pc
->its
); ic
.ok(); ic
++){
109 if (ic
->pstaff_
== ps
)
110 ret
.add((Item
*)(const Item
*)ic
);
118 for (PCursor
<PCol
*> cc(cols
); cc
.ok(); cc
++)
120 for (PCursor
<Idealspacing
*> ic(suz
); ic
.ok(); ic
++)
125 PScore::print() const
129 mtor
<< "PScore { width "<<print_dimen(linewidth
);
130 mtor
<< "\ncolumns: ";
131 for (PCursor
<PCol
*> cc(cols
); cc
.ok(); cc
++)
134 mtor
<< "\nideals: ";
135 for (PCursor
<Idealspacing
*> ic(suz
); ic
.ok(); ic
++)