Merge pull request #498 from paulfd/no-stable-sort
Replace stable_sort by sort
This commit is contained in:
commit
8369f958dd
2 changed files with 11 additions and 2 deletions
|
|
@ -1568,6 +1568,15 @@ void sfz::Synth::applySettingsPerVoice()
|
|||
voice->setPitchEGEnabledPerVoice(settingsPerVoice.havePitchEG);
|
||||
voice->setFilterEGEnabledPerVoice(settingsPerVoice.haveFilterEG);
|
||||
}
|
||||
|
||||
if (stealer.getStealingAlgorithm() ==
|
||||
VoiceStealing::StealingAlgorithm::EnvelopeAndAge) {
|
||||
for (auto& voice : voices)
|
||||
voice->enablePowerFollower();
|
||||
} else {
|
||||
for (auto& voice : voices)
|
||||
voice->disablePowerFollower();
|
||||
}
|
||||
}
|
||||
|
||||
void sfz::Synth::setupModMatrix()
|
||||
|
|
|
|||
|
|
@ -33,13 +33,13 @@ sfz::Voice* sfz::VoiceStealing::stealFirst(absl::Span<Voice*> voices) noexcept
|
|||
|
||||
sfz::Voice* sfz::VoiceStealing::stealOldest(absl::Span<Voice*> voices) noexcept
|
||||
{
|
||||
absl::c_stable_sort(voices, voiceOrdering);
|
||||
absl::c_sort(voices, voiceOrdering);
|
||||
return voices.front();
|
||||
}
|
||||
|
||||
sfz::Voice* sfz::VoiceStealing::stealEnvelopeAndAge(absl::Span<Voice*> voices) noexcept
|
||||
{
|
||||
absl::c_stable_sort(voices, voiceOrdering);
|
||||
absl::c_sort(voices, voiceOrdering);
|
||||
|
||||
const auto sumPower = absl::c_accumulate(voices, 0.0f, [](float sum, const Voice* v) {
|
||||
return sum + v->getAveragePower();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue