mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
fir rustfmt issues
This commit is contained in:
parent
b3966b0e08
commit
b1f2a412ad
2 changed files with 9 additions and 7 deletions
|
@ -171,8 +171,6 @@ fn initial_device_state(config: ConnectConfig, volume: u16) -> DeviceState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fn calc_logarithmic_volume(volume: u16) -> u16 {
|
fn calc_logarithmic_volume(volume: u16) -> u16 {
|
||||||
// Volume conversion taken from https://www.dr-lex.be/info-stuff/volumecontrols.html#ideal2
|
// Volume conversion taken from https://www.dr-lex.be/info-stuff/volumecontrols.html#ideal2
|
||||||
// Convert the given volume [0..0xffff] to a dB gain
|
// Convert the given volume [0..0xffff] to a dB gain
|
||||||
|
@ -532,8 +530,10 @@ impl SpircTask {
|
||||||
|
|
||||||
MessageType::kMessageTypeVolume => {
|
MessageType::kMessageTypeVolume => {
|
||||||
self.device.set_volume(frame.get_volume());
|
self.device.set_volume(frame.get_volume());
|
||||||
self.mixer
|
self.mixer.set_volume(volume_to_mixer(
|
||||||
.set_volume(volume_to_mixer(frame.get_volume() as u16, self.linear_volume));
|
frame.get_volume() as u16,
|
||||||
|
self.linear_volume,
|
||||||
|
));
|
||||||
self.notify(None);
|
self.notify(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -657,7 +657,8 @@ impl SpircTask {
|
||||||
volume = 0xFFFF;
|
volume = 0xFFFF;
|
||||||
}
|
}
|
||||||
self.device.set_volume(volume);
|
self.device.set_volume(volume);
|
||||||
self.mixer.set_volume(volume_to_mixer(volume as u16, self.linear_volume));
|
self.mixer
|
||||||
|
.set_volume(volume_to_mixer(volume as u16, self.linear_volume));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_volume_down(&mut self) {
|
fn handle_volume_down(&mut self) {
|
||||||
|
@ -666,7 +667,8 @@ impl SpircTask {
|
||||||
volume = 0;
|
volume = 0;
|
||||||
}
|
}
|
||||||
self.device.set_volume(volume as u32);
|
self.device.set_volume(volume as u32);
|
||||||
self.mixer.set_volume(volume_to_mixer(volume as u16, self.linear_volume));
|
self.mixer
|
||||||
|
.set_volume(volume_to_mixer(volume as u16, self.linear_volume));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_end_of_track(&mut self) {
|
fn handle_end_of_track(&mut self) {
|
||||||
|
|
|
@ -287,7 +287,7 @@ fn setup(args: &[String]) -> Setup {
|
||||||
name: name,
|
name: name,
|
||||||
device_type: device_type,
|
device_type: device_type,
|
||||||
volume: initial_volume,
|
volume: initial_volume,
|
||||||
linear_volume: matches.opt_present("linear-volume")
|
linear_volume: matches.opt_present("linear-volume"),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue