[][src]Struct bae_rs::sounds::standard_block::StandardBlock

pub struct StandardBlock { /* fields omitted */ }

Struct used for generalizing the structure of and abstracting the Sound struct. This allows us to create complex sounds as a graph of StandardBlocks, where each block can be a Modifier, Generator, or both, and there output of the StandardBlock is defined as some user-definable combination of the Generator and Modifier output. See Sound documentation for more info.

Internally, the Generator, Modifier, and Inter are stored wrapped within an Rc (note: may become Arc depending on future needs of the library). This means that when you clone a StandardBlock, the internal objects are not cloned. Rather, their reference count is incremented, and the wrapped objects stay where they are.

Methods

impl StandardBlock[src]

pub fn new<T, U>(g: T, m: U, i: Inter) -> Self where
    T: 'static + Generator,
    U: 'static + Modifier
[src]

Creates a new StandardBlock from the given Generator, Modifier, and Inter.

Parameters

pub fn from_generator<T>(g: T) -> Self where
    T: 'static + Generator
[src]

Creates a new block from the given Generator. For the StandardBlock, Empty is used for the m, and the return value of StandardBlock::generator_passthrough is used for i.

Parameters

pub fn from_modifier<U>(m: U) -> Self where
    U: 'static + Modifier
[src]

Creates a new block from the given Modifier. For the StandardBlock, Empty is used for g, and the return value of StandardBlock::modifier_passthrough is used for i.

Parametrs

pub fn default_interactor() -> Inter[src]

Creates the default interactor which simply multiplies the two passed samples together.

pub fn generator_passthrough() -> Inter[src]

Creates a passthrough interactor which passes the Generator sample through.

pub fn modifier_passthrough() -> Inter[src]

Creates a passthrough interactor which passes the Modifier sample through.

pub fn get_g(&self) -> &GeneratorRc[src]

Returns a reference to the Rc-wrapped Generator.

pub fn get_m(&self) -> &ModifierRc[src]

Returns a reference to the Rc-wrapped Modifier.

pub fn get_g_mut(&mut self) -> &mut GeneratorRc[src]

Returns a mutable reference to the Rc-wrapped Generator.

pub fn get_m_mut(&mut self) -> &mut ModifierRc[src]

Returns a mutable reference to the Rc-wrapped Modifier.

Trait Implementations

impl Block for StandardBlock[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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