1
0
Fork 0

s2v_f32_panning() now strips C and R, not just L

This commit is contained in:
Jussi Viiri 2023-02-22 21:30:33 +02:00 committed by Robbert van der Helm
parent af5396d1f4
commit debb2662af

View file

@ -114,7 +114,7 @@ pub fn v2s_f32_panning() -> Arc<dyn Fn(f32) -> String + Send + Sync> {
pub fn s2v_f32_panning() -> Arc<dyn Fn(&str) -> Option<f32> + Send + Sync> { pub fn s2v_f32_panning() -> Arc<dyn Fn(&str) -> Option<f32> + Send + Sync> {
Arc::new(|string| { Arc::new(|string| {
let string = string.trim(); let string = string.trim();
let cleaned_string = string.trim_end_matches(&[' ', 'l', 'L']).parse().ok(); let cleaned_string = string.trim_end_matches(&[' ', 'l', 'L', 'c', 'C', 'r', 'R']).parse().ok();
match string.chars().last()?.to_uppercase().next()? { match string.chars().last()?.to_uppercase().next()? {
'L' => cleaned_string.map(|x: f32| x / -100.0), 'L' => cleaned_string.map(|x: f32| x / -100.0),
'C' => Some(0.0), 'C' => Some(0.0),