Browse Source

Change helper and rack0.hpp to use new configParam method. Add dsp::Counter::getCount().

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
dbb4d67a60
3 changed files with 6 additions and 2 deletions
  1. +1
    -1
      helper.py
  2. +4
    -0
      include/dsp/digital.hpp
  3. +1
    -1
      include/rack0.hpp

+ 1
- 1
helper.py View File

@@ -407,7 +407,7 @@ struct {identifier} : Module {{"""


for c in components['params']: for c in components['params']:
source += f""" source += f"""
params[{c['name']}_PARAM].config(0.f, 1.f, 0.f, "");"""
configParam({c['name']}_PARAM, 0.f, 1.f, 0.f, "");"""


source += """ source += """
} }


+ 4
- 0
include/dsp/digital.hpp View File

@@ -151,6 +151,10 @@ struct Counter {
reset(); reset();
} }


int getCount() {
return count;
}

/** Returns true when the counter reaches `period` and resets. */ /** Returns true when the counter reaches `period` and resets. */
bool process() { bool process() {
count++; count++;


+ 1
- 1
include/rack0.hpp View File

@@ -120,7 +120,7 @@ template <class TParamWidget>
DEPRECATED TParamWidget *createParam(math::Vec pos, Module *module, int paramId, float minValue, float maxValue, float defaultValue) { DEPRECATED TParamWidget *createParam(math::Vec pos, Module *module, int paramId, float minValue, float maxValue, float defaultValue) {
TParamWidget *o = createParam<TParamWidget>(pos, module, paramId); TParamWidget *o = createParam<TParamWidget>(pos, module, paramId);
if (module) { if (module) {
module->params[paramId].config(minValue, maxValue, defaultValue);
module->configParam(paramId, minValue, maxValue, defaultValue)
} }
return o; return o;
} }


Loading…
Cancel
Save