LayoutBreak::LayoutBreak(Score* score) : Element(score) { _layoutBreakType = LayoutBreakType(propertyDefault(P_LAYOUT_BREAK).toInt()); _pause = score->styleD(ST_SectionPause); _startWithLongNames = true; _startWithMeasureOne = true; lw = spatium() * 0.3; setFlag(ELEMENT_HAS_TAG, true); }
bool LayoutBreak::setProperty(P_ID propertyId, const QVariant& v) { switch(propertyId) { case P_LAYOUT_BREAK: setLayoutBreakType(LayoutBreakType(v.toInt())); break; case P_PAUSE: setPause(v.toDouble()); break; default: if (!Element::setProperty(propertyId, v)) return false; break; } score()->setLayoutAll(true); setGenerated(false); return true; }
void Xml::tag(P_ID id, QVariant data, QVariant defaultData) { if (data == defaultData) return; const char* name = propertyName(id); if (name == 0) return; switch(propertyType(id)) { case T_BOOL: case T_SUBTYPE: case T_INT: case T_SREAL: case T_REAL: case T_SCALE: case T_POINT: case T_SIZE: case T_COLOR: tag(name, data); break; case T_DIRECTION: switch(MScore::Direction(data.toInt())) { case MScore::UP: tag(name, QVariant("up")); break; case MScore::DOWN: tag(name, QVariant("down")); break; case MScore::AUTO: break; } break; case T_DIRECTION_H: switch(MScore::DirectionH(data.toInt())) { case MScore::DH_LEFT: tag(name, QVariant("left")); break; case MScore::DH_RIGHT: tag(name, QVariant("right")); break; case MScore::DH_AUTO: break; } break; case T_LAYOUT_BREAK: switch(LayoutBreakType(data.toInt())) { case LAYOUT_BREAK_LINE: tag(name, QVariant("line")); break; case LAYOUT_BREAK_PAGE: tag(name, QVariant("page")); break; case LAYOUT_BREAK_SECTION: tag(name, QVariant("section")); break; } break; case T_VALUE_TYPE: switch(MScore::ValueType(data.toInt())) { case MScore::OFFSET_VAL: tag(name, QVariant("offset")); break; case MScore::USER_VAL: tag(name, QVariant("user")); break; } break; case T_PLACEMENT: switch(Element::Placement(data.toInt())) { case Element::ABOVE: tag(name, QVariant("above")); break; case Element::BELOW: tag(name, QVariant("below")); break; } break; default: abort(); } }
void Xml::tag(P_ID id, QVariant data, QVariant defaultData) { if (data == defaultData) return; const char* name = propertyName(id); if (name == 0) return; switch(propertyType(id)) { case T_BOOL: case T_SUBTYPE: case T_INT: case T_SREAL: case T_REAL: case T_SCALE: case T_POINT: case T_SIZE: case T_COLOR: tag(name, data); break; #if 0 case T_FRACTION: fTag(name, *(Fraction*)data); break; #endif case T_DIRECTION: switch(Direction(data.toInt())) { case UP: tag(name, QVariant("up")); break; case DOWN: tag(name, QVariant("down")); break; case AUTO: break; } break; case T_DIRECTION_H: switch(DirectionH(data.toInt())) { case DH_LEFT: tag(name, QVariant("left")); break; case DH_RIGHT: tag(name, QVariant("right")); break; case DH_AUTO: break; } break; case T_LAYOUT_BREAK: switch(LayoutBreakType(data.toInt())) { case LAYOUT_BREAK_LINE: tag(name, QVariant("line")); break; case LAYOUT_BREAK_PAGE: tag(name, QVariant("page")); break; case LAYOUT_BREAK_SECTION: tag(name, QVariant("section")); break; } break; case T_VALUE_TYPE: switch(ValueType(data.toInt())) { case OFFSET_VAL: tag(name, QVariant("offset")); break; case USER_VAL: tag(name, QVariant("user")); break; } break; default: abort(); } }