Struct amethyst_audio::DjSystem
[−]
[src]
pub struct DjSystem<F, R> { /* fields omitted */ }
Calls a closure if the AudioSink
is empty.
Methods
impl<F, R> DjSystem<F, R>
[src]
pub fn new(f: F) -> Self
[src]
Creates a new DjSystem
with the music picker being f
.
The closure takes a parameter, which needs to be a reference to
a resource type, e.g. &MusicLibrary
. This resource will be fetched
by the system and passed to the picker.
Trait Implementations
impl<'a, F, R> System<'a> for DjSystem<F, R> where
F: FnMut(&mut R) -> Option<SourceHandle>,
R: Resource,
[src]
F: FnMut(&mut R) -> Option<SourceHandle>,
R: Resource,
type SystemData = (Read<'a, AssetStorage<Source>>, Read<'a, Errors>, Option<Read<'a, AudioSink>>, WriteExpect<'a, R>)
The resource bundle required to execute this system. Read more
fn run(&mut self, (storage, errors, sink, res): Self::SystemData)
[src]
Executes the system with the required system data. Read more
fn setup(&mut self, res: &mut Resources)
[src]
Sets up the Resources
using Self::SystemData::setup
.
fn running_time(&self) -> RunningTime
Returns a hint how long the system needs for running. This is used to optimize the way they're executed (might allow more parallelization). Read more
fn accessor(&'b self) -> AccessorCow<'a, 'b, Self>
Return the accessor from the [SystemData
].