fix: validate input index in Mixer and update parameter count in plugin info
This commit is contained in:
parent
386f8b7e54
commit
970cb6049d
4 changed files with 16 additions and 10 deletions
|
|
@ -9,7 +9,7 @@
|
|||
#define DISTRHO_PLUGIN_NUM_INPUTS 2
|
||||
#define DISTRHO_PLUGIN_NUM_OUTPUTS 2
|
||||
|
||||
#define DISTRHO_PLUGIN_NUM_PARAMETERS 2
|
||||
#define DISTRHO_PLUGIN_NUM_PARAMETERS 5
|
||||
|
||||
#define DISTRHO_PLUGIN_WANT_PROGRAMS 0
|
||||
#define DISTRHO_PLUGIN_WANT_STATE 0
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
#include "DistrhoPlugin.hpp"
|
||||
#include "DistrhoPluginInfo.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "../../core/Clipper.hpp"
|
||||
#include "../../core/Filter.hpp"
|
||||
#include "../../core/Gain.hpp"
|
||||
|
|
@ -121,7 +123,9 @@ protected:
|
|||
gain_.setGain(value);
|
||||
break;
|
||||
case kParamClipMode:
|
||||
clipper_.setMode((Clipper::ClipperMode)value);
|
||||
value = std::fmin(std::fmax(value, 0.0f),
|
||||
static_cast<float>(Clipper::kClipperModeCount - 1));
|
||||
clipper_.setMode(static_cast<Clipper::ClipperMode>(std::lround(value)));
|
||||
break;
|
||||
case kParamFilter:
|
||||
filter_.setCutOff(value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue