Skip to content

Commit f1c4b3d

Browse files
Merge pull request #31787 from RomanPudashkin/glissando_style_fix
Fix #30837: Glissandi default playback style setting does not work
2 parents 6d2ceca + 26c7426 commit f1c4b3d

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

share/instruments/instruments.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13373,6 +13373,7 @@
1337313373
<aPitchRange>23-104</aPitchRange>
1337413374
<pPitchRange>23-104</pPitchRange>
1337513375
<singleNoteDynamics>0</singleNoteDynamics>
13376+
<glissandoStyle>diatonic</glissandoStyle>
1337613377
<Channel>
1337713378
<!--MIDI: Bank 0, Prog 46; MS General: Harp-->
1337813379
<program value="46"/> <!--Orchestral Harp-->

src/engraving/dom/note.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1975,7 +1975,16 @@ EngravingItem* Note::drop(EditData& data)
19751975
gliss->setShowText(false);
19761976
}
19771977
gliss->setParent(this);
1978-
gliss->setGlissandoStyle(part()->instrument(gliss->tick())->glissandoStyle());
1978+
1979+
const Sid styleId = gliss->getPropertyStyle(Pid::GLISS_STYLE);
1980+
if (gliss->isStyled(Pid::GLISS_STYLE) && score()->style().isDefault(styleId)) {
1981+
const GlissandoStyle instrumentStyle = part()->instrument(gliss->tick())->glissandoStyle();
1982+
if (instrumentStyle != gliss->glissandoStyle()) {
1983+
gliss->setGlissandoStyle(instrumentStyle);
1984+
gliss->setPropertyFlags(Pid::GLISS_STYLE, PropertyFlags::UNSTYLED);
1985+
}
1986+
}
1987+
19791988
score()->undoAddElement(e);
19801989
} else {
19811990
LOGD("no segment for second note of glissando found");

src/engraving/rw/read400/tread.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,6 @@ bool TRead::readProperties(Instrument* item, XmlReader& e, ReadContext& ctx, Par
895895
} else if (tag == "transposingClef") {
896896
int idx = e.intAttribute("staff", 1) - 1;
897897
item->setClefType(idx, ClefTypeList(item->clefType(idx).concertClef, TConv::fromXml(e.readAsciiText(), ClefType::G)));
898-
} else if (tag == "glissandoStyle") {
899-
item->setGlissandoStyle(TConv::fromXml(e.readAsciiText(), GlissandoStyle::CHROMATIC));
900898
} else {
901899
return false;
902900
}

src/engraving/rw/read460/tread.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,8 @@ bool TRead::readProperties(Instrument* item, XmlReader& e, ReadContext& ctx, Par
10551055
} else if (tag == "transposingClef") {
10561056
int idx = e.intAttribute("staff", 1) - 1;
10571057
item->setClefType(idx, ClefTypeList(item->clefType(idx).concertClef, TConv::fromXml(e.readAsciiText(), ClefType::G)));
1058+
} else if (tag == "glissandoStyle") {
1059+
item->setGlissandoStyle(TConv::fromXml(e.readAsciiText(), GlissandoStyle::CHROMATIC));
10581060
} else {
10591061
return false;
10601062
}

0 commit comments

Comments
 (0)