Rename set_factor to update_normalisation_data to better indicate what it does

This commit is contained in:
JasonLG1979 2023-06-23 11:24:10 -05:00
parent bfb0366c90
commit 5da8ddf5e2
3 changed files with 9 additions and 4 deletions

View file

@ -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);
} }

View file

@ -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,
); );

View file

@ -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<()> {