mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Rename steepness to knee
This commit is contained in:
parent
5f26a745d7
commit
309e26456e
3 changed files with 12 additions and 19 deletions
|
@ -107,7 +107,7 @@ pub struct PlayerConfig {
|
||||||
pub normalisation_threshold: f32,
|
pub normalisation_threshold: f32,
|
||||||
pub normalisation_attack: f32,
|
pub normalisation_attack: f32,
|
||||||
pub normalisation_release: f32,
|
pub normalisation_release: f32,
|
||||||
pub normalisation_steepness: f32,
|
pub normalisation_knee: f32,
|
||||||
pub gapless: bool,
|
pub gapless: bool,
|
||||||
pub passthrough: bool,
|
pub passthrough: bool,
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ impl Default for PlayerConfig {
|
||||||
normalisation_threshold: -1.0,
|
normalisation_threshold: -1.0,
|
||||||
normalisation_attack: 0.005,
|
normalisation_attack: 0.005,
|
||||||
normalisation_release: 0.1,
|
normalisation_release: 0.1,
|
||||||
normalisation_steepness: 1.0,
|
normalisation_knee: 1.0,
|
||||||
gapless: true,
|
gapless: true,
|
||||||
passthrough: false,
|
passthrough: false,
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,10 +271,7 @@ impl NormalisationData {
|
||||||
if config.normalisation_method == NormalisationMethod::Dynamic {
|
if config.normalisation_method == NormalisationMethod::Dynamic {
|
||||||
debug!("Normalisation Attack: {:?}", config.normalisation_attack);
|
debug!("Normalisation Attack: {:?}", config.normalisation_attack);
|
||||||
debug!("Normalisation Release: {:?}", config.normalisation_release);
|
debug!("Normalisation Release: {:?}", config.normalisation_release);
|
||||||
debug!(
|
debug!("Normalisation Knee: {:?}", config.normalisation_knee);
|
||||||
"Normalisation Steepness: {:?}",
|
|
||||||
config.normalisation_steepness
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
normalisation_factor
|
normalisation_factor
|
||||||
|
@ -1176,7 +1173,7 @@ impl PlayerInternal {
|
||||||
if self.config.normalisation_method == NormalisationMethod::Dynamic
|
if self.config.normalisation_method == NormalisationMethod::Dynamic
|
||||||
{
|
{
|
||||||
if self.limiter_active {
|
if self.limiter_active {
|
||||||
// "S"-shaped curve with a configurable steepness during attack and release:
|
// "S"-shaped curve with a configurable knee during attack and release:
|
||||||
// - > 1.0 yields soft knees at start and end, steeper in between
|
// - > 1.0 yields soft knees at start and end, steeper in between
|
||||||
// - 1.0 yields a linear function from 0-100%
|
// - 1.0 yields a linear function from 0-100%
|
||||||
// - between 0.0 and 1.0 yields hard knees at start and end, flatter in between
|
// - between 0.0 and 1.0 yields hard knees at start and end, flatter in between
|
||||||
|
@ -1191,7 +1188,7 @@ impl PlayerInternal {
|
||||||
+ f32::powf(
|
+ f32::powf(
|
||||||
shaped_limiter_strength
|
shaped_limiter_strength
|
||||||
/ (1.0 - shaped_limiter_strength),
|
/ (1.0 - shaped_limiter_strength),
|
||||||
-1.0 * self.config.normalisation_steepness,
|
-1.0 * self.config.normalisation_knee,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
actual_normalisation_factor =
|
actual_normalisation_factor =
|
||||||
|
|
18
src/main.rs
18
src/main.rs
|
@ -238,9 +238,9 @@ fn setup(args: &[String]) -> Setup {
|
||||||
)
|
)
|
||||||
.optopt(
|
.optopt(
|
||||||
"",
|
"",
|
||||||
"normalisation-steepness",
|
"normalisation-knee",
|
||||||
"Steepness of the dynamic limiting curve. Default is 1.0.",
|
"Knee steepness of the dynamic limiter. Default is 1.0.",
|
||||||
"STEEPNESS",
|
"KNEE",
|
||||||
)
|
)
|
||||||
.optopt(
|
.optopt(
|
||||||
"",
|
"",
|
||||||
|
@ -475,14 +475,10 @@ fn setup(args: &[String]) -> Setup {
|
||||||
.map(|release| release.parse::<f32>().expect("Invalid release float value"))
|
.map(|release| release.parse::<f32>().expect("Invalid release float value"))
|
||||||
.unwrap_or(PlayerConfig::default().normalisation_release * MILLIS)
|
.unwrap_or(PlayerConfig::default().normalisation_release * MILLIS)
|
||||||
/ MILLIS,
|
/ MILLIS,
|
||||||
normalisation_steepness: matches
|
normalisation_knee: matches
|
||||||
.opt_str("normalisation-steepness")
|
.opt_str("normalisation-knee")
|
||||||
.map(|steepness| {
|
.map(|knee| knee.parse::<f32>().expect("Invalid knee float value"))
|
||||||
steepness
|
.unwrap_or(PlayerConfig::default().normalisation_knee),
|
||||||
.parse::<f32>()
|
|
||||||
.expect("Invalid steepness float value")
|
|
||||||
})
|
|
||||||
.unwrap_or(PlayerConfig::default().normalisation_steepness),
|
|
||||||
passthrough,
|
passthrough,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue