Skip to content

Commit

Permalink
Set volume controller to Fixed when using None in the config. Thanks @…
Browse files Browse the repository at this point in the history
  • Loading branch information
Icelk committed Mar 6, 2023
1 parent ae28414 commit e0757fc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,25 @@ pub(crate) fn initial_state(config: config::SpotifydConfig) -> main_loop::MainLo
let autoplay = config.autoplay;
let device_id = session_config.device_id.clone();

let default_volume_ctrl = if matches!(config.volume_controller, config::VolumeController::None)
{
VolumeCtrl::Fixed
} else {
VolumeCtrl::default()
};

#[cfg(feature = "alsa_backend")]
let volume_ctrl = if matches!(
config.volume_controller,
config::VolumeController::AlsaLinear
) {
VolumeCtrl::Linear
} else {
VolumeCtrl::default()
default_volume_ctrl
};

#[cfg(not(feature = "alsa_backend"))]
let volume_ctrl = VolumeCtrl::default();
let volume_ctrl = default_volume_ctrl;

let zeroconf_port = config.zeroconf_port.unwrap_or(0);

Expand Down

0 comments on commit e0757fc

Please sign in to comment.