Browse Source

fix Alikins.SpecificValue module

pull/1639/head
bsp2 6 years ago
parent
commit
32ce73fe33
2 changed files with 29 additions and 15 deletions
  1. +2
    -0
      plugins/community/repos/Alikins/src/MsDisplayWidget.hpp
  2. +27
    -15
      plugins/community/repos/Alikins/src/SpecificValue.cpp

+ 2
- 0
plugins/community/repos/Alikins/src/MsDisplayWidget.hpp View File

@@ -1,6 +1,7 @@
#include <sstream>
#include <iomanip>

namespace rack_plugin_Alikins {

// From AS DelayPlus.cpp https://github.com/AScustomWorks/AS
struct MsDisplayWidget : TransparentWidget {
@@ -47,3 +48,4 @@ struct MsDisplayWidget : TransparentWidget {
}
};

} // namespace rack_plugin_Alikins

+ 27
- 15
plugins/community/repos/Alikins/src/SpecificValue.cpp View File

@@ -20,7 +20,7 @@ struct SpecificValue : Module
};
enum InputIds
{
VALUE1_INPUT,
VALUE1_INPUT,
NUM_INPUTS
};
enum OutputIds
@@ -431,7 +431,7 @@ SmallPurpleTrimpot::SmallPurpleTrimpot() : Trimpot() {
}

struct PurpleTrimpot : Trimpot {
Module *module;
Module *module;
bool initialized = false;
PurpleTrimpot();
void step() override;
@@ -450,22 +450,34 @@ PurpleTrimpot::PurpleTrimpot() : Trimpot() {
// over the trimpot, we kind of jitter arround.
// maybe run this via an onChange()?
void PurpleTrimpot::step() {
//debug("paramId=%d this->initialized: %d initialized: %d this->value: %f value: %f param.value: %f",
//debug("paramId=%d this->initialized: %d initialized: %d this->value: %f value: %f param.value: %f",
// paramId, this->initialized, initialized, this->value, value, module->params[paramId].value);

if (this->value != module->params[paramId].value) {
if (this != RACK_PLUGIN_UI_HOVERED_WIDGET && this->initialized) {
// this->value = module->params[paramId].value;
setValue(module->params[paramId].value);
} else {
module->params[paramId].value = this->value;
if(module->inputs[SpecificValue::VALUE1_INPUT].active)
{
if (this->value != module->params[paramId].value) {
if (this != RACK_PLUGIN_UI_HOVERED_WIDGET && this->initialized) {
// // // this->value = module->params[paramId].value;
setValue(module->params[paramId].value);
}
else
{
module->params[paramId].value = this->value;
this->initialized |= true;
}
EventChange e;
onChange(e);
}
EventChange e;
onChange(e);
}
}
}
else
{
module->params[paramId].value = this->value;
this->initialized |= true;
EventChange e;
onChange(e);
}

Trimpot::step();
Trimpot::step();
}

void PurpleTrimpot::reset() {
@@ -627,7 +639,7 @@ void SpecificValueWidget::step() {
prev_octave = module->params[SpecificValue::OCTAVE_PARAM].value;
prev_input = module->params[SpecificValue::VALUE1_INPUT].value;
EventChange e;
onChange(e);
onChange(e);
}
}



Loading…
Cancel
Save