fix #290323: synthesizer state duplicated when changing score with saved state
This commit is contained in:
parent
c9981c5d2a
commit
c9f84a4f5c
1 changed files with 8 additions and 2 deletions
|
@ -42,6 +42,7 @@ void SynthesizerState::write(XmlWriter& xml, bool force /* = false */) const
|
|||
|
||||
void SynthesizerState::read(XmlReader& e)
|
||||
{
|
||||
std::list<SynthesizerGroup> tempGroups;
|
||||
while (e.readNextStartElement()) {
|
||||
SynthesizerGroup group;
|
||||
group.setName(e.name().toString());
|
||||
|
@ -54,7 +55,12 @@ void SynthesizerState::read(XmlReader& e)
|
|||
else
|
||||
e.unknown();
|
||||
}
|
||||
push_back(group);
|
||||
tempGroups.push_back(group);
|
||||
}
|
||||
|
||||
if (!tempGroups.empty()) {
|
||||
// Replace any previously set state if we have read a new state
|
||||
swap(tempGroups);
|
||||
setIsDefault(false);
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +134,7 @@ int SynthesizerState::ccToUse() const
|
|||
if (method == 0) // velocity only
|
||||
return -1;
|
||||
|
||||
return cc;
|
||||
return cc;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue