6 #include "complexstaff.hh"
10 #include "clefitem.hh"
16 Complex_staff::get_TYPESET_item(Command
*com
)
19 Array
<Scalar
> arg( com
->args
);
22 if (com
->args
[0] == "KEY") {
23 return new Keyitem(NO_LINES
); // urgh. depends on clef.
24 } else if (type
== "BAR" ) {
25 s
= new Bar(com
->args
[1]);
26 } else if (type
== "METER") {
28 } else if (type
== "CLEF" || type
== "CURRENTCLEF") {
29 Clef_item
* c
= new Clef_item
;
31 c
->change
= (type
== "CLEF");
33 WARN
<< "ignoring TYPESET command for " << type
<< '\n';
41 itemlist_width(const Array
<Item
*> &its
)
46 for (int j
=0; j
< its
.size(); j
++){
47 iv
.unite (its
[j
]->width());
54 Complex_column::typeset_item(Item
*i
, int breakst
)
58 staff_l_
->pscore_l_
->typeset_item(i
, score_column_l_
->pcol_l_
,
59 staff_l_
->pstaff_l_
,breakst
);
61 if (breakst
== BREAK_PRE
- BREAK_PRE
) {
64 staff_l_
->pscore_l_
->select_items(staff_l_
->pstaff_l_
,
65 score_column_l_
->pcol_l_
->prebreak_p_
));
66 Interval column_wid
= itemlist_width(to_move
);
67 assert(!column_wid
.empty());
69 for (int j
=0; j
< to_move
.size(); j
++) {
70 to_move
[j
]->translate(Offset(-column_wid
.right
, 0));
78 Complex_column::typeset_item_directional(Item
*i
, int dir
, int breakst
) // UGH!
81 PCol
* c
=score_column_l_
->pcol_l_
;
84 else if (breakst
== 2)
87 Array
<Item
*> to_move(staff_l_
->pscore_l_
->select_items(staff_l_
->pstaff_l_
,
89 typeset_item(i
, breakst
);
91 Interval column_wid
= itemlist_width(to_move
);
92 if (column_wid
.empty())
93 column_wid
= Interval(0,0);
94 i
->translate(Offset(column_wid
[dir
] - i
->width()[-dir
], 0));
98 Complex_staff::set_output(PScore
* pscore_l
)
100 pstaff_l_
= new PStaff(pscore_l
); // pstaff_l_ is added to pscore later.
101 pscore_l_
= pscore_l
;
102 pscore_l_
->add(pstaff_l_
);