1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-05 02:39:53 +02:00

Refactored to have apply_volume in a specifix mixer

This commit is contained in:
Daniel Romero 2017-01-20 20:39:05 +01:00
parent 7be9626836
commit 347bf05dbe
5 changed files with 75 additions and 24 deletions

View file

@ -18,6 +18,7 @@ use librespot::audio_backend::{self, BACKENDS};
use librespot::cache::{Cache, DefaultCache, NoCache};
use librespot::player::Player;
use librespot::session::{Bitrate, Config, Session};
use librespot::mixer::softmixer::SoftMixer;
use librespot::version;
fn usage(program: &str, opts: &getopts::Options) -> String {
@ -120,8 +121,10 @@ fn setup(args: &[String]) -> (Session, Player) {
matches.opt_str("password"));
session.login(credentials).unwrap();
let mixer = SoftMixer::new();
let device_name = matches.opt_str("device");
let player = Player::new(session.clone(), move || {
let player = Player::new(session.clone(), Box::new(mixer), move || {
(backend)(device_name.as_ref().map(AsRef::as_ref))
});