pub trait AudioEffectImpl<T: FloatType + Float>: Sized {
Show 19 methods
// Required methods
fn new<const N: usize>(
name: &str,
param_props: ParamPropDesk<'_, N>,
proc: Box<dyn AudioEffectTrait<T>>,
) -> AudioEffect<T>;
fn get_name(&self) -> &str;
fn get_params(&self) -> &FxHashMap<String, EffectParamType>;
fn set_param(
&mut self,
name: &str,
value: EffectParamValue<'_>,
) -> AudioEffectState;
fn get_param(
&self,
name: &str,
) -> Result<EffectParamValue<'_>, AudioEffectState>;
fn use_filter_in(&mut self, use_filter: bool);
fn use_filter_out(&mut self, use_filter: bool);
fn is_using_filter_in(&self) -> bool;
fn is_using_filter_out(&self) -> bool;
fn set_mix(&mut self, new_mix: f32);
fn get_mix(&self) -> f32;
fn set_low_cut_in(&mut self, cut: f32);
fn get_low_cut_in(&self) -> f32;
fn set_high_cut_in(&mut self, cut: f32);
fn get_high_cut_in(&self) -> f32;
fn set_low_cut_out(&mut self, cut: f32);
fn get_low_cut_out(&self) -> f32;
fn set_high_cut_out(&mut self, cut: f32);
fn get_high_cut_out(&self) -> f32;
}Expand description
Public API trait for audio effects. NOTE: Uses raw pointers internally for reference exposure; not read/write secured for get_name() and get_params().
Required Methods§
Sourcefn new<const N: usize>(
name: &str,
param_props: ParamPropDesk<'_, N>,
proc: Box<dyn AudioEffectTrait<T>>,
) -> AudioEffect<T>
fn new<const N: usize>( name: &str, param_props: ParamPropDesk<'_, N>, proc: Box<dyn AudioEffectTrait<T>>, ) -> AudioEffect<T>
Creates a new audio effect with the given name, parameter properties, and processor.
The const generic N specifies the number of parameters.
Sourcefn get_params(&self) -> &FxHashMap<String, EffectParamType>
fn get_params(&self) -> &FxHashMap<String, EffectParamType>
Gets a reference to the map of all parameters and their types.
Sourcefn set_param(
&mut self,
name: &str,
value: EffectParamValue<'_>,
) -> AudioEffectState
fn set_param( &mut self, name: &str, value: EffectParamValue<'_>, ) -> AudioEffectState
Sets a parameter by name. Returns the state after setting.
Sourcefn get_param(
&self,
name: &str,
) -> Result<EffectParamValue<'_>, AudioEffectState>
fn get_param( &self, name: &str, ) -> Result<EffectParamValue<'_>, AudioEffectState>
Gets a parameter value by name. Returns the value or an error state.
Sourcefn use_filter_in(&mut self, use_filter: bool)
fn use_filter_in(&mut self, use_filter: bool)
Enables or disables the input filter before processing.
Sourcefn use_filter_out(&mut self, use_filter: bool)
fn use_filter_out(&mut self, use_filter: bool)
Enables or disables the output filter after processing.
Sourcefn is_using_filter_in(&self) -> bool
fn is_using_filter_in(&self) -> bool
Checks if the input filter is enabled.
Sourcefn is_using_filter_out(&self) -> bool
fn is_using_filter_out(&self) -> bool
Checks if the output filter is enabled.
Sourcefn set_low_cut_in(&mut self, cut: f32)
fn set_low_cut_in(&mut self, cut: f32)
Sets the low-cut frequency for the input filter (clamped between 10.0 and 22050.0 Hz).
Sourcefn get_low_cut_in(&self) -> f32
fn get_low_cut_in(&self) -> f32
Gets the low-cut frequency for the input filter.
Sourcefn set_high_cut_in(&mut self, cut: f32)
fn set_high_cut_in(&mut self, cut: f32)
Sets the high-cut frequency for the input filter (clamped between 10.0 and 22050.0 Hz).
Sourcefn get_high_cut_in(&self) -> f32
fn get_high_cut_in(&self) -> f32
Gets the high-cut frequency for the input filter.
Sourcefn set_low_cut_out(&mut self, cut: f32)
fn set_low_cut_out(&mut self, cut: f32)
Sets the low-cut frequency for the output filter (clamped between 10.0 and 22050.0 Hz).
Sourcefn get_low_cut_out(&self) -> f32
fn get_low_cut_out(&self) -> f32
Gets the low-cut frequency for the output filter.
Sourcefn set_high_cut_out(&mut self, cut: f32)
fn set_high_cut_out(&mut self, cut: f32)
Sets the high-cut frequency for the output filter (clamped between 10.0 and 22050.0 Hz).
Sourcefn get_high_cut_out(&self) -> f32
fn get_high_cut_out(&self) -> f32
Gets the high-cut frequency for the output filter.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.