Struct screech::Screech

source ·
pub struct Screech<MessageData = ()> {
    pub sample_rate: usize,
    /* private fields */
}
Expand description

Main helper struct to render and manage relations between crate::traits::Source types.

Fields§

§sample_rate: usize

sample rate field used for sampling

Implementations§

source§

impl<MessageData: 'static> Screech<MessageData>

source

pub fn new(buffer_size: usize, sample_rate: usize) -> Self

Create new Screech instance with a default tracker

source

pub fn with_tracker( tracker: Box<dyn Tracker<MessageData>>, sample_rate: usize ) -> Self

Create a new Screech instance with a supplied tracker

use screech::{Screech, BasicTracker};

let tracker = BasicTracker::<256>::new(8);
let screech = Screech::with_tracker(Box::new(tracker), 48_000);
source

pub fn invalidate_cache(&mut self)

invalidate connections cache

source

pub fn create_source_id(&mut self) -> usize

create new unique identifier

source

pub fn create_main_out(&mut self, signal_id: &'static str)

create new main output based on &'static str identifier

source

pub fn get_main_out(&self, signal_id: &'static str) -> Option<&Signal>

return output Signal based on &'static str identifier

source

pub fn init_input( &mut self, source_id: &usize, signal_id: &'static str ) -> Input

create and initialize a new input

source

pub fn init_output( &mut self, source_id: &usize, signal_id: &'static str ) -> Output

create and initialize a new output

source

pub fn connect_signal(&mut self, output: &Output, input: &Input)

connect an Output to an Input

source

pub fn disconnect_signal(&mut self, output: &Output, input: &Input)

disconnect an Output to an Input

source

pub fn connect_signal_to_main_out( &mut self, output: &Output, signal_id: &'static str )

connect an Output to a main output buffer

source

pub fn disconnect_signal_from_main_out( &mut self, output: &Output, signal_id: &'static str )

disconnect an Output from a main output buffer

source

pub fn sample( &mut self, unmapped_sources: &mut [&mut dyn Source<MessageData>] ) -> Result<(), ScreechError>

Sample multiple sources based on their dependencies into Signals stored in a traits::Tracker

Trait Implementations§

source§

impl<T> Send for Screech<T>

Auto Trait Implementations§

§

impl<MessageData = ()> !RefUnwindSafe for Screech<MessageData>

§

impl<MessageData = ()> !Sync for Screech<MessageData>

§

impl<MessageData> Unpin for Screech<MessageData>

§

impl<MessageData = ()> !UnwindSafe for Screech<MessageData>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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.

source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.