mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-06 03:50:06 +02:00
Add initial support for alsamixer
This commit is contained in:
parent
a41ab28540
commit
a67048c3d7
6 changed files with 108 additions and 30 deletions
|
@ -90,7 +90,7 @@ struct Setup {
|
|||
backend: fn(Option<String>) -> Box<Sink>,
|
||||
device: Option<String>,
|
||||
|
||||
mixer: fn() -> Box<Mixer>,
|
||||
mixer: fn(Option<String>) -> Box<Mixer>,
|
||||
|
||||
cache: Option<Cache>,
|
||||
player_config: PlayerConfig,
|
||||
|
@ -335,7 +335,7 @@ struct Main {
|
|||
connect_config: ConnectConfig,
|
||||
backend: fn(Option<String>) -> Box<Sink>,
|
||||
device: Option<String>,
|
||||
mixer: fn() -> Box<Mixer>,
|
||||
mixer: fn(Option<String>) -> Box<Mixer>,
|
||||
handle: Handle,
|
||||
|
||||
discovery: Option<DiscoveryStream>,
|
||||
|
@ -423,12 +423,13 @@ impl Future for Main {
|
|||
if let Async::Ready(session) = self.connect.poll().unwrap() {
|
||||
self.connect = Box::new(futures::future::empty());
|
||||
let device = self.device.clone();
|
||||
let mixer = (self.mixer)();
|
||||
let mixer = (self.mixer)(device);
|
||||
let player_config = self.player_config.clone();
|
||||
let connect_config = self.connect_config.clone();
|
||||
|
||||
let audio_filter = mixer.get_audio_filter();
|
||||
let backend = self.backend;
|
||||
let device = self.device.clone();
|
||||
let (player, event_channel) =
|
||||
Player::new(player_config, session.clone(), audio_filter, move || {
|
||||
(backend)(device)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue