clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit b3739835bb4849f861a6637df74d34fc5732283c
parent 8a7f6e6b7d38c3324ec80cdbaa238941a596d3da
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date:   Tue, 31 Aug 2021 11:14:44 +0200

param.step() also return the latest value

Diffstat:
Mexamples/plugins/dc-offset/dc-offset.cc | 3+--
Mexamples/plugins/parameters.hh | 4+++-
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/examples/plugins/dc-offset/dc-offset.cc b/examples/plugins/dc-offset/dc-offset.cc @@ -88,10 +88,9 @@ namespace clap { /* Process as many samples as possible until the next event */ for (; i < N; ++i) { - float offset = offsetParam_->value(); + float offset = offsetParam_->step(1); for (int c = 0; c < channelCount_; ++c) out[c][i] = in[c][i] + offset; - offsetParam_->step(1); } } diff --git a/examples/plugins/parameters.hh b/examples/plugins/parameters.hh @@ -32,8 +32,10 @@ namespace clap { void setModulation(double mod) { modulation_ = mod; } - void step(uint32_t n) { + // Advances the value by n samples and return the new value + modulation + double step(uint32_t n) { // TODO smooth + return value_ + modulation_; } private: