copy voice if there are more that 0 voices

This commit is contained in:
Chris
2023-08-25 13:39:06 +02:00
parent 8581a79659
commit b92ffbec00

View File

@@ -22,8 +22,12 @@ public:
{ {
if (voice_count > voicePtrs.size()) { if (voice_count > voicePtrs.size()) {
for (int i = voicePtrs.size(); i < voice_count; ++i) { for (int i = voicePtrs.size(); i < voice_count; ++i) {
if (voicePtrs.size() > 0) {
voicePtrs.emplace_back(std::make_shared<t_voice>(*voicePtrs.at(0)));
} else {
voicePtrs.emplace_back(std::make_shared<t_voice>()); voicePtrs.emplace_back(std::make_shared<t_voice>());
} }
}
} else if (voice_count < voicePtrs.size()) { } else if (voice_count < voicePtrs.size()) {
voicePtrs.resize(voice_count); voicePtrs.resize(voice_count);
} }