pub enum UnifiedKnystCommands {
    Real(Rc<RefCell<MultiThreadedKnystCommands>>),
    Dummy(DummyKnystCommands),
}
Expand description

Represents and possible implementor of KnystCommands

Variants§

Trait Implementations§

source§

impl KnystCommands for UnifiedKnystCommands

source§

fn push_without_inputs(&mut self, gen_or_graph: impl GenOrGraph) -> NodeId

Push a Gen or Graph to the top level Graph without specifying any inputs.
source§

fn push( &mut self, gen_or_graph: impl GenOrGraph, inputs: impl Into<InputBundle> ) -> NodeId

Push a Gen or Graph to the default Graph.
source§

fn push_to_graph_without_inputs( &mut self, gen_or_graph: impl GenOrGraph, graph_id: GraphId ) -> NodeId

Push a Gen or Graph to the Graph with the specified id without specifying inputs.
source§

fn push_to_graph( &mut self, gen_or_graph: impl GenOrGraph, graph_id: GraphId, inputs: impl Into<InputBundle> ) -> NodeId

Push a Gen or Graph to the Graph with the specified id.
source§

fn connect(&mut self, connection: Connection)

Create a new connections
source§

fn connect_bundle(&mut self, bundle: impl Into<ConnectionBundle>)

Make several connections at once using any of the ConnectionBundle notations
source§

fn schedule_beat_callback( &mut self, callback: impl FnMut(Beats, &mut MultiThreadedKnystCommands) -> Option<Beats> + Send + 'static, start_time: StartBeat ) -> CallbackHandle

Add a new beat callback. See BeatCallback for documentation.
source§

fn disconnect(&mut self, connection: Connection)

Disconnect (undo) a Connection
source§

fn free_disconnected_nodes(&mut self)

Free any nodes that are not currently connected to the graph’s outputs via any chain of connections.
source§

fn free_node_mend_connections(&mut self, node: NodeId)

Free a node and try to mend connections between the inputs and the outputs of the node.
source§

fn free_node(&mut self, node: NodeId)

Free a node.
source§

fn schedule_change(&mut self, change: ParameterChange)

Schedule a change to be made. Read more
source§

fn schedule_changes(&mut self, changes: SimultaneousChanges)

Schedule multiple changes to be made. Read more
source§

fn insert_buffer(&mut self, buffer: Buffer) -> BufferId

Inserts a new buffer in the Resources and returns an id which can be converted to a key on the audio thread with access to a Resources.
source§

fn remove_buffer(&mut self, buffer_id: BufferId)

Remove a buffer from the Resources
source§

fn replace_buffer(&mut self, buffer_id: BufferId, buffer: Buffer)

Replace a buffer in the Resources
source§

fn insert_wavetable(&mut self, wavetable: Wavetable) -> WavetableId

Inserts a new wavetable in the Resources and returns an id which can be converted to a key on the audio thread with access to a Resources.
source§

fn remove_wavetable(&mut self, wavetable_id: WavetableId)

Remove a wavetable from the Resources
source§

fn replace_wavetable(&mut self, id: WavetableId, wavetable: Wavetable)

Replace a wavetable in the Resources
source§

fn change_musical_time_map( &mut self, change_fn: impl FnOnce(&mut MusicalTimeMap) + Send + 'static )

Make a change to the shared MusicalTimeMap
source§

fn default_graph_settings(&self) -> GraphSettings

Return the GraphSettings of the top level graph. This means you don’t have to manually keep track of matching sample rate and block size for example.
source§

fn init_local_graph(&mut self, settings: GraphSettings) -> GraphId

Creates a new local graph and sets it as the default graph
source§

fn upload_local_graph(&mut self) -> Option<Handle<GraphHandle>>

Upload the local graph to the previously default graph and restore the default graph to that previous default graph.
source§

fn request_inspection(&mut self) -> Receiver<GraphInspection>

Request a GraphInspection of the top level graph which will be sent back in the returned channel
source§

fn to_graph(&mut self, graph_id: GraphId)

Set knyst commands on the current thread to use the selected GraphId by default
source§

fn to_top_level_graph(&mut self)

Set knyst commands on the current thread to use the top level GraphId by default
source§

fn start_scheduling_bundle(&mut self, time: Time)

Start a scheduling bundle, meaning any change scheduled will not be applied until KnystCommands::upload_scheduling_bundle is called. Prefer using schedule_bundle as it is more difficult to misuse.
source§

fn upload_scheduling_bundle(&mut self)

Uploads scheduled changes to the graph and schedules them for the time specified in KnystCommands::start_scheduling_bundle. Prefer schedule_bundle to help reinforce scoping and potential thread switches.
source§

fn current_graph(&self) -> GraphId

Get the id of the currently active graph
source§

fn set_mortality(&mut self, node: NodeId, is_mortal: bool)

Sets the mortality of a node to mortal (true) or immortal (false). An immortal node cannot be freed.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast for T
where T: Any,

source§

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>

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)

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)

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,