Don't propagate parameter changes while processing
Let the host do this, this would solve all unsoundness issues and potential collisions.
This commit is contained in:
parent
ea18f62d02
commit
7000e9d42e
1 changed files with 12 additions and 7 deletions
|
@ -225,13 +225,18 @@ impl<P: Plugin> GuiContext for WrapperInner<P> {
|
||||||
match &*self.component_handler.read() {
|
match &*self.component_handler.read() {
|
||||||
Some(handler) => match self.param_ptr_to_hash.get(¶m) {
|
Some(handler) => match self.param_ptr_to_hash.get(¶m) {
|
||||||
Some(hash) => {
|
Some(hash) => {
|
||||||
// XXX: The host will also report this value to the plugin, this may cause fun
|
// Only update the parameters manually if the host is not processing audio. If
|
||||||
// behaviour with rapid parameter changes. How does JUCE handle this?
|
// the plugin is currently processing audio, the host will pass this change back
|
||||||
self.set_normalized_value_by_hash(
|
// to the plugin in the audio callback. This also prevents the values from
|
||||||
*hash,
|
// changing in the middle of the process callback, which would be unsound.
|
||||||
normalized,
|
if !self.is_processing.load(Ordering::SeqCst) {
|
||||||
self.current_buffer_config.load().map(|c| c.sample_rate),
|
self.set_normalized_value_by_hash(
|
||||||
);
|
*hash,
|
||||||
|
normalized,
|
||||||
|
self.current_buffer_config.load().map(|c| c.sample_rate),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
handler.perform_edit(*hash, normalized as f64);
|
handler.perform_edit(*hash, normalized as f64);
|
||||||
}
|
}
|
||||||
None => nih_debug_assert_failure!("Unknown parameter: {:?}", param),
|
None => nih_debug_assert_failure!("Unknown parameter: {:?}", param),
|
||||||
|
|
Loading…
Add table
Reference in a new issue