librespot/src/mixer/mod.rs
2017-02-03 17:11:36 +01:00

23 lines
No EOL
480 B
Rust

use self::softmixer::SoftMixer;
pub mod softmixer;
pub trait Mixer {
fn start(&self);
fn stop(&self);
fn set_volume(&self, volume: u16);
fn volume(&self) -> u16;
fn get_audio_filter(&self) -> Option<Box<AudioFilter + Send>> {
None
}
}
pub trait AudioFilter {
fn modify_stream(&self, data: &mut [i16]);
}
pub fn find<T: AsRef<str>>(name: Option<T>) -> Option<Box<Mixer + Send>> {
match name {
_ => Some(Box::new(SoftMixer::new())),
}
}