pub struct AudioGraph {
graph: StableGraph<Node, Edge>,
dest_id: NodeId,
dests: Vec<NodeId>,
listener_id: NodeId,
}Fields§
§graph: StableGraph<Node, Edge>§dest_id: NodeId§dests: Vec<NodeId>§listener_id: NodeIdImplementations§
Source§impl AudioGraph
impl AudioGraph
pub fn new(channel_count: u8) -> Self
Sourcepub(crate) fn add_node(&mut self, node: Box<dyn AudioNodeEngine>) -> NodeId
pub(crate) fn add_node(&mut self, node: Box<dyn AudioNodeEngine>) -> NodeId
Create a node, obtain its id
Sourcepub fn add_edge(&mut self, out: PortId<OutputPort>, inp: PortId<InputPort>)
pub fn add_edge(&mut self, out: PortId<OutputPort>, inp: PortId<InputPort>)
Connect an output port to an input port
The edge goes from the output port to the input port, connecting two nodes
Sourcepub fn disconnect_all_from(&mut self, node: NodeId)
pub fn disconnect_all_from(&mut self, node: NodeId)
Disconnect all outgoing connections from a node
https://webaudio.github.io/web-audio-api/#dom-audionode-disconnect
Sourcepub fn disconnect_output(&mut self, out: PortId<OutputPort>)
pub fn disconnect_output(&mut self, out: PortId<OutputPort>)
Disconnect all outgoing connections from a node’s output
https://webaudio.github.io/web-audio-api/#dom-audionode-disconnect-output
Sourcepub fn disconnect_between(&mut self, from: NodeId, to: NodeId)
pub fn disconnect_between(&mut self, from: NodeId, to: NodeId)
Disconnect connections from a node to another node
https://webaudio.github.io/web-audio-api/#dom-audionode-disconnect-destinationnode
Sourcepub fn disconnect_output_between(&mut self, out: PortId<OutputPort>, to: NodeId)
pub fn disconnect_output_between(&mut self, out: PortId<OutputPort>, to: NodeId)
Disconnect all outgoing connections from a node’s output to another node
https://webaudio.github.io/web-audio-api/#dom-audionode-disconnect-destinationnode-output
Sourcepub fn disconnect_to(&mut self, node: NodeId, inp: PortId<InputPort>)
pub fn disconnect_to(&mut self, node: NodeId, inp: PortId<InputPort>)
Disconnect all outgoing connections from a node to another node’s input
Only used in WebAudio for disconnecting audio params
https://webaudio.github.io/web-audio-api/#dom-audionode-disconnect-destinationparam
Sourcepub fn disconnect_output_between_to(
&mut self,
out: PortId<OutputPort>,
inp: PortId<InputPort>,
)
pub fn disconnect_output_between_to( &mut self, out: PortId<OutputPort>, inp: PortId<InputPort>, )
Disconnect all outgoing connections from a node’s output to another node’s input
https://webaudio.github.io/web-audio-api/#dom-audionode-disconnect-destinationnode-output-input https://webaudio.github.io/web-audio-api/#dom-audionode-disconnect-destinationparam-output
Sourcepub fn dest_id(&self) -> NodeId
pub fn dest_id(&self) -> NodeId
Get the id of the destination node in this graph
All graphs have a destination node, with one input port
Sourcepub fn add_extra_dest(&mut self, dest: NodeId)
pub fn add_extra_dest(&mut self, dest: NodeId)
Add additional terminator nodes
Sourcepub fn listener_id(&self) -> NodeId
pub fn listener_id(&self) -> NodeId
Get the id of the AudioListener in this graph
All graphs have a single listener, with no ports (but nine AudioParams)
N.B. The listener actually has a single output port containing its position data for the block, however this should not be exposed to the DOM.
Auto Trait Implementations§
impl Freeze for AudioGraph
impl !RefUnwindSafe for AudioGraph
impl Send for AudioGraph
impl !Sync for AudioGraph
impl Unpin for AudioGraph
impl !UnwindSafe for AudioGraph
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
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>
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>
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