INNER CODE UNIT · Rust

headless

shawnscode/crayon · modules/audio/src/mixer/mod.rs:42

    pub fn headless(
        clips: Arc<RwLock<ResourcePool<AudioClipHandle, AudioClipLoader>>>,
    ) -> Result<Self> {
        let tx = Arc::new(RwLock::new(Vec::new()));
        headless::run(tx.clone())?;

        Ok(Mixer {
            sources: RwLock::new(HandlePool::new()),
            tx: tx,
            clips: clips,
        })
    }
}

impl Drop for Mixer {
    fn drop(&mut self) {
        let cmd = Command::Discard;
        self.tx.write().unwrap().push(cmd);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…