diff options
author | David Robillard <d@drobilla.net> | 2014-12-04 00:29:28 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-12-04 00:30:47 -0500 |
commit | 24727e65befc310f24196d11a56ec7b269977c16 (patch) | |
tree | e399a174cff1c328b4e7ebd71778cfcb81fc3383 /libs/ardour/ardour/dB.h | |
parent | 9b770c7aff5ad38d5363b232b85018a622596877 (diff) |
Make gain controls step by roughly 1.0/0.1 dB.
Shoot for roughly 30 steps for all controls.
Always keep sensible step information in ParameterDescriptor and just convert
for the UI.
This is a little weird, but it's less weird than it was before, and works.
Diffstat (limited to 'libs/ardour/ardour/dB.h')
-rw-r--r-- | libs/ardour/ardour/dB.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/ardour/ardour/dB.h b/libs/ardour/ardour/dB.h index 4d5f6c9f44..abacdfcd29 100644 --- a/libs/ardour/ardour/dB.h +++ b/libs/ardour/ardour/dB.h @@ -34,6 +34,11 @@ static inline float accurate_coefficient_to_dB (float coeff) { return 20.0f * log10f (coeff); } +static inline double dB_coeff_step(double max_coeff) { + const double max_db = lrint(accurate_coefficient_to_dB(max_coeff)); + return 0.1 * (max_coeff / max_db); +} + extern double zero_db_as_fraction; #endif /* __ardour_dB_h__ */ |