commit 55efe851bebd645ad4233b7b6ace78878eaaaaf0
parent 952460b7eac1eb8ec5b0def3fd64c606fb2a41ad
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date: Mon, 12 Jul 2021 17:49:51 +0200
More fixes
Diffstat:
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/examples/plugins/dc-offset/dc-offset.cc b/examples/plugins/dc-offset/dc-offset.cc
@@ -30,9 +30,9 @@ namespace clap {
DcOffset::DcOffset(const clap_host *host) : PluginHelper(descriptor(), host) {
parameters_.addParameter(clap_param_info{
.id = kParamIdOffset,
+ .flags = 0,
.name = "offset",
.module = "/",
- .flags = 0,
.min_value = -1,
.max_value = 1,
.default_value = 0,
@@ -88,26 +88,27 @@ namespace clap {
std::terminate();
}
- if (ev->time > i)
- {
+ if (ev->time > i) {
// This event is in the future
N = std::min(ev->time, process->frames_count);
break;
}
switch (ev->type) {
- case CLAP_EVENT_PARAM_VALUE:
+ case CLAP_EVENT_PARAM_VALUE: {
auto p = parameters_.getById(ev->param_value.param_id);
if (p)
p->setValue(ev->param_value.value);
break;
+ }
- case CLAP_EVENT_PARAM_MOD:
+ case CLAP_EVENT_PARAM_MOD: {
auto p = parameters_.getById(ev->param_mod.param_id);
if (p)
p->setModulation(ev->param_mod.amount);
break;
}
+ }
}
/* Process as many samples as possible until the next event */
diff --git a/examples/plugins/gain/gain.cc b/examples/plugins/gain/gain.cc
@@ -29,9 +29,9 @@ namespace clap {
Gain::Gain(const clap_host *host) : PluginHelper(descriptor(), host) {
parameters_.addParameter(clap_param_info{
.id = kParamIdGain,
+ .flags = 0,
.name = "gain",
.module = "/",
- .flags = 0,
.min_value = -1,
.max_value = 1,
.default_value = 0,
diff --git a/examples/plugins/parameters.hh b/examples/plugins/parameters.hh
@@ -32,6 +32,10 @@ namespace clap {
void setModulation(double mod) { modulation_ = mod; }
+ void step(uint32_t n) {
+ // TODO smooth
+ }
+
private:
clap_param_info info_;