1
0
Fork 0

Initialize smoothers in the standalone

This commit is contained in:
Robbert van der Helm 2022-06-15 00:18:44 +02:00
parent abe7fec0db
commit a4fa7e8e78

View file

@ -202,6 +202,11 @@ impl<P: Plugin, B: Backend> Wrapper<P, B> {
return Err(WrapperError::IncompatibleConfig);
}
// Befure initializing the plugin, make sure all smoothers are set the the default values
for param in wrapper.known_parameters.iter() {
unsafe { param.update_smoother(wrapper.buffer_config.sample_rate, true) };
}
if !plugin.initialize(
&wrapper.bus_config,
&wrapper.buffer_config,
@ -402,6 +407,9 @@ impl<P: Plugin, B: Backend> Wrapper<P, B> {
return false;
}
// Any output note events are now in a vector that can be processed by the
// audio/MIDI backend
// We'll always write these events to the first sample, so even when we add note output we
// shouldn't have to think about interleaving events here
let mut parameter_values_changed = false;
@ -418,8 +426,6 @@ impl<P: Plugin, B: Backend> Wrapper<P, B> {
self.notify_param_values_changed();
}
// TODO: MIDI output
// After processing audio, we'll check if the editor has sent us updated plugin state.
// We'll restore that here on the audio thread to prevent changing the values during the
// process call and also to prevent inconsistent state when the host also wants to load