mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Rename set_factor to update_normalisation_data to better indicate what it does
This commit is contained in:
parent
bfb0366c90
commit
5da8ddf5e2
3 changed files with 9 additions and 4 deletions
|
@ -246,7 +246,11 @@ impl Normaliser {
|
||||||
self.normalisation.stop();
|
self.normalisation.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_factor(&mut self, auto_normalise_as_album: bool, data: NormalisationData) {
|
pub fn update_normalisation_data(
|
||||||
|
&mut self,
|
||||||
|
auto_normalise_as_album: bool,
|
||||||
|
data: NormalisationData,
|
||||||
|
) {
|
||||||
if self.normalisation != Normalisation::None {
|
if self.normalisation != Normalisation::None {
|
||||||
self.factor = self.get_factor(auto_normalise_as_album, data);
|
self.factor = self.get_factor(auto_normalise_as_album, data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1459,7 +1459,7 @@ impl PlayerInternal {
|
||||||
|
|
||||||
let position_ms = loaded_track.stream_position_ms;
|
let position_ms = loaded_track.stream_position_ms;
|
||||||
|
|
||||||
self.sample_pipeline.set_normalisation_factor(
|
self.sample_pipeline.update_normalisation_data(
|
||||||
self.auto_normalise_as_album,
|
self.auto_normalise_as_album,
|
||||||
loaded_track.normalisation_data,
|
loaded_track.normalisation_data,
|
||||||
);
|
);
|
||||||
|
|
|
@ -57,12 +57,13 @@ impl SamplePipeline {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_normalisation_factor(
|
pub fn update_normalisation_data(
|
||||||
&mut self,
|
&mut self,
|
||||||
auto_normalise_as_album: bool,
|
auto_normalise_as_album: bool,
|
||||||
data: NormalisationData,
|
data: NormalisationData,
|
||||||
) {
|
) {
|
||||||
self.normaliser.set_factor(auto_normalise_as_album, data);
|
self.normaliser
|
||||||
|
.update_normalisation_data(auto_normalise_as_album, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write(&mut self, packet: AudioPacket) -> SinkResult<()> {
|
pub fn write(&mut self, packet: AudioPacket) -> SinkResult<()> {
|
||||||
|
|
Loading…
Reference in a new issue