Enum audio_visualizer::dynamic::window_top_btm::TransformFn [−][src]
pub enum TransformFn<'a> {
Basic(fn(_: &[f32], _: f32) -> Vec<f32>),
Complex(&'a dyn Fn(&[f32], f32) -> Vec<(f64, f64)>),
}
Expand description
Parameter type for open_window_connect_audio
. Describes how the audio data shall
be transformed, and thus, how it should be displayed in the lower part of the window.
The function is called every x milliseconds (refresh rate of window).
This works cross-platform (Windows, MacOS, Linux).
Variants
Synchronized x-axis with the original data. Useful for transformations on the waveform, such as a (lowpass) filter.
Functions takes amplitude values and transforms them to a new amplitude value. It gets the sampling rate as second argument.
Use this, when the x-axis is different than for the original data. For example, if you want to display a spectrum.
Functions takes amplitude values (and their index) and transforms them to a new (x,y)-pair. Takes a closure instead of a function, so that it can capture state. It gets the sampling rate as second argument.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for TransformFn<'a>
impl<'a> !Send for TransformFn<'a>
impl<'a> !Sync for TransformFn<'a>
impl<'a> Unpin for TransformFn<'a>
impl<'a> !UnwindSafe for TransformFn<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more