Skip to content

Commit

Permalink
Fix reading gliss type and tidy properties
Browse files Browse the repository at this point in the history
  • Loading branch information
miiizen committed Nov 13, 2024
1 parent 1573c9a commit 52f1090
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
9 changes: 1 addition & 8 deletions src/engraving/dom/glissando.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ static const ElementStyle glissandoElementStyle {
{ Sid::glissandoShowText, Pid::GLISS_SHOW_TEXT },
{ Sid::glissandoText, Pid::GLISS_TEXT },
{ Sid::glissandoStyle, Pid::GLISS_STYLE },
{ Sid::glissandoStyleHarp, Pid::GLISS_STYLE },
{ Sid::glissandoLineWidth, Pid::LINE_WIDTH },
{ Sid::glissandoLineStyle, Pid::LINE_STYLE },
{ Sid::glissandoDashLineLen, Pid::DASH_LINE_LEN },
{ Sid::glissandoDashGapLen, Pid::DASH_GAP_LEN },
Expand Down Expand Up @@ -111,15 +109,10 @@ Glissando::Glissando(EngravingItem* parent)
{
initElementStyle(&glissandoElementStyle);

static const std::array<Pid, 10> propertiesToInitialise {
Pid::GLISS_SHOW_TEXT,
Pid::GLISS_STYLE,
static const std::array<Pid, 5> propertiesToInitialise {
Pid::GLISS_SHIFT,
Pid::GLISS_TYPE,
Pid::GLISS_TEXT,
Pid::GLISS_EASEIN,
Pid::GLISS_EASEOUT,
Pid::GLISS_TEXT,
Pid::DIAGONAL,
Pid::ANCHOR
};
Expand Down
3 changes: 0 additions & 3 deletions src/engraving/dom/glissando.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
#include "types.h"

namespace mu::engraving {
// the amount of white space to leave before a system-initial chord with glissando
static const double GLISS_STARTOFSYSTEM_WIDTH = 4; // in sp

class Glissando;
class Note;
enum class GlissandoType;
Expand Down
4 changes: 0 additions & 4 deletions src/engraving/rw/read410/tread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2999,10 +2999,6 @@ void TRead::read(Glissando* g, XmlReader& e, ReadContext& ctx)
} else if (tag == "isHarpGliss" && ctx.pasteMode()) {
g->setIsHarpGliss(e.readBool());
g->resetProperty(Pid::GLISS_STYLE);
} else if (tag == "subtype") {
g->setGlissandoType(TConv::fromXml(e.readAsciiText(), GlissandoType::STRAIGHT));
} else if (tag == "glissandoStyle") {
TRead::readProperty(g, e, ctx, Pid::GLISS_STYLE);
} else if (tag == "easeInSpin") {
g->setEaseIn(e.readInt());
} else if (tag == "easeOutSpin") {
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/rw/write/twrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ void TWrite::write(const Glissando* item, XmlWriter& xml, WriteContext& ctx)
xml.tagProperty("isHarpGliss", PropertyValue(item->isHarpGliss().value()));
}

for (auto id : { Pid::GLISS_TYPE, Pid::GLISS_STYLE, Pid::GLISS_SHIFT, Pid::GLISS_EASEIN, Pid::GLISS_EASEOUT }) {
for (auto id : { Pid::GLISS_SHIFT, Pid::GLISS_EASEIN, Pid::GLISS_EASEOUT }) {
writeProperty(item, xml, id);
}
for (const StyledProperty& spp : *item->styledProperties()) {
Expand Down
3 changes: 3 additions & 0 deletions src/palette/internal/palettecreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,9 @@ PalettePtr PaletteCreator::newArpeggioPalette()
for (int i = 0; i < 2; ++i) {
auto a = makeElement<Glissando>(gpaletteScore);
a->setGlissandoType(GlissandoType(i));
if (a->glissandoType() != a->style().styleV(Sid::glissandoType).value<GlissandoType>()) {
a->setPropertyFlags(Pid::GLISS_TYPE, PropertyFlags::UNSTYLED);
}
sp->appendElement(a, a->glissandoTypeName());
}

Expand Down

0 comments on commit 52f1090

Please sign in to comment.