Fix presets being set and state restore #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tries to fix an issue where preset changes and state restore are not working with RNBO v1.2.0 due to a fix to 'notifying' parameters, that will make it so that certain parts of RNBO state aren't updated with the new parameter values on those two scenarios. I need to test further to see if this will address the issue and am not familiar with the bigger picture of this project to tell if it'd be okay or problematic for
rnbo.getParameterValue
to return a different result than the state objects or parameter values.I'm not sure if preset handling will be totally correct with this change since the parameters would not be notifying the hosts depending on how they are called.
RNBO::JuceAudioProcessor::setCurrentProgram
does not set_isSettingPresetAsync
as far as I can tell. Therefore parameter change events forsetCurrentProgram
andsetStateInformation
are being dropped.This change makes it so that these events aren't dropped but still skips notifying hosts. Perhaps a more robust change could be to set a flag while the
setCurrentProgram
andsetStateInformation
run and handle them in the same manner as "_isSettingPresetAsync".I might be totally wrong about the whole thing as well!
This fixes the test suite referenced in #2.
Closes #2.
rnbo.adapter.juce/RNBO_JuceAudioProcessor.cpp
Lines 412 to 421 in dd23360
All the best, happy patching