void StaffState::write(Xml& xml) const { xml.stag(name()); xml.tag("subtype", _staffStateType); if (staffStateType() == STAFF_STATE_INSTRUMENT) _instrument.write(xml); Element::writeProperties(xml); xml.etag(); }
void StaffState::write(Xml& xml) const { xml.stag(name()); xml.tag("subtype", int(_staffStateType)); if (staffStateType() == StaffStateType::INSTRUMENT) _instrument->write(xml, nullptr); Element::writeProperties(xml); xml.etag(); }
void StaffState::layout() { qreal _spatium = spatium(); path = QPainterPath(); lw = _spatium * 0.3; qreal h = _spatium * 4; qreal w = _spatium * 2.5; // qreal w1 = w * .6; switch(staffStateType()) { case STAFF_STATE_INSTRUMENT: path.lineTo(w, 0.0); path.lineTo(w, h); path.lineTo(0.0, h); path.lineTo(0.0, 0.0); path.moveTo(w * .5, h - _spatium * .5); path.lineTo(w * .5, _spatium * 2); path.moveTo(w * .5, _spatium * .8); path.lineTo(w * .5, _spatium * 1.0); break; case STAFF_STATE_TYPE: path.lineTo(w, 0.0); path.lineTo(w, h); path.lineTo(0.0, h); path.lineTo(0.0, 0.0); break; case STAFF_STATE_VISIBLE: path.lineTo(w, 0.0); path.lineTo(w, h); path.lineTo(0.0, h); path.lineTo(0.0, 0.0); break; case STAFF_STATE_INVISIBLE: path.lineTo(w, 0.0); path.lineTo(w, h); path.lineTo(0.0, h); path.lineTo(0.0, 0.0); break; default: qDebug("unknown layout break symbol"); break; } QRectF bb(0, 0, w, h); bb.adjust(-lw, -lw, lw, lw); setbbox(bb); setPos(0.0, _spatium * -6.0); }
QString StaffState::staffStateTypeName() const { switch(staffStateType()) { case STAFF_STATE_INSTRUMENT: return "instrument"; case STAFF_STATE_TYPE: return "type"; case STAFF_STATE_VISIBLE: return "visible"; case STAFF_STATE_INVISIBLE: return "invisible"; default: return "??"; } }