pub struct GraphBuilder { /* private fields */ }
Expand description
A builder for constructing audio graphs.
Implementations§
Source§impl GraphBuilder
impl GraphBuilder
Sourcepub fn add_audio_input(&self) -> Node
pub fn add_audio_input(&self) -> Node
Adds an audio input node to the graph.
Sourcepub fn add_audio_output(&self) -> Node
pub fn add_audio_output(&self) -> Node
Adds an audio output node to the graph.
Sourcepub fn add_midi_input(&self, name: impl Into<String>) -> Node
pub fn add_midi_input(&self, name: impl Into<String>) -> Node
Adds a MIDI input node to the graph.
Sourcepub fn from_graph(graph: Graph) -> Self
pub fn from_graph(graph: Graph) -> Self
Creates a new GraphBuilder
with the given graph as a starting point.
Sourcepub fn build_runtime(&self) -> Runtime
pub fn build_runtime(&self) -> Runtime
Builds the graph and constructs a new Runtime
instance from the graph.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Returns the number of nodes in the graph.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Returns the number of edges in the graph.
Sourcepub fn with_graph<F, R>(&self, f: F) -> R
pub fn with_graph<F, R>(&self, f: F) -> R
Runs the given closure with a reference to the graph.
Sourcepub fn with_graph_mut<F, R>(&self, f: F) -> R
pub fn with_graph_mut<F, R>(&self, f: F) -> R
Runs the given closure with a mutable reference to the graph.
Sourcepub fn connect(
&self,
from: impl IntoNode,
from_output: impl IntoOutputIdx,
to: impl IntoNode,
to_input: impl IntoInputIdx,
)
pub fn connect( &self, from: impl IntoNode, from_output: impl IntoOutputIdx, to: impl IntoNode, to_input: impl IntoInputIdx, )
Connects the given output of one node to the given input of another node.
Source§impl GraphBuilder
impl GraphBuilder
Source§impl GraphBuilder
impl GraphBuilder
Sourcepub fn sample_rate(&self) -> Node
pub fn sample_rate(&self) -> Node
Adds a new SampleRate
processor that continuously outputs the current sample rate.
Trait Implementations§
Source§impl Clone for GraphBuilder
impl Clone for GraphBuilder
Source§fn clone(&self) -> GraphBuilder
fn clone(&self) -> GraphBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for GraphBuilder
impl Default for GraphBuilder
Source§fn default() -> GraphBuilder
fn default() -> GraphBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GraphBuilder
impl RefUnwindSafe for GraphBuilder
impl Send for GraphBuilder
impl Sync for GraphBuilder
impl Unpin for GraphBuilder
impl UnwindSafe for GraphBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn 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
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more