// utility functions for PScore
#include "debug.hh"
+#include "molecule.hh"
#include "dimen.hh"
#include "line.hh"
#include "pscore.hh"
for (PCursor<PCol *> c(cols); c.ok(); )
if (!c->used) {
c.del();
- mtor << "removing pcol\n";
} else
c++;
}
PScore::typeset_item(Item *i, PCol *c, PStaff *s, int breakstat)
{
assert(c && i && s);
- if (breakstat == 1 ) {
- typeset_item(i, c->prebreak, s, 0);
- } if (breakstat == 3)
- typeset_item(i, c->prebreak, s, 0 );
- else{
- its.bottom().add(i);
- s->add(i);
- c->add(i);
+// assert(!breakstat != 4 || c->breakable() );
+ if (breakstat == 0) {
+ typeset_item(i, c->prebreak, s);
+ return;
}
+
+ if (breakstat == 2) {
+ typeset_item(i, c->postbreak, s);
+ return;
+ }
+ if (c->daddy && c == c->daddy->prebreak) { // makeshift.
+ Interval iv (i->width());
+ if (!iv.empty()) {
+ svec<Item*> col_its (select_items(s, c));
+ for (int j =0; j < col_its.sz(); j++)
+ col_its[j]->output->translate(Offset(-iv.length(),0));
+ i->output->translate (Offset(-iv.max, 0));
+ }
+ }
+ its.bottom().add(i);
+ s->add(i);
+ c->add(i);
}
void
{
svec<const PCol *> retval;
for (PCursor<PCol *> c(cols); c.ok(); c++)
- if (c->breakable)
+ if (c->breakable())
retval.add(c);
return retval;
PScore::PScore()
{
- linewidth = convert_dimen(15,"cm");
+ linewidth = convert_dimen(15,"cm"); // default
}
void
void
PScore::OK()const
{
+#ifdef NDEBUG
for (PCursor<PCol*> cc(cols); cc.ok(); cc++)
cc->OK();
for (PCursor<Idealspacing*> ic(suz); ic.ok(); ic++)
ic->OK();
-
+#endif
}
void
PScore::print() const
-{
-
- #ifndef NPRINT
- mtor << "PScore { width "<<print_dimen(linewidth);
+{
+#ifndef NPRINT
+ mtor << "PScore { width "<<print_dimen(linewidth);
mtor << "\ncolumns: ";
for (PCursor<PCol*> cc(cols); cc.ok(); cc++)
cc->print();
for (PCursor<Idealspacing*> ic(suz); ic.ok(); ic++)
ic->print();
mtor << "}\n";
- #endif
+#endif
}