1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-16 00:34:19 +00:00

VST3 Host: Only send updates for modified parameters

This commit is contained in:
reuk 2021-05-06 19:51:18 +01:00
parent f35c2d90e2
commit 1df59f7469
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -942,9 +942,9 @@ public:
void set (size_t index, float value)
{
jassert (index < size());
values[index].store (value, std::memory_order_relaxed);
flags[index / numFlagBits].fetch_or ((FlagType) 1 << (index % numFlagBits),
std::memory_order_acq_rel);
const auto previous = values[index].exchange (value, std::memory_order_relaxed);
const auto bit = previous == value ? ((FlagType) 0) : ((FlagType) 1 << (index % numFlagBits));
flags[index / numFlagBits].fetch_or (bit, std::memory_order_acq_rel);
}
float get (size_t index) const noexcept