From 8b4855a40b61930bada341cd89f2917d0d952377 Mon Sep 17 00:00:00 2001 From: Krzysztof Foltman Date: Sun, 18 Jan 2009 14:01:29 +0000 Subject: [PATCH] + LADSPA: make the hint guessing logic compatible with logarithmic ports (makes default values for Reverb sane again) --- src/calf/ladspa_wrap.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calf/ladspa_wrap.h b/src/calf/ladspa_wrap.h index 5e6ae53..fdd3332 100644 --- a/src/calf/ladspa_wrap.h +++ b/src/calf/ladspa_wrap.h @@ -201,6 +201,8 @@ struct ladspa_wrapper break; default: { int defpt = (int)(100 * (pp.def_value - pp.min) / (pp.max - pp.min)); + if ((pp.flags & PF_SCALEMASK) == PF_SCALE_LOG) + defpt = (int)(100 * log(pp.def_value / pp.min) / log(pp.max / pp.min)); if (defpt < 12) prh.HintDescriptor |= LADSPA_HINT_DEFAULT_MINIMUM; else if (defpt < 37) -- 2.11.4.GIT