[−][src]Struct bae_rs::sounds::standard_block::StandardBlock
Struct used for generalizing the structure of and abstracting the Sound
struct. This allows us to create complex sounds as a graph of StandardBlock
s,
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]
T: 'static + Generator,
U: 'static + Modifier,
Creates a new StandardBlock from the given Generator
, Modifier
, and
Inter
.
Parameters
g
- TheGenerator
for theStandardBlock
.m
- TheModifier
for theStandardBlock
.i
- The interactor (typically a closure) that defines the combination ofg
s andm
s samples whenStandardBlock::process()
is called.
pub fn from_generator<T>(g: T) -> Self where
T: 'static + Generator,
[src]
T: 'static + Generator,
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
g
- TheGenerator
for theStandardBlock
.
pub fn from_modifier<U>(m: U) -> Self where
U: 'static + Modifier,
[src]
U: 'static + Modifier,
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
m
- TheModifier
for theStandardBlock
.
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]
pub fn get_m(&self) -> &ModifierRc
[src]
pub fn get_g_mut(&mut self) -> &mut GeneratorRc
[src]
pub fn get_m_mut(&mut self) -> &mut ModifierRc
[src]
Trait Implementations
impl Block for StandardBlock
[src]
Auto Trait Implementations
impl !RefUnwindSafe for StandardBlock
impl !Send for StandardBlock
impl !Sync for StandardBlock
impl Unpin for StandardBlock
impl !UnwindSafe for StandardBlock
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,