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

Basic(fn(_: &[f32], _: f32) -> Vec<f32>)

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.

Tuple Fields of Basic

0: fn(_: &[f32], _: f32) -> Vec<f32>
Complex(&'a dyn Fn(&[f32], f32) -> Vec<(f64, f64)>)

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.

Tuple Fields of Complex

0: &'a dyn Fn(&[f32], f32) -> Vec<(f64, f64)>

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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

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

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

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.