diff options
author | Minijackson <minijackson@riseup.net> | 2018-09-04 12:33:44 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2018-09-04 12:33:44 +0200 |
commit | 515870c9e8ff833e50f5253ec6e6d43de97519ed (patch) | |
tree | 996a665bebfe847fe8c2ebdb371b3f15f3ce332f /src/parsing/equalizer_apo.rs | |
parent | a903881e79f30f73d0008f88c4b245defbe5b5c1 (diff) | |
download | set_eq-515870c9e8ff833e50f5253ec6e6d43de97519ed.tar.gz set_eq-515870c9e8ff833e50f5253ec6e6d43de97519ed.zip |
Rust stable compatibility + use amplitude decibel conversion
Diffstat (limited to 'src/parsing/equalizer_apo.rs')
-rw-r--r-- | src/parsing/equalizer_apo.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parsing/equalizer_apo.rs b/src/parsing/equalizer_apo.rs index 3fab396..a24cf99 100644 --- a/src/parsing/equalizer_apo.rs +++ b/src/parsing/equalizer_apo.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | // auto-generated: "lalrpop 0.15.2" | 1 | // auto-generated: "lalrpop 0.15.2" |
2 | // sha256: 81b6fa5856d7887b20715c2c7f6137db1927ece087e2db9f4bf1fcd8943365c5 | 2 | // sha256: a735e8f9bd5cf5f3aac915d12b24752d366481c3952258e22871eef395f44 |
3 | use ::Filter; | 3 | use ::Filter; |
4 | use std::str::FromStr; | 4 | use std::str::FromStr; |
5 | #[allow(unused_extern_crates)] | 5 | #[allow(unused_extern_crates)] |
@@ -880,7 +880,7 @@ fn __action1< | |||
880 | ) -> Filter | 880 | ) -> Filter |
881 | { | 881 | { |
882 | { | 882 | { |
883 | let coefficients: Vec<_> = eq.1.iter().map(|decibel| 10f64.powf(decibel / 10f64)).collect(); | 883 | let coefficients: Vec<_> = eq.1.iter().map(|decibel| 10f64.powf(decibel / 10f64).sqrt()).collect(); |
884 | // TODO: add decibel_to_ratio conversion function | 884 | // TODO: add decibel_to_ratio conversion function |
885 | let preamp = 10f64.powf(preamp / 10f64); | 885 | let preamp = 10f64.powf(preamp / 10f64); |
886 | Filter { preamp, frequencies: eq.0, coefficients } | 886 | Filter { preamp, frequencies: eq.0, coefficients } |