Skip to content

Commit 79fce11

Browse files
committed
Fixed Boolean Parameters
1 parent 8cc02d5 commit 79fce11

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

Plateau2/Plateau2.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,7 @@ void Plateau2::OnParamChange(int index)
362362
case kTunedMode1:
363363
{
364364
double size = GetParam(kSize1)->Value();
365-
bool tunedMode = GetParam(kTunedMode1)->Value();
366-
if (tunedMode) {
365+
if (GetParam(kTunedMode1)->Value()>=0.5) {
367366
reverb1.setTimeScale(0.0025f * powf(2.f, size * 5.f));
368367
}
369368
else {
@@ -399,10 +398,10 @@ void Plateau2::OnParamChange(int index)
399398
reverb1.setTankModShape(GetParam(index)->Value());
400399
break;
401400
case kDiffuseInput1:
402-
reverb1.enableInputDiffusion(GetParam(index)->Value());
401+
reverb1.enableInputDiffusion(GetParam(index)->Value()>=0.5);
403402
break;
404403
case kNesting1:
405-
reverb1.setTankDiffusionNesting(GetParam(index)->Value());
404+
reverb1.setTankDiffusionNesting(GetParam(index)->Value()>=0.5);
406405
break;
407406
case kDiffusionDecay1:
408407
{
@@ -443,8 +442,7 @@ void Plateau2::OnParamChange(int index)
443442
case kTunedMode2:
444443
{
445444
double size = GetParam(kSize2)->Value();
446-
bool tunedMode = GetParam(kTunedMode2)->Value();
447-
if (tunedMode) {
445+
if (GetParam(kTunedMode2)->Value()>=0.5) {
448446
reverb2.setTimeScale(0.0025f * powf(2.f, size * 5.f));
449447
}
450448
else {
@@ -480,10 +478,10 @@ void Plateau2::OnParamChange(int index)
480478
reverb2.setTankModShape(GetParam(index)->Value());
481479
break;
482480
case kDiffuseInput2:
483-
reverb2.enableInputDiffusion(GetParam(index)->Value());
481+
reverb2.enableInputDiffusion(GetParam(index)->Value()>=0.5);
484482
break;
485483
case kNesting2:
486-
reverb2.setTankDiffusionNesting(GetParam(index)->Value());
484+
reverb2.setTankDiffusionNesting(GetParam(index)->Value()>=0.5);
487485
break;
488486
case kDiffusionDecay2:
489487
{
@@ -539,11 +537,11 @@ void Plateau2::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
539537
for (int s = 0; s < nFrames; s++) {
540538
const double dryParam = GetParam(kDry)->Value() / 100;
541539

542-
const bool tank1Enabled = GetParam(kEnable1)->Value();
543-
const bool tank2Enabled = GetParam(kEnable2)->Value();
540+
const bool tank1Enabled = GetParam(kEnable1)->Value()>=0.5;
541+
const bool tank2Enabled = GetParam(kEnable2)->Value()>=0.5;
544542

545-
const bool send2to1 = tank2Enabled && GetParam(k2to1)->Value() && GetParam(kDanger)->Value();
546-
const bool send1to2 = tank1Enabled && GetParam(k1to2)->Value();
543+
const bool send2to1 = tank2Enabled && GetParam(k2to1)->Value() && GetParam(kDanger)->Value()>=0.5;
544+
const bool send1to2 = tank1Enabled && GetParam(k1to2)->Value()>=0.5;
547545

548546
outputs[0][s] = inputs[0][s] * dryParam;
549547
if (nChans > 1)
@@ -552,8 +550,8 @@ void Plateau2::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
552550
}
553551

554552
if (tank1Enabled) {
555-
const bool clear1Param = GetParam(kClear1)->Value() || GetParam(kClear)->Value();
556-
const bool freeze1Param = GetParam(kFreeze1)->Value();
553+
const bool clear1Param = GetParam(kClear1)->Value()>=0.5 || GetParam(kClear)->Value()>=0.5;
554+
const bool freeze1Param = GetParam(kFreeze1)->Value() >= 0.5;
557555
const double wet1Param = GetParam(kWet1)->Value() / 100;
558556
const double input1 = GetParam(kInput1)->Value() / 100;
559557
const double level2to1 = GetParam(k2to1Level)->Value() / 100;

Plateau2/controls/LEDSwitch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class LEDSwitch : public ISwitchControlBase
2323
}
2424

2525
virtual ~LEDSwitch() {}
26-
void Draw(IGraphics& g) override { g.DrawSVG(GetValue() >= 1. ? (tank2 ? mSVGOn2 : mSVGOn1) : mSVGOff, mRECT, &mBlend); }
26+
void Draw(IGraphics& g) override { g.DrawSVG(GetValue() >= 0.5 ? (tank2 ? mSVGOn2 : mSVGOn1) : mSVGOff, mRECT, &mBlend); }
2727
void OnMouseDown(float x, float y, const IMouseMod& mod) override {
2828
SetValue(GetValue() + 1.);
2929
if (GetValue() > 1.) {

0 commit comments

Comments
 (0)