1
0
Fork 0

Also add an Editor::param_modulation_changed()

This commit is contained in:
Robbert van der Helm 2023-01-11 14:45:05 +01:00
parent 922d2de603
commit 08c6729ed1
4 changed files with 19 additions and 3 deletions

View file

@ -107,6 +107,8 @@ where
// that boolean is set.
}
fn param_modulation_changed(&self, _id: &str, _modulation_offset: f32) {}
fn param_values_changed(&self) {
// Same
}

View file

@ -109,6 +109,10 @@ impl<E: IcedEditor> Editor for IcedEditorWrapper<E> {
let _ = self.parameter_updates_sender.try_send(ParameterUpdate);
}
fn param_modulation_changed(&self, _id: &str, _modulation_offset: f32) {
let _ = self.parameter_updates_sender.try_send(ParameterUpdate);
}
fn param_values_changed(&self) {
let _ = self.parameter_updates_sender.try_send(ParameterUpdate);
}

View file

@ -131,6 +131,11 @@ impl Editor for ViziaEditor {
.store(true, Ordering::Relaxed);
}
fn param_modulation_changed(&self, _id: &str, _modulation_offset: f32) {
self.emit_parameters_changed_event
.store(true, Ordering::Relaxed);
}
fn param_values_changed(&self) {
self.emit_parameters_changed_event
.store(true, Ordering::Relaxed);

View file

@ -58,9 +58,14 @@ pub trait Editor: Send {
/// new value for a parameter or when a parameter change sent to the host gets processed.
fn param_value_changed(&self, id: &str, normalized_value: f32);
/// Called whenever one or more parameter values changed while the editor is open. This may be
/// called in place of [`param_value_changed()`][Self::param_value_changed()] when multiple
/// parameter values hcange at the same time. For example, when a preset is loaded.
/// Called whenever a specific parameter's monophonic modulation value has changed while the
/// editor is open.
fn param_modulation_changed(&self, id: &str, modulation_offset: f32);
/// Called whenever one or more parameter values or modulations have changed while the editor is
/// open. This may be called in place of [`param_value_changed()`][Self::param_value_changed()]
/// when multiple parameter values hcange at the same time. For example, when a preset is
/// loaded.
fn param_values_changed(&self);
// TODO: Reconsider adding a tick function here for the Linux `IRunLoop`. To keep this platform