commit bfb2c4cb52f4dcb089b39482e2af72fc0b77d0cc
parent a0ac4b7b58883179df3f7d5e12335426349a50c3
Author: Matt Demanett <matt@demanett.net>
Date: Sat, 28 Dec 2019 17:02:27 -0600
Fix module base class call of onReset, onSR to respect overrides.
Diffstat:
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/module.cpp b/src/module.cpp
@@ -15,6 +15,11 @@ void BGModule::onSampleRateChange() {
}
void BGModule::process(const ProcessArgs& args) {
+ if (_steps < 0) {
+ onReset();
+ onSampleRateChange();
+ }
+
processAll(args);
if (active()) {
++_steps;
diff --git a/src/module.hpp b/src/module.hpp
@@ -8,14 +8,12 @@ namespace bogaudio {
struct BGModule : Module {
int _modulationSteps = 100;
- int _steps = 0;
+ int _steps = -1;
static constexpr int maxChannels = PORT_MAX_CHANNELS;
int _channels = 0;
BGModule() {
- reset();
- onSampleRateChange();
}
virtual ~BGModule() {
while (_channels >= 1) {