pub struct AudioNode {
pub id: String,
pub name: Option<String>,
pub node_type: NodeType,
pub effects: Vec<(String, Value)>,
pub parameters: HashMap<String, f32>,
}Expand description
Audio Node: source of audio or container of other nodes
Fields§
§id: StringUnique identifier
name: Option<String>Human-readable name (optional)
node_type: NodeTypeType of node
effects: Vec<(String, Value)>Effect chain: list of (effect_name, parameters)
parameters: HashMap<String, f32>Node parameters (e.g., volume, pan)
Implementations§
Source§impl AudioNode
impl AudioNode
Sourcepub fn new_sample(id: impl Into<String>) -> Self
pub fn new_sample(id: impl Into<String>) -> Self
Create new sample node
Sourcepub fn new_master() -> Self
pub fn new_master() -> Self
Create master output node
Sourcepub fn add_effect(&mut self, name: impl Into<String>, params: Value)
pub fn add_effect(&mut self, name: impl Into<String>, params: Value)
Add effect to effect chain
Sourcepub fn set_parameter(&mut self, name: impl Into<String>, value: f32)
pub fn set_parameter(&mut self, name: impl Into<String>, value: f32)
Set node parameter
Sourcepub fn get_parameter(&self, name: &str) -> Option<f32>
pub fn get_parameter(&self, name: &str) -> Option<f32>
Get node parameter
Sourcepub fn set_volume(&mut self, vol: f32)
pub fn set_volume(&mut self, vol: f32)
Set volume (linear scale: 0.0 to 2.0+)
Sourcepub fn is_container(&self) -> bool
pub fn is_container(&self) -> bool
Check if node is a container
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AudioNode
impl RefUnwindSafe for AudioNode
impl Send for AudioNode
impl Sync for AudioNode
impl Unpin for AudioNode
impl UnsafeUnpin for AudioNode
impl UnwindSafe for AudioNode
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,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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