bae_rs::sounds::complex_sound

Struct ComplexSound

Source
pub struct ComplexSound { /* private fields */ }
Expand description

Type implementing the ability to run multiple Generators and Modifiers within a single object, granting the ability to create complex systems like those found in digital synthesizers.

Implementations§

Source§

impl ComplexSound

Source

pub fn new(input_gain: MathT, output_gain: MathT) -> Self

Creates a new ComplexSound object with the given input and output gain values.

Source

pub fn get_input_gain(&self) -> GraphNode

Returns the [‘GraphNode’] containing the input gain Modifier.

Source

pub fn get_output_gain(&self) -> GraphNode

Returns the [‘GraphNode’] containing the output gain Modifier.

Source

pub fn add_block(&mut self, block: BlockSP) -> GraphNode

Adds a new node to the Graph, using the given Block for the node value. Returns the GraphNode containing the Block for later use with [add_connection] and [remove_connection].

Source

pub fn add_connection(&mut self, from: GraphNode, to: GraphNode)

Adds a new connection (edge) between the two given GraphNodes.

Source

pub fn remove_connection(&mut self, from: GraphNode, to: GraphNode)

Removes a connection between the two given GraphNodes.

Source

pub fn get_nodes(&self) -> ProcessOrder

Returns a copy of the list of all nodes of the graph in the order in which they will be processed.

Trait Implementations§

Source§

impl Clone for ComplexSound

Source§

fn clone(&self) -> ComplexSound

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Sound for ComplexSound

Source§

fn toggle_pause(&mut self)

Toggles the pause state of the sound. If the sound is paused, the internal structures aren’t process during a call to process, instead only Default::default() is returned.
Source§

fn is_paused(&self) -> bool

Returns the pause state of the sound.
Source§

fn toggle_mute(&mut self)

Toggles the mute state of the sound. If the sound is muted, the internal structures are still processed during a call to process, but Default::default() is returned.
Source§

fn is_muted(&self) -> bool

Returns the mute state of the sound.
Source§

fn register(&mut self, id: usize)

Sets itself as registered with the given ID. Read more
Source§

fn unregister(&mut self)

Sets itself as unregistered and clears the saved ID. Read more
Source§

fn process(&mut self, input: SampleT) -> SampleT

Processes the sound and its internal structures, returning the resulting audio sample. Read more
Source§

fn get_id(&self) -> Option<usize>

Returns the ID given to the Sound during registration with a Channel. If the Sound is unregistered, it will return None.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V