Trait screech::traits::Source [−][src]
pub trait Source {
fn sample(&mut self, sources: &mut dyn Tracker, sample_rate: usize);
fn get_source_id(&self) -> &usize;
fn get_sources(&self) -> Vec<usize>;
}
Expand description
To implement Source
means something can be a source of sound,
just like when sampling continous sources of sound into discrete slices.
Each component that is a sound source should be able to be “sampled”.
So no matter what when sampling a source it should return a
Signal
, this way each component has
to choose what to do in the case of failure, a sound processor
can choose to send the audio through unprocessed, or fail and send
silence instead
crate::basic::Clip
as an example implements Source
crate::basic::Track
as an example implements Source
crate::basic::Oscillator
as an example implements Source
Required methods
move one buffersize forward in discrete time
fn get_source_id(&self) -> &usize
fn get_source_id(&self) -> &usize
get id for instance, this is to identify this source when building the output
fn get_sources(&self) -> Vec<usize>
fn get_sources(&self) -> Vec<usize>
Get a list of sources