From 8d6973b2d1c83dc17198b5e7556ca84526a1890e Mon Sep 17 00:00:00 2001 From: jatin Date: Wed, 13 Mar 2024 12:46:59 -0700 Subject: [PATCH] Fixing custom choice parameter save/load bug --- src/processors/other/Delay.cpp | 8 ++++---- src/processors/tone/StateVariableFilter.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/processors/other/Delay.cpp b/src/processors/other/Delay.cpp index b01f8d0b..4d9f7b24 100644 --- a/src/processors/other/Delay.cpp +++ b/src/processors/other/Delay.cpp @@ -315,11 +315,11 @@ bool DelayModule::getCustomComponents (OwnedArray& customComps, chowd addChildComponent (tempoSyncSelector); addChildComponent (delayTimeSlider); - const auto* modeChoiceParam = getParameterPointer (vts, DelayTags::tempoSyncAmountTag); - tempoSyncSelector.addItemList (modeChoiceParam->choices, 1); - tempoSyncSelector.setSelectedItemIndex (0); + const auto* tempoChoiceParam = getParameterPointer (vts, DelayTags::tempoSyncAmountTag); + tempoSyncSelector.addItemList (tempoChoiceParam->choices, 1); + tempoSyncSelector.setSelectedItemIndex (tempoChoiceParam->getIndex()); tempoSyncSelector.setScrollWheelEnabled (true); - hcp.registerParameterComponent (tempoSyncSelector, *modeChoiceParam); + hcp.registerParameterComponent (tempoSyncSelector, *tempoChoiceParam); hcp.registerParameterComponent (delayTimeSlider, delayTimeSlider.getParameter()); diff --git a/src/processors/tone/StateVariableFilter.cpp b/src/processors/tone/StateVariableFilter.cpp index a891db59..5a599fc3 100644 --- a/src/processors/tone/StateVariableFilter.cpp +++ b/src/processors/tone/StateVariableFilter.cpp @@ -161,7 +161,7 @@ bool StateVariableFilter::getCustomComponents (OwnedArray& customComp const auto* modeChoiceParam = getParameterPointer (vts, SVFTags::modeTag); modeSelector.addItemList (modeChoiceParam->choices, 1); - modeSelector.setSelectedItemIndex (0); + modeSelector.setSelectedItemIndex (modeChoiceParam->getIndex()); modeSelector.setScrollWheelEnabled (true); hcp.registerParameterComponent (modeSelector, *modeChoiceParam);