pub struct NodeChanges { /* private fields */ }Expand description
Multiple changes to the input values of a certain node. See Change for
what kinds of changes can be scheduled. All methods return Self so it can be chained:
§Example
use knyst::graph::{NodeChanges, NodeId, SimultaneousChanges};
// In reality, use a real NodeAddress that points to a node.
let my_node = NodeId::new(0);
let node_changes = NodeChanges::new(my_node).set("freq", 442.0).set("amp", 0.5).trigger("reset");
// equivalent to:
// let node_changes = my_node.change().set("freq", 442.0).set("amp", 0.5).trigger("reset");
let mut simultaneous_changes = SimultaneousChanges::now();
simultaneous_changes.push(node_changes);Implementations§
Source§impl NodeChanges
impl NodeChanges
Sourcepub fn set(self, channel: impl Into<NodeChannel>, value: Sample) -> Self
pub fn set(self, channel: impl Into<NodeChannel>, value: Sample) -> Self
Adds a new value to set for a specific channel. Can be chained.
Sourcepub fn trigger(self, channel: impl Into<NodeChannel>) -> Self
pub fn trigger(self, channel: impl Into<NodeChannel>) -> Self
Adds a trigger for a specific channel. Can be chained.
Sourcepub fn time_offset(self, offset: TimeOffset) -> Self
pub fn time_offset(self, offset: TimeOffset) -> Self
Add this time offset to all the Changes in the NodeChanges. If
you want different offsets for different settings to the same node you
can create multiple NodeChanges.
With the Time::Immediately timing variant for the
SimultaneousChanges only positive offsets are allowed.
Trait Implementations§
Source§impl Clone for NodeChanges
impl Clone for NodeChanges
Source§fn clone(&self) -> NodeChanges
fn clone(&self) -> NodeChanges
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 moreAuto Trait Implementations§
impl Freeze for NodeChanges
impl RefUnwindSafe for NodeChanges
impl Send for NodeChanges
impl Sync for NodeChanges
impl Unpin for NodeChanges
impl UnwindSafe for NodeChanges
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.