From dbb4d67a6055b476a3b618c573e230263798e99c Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 11 Apr 2019 17:32:54 -0400 Subject: [PATCH] Change helper and rack0.hpp to use new configParam method. Add dsp::Counter::getCount(). --- helper.py | 2 +- include/dsp/digital.hpp | 4 ++++ include/rack0.hpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/helper.py b/helper.py index 5ddf2a44..e7d029b6 100755 --- a/helper.py +++ b/helper.py @@ -407,7 +407,7 @@ struct {identifier} : Module {{""" for c in components['params']: source += f""" - params[{c['name']}_PARAM].config(0.f, 1.f, 0.f, "");""" + configParam({c['name']}_PARAM, 0.f, 1.f, 0.f, "");""" source += """ } diff --git a/include/dsp/digital.hpp b/include/dsp/digital.hpp index 79cb66e9..ecc6083b 100644 --- a/include/dsp/digital.hpp +++ b/include/dsp/digital.hpp @@ -151,6 +151,10 @@ struct Counter { reset(); } + int getCount() { + return count; + } + /** Returns true when the counter reaches `period` and resets. */ bool process() { count++; diff --git a/include/rack0.hpp b/include/rack0.hpp index 40797144..32e323d0 100644 --- a/include/rack0.hpp +++ b/include/rack0.hpp @@ -120,7 +120,7 @@ template DEPRECATED TParamWidget *createParam(math::Vec pos, Module *module, int paramId, float minValue, float maxValue, float defaultValue) { TParamWidget *o = createParam(pos, module, paramId); if (module) { - module->params[paramId].config(minValue, maxValue, defaultValue); + module->configParam(paramId, minValue, maxValue, defaultValue) } return o; }