clearing enum type Placement

This commit is contained in:
Igor Korsukov 2021-11-19 18:41:54 +02:00
parent 296c00267b
commit 5199c804e8
55 changed files with 249 additions and 246 deletions

View file

@ -321,7 +321,7 @@ public:
void tag(const QString&, QVariant data); void tag(const QString&, QVariant data);
void tag(const char* name, const char* s) { tag(name, QVariant(s)); } void tag(const char* name, const char* s) { tag(name, QVariant(s)); }
void tag(const char* name, const QString& s) { tag(name, QVariant(s)); } void tag(const char* name, const QString& s) { tag(name, QVariant(s)); }
void tag(const char* name, const mu::PointF& s); void tag(const char* name, const mu::PointF& s, bool isPutLevel = true);
void comment(const QString&); void comment(const QString&);

View file

@ -238,7 +238,7 @@ void XmlWriter::tagProperty(const char* name, const mu::engraving::PropertyValue
// geometry // geometry
case P_TYPE::POINT: { case P_TYPE::POINT: {
PointF p = data.value<PointF>(); PointF p = data.value<PointF>();
tag(name, p); tag(name, p, false);
} }
break; break;
case P_TYPE::SIZE: { case P_TYPE::SIZE: {
@ -294,29 +294,29 @@ void XmlWriter::tagProperty(const char* name, const mu::engraving::PropertyValue
*this << QString("<%1>%2,%3</%1>\n").arg(name).arg(h, v); *this << QString("<%1>%2,%3</%1>\n").arg(name).arg(h, v);
} }
break; break;
case P_TYPE::PLACEMENT: { case P_TYPE::PLACEMENT_V: {
*this << "<" << name << ">"; *this << "<" << name << ">";
switch (data.value<Placement>()) { switch (data.value<PlacementV>()) {
case Placement::ABOVE: case PlacementV::ABOVE:
*this << "above"; *this << "above";
break; break;
case Placement::BELOW: case PlacementV::BELOW:
*this << "below"; *this << "below";
break; break;
} }
*this << "</" << ename << ">\n"; *this << "</" << ename << ">\n";
} }
break; break;
case P_TYPE::HPLACEMENT: { case P_TYPE::PLACEMENT_H: {
*this << "<" << name << ">"; *this << "<" << name << ">";
switch (data.value<HPlacement>()) { switch (data.value<PlacementH>()) {
case HPlacement::LEFT: case PlacementH::LEFT:
*this << "left"; *this << "left";
break; break;
case HPlacement::CENTER: case PlacementH::CENTER:
*this << "center"; *this << "center";
break; break;
case HPlacement::RIGHT: case PlacementH::RIGHT:
*this << "right"; *this << "right";
break; break;
} }
@ -384,8 +384,12 @@ void XmlWriter::tagProperty(const char* name, const mu::engraving::PropertyValue
} }
} }
void XmlWriter::tag(const char* name, const mu::PointF& p) void XmlWriter::tag(const char* name, const mu::PointF& p, bool isPutLevel)
{ {
if (isPutLevel) {
putLevel();
}
*this << QString("<%1 x=\"%2\" y=\"%3\"/>\n").arg(name).arg(p.x()).arg(p.y()); *this << QString("<%1 x=\"%2\" y=\"%3\"/>\n").arg(name).arg(p.x()).arg(p.y());
} }

View file

@ -229,7 +229,7 @@ void LayoutLyrics::layoutLyrics(const LayoutOptions& options, const Score* score
for (Lyrics* l : cr->lyrics()) { for (Lyrics* l : cr->lyrics()) {
// user adjusted offset can possibly change placement // user adjusted offset can possibly change placement
if (l->offsetChanged() != OffsetChange::NONE) { if (l->offsetChanged() != OffsetChange::NONE) {
Placement p = l->placement(); PlacementV p = l->placement();
l->rebaseOffset(); l->rebaseOffset();
if (l->placement() != p) { if (l->placement() != p) {
l->undoResetProperty(Pid::AUTOPLACE); l->undoResetProperty(Pid::AUTOPLACE);

View file

@ -900,11 +900,11 @@ std::set<SymId> updateArticulations(const std::set<SymId>& articulationSymbolIds
return joinArticulations(splittedArticulations); return joinArticulations(splittedArticulations);
} }
std::set<SymId> flipArticulations(const std::set<SymId>& articulationSymbolIds, Placement placement) std::set<SymId> flipArticulations(const std::set<SymId>& articulationSymbolIds, PlacementV placement)
{ {
std::set<SymId> result; std::set<SymId> result;
switch (placement) { switch (placement) {
case Placement::ABOVE: case PlacementV::ABOVE:
for (const SymId& articulationSymbolId: articulationSymbolIds) { for (const SymId& articulationSymbolId: articulationSymbolIds) {
bool found = false; bool found = false;
for (auto it = articulationPlacements.begin(); it != articulationPlacements.end(); ++it) { for (auto it = articulationPlacements.begin(); it != articulationPlacements.end(); ++it) {
@ -920,7 +920,7 @@ std::set<SymId> flipArticulations(const std::set<SymId>& articulationSymbolIds,
} }
} }
break; break;
case Placement::BELOW: case PlacementV::BELOW:
for (const SymId& articulationSymbolId: articulationSymbolIds) { for (const SymId& articulationSymbolId: articulationSymbolIds) {
bool found = false; bool found = false;
for (auto it = articulationPlacements.begin(); it != articulationPlacements.end(); ++it) { for (auto it = articulationPlacements.begin(); it != articulationPlacements.end(); ++it) {

View file

@ -77,7 +77,7 @@ std::set<SymId> updateArticulations(const std::set<SymId>& articulationSymbolIds
ArticulationsUpdateMode updateMode = ArticulationsUpdateMode::Insert); ArticulationsUpdateMode updateMode = ArticulationsUpdateMode::Insert);
std::set<SymId> splitArticulations(const std::set<SymId>& articulationSymbolIds); std::set<SymId> splitArticulations(const std::set<SymId>& articulationSymbolIds);
std::set<SymId> joinArticulations(const std::set<SymId>& articulationSymbolIds); std::set<SymId> joinArticulations(const std::set<SymId>& articulationSymbolIds);
std::set<SymId> flipArticulations(const std::set<SymId>& articulationSymbolIds, Placement placement); std::set<SymId> flipArticulations(const std::set<SymId>& articulationSymbolIds, PlacementV placement);
//--------------------------------------------------------- //---------------------------------------------------------
// @@ Articulation // @@ Articulation

View file

@ -975,7 +975,7 @@ EngravingItem* BarLine::drop(EditData& data)
score()->undoAddElement(e); score()->undoAddElement(e);
return e; return e;
} else if (e->isFermata()) { } else if (e->isFermata()) {
e->setPlacement(track() & 1 ? Placement::BELOW : Placement::ABOVE); e->setPlacement(track() & 1 ? PlacementV::BELOW : PlacementV::ABOVE);
for (EngravingItem* el: segment()->annotations()) { for (EngravingItem* el: segment()->annotations()) {
if (el->isFermata() && (el->track() == track())) { if (el->isFermata() && (el->track() == track())) {
if (el->subtype() == e->subtype()) { if (el->subtype() == e->subtype()) {

View file

@ -226,7 +226,7 @@ PropertyValue Breath::propertyDefault(Pid id) const
case Pid::PAUSE: case Pid::PAUSE:
return 0.0; return 0.0;
case Pid::PLACEMENT: case Pid::PLACEMENT:
return track() & 1 ? int(Placement::BELOW) : int(Placement::ABOVE); return track() & 1 ? int(PlacementV::BELOW) : int(PlacementV::ABOVE);
default: default:
return EngravingItem::propertyDefault(id); return EngravingItem::propertyDefault(id);
} }

View file

@ -2859,10 +2859,10 @@ void Chord::updateArticulations(const std::set<SymId>& newArticulationIds, Artic
score()->undoRemoveElement(artic); score()->undoRemoveElement(artic);
} }
std::set<SymId> articulationIds = flipArticulations(currentArticulationIds, Placement::ABOVE); std::set<SymId> articulationIds = flipArticulations(currentArticulationIds, PlacementV::ABOVE);
articulationIds = splitArticulations(articulationIds); articulationIds = splitArticulations(articulationIds);
std::set<SymId> _newArticulationIds = flipArticulations(newArticulationIds, Placement::ABOVE); std::set<SymId> _newArticulationIds = flipArticulations(newArticulationIds, PlacementV::ABOVE);
_newArticulationIds = splitArticulations(_newArticulationIds); _newArticulationIds = splitArticulations(_newArticulationIds);
for (const SymId& articulationId: _newArticulationIds) { for (const SymId& articulationId: _newArticulationIds) {

View file

@ -427,7 +427,7 @@ EngravingItem* ChordRest::drop(EditData& data)
b->setPos(PointF()); b->setPos(PointF());
// allow breath marks in voice > 1 // allow breath marks in voice > 1
b->setTrack(this->track()); b->setTrack(this->track());
b->setPlacement(b->track() & 1 ? Placement::BELOW : Placement::ABOVE); b->setPlacement(b->track() & 1 ? PlacementV::BELOW : PlacementV::ABOVE);
Fraction bt = tick() + actualTicks(); Fraction bt = tick() + actualTicks();
bt = tick() + actualTicks(); bt = tick() + actualTicks();
@ -492,7 +492,7 @@ EngravingItem* ChordRest::drop(EditData& data)
} }
case ElementType::FERMATA: case ElementType::FERMATA:
e->setPlacement(track() & 1 ? Placement::BELOW : Placement::ABOVE); e->setPlacement(track() & 1 ? PlacementV::BELOW : PlacementV::ABOVE);
for (EngravingItem* el: segment()->annotations()) { for (EngravingItem* el: segment()->annotations()) {
if (el->isFermata() && (el->track() == track())) { if (el->isFermata() && (el->track() == track())) {
if (el->subtype() == e->subtype()) { if (el->subtype() == e->subtype()) {
@ -1379,7 +1379,7 @@ Shape ChordRest::shape() const
// lyrics // lyrics
//--------------------------------------------------------- //---------------------------------------------------------
Lyrics* ChordRest::lyrics(int no, Placement p) const Lyrics* ChordRest::lyrics(int no, PlacementV p) const
{ {
for (Lyrics* l : _lyrics) { for (Lyrics* l : _lyrics) {
if (l->placement() == p && l->no() == no) { if (l->placement() == p && l->no() == no) {
@ -1395,7 +1395,7 @@ Lyrics* ChordRest::lyrics(int no, Placement p) const
// return -1 if there are no lyrics; // return -1 if there are no lyrics;
//--------------------------------------------------------- //---------------------------------------------------------
int ChordRest::lastVerse(Placement p) const int ChordRest::lastVerse(PlacementV p) const
{ {
int lastVerse = -1; int lastVerse = -1;

View file

@ -157,8 +157,8 @@ public:
const std::vector<Lyrics*>& lyrics() const { return _lyrics; } const std::vector<Lyrics*>& lyrics() const { return _lyrics; }
std::vector<Lyrics*>& lyrics() { return _lyrics; } std::vector<Lyrics*>& lyrics() { return _lyrics; }
Lyrics* lyrics(int verse, Placement) const; Lyrics* lyrics(int verse, PlacementV) const;
int lastVerse(Placement) const; int lastVerse(PlacementV) const;
bool isMelismaEnd() const; bool isMelismaEnd() const;
void setMelismaEnd(bool v); void setMelismaEnd(bool v);

View file

@ -621,7 +621,7 @@ TextBase* Score::addText(Tid type)
break; break;
} }
textBox = new StaffText(this->dummy()->segment(), Tid::EXPRESSION); textBox = new StaffText(this->dummy()->segment(), Tid::EXPRESSION);
textBox->setPlacement(Placement::BELOW); textBox->setPlacement(PlacementV::BELOW);
textBox->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED); textBox->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED);
chordRest->undoAddAnnotation(textBox); chordRest->undoAddAnnotation(textBox);
break; break;
@ -1880,7 +1880,7 @@ void Score::cmdAddOttava(OttavaType type)
Ottava* ottava = new Ottava(this->dummy()); Ottava* ottava = new Ottava(this->dummy());
ottava->setOttavaType(type); ottava->setOttavaType(type);
if (type == OttavaType::OTTAVA_8VB /*|| type == OttavaType::OTTAVA_15MB || type == OttavaType::OTTAVA_22MB*/) { if (type == OttavaType::OTTAVA_8VB /*|| type == OttavaType::OTTAVA_15MB || type == OttavaType::OTTAVA_22MB*/) {
ottava->setPlacement(Placement::BELOW); ottava->setPlacement(PlacementV::BELOW);
ottava->styleChanged(); ottava->styleChanged();
} }
ottava->setTrack(cr1->track()); ottava->setTrack(cr1->track());
@ -1903,7 +1903,7 @@ void Score::cmdAddOttava(OttavaType type)
Ottava* ottava = new Ottava(this->dummy()); Ottava* ottava = new Ottava(this->dummy());
ottava->setOttavaType(type); ottava->setOttavaType(type);
if (type == OttavaType::OTTAVA_8VB /*|| type == OttavaType::OTTAVA_15MB || type == OttavaType::OTTAVA_22MB*/) { if (type == OttavaType::OTTAVA_8VB /*|| type == OttavaType::OTTAVA_15MB || type == OttavaType::OTTAVA_22MB*/) {
ottava->setPlacement(Placement::BELOW); ottava->setPlacement(PlacementV::BELOW);
ottava->styleChanged(); ottava->styleChanged();
} }
ottava->setTrack(cr1->track()); ottava->setTrack(cr1->track());
@ -2139,8 +2139,8 @@ void Score::cmdFlip()
|| e->isBreath()) { || e->isBreath()) {
e->undoChangeProperty(Pid::AUTOPLACE, true); e->undoChangeProperty(Pid::AUTOPLACE, true);
// getProperty() delegates call from spannerSegment to Spanner // getProperty() delegates call from spannerSegment to Spanner
Placement p = Placement(e->getProperty(Pid::PLACEMENT).toInt()); PlacementV p = PlacementV(e->getProperty(Pid::PLACEMENT).toInt());
p = (p == Placement::ABOVE) ? Placement::BELOW : Placement::ABOVE; p = (p == PlacementV::ABOVE) ? PlacementV::BELOW : PlacementV::ABOVE;
// TODO: undoChangeProperty() should probably do this directly // TODO: undoChangeProperty() should probably do this directly
// see https://musescore.org/en/node/281432 // see https://musescore.org/en/node/281432
EngravingItem* ee = e->propertyDelegate(Pid::PLACEMENT); EngravingItem* ee = e->propertyDelegate(Pid::PLACEMENT);

View file

@ -1342,7 +1342,7 @@ bool EngravingItem::setProperty(Pid propertyId, const PropertyValue& v)
setMinDistance(v.value<Spatium>()); setMinDistance(v.value<Spatium>());
break; break;
case Pid::PLACEMENT: case Pid::PLACEMENT:
setPlacement(Placement(v.toInt())); setPlacement(PlacementV(v.toInt()));
break; break;
case Pid::AUTOPLACE: case Pid::AUTOPLACE:
setAutoplace(v.toBool()); setAutoplace(v.toBool());
@ -1401,7 +1401,7 @@ PropertyValue EngravingItem::propertyDefault(Pid pid) const
if (v.isValid()) { // if it's a styled property if (v.isValid()) { // if it's a styled property
return v; return v;
} }
return int(Placement::BELOW); return int(PlacementV::BELOW);
} }
case Pid::SELECTED: case Pid::SELECTED:
return false; return false;
@ -2149,7 +2149,7 @@ QVector<LineF> EngravingItem::genericDragAnchorLines() const
System* system = toSegment(parent())->measure()->system(); System* system = toSegment(parent())->measure()->system();
const int stIdx = staffIdx(); const int stIdx = staffIdx();
yp = system ? system->staffCanvasYpage(stIdx) : 0.0; yp = system ? system->staffCanvasYpage(stIdx) : 0.0;
if (placement() == Placement::BELOW) { if (placement() == PlacementV::BELOW) {
yp += system ? system->staff(stIdx)->bbox().height() : 0.0; yp += system ? system->staff(stIdx)->bbox().height() : 0.0;
} }
//adjust anchor Y positions to staffType offset //adjust anchor Y positions to staffType offset
@ -2327,7 +2327,7 @@ qreal EngravingItem::rebaseOffset(bool nox)
if (pf == PropertyFlags::STYLED) { if (pf == PropertyFlags::STYLED) {
pf = PropertyFlags::UNSTYLED; pf = PropertyFlags::UNSTYLED;
} }
Placement place = above ? Placement::BELOW : Placement::ABOVE; PlacementV place = above ? PlacementV::BELOW : PlacementV::ABOVE;
e->undoChangeProperty(Pid::PLACEMENT, int(place), pf); e->undoChangeProperty(Pid::PLACEMENT, int(place), pf);
undoResetProperty(Pid::MIN_DISTANCE); undoResetProperty(Pid::MIN_DISTANCE);
return 0.0; return 0.0;

View file

@ -286,10 +286,10 @@ public:
void setSizeIsSpatiumDependent(bool v) { setFlag(ElementFlag::SIZE_SPATIUM_DEPENDENT, !v); } void setSizeIsSpatiumDependent(bool v) { setFlag(ElementFlag::SIZE_SPATIUM_DEPENDENT, !v); }
bool offsetIsSpatiumDependent() const override; bool offsetIsSpatiumDependent() const override;
Placement placement() const { return Placement(!flag(ElementFlag::PLACE_ABOVE)); } PlacementV placement() const { return PlacementV(!flag(ElementFlag::PLACE_ABOVE)); }
void setPlacement(Placement val) { setFlag(ElementFlag::PLACE_ABOVE, !bool(val)); } void setPlacement(PlacementV val) { setFlag(ElementFlag::PLACE_ABOVE, !bool(val)); }
bool placeAbove() const { return placement() == Placement::ABOVE; } bool placeAbove() const { return placement() == PlacementV::ABOVE; }
bool placeBelow() const { return placement() == Placement::BELOW; } bool placeBelow() const { return placement() == PlacementV::BELOW; }
virtual bool placeMultiple() const { return true; } virtual bool placeMultiple() const { return true; }
bool generated() const { return flag(ElementFlag::GENERATED); } bool generated() const { return flag(ElementFlag::GENERATED); }

View file

@ -53,7 +53,7 @@ static const ElementStyle fermataStyle {
Fermata::Fermata(EngravingItem* parent) Fermata::Fermata(EngravingItem* parent)
: EngravingItem(ElementType::FERMATA, parent, ElementFlag::MOVABLE | ElementFlag::ON_STAFF) : EngravingItem(ElementType::FERMATA, parent, ElementFlag::MOVABLE | ElementFlag::ON_STAFF)
{ {
setPlacement(Placement::ABOVE); setPlacement(PlacementV::ABOVE);
_symId = SymId::noSym; _symId = SymId::noSym;
_timeStretch = 1.0; _timeStretch = 1.0;
setPlay(true); setPlay(true);
@ -285,7 +285,7 @@ bool Fermata::setProperty(Pid propertyId, const PropertyValue& v)
setSymId(v.value<SymId>()); setSymId(v.value<SymId>());
break; break;
case Pid::PLACEMENT: { case Pid::PLACEMENT: {
Placement p = Placement(v.toInt()); PlacementV p = PlacementV(v.toInt());
if (p != placement()) { if (p != placement()) {
QString s = SymNames::nameForSymId(_symId); QString s = SymNames::nameForSymId(_symId);
bool up = placeAbove(); bool up = placeAbove();
@ -319,7 +319,7 @@ PropertyValue Fermata::propertyDefault(Pid propertyId) const
{ {
switch (propertyId) { switch (propertyId) {
case Pid::PLACEMENT: case Pid::PLACEMENT:
return int(track() & 1 ? Placement::BELOW : Placement::ABOVE); return int(track() & 1 ? PlacementV::BELOW : PlacementV::ABOVE);
case Pid::TIME_STRETCH: case Pid::TIME_STRETCH:
return 1.0; // articulationList[int(articulationType())].timeStretch; return 1.0; // articulationList[int(articulationType())].timeStretch;
case Pid::PLAY: case Pid::PLAY:

View file

@ -54,7 +54,7 @@ static const ElementStyle fingeringStyle {
Fingering::Fingering(Note* parent, Tid tid, ElementFlags ef) Fingering::Fingering(Note* parent, Tid tid, ElementFlags ef)
: TextBase(ElementType::FINGERING, parent, tid, ef) : TextBase(ElementType::FINGERING, parent, tid, ef)
{ {
setPlacement(Placement::ABOVE); setPlacement(PlacementV::ABOVE);
initElementStyle(&fingeringStyle); initElementStyle(&fingeringStyle);
} }
@ -83,11 +83,11 @@ ElementType Fingering::layoutType()
// calculatePlacement // calculatePlacement
//--------------------------------------------------------- //---------------------------------------------------------
Placement Fingering::calculatePlacement() const PlacementV Fingering::calculatePlacement() const
{ {
Note* n = note(); Note* n = note();
if (!n) { if (!n) {
return Placement::ABOVE; return PlacementV::ABOVE;
} }
Chord* chord = n->chord(); Chord* chord = n->chord();
Staff* staff = chord->staff(); Staff* staff = chord->staff();
@ -95,7 +95,7 @@ Placement Fingering::calculatePlacement() const
int nstaves = part->nstaves(); int nstaves = part->nstaves();
bool voices = chord->measure()->hasVoices(staff->idx(), chord->tick(), chord->actualTicks()); bool voices = chord->measure()->hasVoices(staff->idx(), chord->tick(), chord->actualTicks());
bool below = voices ? !chord->up() : (nstaves > 1) && (staff->rstaff() == nstaves - 1); bool below = voices ? !chord->up() : (nstaves > 1) && (staff->rstaff() == nstaves - 1);
return below ? Placement::BELOW : Placement::ABOVE; return below ? PlacementV::BELOW : PlacementV::ABOVE;
} }
//--------------------------------------------------------- //---------------------------------------------------------

View file

@ -40,7 +40,7 @@ public:
Note* note() const { return toNote(parent()); } Note* note() const { return toNote(parent()); }
ElementType layoutType(); ElementType layoutType();
Placement calculatePlacement() const; PlacementV calculatePlacement() const;
void draw(mu::draw::Painter*) const override; void draw(mu::draw::Painter*) const override;
void layout() override; void layout() override;

View file

@ -2022,7 +2022,7 @@ const ParsedChord* Harmony::parsedForm()
void Harmony::setHarmonyType(HarmonyType val) void Harmony::setHarmonyType(HarmonyType val)
{ {
_harmonyType = val; _harmonyType = val;
setPlacement(Placement(propertyDefault(Pid::PLACEMENT).toInt())); setPlacement(PlacementV(propertyDefault(Pid::PLACEMENT).toInt()));
switch (_harmonyType) { switch (_harmonyType) {
case HarmonyType::STANDARD: case HarmonyType::STANDARD:
initTid(Tid::HARMONY_A); initTid(Tid::HARMONY_A);

View file

@ -166,7 +166,7 @@ void InputState::update(Selection& selection)
} }
articulationsIds = Ms::splitArticulations(articulationsIds); articulationsIds = Ms::splitArticulations(articulationsIds);
articulationsIds = Ms::flipArticulations(articulationsIds, Ms::Placement::ABOVE); articulationsIds = Ms::flipArticulations(articulationsIds, Ms::PlacementV::ABOVE);
for (const SymId& articulationSymbolId: articulationsIds) { for (const SymId& articulationSymbolId: articulationsIds) {
if (std::find(articulationSymbolIds.begin(), articulationSymbolIds.end(), if (std::find(articulationSymbolIds.begin(), articulationSymbolIds.end(),
articulationSymbolId) == articulationSymbolIds.end()) { articulationSymbolId) == articulationSymbolIds.end()) {
@ -180,7 +180,7 @@ void InputState::update(Selection& selection)
for (Articulation* artic: n->chord()->articulations()) { for (Articulation* artic: n->chord()->articulations()) {
articulationsIds.insert(artic->symId()); articulationsIds.insert(artic->symId());
} }
articulationSymbolIds = Ms::flipArticulations(articulationsIds, Ms::Placement::ABOVE); articulationSymbolIds = Ms::flipArticulations(articulationsIds, Ms::PlacementV::ABOVE);
n1 = n; n1 = n;
} }

View file

@ -251,7 +251,7 @@ PropertyValue Jump::propertyDefault(Pid propertyId) const
case Pid::PLAY_REPEATS: case Pid::PLAY_REPEATS:
return false; return false;
case Pid::PLACEMENT: case Pid::PLACEMENT:
return int(Placement::ABOVE); return int(PlacementV::ABOVE);
default: default:
break; break;
} }

View file

@ -177,7 +177,7 @@ QVector<LineF> LineSegment::gripAnchorLines(Grip grip) const
} else { } else {
const int stIdx = staffIdx(); const int stIdx = staffIdx();
y = system()->staffYpage(stIdx); y = system()->staffYpage(stIdx);
if (line()->placement() == Placement::BELOW) { if (line()->placement() == PlacementV::BELOW) {
y += system()->staff(stIdx)->bbox().height(); y += system()->staff(stIdx)->bbox().height();
} }
// adjust Y to staffType offset // adjust Y to staffType offset

View file

@ -570,7 +570,7 @@ bool Lyrics::setProperty(Pid propertyId, const PropertyValue& v)
{ {
switch (propertyId) { switch (propertyId) {
case Pid::PLACEMENT: case Pid::PLACEMENT:
setPlacement(Placement(v.toInt())); setPlacement(PlacementV(v.toInt()));
break; break;
case Pid::SYLLABIC: case Pid::SYLLABIC:
_syllabic = Syllabic(v.toInt()); _syllabic = Syllabic(v.toInt());
@ -660,7 +660,7 @@ void Lyrics::undoChangeProperty(Pid id, const PropertyValue& v, PropertyFlags ps
if (l->no() == v.toInt()) { if (l->no() == v.toInt()) {
// verse already exists, swap // verse already exists, swap
l->TextBase::undoChangeProperty(id, no(), ps); l->TextBase::undoChangeProperty(id, no(), ps);
Placement p = l->placement(); PlacementV p = l->placement();
l->TextBase::undoChangeProperty(Pid::PLACEMENT, int(placement()), ps); l->TextBase::undoChangeProperty(Pid::PLACEMENT, int(placement()), ps);
TextBase::undoChangeProperty(Pid::PLACEMENT, int(p), ps); TextBase::undoChangeProperty(Pid::PLACEMENT, int(p), ps);
break; break;

View file

@ -41,7 +41,7 @@ namespace Ms {
// searchNextLyrics // searchNextLyrics
//--------------------------------------------------------- //---------------------------------------------------------
static Lyrics* searchNextLyrics(Segment* s, int staffIdx, int verse, Placement p) static Lyrics* searchNextLyrics(Segment* s, int staffIdx, int verse, PlacementV p)
{ {
Lyrics* l = 0; Lyrics* l = 0;
while ((s = s->next1(SegmentType::ChordRest))) { while ((s = s->next1(SegmentType::ChordRest))) {

View file

@ -305,7 +305,7 @@ PropertyValue Marker::propertyDefault(Pid propertyId) const
case Pid::MARKER_TYPE: case Pid::MARKER_TYPE:
return int(Type::FINE); return int(Type::FINE);
case Pid::PLACEMENT: case Pid::PLACEMENT:
return int(Placement::ABOVE); return int(PlacementV::ABOVE);
default: default:
break; break;
} }

View file

@ -45,7 +45,7 @@ MeasureNumber::MeasureNumber(Measure* parent, Tid tid)
{ {
initElementStyle(&measureNumberStyle); initElementStyle(&measureNumberStyle);
setHPlacement(score()->styleV(Sid::measureNumberHPlacement).value<HPlacement>()); setHPlacement(score()->styleV(Sid::measureNumberHPlacement).value<PlacementH>());
} }
//--------------------------------------------------------- //---------------------------------------------------------

View file

@ -74,7 +74,7 @@ bool MeasureNumberBase::setProperty(Pid id, const PropertyValue& val)
{ {
switch (id) { switch (id) {
case Pid::HPLACEMENT: case Pid::HPLACEMENT:
setHPlacement(HPlacement(val.toInt())); setHPlacement(PlacementH(val.toInt()));
setLayoutInvalid(); setLayoutInvalid();
triggerLayout(); triggerLayout();
return true; return true;
@ -152,7 +152,7 @@ void MeasureNumberBase::layout()
rypos() = yoff; rypos() = yoff;
} }
if (hPlacement() == HPlacement::CENTER) { if (hPlacement() == PlacementH::CENTER) {
// measure numbers should be centered over where there can be notes. // measure numbers should be centered over where there can be notes.
// This means that header and trailing segments should be ignored, // This means that header and trailing segments should be ignored,
// which includes all timesigs, clefs, keysigs, etc. // which includes all timesigs, clefs, keysigs, etc.
@ -193,7 +193,7 @@ void MeasureNumberBase::layout()
qreal x2 = s2 ? s2->x() - s2->minLeft() : mea->width(); qreal x2 = s2 ? s2->x() - s2->minLeft() : mea->width();
rxpos() = (x1 + x2) * 0.5; rxpos() = (x1 + x2) * 0.5;
} else if (hPlacement() == HPlacement::RIGHT) { } else if (hPlacement() == PlacementH::RIGHT) {
rxpos() = measure()->width(); rxpos() = measure()->width();
} }
} }

View file

@ -34,8 +34,6 @@ namespace Ms {
class MeasureNumberBase : public TextBase class MeasureNumberBase : public TextBase
{ {
M_PROPERTY(HPlacement, hPlacement, setHPlacement) // Horizontal Placement
public: public:
MeasureNumberBase(const ElementType& type, Measure* parent = nullptr, Tid = Tid::DEFAULT); MeasureNumberBase(const ElementType& type, Measure* parent = nullptr, Tid = Tid::DEFAULT);
MeasureNumberBase(const MeasureNumberBase& other); MeasureNumberBase(const MeasureNumberBase& other);
@ -50,6 +48,12 @@ public:
Measure* measure() const { return toMeasure(parent()); } Measure* measure() const { return toMeasure(parent()); }
bool isEditable() const override { return false; } // The measure numbers' text should not be editable bool isEditable() const override { return false; } // The measure numbers' text should not be editable
PlacementH hPlacement() const { return m_placementH; }
void setHPlacement(PlacementH p) { m_placementH = p; }
private:
PlacementH m_placementH = PlacementH::LEFT;
}; };
} // namespace Ms } // namespace Ms

View file

@ -114,7 +114,7 @@ void Ottava::setNumbersOnly(bool val)
// setPlacement // setPlacement
//--------------------------------------------------------- //---------------------------------------------------------
void Ottava::setPlacement(Placement p) void Ottava::setPlacement(PlacementV p)
{ {
TextLineBase::setPlacement(p); TextLineBase::setPlacement(p);
} }
@ -212,7 +212,7 @@ Sid Ottava::getPropertyStyle(Pid pid) const
return ss[idx + 2]; // CONTINUE_TEXT return ss[idx + 2]; // CONTINUE_TEXT
case Pid::END_HOOK_HEIGHT: case Pid::END_HOOK_HEIGHT:
if (isStyled(Pid::PLACEMENT)) { if (isStyled(Pid::PLACEMENT)) {
return score()->styleI(ss[idx]) == int(Placement::ABOVE) ? Sid::ottavaHookAbove : Sid::ottavaHookBelow; return score()->styleI(ss[idx]) == int(PlacementV::ABOVE) ? Sid::ottavaHookAbove : Sid::ottavaHookBelow;
} else { } else {
return placeAbove() ? Sid::ottavaHookAbove : Sid::ottavaHookBelow; return placeAbove() ? Sid::ottavaHookAbove : Sid::ottavaHookBelow;
} }

View file

@ -119,7 +119,7 @@ public:
bool numbersOnly() const { return _numbersOnly; } bool numbersOnly() const { return _numbersOnly; }
void setNumbersOnly(bool val); void setNumbersOnly(bool val);
void setPlacement(Placement); void setPlacement(PlacementV);
LineSegment* createLineSegment(System* parent) override; LineSegment* createLineSegment(System* parent) override;
int pitchShift() const; int pitchShift() const;

View file

@ -399,7 +399,7 @@ bool Score::pasteStaff(XmlReader& e, Segment* dst, int dstStaff, Fraction scale)
EngravingItem* el = Factory::createItemByName(tag, this->dummy()); EngravingItem* el = Factory::createItemByName(tag, this->dummy());
el->setTrack(e.track()); // a valid track might be necessary for el->read() to work el->setTrack(e.track()); // a valid track might be necessary for el->read() to work
if (el->isFermata()) { if (el->isFermata()) {
el->setPlacement(el->track() & 1 ? Placement::BELOW : Placement::ABOVE); el->setPlacement(el->track() & 1 ? PlacementV::BELOW : PlacementV::ABOVE);
} }
el->read(e); el->read(e);
@ -434,7 +434,7 @@ bool Score::pasteStaff(XmlReader& e, Segment* dst, int dstStaff, Fraction scale)
Segment* segment = m->undoGetSegment(SegmentType::Breath, tick); Segment* segment = m->undoGetSegment(SegmentType::Breath, tick);
Breath* breath = Factory::createBreath(segment); Breath* breath = Factory::createBreath(segment);
breath->setTrack(e.track()); breath->setTrack(e.track());
breath->setPlacement(breath->track() & 1 ? Placement::BELOW : Placement::ABOVE); breath->setPlacement(breath->track() & 1 ? PlacementV::BELOW : PlacementV::ABOVE);
breath->read(e); breath->read(e);
breath->setParent(segment); breath->setParent(segment);
undoChangeElement(segment->element(e.track()), breath); undoChangeElement(segment->element(e.track()), breath);

View file

@ -186,8 +186,8 @@ static constexpr PropertyMetaData propertyList[] = {
{ Pid::SINGLE_NOTE_DYNAMICS, true, "singleNoteDynamics", P_TYPE::BOOL, DUMMY_QT_TR_NOOP("propertyName", "single note dynamics") }, { Pid::SINGLE_NOTE_DYNAMICS, true, "singleNoteDynamics", P_TYPE::BOOL, DUMMY_QT_TR_NOOP("propertyName", "single note dynamics") },
{ Pid::CHANGE_METHOD, true, "changeMethod", P_TYPE::CHANGE_METHOD, DUMMY_QT_TR_NOOP("propertyName", "change method") }, // the new, more general version of VELO_CHANGE_METHOD { Pid::CHANGE_METHOD, true, "changeMethod", P_TYPE::CHANGE_METHOD, DUMMY_QT_TR_NOOP("propertyName", "change method") }, // the new, more general version of VELO_CHANGE_METHOD
{ Pid::PLACEMENT, false, "placement", P_TYPE::PLACEMENT, DUMMY_QT_TR_NOOP("propertyName", "placement") }, { Pid::PLACEMENT, false, "placement", P_TYPE::PLACEMENT_V, DUMMY_QT_TR_NOOP("propertyName", "placement") },
{ Pid::HPLACEMENT, false, "hplacement", P_TYPE::HPLACEMENT, DUMMY_QT_TR_NOOP("propertyName", "horizontal placement") }, { Pid::HPLACEMENT, false, "hplacement", P_TYPE::PLACEMENT_H, DUMMY_QT_TR_NOOP("propertyName", "horizontal placement") },
{ Pid::MMREST_RANGE_BRACKET_TYPE, false, "mmrestRangeBracketType", P_TYPE::INT, DUMMY_QT_TR_NOOP("propertyName", "multimeasure rest range bracket type") }, { Pid::MMREST_RANGE_BRACKET_TYPE, false, "mmrestRangeBracketType", P_TYPE::INT, DUMMY_QT_TR_NOOP("propertyName", "multimeasure rest range bracket type") },
{ Pid::VELOCITY, false, "velocity", P_TYPE::INT, DUMMY_QT_TR_NOOP("propertyName", "velocity") }, { Pid::VELOCITY, false, "velocity", P_TYPE::INT, DUMMY_QT_TR_NOOP("propertyName", "velocity") },
{ Pid::JUMP_TO, true, "jumpTo", P_TYPE::STRING, DUMMY_QT_TR_NOOP("propertyName", "jump to") }, { Pid::JUMP_TO, true, "jumpTo", P_TYPE::STRING, DUMMY_QT_TR_NOOP("propertyName", "jump to") },
@ -548,21 +548,21 @@ PropertyValue propertyFromString(Pid id, QString value)
} }
} }
break; break;
case P_TYPE::PLACEMENT: { case P_TYPE::PLACEMENT_V: {
if (value == "above") { if (value == "above") {
return PropertyValue(int(Placement::ABOVE)); return PropertyValue(int(PlacementV::ABOVE));
} else if (value == "below") { } else if (value == "below") {
return PropertyValue(int(Placement::BELOW)); return PropertyValue(int(PlacementV::BELOW));
} }
} }
break; break;
case P_TYPE::HPLACEMENT: { case P_TYPE::PLACEMENT_H: {
if (value == "left") { if (value == "left") {
return PropertyValue(int(HPlacement::LEFT)); return PropertyValue(int(PlacementH::LEFT));
} else if (value == "center") { } else if (value == "center") {
return PropertyValue(int(HPlacement::CENTER)); return PropertyValue(int(PlacementH::CENTER));
} else if (value == "right") { } else if (value == "right") {
return PropertyValue(int(HPlacement::RIGHT)); return PropertyValue(int(PlacementH::RIGHT));
} }
} }
break; break;
@ -687,8 +687,8 @@ PropertyValue readProperty(Pid id, XmlReader& e)
case P_TYPE::DIRECTION_H: case P_TYPE::DIRECTION_H:
case P_TYPE::LAYOUT_BREAK: case P_TYPE::LAYOUT_BREAK:
case P_TYPE::VALUE_TYPE: case P_TYPE::VALUE_TYPE:
case P_TYPE::PLACEMENT: case P_TYPE::PLACEMENT_V:
case P_TYPE::HPLACEMENT: case P_TYPE::PLACEMENT_H:
case P_TYPE::TEXT_PLACE: case P_TYPE::TEXT_PLACE:
case P_TYPE::BARLINE_TYPE: case P_TYPE::BARLINE_TYPE:
case P_TYPE::SYMID: case P_TYPE::SYMID:
@ -838,21 +838,21 @@ QString propertyToString(Pid id, const PropertyValue& value, bool mscx)
return "user"; return "user";
} }
break; break;
case P_TYPE::PLACEMENT: case P_TYPE::PLACEMENT_V:
switch (Placement(value.toInt())) { switch (PlacementV(value.toInt())) {
case Placement::ABOVE: case PlacementV::ABOVE:
return "above"; return "above";
case Placement::BELOW: case PlacementV::BELOW:
return "below"; return "below";
} }
break; break;
case P_TYPE::HPLACEMENT: case P_TYPE::PLACEMENT_H:
switch (HPlacement(value.toInt())) { switch (PlacementH(value.toInt())) {
case HPlacement::LEFT: case PlacementH::LEFT:
return "left"; return "left";
case HPlacement::CENTER: case PlacementH::CENTER:
return "center"; return "center";
case HPlacement::RIGHT: case PlacementH::RIGHT:
return "right"; return "right";
} }
break; break;

View file

@ -4561,7 +4561,7 @@ QString Score::extractLyrics()
if (playCount >= int(cr->lyrics().size())) { if (playCount >= int(cr->lyrics().size())) {
continue; continue;
} }
Lyrics* l = cr->lyrics(playCount, Placement::BELOW); // TODO: ABOVE Lyrics* l = cr->lyrics(playCount, PlacementV::BELOW); // TODO: ABOVE
if (!l) { if (!l) {
continue; continue;
} }
@ -4596,7 +4596,7 @@ QString Score::extractLyrics()
if (lyricsNumber >= cr->lyrics().size()) { if (lyricsNumber >= cr->lyrics().size()) {
continue; continue;
} }
Lyrics* l = cr->lyrics(lyricsNumber, Placement::BELOW); // TODO Lyrics* l = cr->lyrics(lyricsNumber, PlacementV::BELOW); // TODO
if (!l) { if (!l) {
continue; continue;
} }

View file

@ -334,7 +334,7 @@ bool TextLine::setProperty(Pid id, const engraving::PropertyValue& v)
{ {
switch (id) { switch (id) {
case Pid::PLACEMENT: case Pid::PLACEMENT:
setPlacement(Placement(v.toInt())); setPlacement(PlacementV(v.toInt()));
break; break;
default: default:
return TextLineBase::setProperty(id, v); return TextLineBase::setProperty(id, v);

View file

@ -301,7 +301,7 @@ void TextLineBaseSegment::layout()
_text->setStrike(tl->continueFontStyle() & FontStyle::Strike); _text->setStrike(tl->continueFontStyle() & FontStyle::Strike);
break; break;
} }
_text->setPlacement(Placement::ABOVE); _text->setPlacement(PlacementV::ABOVE);
_text->setTrack(track()); _text->setTrack(track());
_text->layout(); _text->layout();
@ -315,7 +315,7 @@ void TextLineBaseSegment::layout()
_endText->setItalic(tl->endFontStyle() & FontStyle::Italic); _endText->setItalic(tl->endFontStyle() & FontStyle::Italic);
_endText->setUnderline(tl->endFontStyle() & FontStyle::Underline); _endText->setUnderline(tl->endFontStyle() & FontStyle::Underline);
_endText->setStrike(tl->endFontStyle() & FontStyle::Strike); _endText->setStrike(tl->endFontStyle() & FontStyle::Strike);
_endText->setPlacement(Placement::ABOVE); _endText->setPlacement(PlacementV::ABOVE);
_endText->setTrack(track()); _endText->setTrack(track());
_endText->layout(); _endText->layout();
} else { } else {

View file

@ -419,26 +419,6 @@ enum class HarmonyType {
///\} ///\}
}; };
//---------------------------------------------------------
// Placement
//---------------------------------------------------------
enum class Placement {
///.\{
ABOVE, BELOW
///\}
};
//---------------------------------------------------------
// HPlacement
//---------------------------------------------------------
enum class HPlacement {
///.\{
LEFT, CENTER, RIGHT
///\}
};
//--------------------------------------------------------- //---------------------------------------------------------
// MMRestRangeBracketType // MMRestRangeBracketType
//--------------------------------------------------------- //---------------------------------------------------------
@ -677,8 +657,6 @@ Q_ENUM_NS(ElementType);
Q_ENUM_NS(Direction); Q_ENUM_NS(Direction);
Q_ENUM_NS(GlissandoType); Q_ENUM_NS(GlissandoType);
Q_ENUM_NS(GlissandoStyle); Q_ENUM_NS(GlissandoStyle);
Q_ENUM_NS(Placement);
Q_ENUM_NS(HPlacement);
Q_ENUM_NS(SegmentType); Q_ENUM_NS(SegmentType);
Q_ENUM_NS(Tid); Q_ENUM_NS(Tid);
Q_ENUM_NS(NoteType); Q_ENUM_NS(NoteType);
@ -708,7 +686,6 @@ Q_DECLARE_METATYPE(Ms::PlayEventType);
Q_DECLARE_METATYPE(Ms::AccidentalType); Q_DECLARE_METATYPE(Ms::AccidentalType);
Q_DECLARE_METATYPE(Ms::HPlacement);
Q_DECLARE_METATYPE(Ms::DynamicType) Q_DECLARE_METATYPE(Ms::DynamicType)
#endif #endif

View file

@ -100,7 +100,7 @@ EngravingItem* VoltaSegment::propertyDelegate(Pid pid)
Volta::Volta(EngravingItem* parent) Volta::Volta(EngravingItem* parent)
: TextLineBase(ElementType::VOLTA, parent, ElementFlag::SYSTEM) : TextLineBase(ElementType::VOLTA, parent, ElementFlag::SYSTEM)
{ {
setPlacement(Placement::ABOVE); setPlacement(PlacementV::ABOVE);
initElementStyle(&voltaStyle); initElementStyle(&voltaStyle);
setBeginTextPlace(PlaceText::BELOW); setBeginTextPlace(PlaceText::BELOW);
@ -325,7 +325,7 @@ PropertyValue Volta::propertyDefault(Pid propertyId) const
return int(PlaceText::ABOVE); return int(PlaceText::ABOVE);
case Pid::PLACEMENT: case Pid::PLACEMENT:
return int(Placement::ABOVE); return int(PlacementV::ABOVE);
default: default:
return TextLineBase::propertyDefault(propertyId); return TextLineBase::propertyDefault(propertyId);

View file

@ -108,11 +108,6 @@ PropertyValue::PropertyValue(Ms::HookType v)
{ {
} }
PropertyValue::PropertyValue(Ms::HPlacement v)
: m_type(P_TYPE::HPLACEMENT), m_val(v)
{
}
PropertyValue::PropertyValue(const Ms::PitchValues& v) PropertyValue::PropertyValue(const Ms::PitchValues& v)
: m_type(P_TYPE::PITCH_VALUES), m_val(v) : m_type(P_TYPE::PITCH_VALUES), m_val(v)
{ {
@ -223,8 +218,8 @@ QVariant PropertyValue::toQVariant() const
// draw // draw
case P_TYPE::COLOR: return value<draw::Color>().toQColor(); case P_TYPE::COLOR: return value<draw::Color>().toQColor();
case P_TYPE::ALIGN: return QVariant::fromValue(int(value<Align>())); case P_TYPE::ALIGN: return QVariant::fromValue(int(value<Align>()));
case P_TYPE::PLACEMENT: return static_cast<int>(value<Ms::Placement>()); case P_TYPE::PLACEMENT_V: return static_cast<int>(value<PlacementV>());
case P_TYPE::HPLACEMENT: return static_cast<int>(value<Ms::HPlacement>()); case P_TYPE::PLACEMENT_H: return static_cast<int>(value<PlacementH>());
case P_TYPE::DIRECTION: return QVariant::fromValue(value<Ms::Direction>()); case P_TYPE::DIRECTION: return QVariant::fromValue(value<Ms::Direction>());
case P_TYPE::DIRECTION_H: { case P_TYPE::DIRECTION_H: {
UNREACHABLE; //! TODO UNREACHABLE; //! TODO
@ -275,8 +270,8 @@ PropertyValue PropertyValue::fromQVariant(const QVariant& v, P_TYPE type)
// Layout // Layout
case P_TYPE::ALIGN: return PropertyValue(Align(v.toInt())); case P_TYPE::ALIGN: return PropertyValue(Align(v.toInt()));
case P_TYPE::PLACEMENT: return PropertyValue(Ms::Placement(v.toInt())); case P_TYPE::PLACEMENT_V: return PropertyValue(PlacementV(v.toInt()));
case P_TYPE::HPLACEMENT: return PropertyValue(Ms::HPlacement(v.toInt())); case P_TYPE::PLACEMENT_H: return PropertyValue(PlacementH(v.toInt()));
case P_TYPE::DIRECTION: return PropertyValue(Ms::Direction(v.toInt())); case P_TYPE::DIRECTION: return PropertyValue(Ms::Direction(v.toInt()));
case P_TYPE::DIRECTION_H: { case P_TYPE::DIRECTION_H: {
UNREACHABLE; //! TODO UNREACHABLE; //! TODO

View file

@ -69,8 +69,8 @@ enum class P_TYPE {
// Layout // Layout
ALIGN, ALIGN,
PLACEMENT, // ABOVE or BELOW PLACEMENT_V, // ABOVE or BELOW
HPLACEMENT, // LEFT, CENTER or RIGHT PLACEMENT_H, // LEFT, CENTER or RIGHT
DIRECTION, // enum class Direction DIRECTION, // enum class Direction
DIRECTION_H, // enum class MScore::DirectionH DIRECTION_H, // enum class MScore::DirectionH
@ -137,9 +137,10 @@ public:
// Layout // Layout
PropertyValue(Align v); PropertyValue(Align v);
PropertyValue(Ms::HPlacement v); PropertyValue(PlacementV v)
PropertyValue(Ms::Placement v) : m_type(P_TYPE::PLACEMENT_V), m_val(v) {}
: m_type(P_TYPE::PLACEMENT), m_val(v) {} PropertyValue(PlacementH v)
: m_type(P_TYPE::PLACEMENT_H), m_val(v) {}
PropertyValue(Ms::Direction v); PropertyValue(Ms::Direction v);
PropertyValue(Ms::SymId v); PropertyValue(Ms::SymId v);
@ -187,8 +188,8 @@ public:
if constexpr (std::is_same<T, int>::value) { if constexpr (std::is_same<T, int>::value) {
switch (m_type) { switch (m_type) {
case P_TYPE::ALIGN: return static_cast<int>(value<Align>()); case P_TYPE::ALIGN: return static_cast<int>(value<Align>());
case P_TYPE::HPLACEMENT: return static_cast<int>(value<Ms::HPlacement>()); case P_TYPE::PLACEMENT_H: return static_cast<int>(value<PlacementH>());
case P_TYPE::PLACEMENT: return static_cast<int>(value<Ms::Placement>()); case P_TYPE::PLACEMENT_V: return static_cast<int>(value<PlacementV>());
case P_TYPE::DIRECTION: return static_cast<int>(value<Ms::Direction>()); case P_TYPE::DIRECTION: return static_cast<int>(value<Ms::Direction>());
case P_TYPE::SYMID: return static_cast<int>(value<Ms::SymId>()); case P_TYPE::SYMID: return static_cast<int>(value<Ms::SymId>());
case P_TYPE::BARLINE_TYPE: return static_cast<int>(value<Ms::BarLineType>()); case P_TYPE::BARLINE_TYPE: return static_cast<int>(value<Ms::BarLineType>());
@ -298,7 +299,7 @@ private:
Color, Color,
// Layout // Layout
Align, Ms::HPlacement, Ms::Placement, Ms::Direction, Align, PlacementV, PlacementH, Ms::Direction,
// time // time
Ms::Fraction, Ms::Fraction,

View file

@ -1711,7 +1711,7 @@ static void readMeasure(Measure* m, int staffIdx, XmlReader& e, ReadContext& ctx
Breath* breath = Factory::createBreath(segment); Breath* breath = Factory::createBreath(segment);
breath->setTrack(e.track()); breath->setTrack(e.track());
Fraction tick = e.tick(); Fraction tick = e.tick();
breath->setPlacement(breath->track() & 1 ? Placement::BELOW : Placement::ABOVE); breath->setPlacement(breath->track() & 1 ? PlacementV::BELOW : PlacementV::ABOVE);
breath->read(e); breath->read(e);
// older scores placed the breath segment right after the chord to which it applies // older scores placed the breath segment right after the chord to which it applies
// rather than before the next chordrest segment with an element for the staff // rather than before the next chordrest segment with an element for the staff

View file

@ -124,7 +124,7 @@ void Read206::readTextStyle206(MStyle* style, XmlReader& e, std::map<QString, st
mu::draw::Color foregroundColor = mu::draw::Color::black; mu::draw::Color foregroundColor = mu::draw::Color::black;
mu::draw::Color backgroundColor = mu::draw::Color::transparent; mu::draw::Color backgroundColor = mu::draw::Color::transparent;
Placement placement = Placement::ABOVE; PlacementV placement = PlacementV::ABOVE;
bool placementValid = false; bool placementValid = false;
QString name = e.attribute("name"); QString name = e.attribute("name");
@ -244,9 +244,9 @@ void Read206::readTextStyle206(MStyle* style, XmlReader& e, std::map<QString, st
} else if (tag == "placement") { } else if (tag == "placement") {
QString value(e.readElementText()); QString value(e.readElementText());
if (value == "above") { if (value == "above") {
placement = Placement::ABOVE; placement = PlacementV::ABOVE;
} else if (value == "below") { } else if (value == "below") {
placement = Placement::BELOW; placement = PlacementV::BELOW;
} }
placementValid = true; placementValid = true;
} else if (tag == "lineWidth") { } else if (tag == "lineWidth") {
@ -892,22 +892,22 @@ static void adjustPlacement(EngravingItem* e)
qreal staffHeight = e->staff()->height(); qreal staffHeight = e->staff()->height();
qreal threshold = staffHeight; qreal threshold = staffHeight;
qreal offsetAdjust = 0.0; qreal offsetAdjust = 0.0;
Placement defaultPlacement = Placement(e->propertyDefault(Pid::PLACEMENT).toInt()); PlacementV defaultPlacement = PlacementV(e->propertyDefault(Pid::PLACEMENT).toInt());
Placement newPlacement; PlacementV newPlacement;
// most offsets will be recorded as relative to top staff line // most offsets will be recorded as relative to top staff line
// exceptions are styled offsets on elements with default placement below // exceptions are styled offsets on elements with default placement below
qreal normalize; qreal normalize;
if (defaultPlacement == Placement::BELOW && ee->propertyFlags(Pid::OFFSET) == PropertyFlags::STYLED) { if (defaultPlacement == PlacementV::BELOW && ee->propertyFlags(Pid::OFFSET) == PropertyFlags::STYLED) {
normalize = staffHeight; normalize = staffHeight;
} else { } else {
normalize = 0.0; normalize = 0.0;
} }
qreal ypos = ee->offset().y() + normalize; qreal ypos = ee->offset().y() + normalize;
if (ypos >= threshold) { if (ypos >= threshold) {
newPlacement = Placement::BELOW; newPlacement = PlacementV::BELOW;
offsetAdjust -= staffHeight; offsetAdjust -= staffHeight;
} else { } else {
newPlacement = Placement::ABOVE; newPlacement = PlacementV::ABOVE;
} }
// set placement // set placement
@ -922,7 +922,7 @@ static void adjustPlacement(EngravingItem* e)
for (auto a : spanner->spannerSegments()) { for (auto a : spanner->spannerSegments()) {
// spanner segments share the placement setting of the spanner // spanner segments share the placement setting of the spanner
// just adjust offset // just adjust offset
if (defaultPlacement == Placement::BELOW && a->propertyFlags(Pid::OFFSET) == PropertyFlags::STYLED) { if (defaultPlacement == PlacementV::BELOW && a->propertyFlags(Pid::OFFSET) == PropertyFlags::STYLED) {
normalize = staffHeight; normalize = staffHeight;
} else { } else {
normalize = 0.0; normalize = 0.0;
@ -935,9 +935,9 @@ static void adjustPlacement(EngravingItem* e)
// disable autoplace // disable autoplace
bool disableAutoplace; bool disableAutoplace;
if (yp + a->height() <= 0.0) { if (yp + a->height() <= 0.0) {
disableAutoplace = (newPlacement == Placement::BELOW); disableAutoplace = (newPlacement == PlacementV::BELOW);
} else if (yp > staffHeight) { } else if (yp > staffHeight) {
disableAutoplace = (newPlacement == Placement::ABOVE); disableAutoplace = (newPlacement == PlacementV::ABOVE);
} else { } else {
disableAutoplace = true; disableAutoplace = true;
} }
@ -1517,7 +1517,7 @@ static void readLyrics(Lyrics* lyrics, XmlReader& e, const ReadContext& ctx)
//lyrics->ryoffset() -= lyrics->placeBelow() && lyrics->staff() ? lyrics->staff()->height() : 0.0; //lyrics->ryoffset() -= lyrics->placeBelow() && lyrics->staff() ? lyrics->staff()->height() : 0.0;
// temporarily set placement to above, since the original offset is relative to top of staff // temporarily set placement to above, since the original offset is relative to top of staff
// depend on adjustPlacement() to change the placement if appropriate // depend on adjustPlacement() to change the placement if appropriate
lyrics->setPlacement(Placement::ABOVE); lyrics->setPlacement(PlacementV::ABOVE);
adjustPlacement(lyrics); adjustPlacement(lyrics);
} }
} }
@ -2207,19 +2207,19 @@ void Read206::readTextLine206(XmlReader& e, const ReadContext& ctx, TextLineBase
static void setFermataPlacement(EngravingItem* el, ArticulationAnchor anchor, Direction direction) static void setFermataPlacement(EngravingItem* el, ArticulationAnchor anchor, Direction direction)
{ {
if (direction == Direction::UP) { if (direction == Direction::UP) {
el->setPlacement(Placement::ABOVE); el->setPlacement(PlacementV::ABOVE);
} else if (direction == Direction::DOWN) { } else if (direction == Direction::DOWN) {
el->setPlacement(Placement::BELOW); el->setPlacement(PlacementV::BELOW);
} else { } else {
switch (anchor) { switch (anchor) {
case ArticulationAnchor::TOP_STAFF: case ArticulationAnchor::TOP_STAFF:
case ArticulationAnchor::TOP_CHORD: case ArticulationAnchor::TOP_CHORD:
el->setPlacement(Placement::ABOVE); el->setPlacement(PlacementV::ABOVE);
break; break;
case ArticulationAnchor::BOTTOM_STAFF: case ArticulationAnchor::BOTTOM_STAFF:
case ArticulationAnchor::BOTTOM_CHORD: case ArticulationAnchor::BOTTOM_CHORD:
el->setPlacement(Placement::BELOW); el->setPlacement(PlacementV::BELOW);
break; break;
case ArticulationAnchor::CHORD: case ArticulationAnchor::CHORD:
@ -2357,7 +2357,7 @@ EngravingItem* Read206::readArticulation(EngravingItem* parent, XmlReader& e, co
el->setProperty(Pid::TIME_STRETCH, timeStretch); el->setProperty(Pid::TIME_STRETCH, timeStretch);
} }
if (useDefaultPlacement) { if (useDefaultPlacement) {
el->setPlacement(track & 1 ? Placement::BELOW : Placement::ABOVE); el->setPlacement(track & 1 ? PlacementV::BELOW : PlacementV::ABOVE);
} else { } else {
setFermataPlacement(el, anchor, direction); setFermataPlacement(el, anchor, direction);
} }
@ -2505,7 +2505,7 @@ static void readMeasure206(Measure* m, int staffIdx, XmlReader& e, ReadContext&
} else if (t == "Articulation") { } else if (t == "Articulation") {
EngravingItem* el = Read206::readArticulation(bl, e, ctx); EngravingItem* el = Read206::readArticulation(bl, e, ctx);
if (el->isFermata()) { if (el->isFermata()) {
if (el->placement() == Placement::ABOVE) { if (el->placement() == PlacementV::ABOVE) {
fermataAbove = toFermata(el); fermataAbove = toFermata(el);
} else { } else {
fermataBelow = toFermata(el); fermataBelow = toFermata(el);
@ -2592,7 +2592,7 @@ static void readMeasure206(Measure* m, int staffIdx, XmlReader& e, ReadContext&
} else if (tag == "Breath") { } else if (tag == "Breath") {
Breath* breath = Factory::createBreath(ctx.dummy()->segment()); Breath* breath = Factory::createBreath(ctx.dummy()->segment());
breath->setTrack(e.track()); breath->setTrack(e.track());
breath->setPlacement(Placement::ABOVE); breath->setPlacement(PlacementV::ABOVE);
Fraction tick = e.tick(); Fraction tick = e.tick();
breath->read(e); breath->read(e);
// older scores placed the breath segment right after the chord to which it applies // older scores placed the breath segment right after the chord to which it applies
@ -3212,10 +3212,10 @@ static void readStyle206(MStyle* style, XmlReader& e, ReadChordListHook& readCho
} else if (tag == "harmonyY") { } else if (tag == "harmonyY") {
qreal val = -e.readDouble(); qreal val = -e.readDouble();
if (val > 0.0) { if (val > 0.0) {
style->set(Sid::harmonyPlacement, int(Placement::BELOW)); style->set(Sid::harmonyPlacement, int(PlacementV::BELOW));
style->set(Sid::chordSymbolAPosBelow, PointF(.0, val)); style->set(Sid::chordSymbolAPosBelow, PointF(.0, val));
} else { } else {
style->set(Sid::harmonyPlacement, int(Placement::ABOVE)); style->set(Sid::harmonyPlacement, int(PlacementV::ABOVE));
style->set(Sid::chordSymbolAPosBelow, PointF(.0, val)); style->set(Sid::chordSymbolAPosBelow, PointF(.0, val));
} }
} else { } else {

View file

@ -318,7 +318,7 @@ void MeasureRW::readVoice(Measure* measure, XmlReader& e, ReadContext& ctx, int
segment = measure->getSegment(SegmentType::Breath, e.tick()); segment = measure->getSegment(SegmentType::Breath, e.tick());
Breath* breath = Factory::createBreath(segment); Breath* breath = Factory::createBreath(segment);
breath->setTrack(e.track()); breath->setTrack(e.track());
breath->setPlacement(breath->track() & 1 ? Placement::BELOW : Placement::ABOVE); breath->setPlacement(breath->track() & 1 ? PlacementV::BELOW : PlacementV::ABOVE);
breath->read(e); breath->read(e);
segment->add(breath); segment->add(breath);
} else if (tag == "Spanner") { } else if (tag == "Spanner") {
@ -451,7 +451,7 @@ void MeasureRW::readVoice(Measure* measure, XmlReader& e, ReadContext& ctx, int
} else if (tag == "Fermata") { } else if (tag == "Fermata") {
fermata = Factory::createFermata(ctx.dummy()); fermata = Factory::createFermata(ctx.dummy());
fermata->setTrack(e.track()); fermata->setTrack(e.track());
fermata->setPlacement(fermata->track() & 1 ? Placement::BELOW : Placement::ABOVE); fermata->setPlacement(fermata->track() & 1 ? PlacementV::BELOW : PlacementV::ABOVE);
fermata->read(e); fermata->read(e);
} else if (tag == "Image") { } else if (tag == "Image") {
if (MScore::noImages) { if (MScore::noImages) {

View file

@ -156,8 +156,10 @@ bool MStyle::readProperties(XmlReader& e)
c.setAlpha(e.intAttribute("a", 255)); c.setAlpha(e.intAttribute("a", 255));
set(idx, c); set(idx, c);
e.readElementText(); e.readElementText();
} else if (P_TYPE::HPLACEMENT == type) { } else if (P_TYPE::PLACEMENT_V == type) {
set(idx, Ms::HPlacement(e.readElementText().toInt())); set(idx, Ms::PlacementV(e.readElementText().toInt()));
} else if (P_TYPE::PLACEMENT_H == type) {
set(idx, Ms::PlacementH(e.readElementText().toInt()));
} else if (P_TYPE::HOOK_TYPE == type) { } else if (P_TYPE::HOOK_TYPE == type) {
set(idx, Ms::HookType(e.readElementText().toInt())); set(idx, Ms::HookType(e.readElementText().toInt()));
} else { } else {

View file

@ -62,7 +62,7 @@ public:
QString styleSt(Sid idx) const { Q_ASSERT(MStyle::valueType(idx) == mu::engraving::P_TYPE::STRING); return value(idx).toString(); } QString styleSt(Sid idx) const { Q_ASSERT(MStyle::valueType(idx) == mu::engraving::P_TYPE::STRING); return value(idx).toString(); }
bool styleB(Sid idx) const { Q_ASSERT(MStyle::valueType(idx) == mu::engraving::P_TYPE::BOOL); return value(idx).toBool(); } bool styleB(Sid idx) const { Q_ASSERT(MStyle::valueType(idx) == mu::engraving::P_TYPE::BOOL); return value(idx).toBool(); }
qreal styleD(Sid idx) const { Q_ASSERT(MStyle::valueType(idx) == mu::engraving::P_TYPE::REAL); return value(idx).toReal(); } qreal styleD(Sid idx) const { Q_ASSERT(MStyle::valueType(idx) == mu::engraving::P_TYPE::REAL); return value(idx).toReal(); }
int styleI(Sid idx) const { Q_ASSERT(MStyle::valueType(idx) == mu::engraving::P_TYPE::INT); return value(idx).toInt(); } int styleI(Sid idx) const { /* can be int or enum, so no assert */ return value(idx).toInt(); }
const mu::engraving::PropertyValue& value(Sid idx) const; const mu::engraving::PropertyValue& value(Sid idx) const;
Milimetre valueMM(Sid idx) const; Milimetre valueMM(Sid idx) const;

View file

@ -76,7 +76,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::maxAkkoladeDistance, "maxAkkoladeDistance", Spatium(6.5) }, { Sid::maxAkkoladeDistance, "maxAkkoladeDistance", Spatium(6.5) },
{ Sid::maxPageFillSpread, "maxPageFillSpread", Spatium(6.0) }, { Sid::maxPageFillSpread, "maxPageFillSpread", Spatium(6.0) },
{ Sid::lyricsPlacement, "lyricsPlacement", int(Placement::BELOW) }, { Sid::lyricsPlacement, "lyricsPlacement", PlacementV::BELOW },
{ Sid::lyricsPosAbove, "lyricsPosAbove", PointF(0.0, -2.0) }, { Sid::lyricsPosAbove, "lyricsPosAbove", PointF(0.0, -2.0) },
{ Sid::lyricsPosBelow, "lyricsPosBelow", PointF(.0, 3.0) }, { Sid::lyricsPosBelow, "lyricsPosBelow", PointF(.0, 3.0) },
{ Sid::lyricsMinTopDistance, "lyricsMinTopDistance", Spatium(1.0) }, { Sid::lyricsMinTopDistance, "lyricsMinTopDistance", Spatium(1.0) },
@ -223,7 +223,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::articulationAnchorOther, "articulationAnchorOther", int(ArticulationAnchor::TOP_STAFF) }, { Sid::articulationAnchorOther, "articulationAnchorOther", int(ArticulationAnchor::TOP_STAFF) },
{ Sid::lastSystemFillLimit, "lastSystemFillLimit", PropertyValue(0.3) }, { Sid::lastSystemFillLimit, "lastSystemFillLimit", PropertyValue(0.3) },
{ Sid::hairpinPlacement, "hairpinPlacement", int(Placement::BELOW) }, { Sid::hairpinPlacement, "hairpinPlacement", PlacementV::BELOW },
{ Sid::hairpinPosAbove, "hairpinPosAbove", PointF(0.0, -2.0) }, { Sid::hairpinPosAbove, "hairpinPosAbove", PointF(0.0, -2.0) },
{ Sid::hairpinPosBelow, "hairpinPosBelow", PointF(.0, 2) }, { Sid::hairpinPosBelow, "hairpinPosBelow", PointF(.0, 2) },
{ Sid::hairpinLinePosAbove, "hairpinLinePosAbove", PointF(0.0, -3.0) }, { Sid::hairpinLinePosAbove, "hairpinLinePosAbove", PointF(0.0, -3.0) },
@ -252,7 +252,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::hairpinLineStyle, "hairpinLineStyle", PropertyValue(static_cast<int>(mu::draw::PenStyle::SolidLine)) }, { Sid::hairpinLineStyle, "hairpinLineStyle", PropertyValue(static_cast<int>(mu::draw::PenStyle::SolidLine)) },
{ Sid::hairpinLineLineStyle, "hairpinLineLineStyle", PropertyValue(static_cast<int>(mu::draw::PenStyle::CustomDashLine)) }, { Sid::hairpinLineLineStyle, "hairpinLineLineStyle", PropertyValue(static_cast<int>(mu::draw::PenStyle::CustomDashLine)) },
{ Sid::pedalPlacement, "pedalPlacement", int(Placement::BELOW) }, { Sid::pedalPlacement, "pedalPlacement", PlacementV::BELOW },
{ Sid::pedalPosAbove, "pedalPosAbove", PointF(.0, -1) }, { Sid::pedalPosAbove, "pedalPosAbove", PointF(.0, -1) },
{ Sid::pedalPosBelow, "pedalPosBelow", PointF(.0, 2.5) }, { Sid::pedalPosBelow, "pedalPosBelow", PointF(.0, 2.5) },
{ Sid::pedalLineWidth, "pedalLineWidth", Spatium(0.11) }, { Sid::pedalLineWidth, "pedalLineWidth", Spatium(0.11) },
@ -273,11 +273,11 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::pedalFrameFgColor, "pedalFrameFgColor", draw::Color::black }, { Sid::pedalFrameFgColor, "pedalFrameFgColor", draw::Color::black },
{ Sid::pedalFrameBgColor, "pedalFrameBgColor", draw::Color::transparent }, { Sid::pedalFrameBgColor, "pedalFrameBgColor", draw::Color::transparent },
{ Sid::trillPlacement, "trillPlacement", int(Placement::ABOVE) }, { Sid::trillPlacement, "trillPlacement", PlacementV::ABOVE },
{ Sid::trillPosAbove, "trillPosAbove", PointF(.0, -0.5) }, { Sid::trillPosAbove, "trillPosAbove", PointF(.0, -0.5) },
{ Sid::trillPosBelow, "trillPosBelow", PointF(.0, 2) }, { Sid::trillPosBelow, "trillPosBelow", PointF(.0, 2) },
{ Sid::vibratoPlacement, "vibratoPlacement", int(Placement::ABOVE) }, { Sid::vibratoPlacement, "vibratoPlacement", PlacementV::ABOVE },
{ Sid::vibratoPosAbove, "vibratoPosAbove", PointF(.0, -1) }, { Sid::vibratoPosAbove, "vibratoPosAbove", PointF(.0, -1) },
{ Sid::vibratoPosBelow, "vibratoPosBelow", PointF(.0, 1) }, { Sid::vibratoPosBelow, "vibratoPosBelow", PointF(.0, 1) },
@ -287,9 +287,9 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::maxChordShiftAbove, "maxChordShiftAbove", Spatium(0.0) }, { Sid::maxChordShiftAbove, "maxChordShiftAbove", Spatium(0.0) },
{ Sid::maxChordShiftBelow, "maxChordShiftBelow", Spatium(0.0) }, { Sid::maxChordShiftBelow, "maxChordShiftBelow", Spatium(0.0) },
{ Sid::harmonyPlacement, "harmonyPlacement", int(Placement::ABOVE) }, { Sid::harmonyPlacement, "harmonyPlacement", PlacementV::ABOVE },
{ Sid::romanNumeralPlacement, "romanNumeralPlacement", int(Placement::BELOW) }, { Sid::romanNumeralPlacement, "romanNumeralPlacement", PlacementV::BELOW },
{ Sid::nashvilleNumberPlacement, "nashvilleNumberPlacement", int(Placement::ABOVE) }, { Sid::nashvilleNumberPlacement, "nashvilleNumberPlacement", PlacementV::ABOVE },
{ Sid::harmonyPlay, "harmonyPlay", true }, { Sid::harmonyPlay, "harmonyPlay", true },
{ Sid::harmonyVoiceLiteral, "harmonyVoiceLiteral", true }, { Sid::harmonyVoiceLiteral, "harmonyVoiceLiteral", true },
{ Sid::harmonyVoicing, "harmonyVoicing", int(Voicing::AUTO) }, { Sid::harmonyVoicing, "harmonyVoicing", int(Voicing::AUTO) },
@ -369,7 +369,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::fretY, "fretY", Spatium(1.0) }, { Sid::fretY, "fretY", Spatium(1.0) },
{ Sid::fretMinDistance, "fretMinDistance", Spatium(0.5) }, { Sid::fretMinDistance, "fretMinDistance", Spatium(0.5) },
{ Sid::fretMag, "fretMag", PropertyValue(1.0) }, { Sid::fretMag, "fretMag", PropertyValue(1.0) },
{ Sid::fretPlacement, "fretPlacement", int(Placement::ABOVE) }, { Sid::fretPlacement, "fretPlacement", PlacementV::ABOVE },
{ Sid::fretStrings, "fretStrings", 6 }, { Sid::fretStrings, "fretStrings", 6 },
{ Sid::fretFrets, "fretFrets", 5 }, { Sid::fretFrets, "fretFrets", 5 },
{ Sid::fretNut, "fretNut", true }, { Sid::fretNut, "fretNut", true },
@ -500,12 +500,12 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::voltaFrameFgColor, "voltaFrameFgColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::voltaFrameFgColor, "voltaFrameFgColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::voltaFrameBgColor, "voltaFrameBgColor", PropertyValue::fromValue(draw::Color::transparent) }, { Sid::voltaFrameBgColor, "voltaFrameBgColor", PropertyValue::fromValue(draw::Color::transparent) },
{ Sid::ottava8VAPlacement, "ottava8VAPlacement", int(Placement::ABOVE) }, { Sid::ottava8VAPlacement, "ottava8VAPlacement", PlacementV::ABOVE },
{ Sid::ottava8VBPlacement, "ottava8VBPlacement", int(Placement::BELOW) }, { Sid::ottava8VBPlacement, "ottava8VBPlacement", PlacementV::BELOW },
{ Sid::ottava15MAPlacement, "ottava15MAPlacement", int(Placement::ABOVE) }, { Sid::ottava15MAPlacement, "ottava15MAPlacement", PlacementV::ABOVE },
{ Sid::ottava15MBPlacement, "ottava15MBPlacement", int(Placement::BELOW) }, { Sid::ottava15MBPlacement, "ottava15MBPlacement", PlacementV::BELOW },
{ Sid::ottava22MAPlacement, "ottava22MAPlacement", int(Placement::ABOVE) }, { Sid::ottava22MAPlacement, "ottava22MAPlacement", PlacementV::ABOVE },
{ Sid::ottava22MBPlacement, "ottava22MBPlacement", int(Placement::BELOW) }, { Sid::ottava22MBPlacement, "ottava22MBPlacement", PlacementV::BELOW },
{ Sid::ottava8VAText, "ottava8VAText", QString("<sym>ottavaAlta</sym>") }, { Sid::ottava8VAText, "ottava8VAText", QString("<sym>ottavaAlta</sym>") },
{ Sid::ottava8VAContinueText, "ottava8VAContinueText", QString("<sym>ottavaAlta</sym>") }, { Sid::ottava8VAContinueText, "ottava8VAContinueText", QString("<sym>ottavaAlta</sym>") },
@ -604,14 +604,14 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::autoplaceHairpinDynamicsDistance, "autoplaceHairpinDynamicsDistance", Spatium(0.5) }, { Sid::autoplaceHairpinDynamicsDistance, "autoplaceHairpinDynamicsDistance", Spatium(0.5) },
{ Sid::dynamicsPlacement, "dynamicsPlacement", int(Placement::BELOW) }, { Sid::dynamicsPlacement, "dynamicsPlacement", PlacementV::BELOW },
{ Sid::dynamicsPosAbove, "dynamicsPosAbove", PointF(.0, -1.5) }, { Sid::dynamicsPosAbove, "dynamicsPosAbove", PointF(.0, -1.5) },
{ Sid::dynamicsPosBelow, "dynamicsPosBelow", PointF(.0, 2.5) }, { Sid::dynamicsPosBelow, "dynamicsPosBelow", PointF(.0, 2.5) },
{ Sid::dynamicsMinDistance, "dynamicsMinDistance", Spatium(0.5) }, { Sid::dynamicsMinDistance, "dynamicsMinDistance", Spatium(0.5) },
{ Sid::autoplaceVerticalAlignRange, "autoplaceVerticalAlignRange", int(VerticalAlignRange::SYSTEM) }, { Sid::autoplaceVerticalAlignRange, "autoplaceVerticalAlignRange", int(VerticalAlignRange::SYSTEM) },
{ Sid::textLinePlacement, "textLinePlacement", int(Placement::ABOVE) }, { Sid::textLinePlacement, "textLinePlacement", PlacementV::ABOVE },
{ Sid::textLinePosAbove, "textLinePosAbove", PointF(.0, -1.0) }, { Sid::textLinePosAbove, "textLinePosAbove", PointF(.0, -1.0) },
{ Sid::textLinePosBelow, "textLinePosBelow", PointF(.0, 1.0) }, { Sid::textLinePosBelow, "textLinePosBelow", PointF(.0, 1.0) },
{ Sid::textLineFrameType, "textLineFrameType", int(FrameType::NO_FRAME) }, { Sid::textLineFrameType, "textLineFrameType", int(FrameType::NO_FRAME) },
@ -621,7 +621,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::textLineFrameFgColor, "textLineFrameFgColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::textLineFrameFgColor, "textLineFrameFgColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::textLineFrameBgColor, "textLineFrameBgColor", PropertyValue::fromValue(draw::Color::transparent) }, { Sid::textLineFrameBgColor, "textLineFrameBgColor", PropertyValue::fromValue(draw::Color::transparent) },
{ Sid::systemTextLinePlacement, "systemTextLinePlacement", int(Placement::ABOVE) }, { Sid::systemTextLinePlacement, "systemTextLinePlacement", PlacementV::ABOVE },
{ Sid::systemTextLinePosAbove, "systemTextLinePosAbove", PointF(.0, -1.0) }, { Sid::systemTextLinePosAbove, "systemTextLinePosAbove", PointF(.0, -1.0) },
{ Sid::systemTextLinePosBelow, "systemTextLinePosBelow", PointF(.0, 1.0) }, { Sid::systemTextLinePosBelow, "systemTextLinePosBelow", PointF(.0, 1.0) },
{ Sid::systemTextLineFrameType, "systemTextLineFrameType", int(FrameType::NO_FRAME) }, { Sid::systemTextLineFrameType, "systemTextLineFrameType", int(FrameType::NO_FRAME) },
@ -843,7 +843,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::expressionFontStyle, "expressionFontStyle", int(FontStyle::Italic) }, { Sid::expressionFontStyle, "expressionFontStyle", int(FontStyle::Italic) },
{ Sid::expressionColor, "expressionColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::expressionColor, "expressionColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::expressionAlign, "expressionAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) }, { Sid::expressionAlign, "expressionAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) },
{ Sid::expressionPlacement, "expressionPlacement", int(Placement::BELOW) }, { Sid::expressionPlacement, "expressionPlacement", PlacementV::BELOW },
{ Sid::expressionOffset, "expressionOffset", PointF(.0, 2.5) }, { Sid::expressionOffset, "expressionOffset", PointF(.0, 2.5) },
{ Sid::expressionFrameType, "expressionFrameType", int(FrameType::NO_FRAME) }, { Sid::expressionFrameType, "expressionFrameType", int(FrameType::NO_FRAME) },
{ Sid::expressionFramePadding, "expressionFramePadding", 0.2 }, { Sid::expressionFramePadding, "expressionFramePadding", 0.2 },
@ -860,7 +860,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::tempoColor, "tempoColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::tempoColor, "tempoColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::tempoAlign, "tempoAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) }, { Sid::tempoAlign, "tempoAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) },
{ Sid::tempoSystemFlag, "tempoSystemFlag", true }, { Sid::tempoSystemFlag, "tempoSystemFlag", true },
{ Sid::tempoPlacement, "tempoPlacement", int(Placement::ABOVE) }, { Sid::tempoPlacement, "tempoPlacement", PlacementV::ABOVE },
{ Sid::tempoPosAbove, "tempoPosAbove", PointF(.0, -2.0) }, { Sid::tempoPosAbove, "tempoPosAbove", PointF(.0, -2.0) },
{ Sid::tempoPosBelow, "tempoPosBelow", PointF(.0, 3.0) }, { Sid::tempoPosBelow, "tempoPosBelow", PointF(.0, 3.0) },
{ Sid::tempoMinDistance, "tempoMinDistance", Spatium(.5) }, { Sid::tempoMinDistance, "tempoMinDistance", Spatium(.5) },
@ -877,7 +877,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::metronomeFontSpatiumDependent, "metronomeFontSpatiumDependent", false }, { Sid::metronomeFontSpatiumDependent, "metronomeFontSpatiumDependent", false },
{ Sid::metronomeFontStyle, "metronomeFontStyle", int(FontStyle::Normal) }, { Sid::metronomeFontStyle, "metronomeFontStyle", int(FontStyle::Normal) },
{ Sid::metronomeColor, "metronomeColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::metronomeColor, "metronomeColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::metronomePlacement, "metronomePlacement", int(Placement::ABOVE) }, { Sid::metronomePlacement, "metronomePlacement", PlacementV::ABOVE },
{ Sid::metronomeAlign, "metronomeAlign", PropertyValue::fromValue(Align::LEFT) }, { Sid::metronomeAlign, "metronomeAlign", PropertyValue::fromValue(Align::LEFT) },
{ Sid::metronomeOffset, "metronomeOffset", PointF() }, { Sid::metronomeOffset, "metronomeOffset", PointF() },
{ Sid::metronomeFrameType, "metronomeFrameType", int(FrameType::NO_FRAME) }, { Sid::metronomeFrameType, "metronomeFrameType", int(FrameType::NO_FRAME) },
@ -896,8 +896,8 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::measureNumberPosAbove, "measureNumberOffset", PointF(0.0, -2.0) }, // This measureNumberOffset cannot be renamed to measureNumberPosAbove for backward compatibility { Sid::measureNumberPosAbove, "measureNumberOffset", PointF(0.0, -2.0) }, // This measureNumberOffset cannot be renamed to measureNumberPosAbove for backward compatibility
{ Sid::measureNumberPosBelow, "measureNumberPosBelow", PointF(0.0, 2.0) }, { Sid::measureNumberPosBelow, "measureNumberPosBelow", PointF(0.0, 2.0) },
{ Sid::measureNumberOffsetType, "measureNumberOffsetType", int(OffsetType::SPATIUM) }, { Sid::measureNumberOffsetType, "measureNumberOffsetType", int(OffsetType::SPATIUM) },
{ Sid::measureNumberVPlacement, "measureNumberVPlacement", int(Placement::ABOVE) }, { Sid::measureNumberVPlacement, "measureNumberVPlacement", PlacementV::ABOVE },
{ Sid::measureNumberHPlacement, "measureNumberHPlacement", HPlacement::LEFT }, { Sid::measureNumberHPlacement, "measureNumberHPlacement", PlacementH::LEFT },
{ Sid::measureNumberAlign, "measureNumberAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) }, { Sid::measureNumberAlign, "measureNumberAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) },
{ Sid::measureNumberFrameType, "measureNumberFrameType", int(FrameType::NO_FRAME) }, { Sid::measureNumberFrameType, "measureNumberFrameType", int(FrameType::NO_FRAME) },
{ Sid::measureNumberFramePadding, "measureNumberFramePadding", 0.2 }, { Sid::measureNumberFramePadding, "measureNumberFramePadding", 0.2 },
@ -917,8 +917,8 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::mmRestRangePosAbove, "measureNumberPosAbove", PointF(0.0, -3.0) }, { Sid::mmRestRangePosAbove, "measureNumberPosAbove", PointF(0.0, -3.0) },
{ Sid::mmRestRangePosBelow, "measureNumberPosBelow", PointF(0.0, 1.0) }, { Sid::mmRestRangePosBelow, "measureNumberPosBelow", PointF(0.0, 1.0) },
{ Sid::mmRestRangeOffsetType, "mmRestRangeOffsetType", int(OffsetType::SPATIUM) }, { Sid::mmRestRangeOffsetType, "mmRestRangeOffsetType", int(OffsetType::SPATIUM) },
{ Sid::mmRestRangeVPlacement, "mmRestRangeVPlacement", int(Placement::BELOW) }, { Sid::mmRestRangeVPlacement, "mmRestRangeVPlacement", PlacementV::BELOW },
{ Sid::mmRestRangeHPlacement, "mmRestRangeHPlacement", HPlacement::CENTER }, { Sid::mmRestRangeHPlacement, "mmRestRangeHPlacement", PlacementH::CENTER },
{ Sid::mmRestRangeAlign, "mmRestRangeAlign", PropertyValue::fromValue(Align::HCENTER | Align::BASELINE) }, { Sid::mmRestRangeAlign, "mmRestRangeAlign", PropertyValue::fromValue(Align::HCENTER | Align::BASELINE) },
{ Sid::mmRestRangeFrameType, "mmRestRangeFrameType", int(FrameType::NO_FRAME) }, { Sid::mmRestRangeFrameType, "mmRestRangeFrameType", int(FrameType::NO_FRAME) },
{ Sid::mmRestRangeFramePadding, "mmRestRangeFramePadding", 0.2 }, { Sid::mmRestRangeFramePadding, "mmRestRangeFramePadding", 0.2 },
@ -950,7 +950,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::systemTextColor, "systemTextColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::systemTextColor, "systemTextColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::systemTextAlign, "systemAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) }, { Sid::systemTextAlign, "systemAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) },
{ Sid::systemTextOffsetType, "systemOffsetType", int(OffsetType::SPATIUM) }, { Sid::systemTextOffsetType, "systemOffsetType", int(OffsetType::SPATIUM) },
{ Sid::systemTextPlacement, "systemPlacement", int(Placement::ABOVE) }, { Sid::systemTextPlacement, "systemPlacement", PlacementV::ABOVE },
{ Sid::systemTextPosAbove, "systemPosAbove", PointF(.0, -2.0) }, { Sid::systemTextPosAbove, "systemPosAbove", PointF(.0, -2.0) },
{ Sid::systemTextPosBelow, "systemPosBelow", PointF(.0, 3.5) }, { Sid::systemTextPosBelow, "systemPosBelow", PointF(.0, 3.5) },
{ Sid::systemTextMinDistance, "systemMinDistance", Spatium(0.5) }, { Sid::systemTextMinDistance, "systemMinDistance", Spatium(0.5) },
@ -969,7 +969,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::staffTextColor, "staffTextColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::staffTextColor, "staffTextColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::staffTextAlign, "staffAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) }, { Sid::staffTextAlign, "staffAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) },
{ Sid::staffTextOffsetType, "systemOffsetType", int(OffsetType::SPATIUM) }, { Sid::staffTextOffsetType, "systemOffsetType", int(OffsetType::SPATIUM) },
{ Sid::staffTextPlacement, "staffPlacement", int(Placement::ABOVE) }, { Sid::staffTextPlacement, "staffPlacement", PlacementV::ABOVE },
{ Sid::staffTextPosAbove, "staffPosAbove", PointF(.0, -1.0) }, { Sid::staffTextPosAbove, "staffPosAbove", PointF(.0, -1.0) },
{ Sid::staffTextPosBelow, "staffPosBelow", PointF(.0, 2.5) }, { Sid::staffTextPosBelow, "staffPosBelow", PointF(.0, 2.5) },
{ Sid::staffTextMinDistance, "staffMinDistance", Spatium(0.5) }, { Sid::staffTextMinDistance, "staffMinDistance", Spatium(0.5) },
@ -993,7 +993,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::rehearsalMarkFrameRound, "rehearsalMarkFrameRound", 0 }, { Sid::rehearsalMarkFrameRound, "rehearsalMarkFrameRound", 0 },
{ Sid::rehearsalMarkFrameFgColor, "rehearsalMarkFrameFgColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::rehearsalMarkFrameFgColor, "rehearsalMarkFrameFgColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::rehearsalMarkFrameBgColor, "rehearsalMarkFrameBgColor", PropertyValue::fromValue(draw::Color::transparent) }, { Sid::rehearsalMarkFrameBgColor, "rehearsalMarkFrameBgColor", PropertyValue::fromValue(draw::Color::transparent) },
{ Sid::rehearsalMarkPlacement, "rehearsalMarkPlacement", int(Placement::ABOVE) }, { Sid::rehearsalMarkPlacement, "rehearsalMarkPlacement", PlacementV::ABOVE },
{ Sid::rehearsalMarkPosAbove, "rehearsalMarkPosAbove", PointF(.0, -3.0) }, { Sid::rehearsalMarkPosAbove, "rehearsalMarkPosAbove", PointF(.0, -3.0) },
{ Sid::rehearsalMarkPosBelow, "rehearsalMarkPosBelow", PointF(.0, 4.0) }, { Sid::rehearsalMarkPosBelow, "rehearsalMarkPosBelow", PointF(.0, 4.0) },
{ Sid::rehearsalMarkMinDistance, "rehearsalMarkMinDistance", Spatium(0.5) }, { Sid::rehearsalMarkMinDistance, "rehearsalMarkMinDistance", Spatium(0.5) },
@ -1005,7 +1005,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::repeatLeftFontStyle, "repeatLeftFontStyle", int(FontStyle::Normal) }, { Sid::repeatLeftFontStyle, "repeatLeftFontStyle", int(FontStyle::Normal) },
{ Sid::repeatLeftColor, "repeatLeftColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::repeatLeftColor, "repeatLeftColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::repeatLeftAlign, "repeatLeftAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) }, { Sid::repeatLeftAlign, "repeatLeftAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) },
{ Sid::repeatLeftPlacement, "repeatLeftPlacement", int(Placement::ABOVE) }, { Sid::repeatLeftPlacement, "repeatLeftPlacement", PlacementV::ABOVE },
{ Sid::repeatLeftFrameType, "repeatLeftFrameType", int(FrameType::NO_FRAME) }, { Sid::repeatLeftFrameType, "repeatLeftFrameType", int(FrameType::NO_FRAME) },
{ Sid::repeatLeftFramePadding, "repeatLeftFramePadding", 0.2 }, { Sid::repeatLeftFramePadding, "repeatLeftFramePadding", 0.2 },
{ Sid::repeatLeftFrameWidth, "repeatLeftFrameWidth", 0.1 }, { Sid::repeatLeftFrameWidth, "repeatLeftFrameWidth", 0.1 },
@ -1020,7 +1020,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::repeatRightFontStyle, "repeatRightFontStyle", int(FontStyle::Normal) }, { Sid::repeatRightFontStyle, "repeatRightFontStyle", int(FontStyle::Normal) },
{ Sid::repeatRightColor, "repeatRightColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::repeatRightColor, "repeatRightColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::repeatRightAlign, "repeatRightAlign", PropertyValue::fromValue(Align::RIGHT | Align::BASELINE) }, { Sid::repeatRightAlign, "repeatRightAlign", PropertyValue::fromValue(Align::RIGHT | Align::BASELINE) },
{ Sid::repeatRightPlacement, "repeatRightPlacement", int(Placement::ABOVE) }, { Sid::repeatRightPlacement, "repeatRightPlacement", PlacementV::ABOVE },
{ Sid::repeatRightFrameType, "repeatRightFrameType", int(FrameType::NO_FRAME) }, { Sid::repeatRightFrameType, "repeatRightFrameType", int(FrameType::NO_FRAME) },
{ Sid::repeatRightFramePadding, "repeatRightFramePadding", 0.2 }, { Sid::repeatRightFramePadding, "repeatRightFramePadding", 0.2 },
{ Sid::repeatRightFrameWidth, "repeatRightFrameWidth", 0.1 }, { Sid::repeatRightFrameWidth, "repeatRightFrameWidth", 0.1 },
@ -1133,7 +1133,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::instrumentChangeColor, "instrumentChangeColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::instrumentChangeColor, "instrumentChangeColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::instrumentChangeAlign, "instrumentChangeAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) }, { Sid::instrumentChangeAlign, "instrumentChangeAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) },
{ Sid::instrumentChangeOffset, "instrumentChangeOffset", PointF() }, { Sid::instrumentChangeOffset, "instrumentChangeOffset", PointF() },
{ Sid::instrumentChangePlacement, "instrumentChangePlacement", int(Placement::ABOVE) }, { Sid::instrumentChangePlacement, "instrumentChangePlacement", PlacementV::ABOVE },
{ Sid::instrumentChangePosAbove, "instrumentChangePosAbove", PointF(.0, -2.0) }, { Sid::instrumentChangePosAbove, "instrumentChangePosAbove", PointF(.0, -2.0) },
{ Sid::instrumentChangePosBelow, "instrumentChangePosBelow", PointF(.0, 3.5) }, { Sid::instrumentChangePosBelow, "instrumentChangePosBelow", PointF(.0, 3.5) },
{ Sid::instrumentChangeMinDistance, "instrumentChangeMinDistance", Spatium(0.5) }, { Sid::instrumentChangeMinDistance, "instrumentChangeMinDistance", Spatium(0.5) },
@ -1152,7 +1152,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::stickingColor, "stickingColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::stickingColor, "stickingColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::stickingAlign, "stickingAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) }, { Sid::stickingAlign, "stickingAlign", PropertyValue::fromValue(Align::LEFT | Align::BASELINE) },
{ Sid::stickingOffset, "stickingOffset", PointF() }, { Sid::stickingOffset, "stickingOffset", PointF() },
{ Sid::stickingPlacement, "stickingPlacement", int(Placement::BELOW) }, { Sid::stickingPlacement, "stickingPlacement", PlacementV::BELOW },
{ Sid::stickingPosAbove, "stickingPosAbove", PointF(.0, -2.0) }, { Sid::stickingPosAbove, "stickingPosAbove", PointF(.0, -2.0) },
{ Sid::stickingPosBelow, "stickingPosBelow", PointF(.0, 2.0) }, { Sid::stickingPosBelow, "stickingPosBelow", PointF(.0, 2.0) },
{ Sid::stickingMinDistance, "stickingMinDistance", Spatium(0.5) }, { Sid::stickingMinDistance, "stickingMinDistance", Spatium(0.5) },
@ -1382,7 +1382,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::letRingColor, "letRingColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::letRingColor, "letRingColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::letRingTextAlign, "letRingTextAlign", PropertyValue::fromValue(Align::LEFT | Align::VCENTER) }, { Sid::letRingTextAlign, "letRingTextAlign", PropertyValue::fromValue(Align::LEFT | Align::VCENTER) },
{ Sid::letRingHookHeight, "letRingHookHeight", Spatium(0.6) }, { Sid::letRingHookHeight, "letRingHookHeight", Spatium(0.6) },
{ Sid::letRingPlacement, "letRingPlacement", int(Placement::BELOW) }, { Sid::letRingPlacement, "letRingPlacement", PlacementV::BELOW },
{ Sid::letRingPosAbove, "letRingPosAbove", PointF(.0, 0.0) }, { Sid::letRingPosAbove, "letRingPosAbove", PointF(.0, 0.0) },
{ Sid::letRingPosBelow, "letRingPosBelow", PointF(.0, 0.0) }, { Sid::letRingPosBelow, "letRingPosBelow", PointF(.0, 0.0) },
{ Sid::letRingLineWidth, "letRingLineWidth", Spatium(0.15) }, { Sid::letRingLineWidth, "letRingLineWidth", Spatium(0.15) },
@ -1405,7 +1405,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::palmMuteColor, "palmMuteColor", PropertyValue::fromValue(draw::Color::black) }, { Sid::palmMuteColor, "palmMuteColor", PropertyValue::fromValue(draw::Color::black) },
{ Sid::palmMuteTextAlign, "palmMuteTextAlign", PropertyValue::fromValue(Align::LEFT | Align::VCENTER) }, { Sid::palmMuteTextAlign, "palmMuteTextAlign", PropertyValue::fromValue(Align::LEFT | Align::VCENTER) },
{ Sid::palmMuteHookHeight, "palmMuteHookHeight", Spatium(0.6) }, { Sid::palmMuteHookHeight, "palmMuteHookHeight", Spatium(0.6) },
{ Sid::palmMutePlacement, "palmMutePlacement", int(Placement::BELOW) }, { Sid::palmMutePlacement, "palmMutePlacement", PlacementV::BELOW },
{ Sid::palmMutePosAbove, "palmMutePosAbove", PointF(.0, -4.0) }, { Sid::palmMutePosAbove, "palmMutePosAbove", PointF(.0, -4.0) },
{ Sid::palmMutePosBelow, "palmMutePosBelow", PointF(.0, 4.0) }, { Sid::palmMutePosBelow, "palmMutePosBelow", PointF(.0, 4.0) },
{ Sid::palmMuteLineWidth, "palmMuteLineWidth", Spatium(0.15) }, { Sid::palmMuteLineWidth, "palmMuteLineWidth", Spatium(0.15) },
@ -1424,7 +1424,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::fermataPosBelow, "fermataPosBelow", PointF(.0, 0.5) }, { Sid::fermataPosBelow, "fermataPosBelow", PointF(.0, 0.5) },
{ Sid::fermataMinDistance, "fermataMinDistance", Spatium(0.4) }, { Sid::fermataMinDistance, "fermataMinDistance", Spatium(0.4) },
{ Sid::fingeringPlacement, "fingeringPlacement", int(Placement::ABOVE) }, { Sid::fingeringPlacement, "fingeringPlacement", PlacementV::ABOVE },
{ Sid::articulationMinDistance, "articulationMinDistance", Spatium(0.5) }, { Sid::articulationMinDistance, "articulationMinDistance", Spatium(0.5) },
{ Sid::fingeringMinDistance, "fingeringMinDistance", Spatium(0.5) }, { Sid::fingeringMinDistance, "fingeringMinDistance", Spatium(0.5) },

View file

@ -66,8 +66,8 @@ using Color = draw::Color; // P_TYPE::COLOR
/// `if ((static_cast<char>(align()) & static_cast<char>(Align::VMASK)) == Align::Top) { doSomething(); }` /// `if ((static_cast<char>(align()) & static_cast<char>(Align::VMASK)) == Align::Top) { doSomething(); }`
/// Same applies to Align::Left. /// Same applies to Align::Left.
//--------------------------------------------------------- //---------------------------------------------------------
// P_TYPE::ALIGN
enum class Align : char { // P_TYPE::ALIGN enum class Align : char {
///.\{ ///.\{
LEFT = 0, LEFT = 0,
RIGHT = 1, RIGHT = 1,
@ -96,11 +96,23 @@ constexpr Align operator~(Align a)
{ {
return static_cast<Align>(~static_cast<char>(a)); return static_cast<Align>(~static_cast<char>(a));
} }
}
// P_TYPE::PLACEMENT_V
enum class PlacementV {
ABOVE, BELOW
};
// P_TYPE::PLACEMENT_H
enum class PlacementH {
LEFT, CENTER, RIGHT
};
} // mu::engraving
//! NOTE compat //! NOTE compat
namespace Ms { namespace Ms {
using Align = mu::engraving::Align; using Align = mu::engraving::Align;
using PlacementV = mu::engraving::PlacementV;
using PlacementH = mu::engraving::PlacementH;
} }
#endif // MU_ENGRAVING_TYPES_H #endif // MU_ENGRAVING_TYPES_H

View file

@ -48,28 +48,28 @@ TEST_F(DynamicTests, test1)
Dynamic* d; Dynamic* d;
dynamic->setPlacement(Placement::ABOVE); dynamic->setPlacement(PlacementV::ABOVE);
dynamic->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED); dynamic->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED);
d = toDynamic(ScoreRW::writeReadElement(dynamic)); d = toDynamic(ScoreRW::writeReadElement(dynamic));
EXPECT_EQ(d->placement(), Placement::ABOVE); EXPECT_EQ(d->placement(), PlacementV::ABOVE);
delete d; delete d;
dynamic->setPlacement(Placement::BELOW); dynamic->setPlacement(PlacementV::BELOW);
dynamic->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED); dynamic->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED);
d = static_cast<Dynamic*>(ScoreRW::writeReadElement(dynamic)); d = static_cast<Dynamic*>(ScoreRW::writeReadElement(dynamic));
EXPECT_EQ(d->placement(), Placement::BELOW); EXPECT_EQ(d->placement(), PlacementV::BELOW);
delete d; delete d;
dynamic->setProperty(Pid::PLACEMENT, int(Placement::ABOVE)); dynamic->setProperty(Pid::PLACEMENT, int(PlacementV::ABOVE));
dynamic->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED); dynamic->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED);
d = static_cast<Dynamic*>(ScoreRW::writeReadElement(dynamic)); d = static_cast<Dynamic*>(ScoreRW::writeReadElement(dynamic));
EXPECT_EQ(d->placement(), Placement::ABOVE); EXPECT_EQ(d->placement(), PlacementV::ABOVE);
delete d; delete d;
dynamic->setProperty(Pid::PLACEMENT, int(Placement::BELOW)); dynamic->setProperty(Pid::PLACEMENT, int(PlacementV::BELOW));
dynamic->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED); dynamic->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED);
d = static_cast<Dynamic*>(ScoreRW::writeReadElement(dynamic)); d = static_cast<Dynamic*>(ScoreRW::writeReadElement(dynamic));
EXPECT_EQ(d->placement(), Placement::BELOW); EXPECT_EQ(d->placement(), PlacementV::BELOW);
delete d; delete d;
dynamic->setVelocity(23); dynamic->setVelocity(23);

View file

@ -497,22 +497,22 @@ TEST_F(MeasureTests, measureNumbers)
MeasureNumber* measureNumber = new MeasureNumber(score->dummy()->measure()); MeasureNumber* measureNumber = new MeasureNumber(score->dummy()->measure());
// horizontal placement // horizontal placement
measureNumber->setHPlacement(HPlacement::CENTER); measureNumber->setHPlacement(PlacementH::CENTER);
measureNumber->setPropertyFlags(Pid::HPLACEMENT, PropertyFlags::UNSTYLED); measureNumber->setPropertyFlags(Pid::HPLACEMENT, PropertyFlags::UNSTYLED);
MeasureNumber* mn = static_cast<MeasureNumber*>(ScoreRW::writeReadElement(measureNumber)); MeasureNumber* mn = static_cast<MeasureNumber*>(ScoreRW::writeReadElement(measureNumber));
EXPECT_EQ(mn->hPlacement(), HPlacement::CENTER); EXPECT_EQ(mn->hPlacement(), PlacementH::CENTER);
delete mn; delete mn;
// Place measure numbers below // Place measure numbers below
score->startCmd(); score->startCmd();
score->undo(new ChangeStyleVal(score, Sid::measureNumberVPlacement, int(Placement::BELOW))); score->undo(new ChangeStyleVal(score, Sid::measureNumberVPlacement, int(PlacementV::BELOW)));
score->setLayoutAll(); score->setLayoutAll();
score->endCmd(); score->endCmd();
EXPECT_TRUE(ScoreComp::saveCompareScore(score, "measurenumber-1.mscx", MEASURE_DATA_DIR + "measurenumber-1-ref.mscx")); EXPECT_TRUE(ScoreComp::saveCompareScore(score, "measurenumber-1.mscx", MEASURE_DATA_DIR + "measurenumber-1-ref.mscx"));
// center measure numbers // center measure numbers
score->startCmd(); score->startCmd();
score->undo(new ChangeStyleVal(score, Sid::measureNumberHPlacement, int(HPlacement::CENTER))); score->undo(new ChangeStyleVal(score, Sid::measureNumberHPlacement, int(PlacementH::CENTER)));
score->setLayoutAll(); score->setLayoutAll();
score->endCmd(); score->endCmd();
EXPECT_TRUE(ScoreComp::saveCompareScore(score, "measurenumber-2.mscx", MEASURE_DATA_DIR + "measurenumber-2-ref.mscx")); EXPECT_TRUE(ScoreComp::saveCompareScore(score, "measurenumber-2.mscx", MEASURE_DATA_DIR + "measurenumber-2-ref.mscx"));

View file

@ -1852,7 +1852,7 @@ QString ExportMusicXml::fermataPosition(const Fermata* const fermata)
static void fermata(const Fermata* const a, XmlWriter& xml) static void fermata(const Fermata* const a, XmlWriter& xml)
{ {
QString tagName = "fermata"; QString tagName = "fermata";
tagName += QString(" type=\"%1\"").arg(a->placement() == Placement::ABOVE ? "upright" : "inverted"); tagName += QString(" type=\"%1\"").arg(a->placement() == PlacementV::ABOVE ? "upright" : "inverted");
tagName += ExportMusicXml::fermataPosition(a); tagName += ExportMusicXml::fermataPosition(a);
tagName += color2xml(a); tagName += color2xml(a);
SymId id = a->symId(); SymId id = a->symId();
@ -3271,8 +3271,8 @@ static void writeFingering(XmlWriter& xml, Notations& notations, Technical& tech
technical.tag(xml); technical.tag(xml);
QString t = MScoreTextToMXML::toPlainText(f->xmlText()); QString t = MScoreTextToMXML::toPlainText(f->xmlText());
QString attr; QString attr;
if (!f->isStyled(Pid::PLACEMENT) || f->placement() == Placement::BELOW) { if (!f->isStyled(Pid::PLACEMENT) || f->placement() == PlacementV::BELOW) {
attr = QString(" placement=\"%1\"").arg((f->placement() == Placement::BELOW) ? "below" : "above"); attr = QString(" placement=\"%1\"").arg((f->placement() == PlacementV::BELOW) ? "below" : "above");
} }
if (!f->isStyled(Pid::FONT_FACE)) { if (!f->isStyled(Pid::FONT_FACE)) {
attr += QString(" font-family=\"%1\"").arg(f->getProperty(Pid::FONT_FACE).toString()); attr += QString(" font-family=\"%1\"").arg(f->getProperty(Pid::FONT_FACE).toString());
@ -3959,14 +3959,14 @@ static void directionTag(XmlWriter& xml, Attributes& attr, EngravingItem const*
// actual position info is in the segments // actual position info is in the segments
// compare the segment's canvas ypos with the staff's center height // compare the segment's canvas ypos with the staff's center height
// if (seg->pagePos().y() < sys->pagePos().y() + bb.y() + bb.height() / 2) // if (seg->pagePos().y() < sys->pagePos().y() + bb.y() + bb.height() / 2)
if (el->placement() == Placement::ABOVE) { if (el->placement() == PlacementV::ABOVE) {
tagname += " placement=\"above\""; tagname += " placement=\"above\"";
} else { } else {
tagname += " placement=\"below\""; tagname += " placement=\"below\"";
} }
} else if (el->isDynamic()) { } else if (el->isDynamic()) {
tagname += " placement=\""; tagname += " placement=\"";
tagname += el->placement() == Placement::ABOVE ? "above" : "below"; tagname += el->placement() == PlacementV::ABOVE ? "above" : "below";
tagname += "\""; tagname += "\"";
} else { } else {
/* /*
@ -3975,7 +3975,7 @@ static void directionTag(XmlWriter& xml, Attributes& attr, EngravingItem const*
bb.y(), bb.height()); bb.y(), bb.height());
*/ */
// if (el->y() + el->height() / 2 < /*bb.y() +*/ bb.height() / 2) // if (el->y() + el->height() / 2 < /*bb.y() +*/ bb.height() / 2)
if (el->placement() == Placement::ABOVE) { if (el->placement() == PlacementV::ABOVE) {
tagname += " placement=\"above\""; tagname += " placement=\"above\"";
} else { } else {
tagname += " placement=\"below\""; tagname += " placement=\"below\"";
@ -4277,7 +4277,7 @@ void ExportMusicXml::tempoText(TempoText const* const text, int staff)
qPrintable(text->xmlText())); qPrintable(text->xmlText()));
*/ */
_attr.doAttr(_xml, false); _attr.doAttr(_xml, false);
_xml.startObject(QString("direction placement=\"%1\"").arg((text->placement() == Placement::BELOW) ? "below" : "above")); _xml.startObject(QString("direction placement=\"%1\"").arg((text->placement() == PlacementV::BELOW) ? "below" : "above"));
wordsMetrome(_xml, _score, text, offset); wordsMetrome(_xml, _score, text, offset);
if (staff) { if (staff) {
@ -5053,7 +5053,7 @@ static void directionJump(XmlWriter& xml, const Jump* const jp)
} }
if (sound != "") { if (sound != "") {
xml.startObject(QString("direction placement=\"%1\"").arg((jp->placement() == Placement::BELOW) ? "below" : "above")); xml.startObject(QString("direction placement=\"%1\"").arg((jp->placement() == PlacementV::BELOW) ? "below" : "above"));
xml.startObject("direction-type"); xml.startObject("direction-type");
QString positioning = ExportMusicXml::positioningAttributes(jp); QString positioning = ExportMusicXml::positioningAttributes(jp);
if (type != "") { if (type != "") {
@ -5180,7 +5180,7 @@ static void directionMarker(XmlWriter& xml, const Marker* const m, const std::ve
} }
if (sound != "") { if (sound != "") {
xml.startObject(QString("direction placement=\"%1\"").arg((m->placement() == Placement::BELOW) ? "below" : "above")); xml.startObject(QString("direction placement=\"%1\"").arg((m->placement() == PlacementV::BELOW) ? "below" : "above"));
xml.startObject("direction-type"); xml.startObject("direction-type");
QString positioning = ExportMusicXml::positioningAttributes(m); QString positioning = ExportMusicXml::positioningAttributes(m);
if (type != "") { if (type != "") {

View file

@ -111,7 +111,7 @@ static std::shared_ptr<mu::iex::musicxml::IMusicXmlConfiguration> configuration(
//--------------------------------------------------------- //---------------------------------------------------------
MusicXmlTupletDesc::MusicXmlTupletDesc() MusicXmlTupletDesc::MusicXmlTupletDesc()
: type(MxmlStartStop::NONE), placement(Placement::BELOW), : type(MxmlStartStop::NONE), placement(PlacementV::BELOW),
bracket(TupletBracketType::AUTO_BRACKET), shownumber(TupletNumberType::SHOW_NUMBER) bracket(TupletBracketType::AUTO_BRACKET), shownumber(TupletNumberType::SHOW_NUMBER)
{ {
// nothing // nothing
@ -882,7 +882,7 @@ static void addElemOffset(EngravingItem* el, int track, const QString& placement
return; return;
} }
el->setPlacement(placement == "above" ? Placement::ABOVE : Placement::BELOW); el->setPlacement(placement == "above" ? PlacementV::ABOVE : PlacementV::BELOW);
el->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED); el->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED);
el->setTrack(el->isTempoText() ? 0 : track); // TempoText must be in track 0 el->setTrack(el->isTempoText() ? 0 : track); // TempoText must be in track 0
@ -1050,7 +1050,7 @@ static void addFermataToChord(const Notation& notation, ChordRest* cr)
na->setSymId(articSym); na->setSymId(articSym);
na->setTrack(cr->track()); na->setTrack(cr->track());
if (!direction.isNull()) { // Only for case where XML attribute is present (isEmpty wouldn't work) if (!direction.isNull()) { // Only for case where XML attribute is present (isEmpty wouldn't work)
na->setPlacement(direction == "inverted" ? Placement::BELOW : Placement::ABOVE); na->setPlacement(direction == "inverted" ? PlacementV::BELOW : PlacementV::ABOVE);
} }
setElementPropertyFlags(na, Pid::PLACEMENT, direction); setElementPropertyFlags(na, Pid::PLACEMENT, direction);
if (cr->segment() == nullptr && cr->isGrace()) { if (cr->segment() == nullptr && cr->isGrace()) {
@ -1230,7 +1230,7 @@ static void addTextToNote(int l, int c, QString txt, QString placement, QString
t->setPropertyFlags(Pid::FONT_STYLE, PropertyFlags::UNSTYLED); t->setPropertyFlags(Pid::FONT_STYLE, PropertyFlags::UNSTYLED);
} }
if (!placement.isEmpty()) { if (!placement.isEmpty()) {
t->setPlacement(placement == "below" ? Placement::BELOW : Placement::ABOVE); t->setPlacement(placement == "below" ? PlacementV::BELOW : PlacementV::ABOVE);
t->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED); t->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED);
} }
note->add(t); note->add(t);
@ -1252,7 +1252,7 @@ static void addTextToNote(int l, int c, QString txt, QString placement, QString
static void setSLinePlacement(SLine* sli, const QString placement) static void setSLinePlacement(SLine* sli, const QString placement)
{ {
sli->setPlacement(placement == "above" ? Placement::ABOVE : Placement::BELOW); sli->setPlacement(placement == "above" ? PlacementV::ABOVE : PlacementV::BELOW);
sli->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED); sli->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED);
} }
@ -2582,7 +2582,7 @@ void MusicXMLParserDirection::direction(const QString& partId,
} }
t->setXmlText(_rehearsalText); t->setXmlText(_rehearsalText);
if (!_hasDefaultY) { if (!_hasDefaultY) {
t->setPlacement(Placement::ABOVE); // crude way to force placement TODO improve ? t->setPlacement(PlacementV::ABOVE); // crude way to force placement TODO improve ?
t->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED); t->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED);
} }
} }

View file

@ -72,7 +72,7 @@ enum class MusicXmlSlash : char {
struct MusicXmlTupletDesc { struct MusicXmlTupletDesc {
MusicXmlTupletDesc(); MusicXmlTupletDesc();
MxmlStartStop type; MxmlStartStop type;
Placement placement; PlacementV placement;
TupletBracketType bracket; TupletBracketType bracket;
TupletNumberType shownumber; TupletNumberType shownumber;
}; };

View file

@ -1615,7 +1615,7 @@ bool NotationInteraction::notesHaveActiculation(const std::vector<Note*>& notes,
Chord* chord = note->chord(); Chord* chord = note->chord();
std::set<SymbolId> chordArticulations = chord->articulationSymbolIds(); std::set<SymbolId> chordArticulations = chord->articulationSymbolIds();
chordArticulations = Ms::flipArticulations(chordArticulations, Ms::Placement::ABOVE); chordArticulations = Ms::flipArticulations(chordArticulations, Ms::PlacementV::ABOVE);
chordArticulations = Ms::splitArticulations(chordArticulations); chordArticulations = Ms::splitArticulations(chordArticulations);
if (chordArticulations.find(articulationSymbolId) == chordArticulations.end()) { if (chordArticulations.find(articulationSymbolId) == chordArticulations.end()) {
@ -3179,7 +3179,7 @@ void NotationInteraction::nextLyrics(bool back, bool moveOnly, bool end)
int track = lyrics->track(); int track = lyrics->track();
Ms::Segment* segment = lyrics->segment(); Ms::Segment* segment = lyrics->segment();
int verse = lyrics->no(); int verse = lyrics->no();
Ms::Placement placement = lyrics->placement(); Ms::PlacementV placement = lyrics->placement();
Ms::PropertyFlags pFlags = lyrics->propertyFlags(Ms::Pid::PLACEMENT); Ms::PropertyFlags pFlags = lyrics->propertyFlags(Ms::Pid::PLACEMENT);
Ms::Segment* nextSegment = segment; Ms::Segment* nextSegment = segment;
@ -3302,7 +3302,7 @@ void NotationInteraction::nextSyllable()
int track = lyrics->track(); int track = lyrics->track();
Ms::Segment* segment = lyrics->segment(); Ms::Segment* segment = lyrics->segment();
int verse = lyrics->no(); int verse = lyrics->no();
Ms::Placement placement = lyrics->placement(); Ms::PlacementV placement = lyrics->placement();
Ms::PropertyFlags pFlags = lyrics->propertyFlags(Ms::Pid::PLACEMENT); Ms::PropertyFlags pFlags = lyrics->propertyFlags(Ms::Pid::PLACEMENT);
// search next chord // search next chord
@ -3397,7 +3397,7 @@ void NotationInteraction::nextLyricsVerse(bool back)
int track = lyrics->track(); int track = lyrics->track();
ChordRest* cr = lyrics->chordRest(); ChordRest* cr = lyrics->chordRest();
int verse = lyrics->no(); int verse = lyrics->no();
Ms::Placement placement = lyrics->placement(); Ms::PlacementV placement = lyrics->placement();
Ms::PropertyFlags pFlags = lyrics->propertyFlags(Ms::Pid::PLACEMENT); Ms::PropertyFlags pFlags = lyrics->propertyFlags(Ms::Pid::PLACEMENT);
if (back) { if (back) {
@ -3448,7 +3448,7 @@ void NotationInteraction::addMelisma()
int track = lyrics->track(); int track = lyrics->track();
Ms::Segment* segment = lyrics->segment(); Ms::Segment* segment = lyrics->segment();
int verse = lyrics->no(); int verse = lyrics->no();
Ms::Placement placement = lyrics->placement(); Ms::PlacementV placement = lyrics->placement();
Ms::PropertyFlags pFlags = lyrics->propertyFlags(Ms::Pid::PLACEMENT); Ms::PropertyFlags pFlags = lyrics->propertyFlags(Ms::Pid::PLACEMENT);
Fraction endTick = segment->tick(); // a previous melisma cannot extend beyond this point Fraction endTick = segment->tick(); // a previous melisma cannot extend beyond this point

View file

@ -419,7 +419,7 @@ std::set<SymbolId> NoteInputBarModel::resolveCurrentArticulations() const
result.insert(articulation->symId()); result.insert(articulation->symId());
} }
result = Ms::flipArticulations(result, Ms::Placement::ABOVE); result = Ms::flipArticulations(result, Ms::PlacementV::ABOVE);
return Ms::splitArticulations(result); return Ms::splitArticulations(result);
}; };

View file

@ -475,8 +475,8 @@ EditStyle::EditStyle(QWidget* parent)
for (QComboBox* cb : verticalPlacementComboBoxes) { for (QComboBox* cb : verticalPlacementComboBoxes) {
cb->clear(); cb->clear();
cb->addItem(tr("Above"), int(Ms::Placement::ABOVE)); cb->addItem(tr("Above"), int(Ms::PlacementV::ABOVE));
cb->addItem(tr("Below"), int(Ms::Placement::BELOW)); cb->addItem(tr("Below"), int(Ms::PlacementV::BELOW));
} }
horizontalPlacementComboBoxes = { horizontalPlacementComboBoxes = {
@ -486,9 +486,9 @@ EditStyle::EditStyle(QWidget* parent)
for (QComboBox* cb : horizontalPlacementComboBoxes) { for (QComboBox* cb : horizontalPlacementComboBoxes) {
cb->clear(); cb->clear();
cb->addItem(tr("Left"), int(Ms::HPlacement::LEFT)); cb->addItem(tr("Left"), int(Ms::PlacementH::LEFT));
cb->addItem(tr("Center"), int(Ms::HPlacement::CENTER)); cb->addItem(tr("Center"), int(Ms::PlacementH::CENTER));
cb->addItem(tr("Right"), int(Ms::HPlacement::RIGHT)); cb->addItem(tr("Right"), int(Ms::PlacementH::RIGHT));
} }
mmRestRangeBracketType->clear(); mmRestRangeBracketType->clear();
@ -1498,8 +1498,8 @@ void EditStyle::setValues()
} }
} }
} break; } break;
case P_TYPE::HPLACEMENT: case P_TYPE::PLACEMENT_H:
case P_TYPE::PLACEMENT: case P_TYPE::PLACEMENT_V:
case P_TYPE::BARLINE_TYPE: case P_TYPE::BARLINE_TYPE:
case P_TYPE::HOOK_TYPE: case P_TYPE::HOOK_TYPE:
case P_TYPE::DYNAMIC_TYPE: case P_TYPE::DYNAMIC_TYPE:

View file

@ -1009,7 +1009,7 @@ PalettePtr PaletteCreator::newLinesPalette()
ottava = makeElement<Ottava>(gpaletteScore); ottava = makeElement<Ottava>(gpaletteScore);
ottava->setOttavaType(OttavaType::OTTAVA_8VB); ottava->setOttavaType(OttavaType::OTTAVA_8VB);
ottava->setLen(w); ottava->setLen(w);
ottava->setPlacement(Placement::BELOW); ottava->setPlacement(PlacementV::BELOW);
ottava->styleChanged(); ottava->styleChanged();
sp->appendElement(ottava, QT_TRANSLATE_NOOP("palette", "8va bassa")); sp->appendElement(ottava, QT_TRANSLATE_NOOP("palette", "8va bassa"));
@ -1022,7 +1022,7 @@ PalettePtr PaletteCreator::newLinesPalette()
ottava = makeElement<Ottava>(gpaletteScore); ottava = makeElement<Ottava>(gpaletteScore);
ottava->setOttavaType(OttavaType::OTTAVA_15MB); ottava->setOttavaType(OttavaType::OTTAVA_15MB);
ottava->setLen(w); ottava->setLen(w);
ottava->setPlacement(Placement::BELOW); ottava->setPlacement(PlacementV::BELOW);
ottava->styleChanged(); ottava->styleChanged();
sp->appendElement(ottava, QT_TRANSLATE_NOOP("palette", "15ma bassa")); sp->appendElement(ottava, QT_TRANSLATE_NOOP("palette", "15ma bassa"));
@ -1034,7 +1034,7 @@ PalettePtr PaletteCreator::newLinesPalette()
ottava = makeElement<Ottava>(gpaletteScore); ottava = makeElement<Ottava>(gpaletteScore);
ottava->setOttavaType(OttavaType::OTTAVA_22MB); ottava->setOttavaType(OttavaType::OTTAVA_22MB);
ottava->setPlacement(Placement::BELOW); ottava->setPlacement(PlacementV::BELOW);
ottava->setLen(w); ottava->setLen(w);
ottava->styleChanged(); ottava->styleChanged();
sp->appendElement(ottava, QT_TRANSLATE_NOOP("palette", "22ma bassa")); sp->appendElement(ottava, QT_TRANSLATE_NOOP("palette", "22ma bassa"));
@ -1241,7 +1241,7 @@ PalettePtr PaletteCreator::newTextPalette(bool defaultPalette)
st = makeElement<StaffText>(gpaletteScore); st = makeElement<StaffText>(gpaletteScore);
st->setTid(Tid::EXPRESSION); st->setTid(Tid::EXPRESSION);
st->setXmlText(QT_TRANSLATE_NOOP("palette", "Expression")); st->setXmlText(QT_TRANSLATE_NOOP("palette", "Expression"));
st->setPlacement(Placement::BELOW); st->setPlacement(PlacementV::BELOW);
st->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED); st->setPropertyFlags(Pid::PLACEMENT, PropertyFlags::UNSTYLED);
sp->appendElement(st, QT_TRANSLATE_NOOP("palette", "Expression text"))->setElementTranslated(true); sp->appendElement(st, QT_TRANSLATE_NOOP("palette", "Expression text"))->setElementTranslated(true);

View file

@ -44,6 +44,13 @@ enum class Align : char {
}; };
Q_ENUM_NS(Align); Q_ENUM_NS(Align);
//! NOTE just Placement for compatibility
enum class Placement {
ABOVE = int(mu::engraving::PlacementV::ABOVE),
BELOW = int(mu::engraving::PlacementV::BELOW),
};
Q_ENUM_NS(Placement);
//! HACK to force the build system to run moc on this file //! HACK to force the build system to run moc on this file
class Mops : public QObject class Mops : public QObject
{ {
@ -52,5 +59,6 @@ class Mops : public QObject
} }
Q_DECLARE_METATYPE(Ms::PluginAPI::Align); Q_DECLARE_METATYPE(Ms::PluginAPI::Align);
Q_DECLARE_METATYPE(Ms::PluginAPI::Placement);
#endif // MU_PLUGINS_APITYPES_H #endif // MU_PLUGINS_APITYPES_H

View file

@ -124,7 +124,7 @@ class PluginAPI : public Ms::QmlPlugin
/// Contains Ms::Placement enumeration values /// Contains Ms::Placement enumeration values
/// \note In MuseScore 2.X this enumeration was available as /// \note In MuseScore 2.X this enumeration was available as
/// EngravingItem.ABOVE and EngravingItem.BELOW. /// EngravingItem.ABOVE and EngravingItem.BELOW.
DECLARE_API_ENUM(Placement, placementEnum, Ms::Placement) DECLARE_API_ENUM(Placement, placementEnum, Ms::PluginAPI::Placement)
/// Contains Ms::GlissandoType enumeration values /// Contains Ms::GlissandoType enumeration values
DECLARE_API_ENUM(Glissando, glissandoTypeEnum, Ms::GlissandoType) // was probably absent in 2.X DECLARE_API_ENUM(Glissando, glissandoTypeEnum, Ms::GlissandoType) // was probably absent in 2.X
/// Contains Ms::LayoutBreak::Type enumeration values /// Contains Ms::LayoutBreak::Type enumeration values