fix: clear preset selection checkmark when Randomize is used

Set currentPresetIndex to -1 in randomizeParameters so the preset menu
no longer shows a tick on the previously selected preset.
This commit is contained in:
Armin 2026-07-14 14:01:27 +02:00
commit dc9e973340

View file

@ -709,6 +709,7 @@ void MainContentComponent::applyCurrentPreset() {
void MainContentComponent::randomizeParameters() { void MainContentComponent::randomizeParameters() {
juce::Random rand; juce::Random rand;
processorRef.fadeOutActiveVoices(0.25f); processorRef.fadeOutActiveVoices(0.25f);
currentPresetIndex = -1;
for (auto* p : processorRef.getParameters()) { for (auto* p : processorRef.getParameters()) {
auto* rap = dynamic_cast<juce::RangedAudioParameter*>(p); auto* rap = dynamic_cast<juce::RangedAudioParameter*>(p);
if (rap == nullptr) if (rap == nullptr)