summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/humanizerframecontent.cc27
-rw-r--r--plugingui/humanizerframecontent.h4
2 files changed, 27 insertions, 4 deletions
diff --git a/plugingui/humanizerframecontent.cc b/plugingui/humanizerframecontent.cc
index 6753836..96b54a8 100644
--- a/plugingui/humanizerframecontent.cc
+++ b/plugingui/humanizerframecontent.cc
@@ -54,20 +54,29 @@ HumanizerframeContent::HumanizerframeContent(Widget* parent,
falloff.setControl(&falloff_knob);
layout.addItem(&falloff);
+ stddev.resize(80, 80);
+ stddev_knob.resize(30, 30);
+ stddev_knob.showValue(false);
+ stddev.setControl(&stddev_knob);
+ layout.addItem(&stddev);
+
layout.setPosition(&attack, GridLayout::GridRange{1, 2, 0, 1});
layout.setPosition(&falloff, GridLayout::GridRange{2, 3, 0, 1});
+ layout.setPosition(&stddev, GridLayout::GridRange{3, 3, 0, 1});
- CONNECT(this, settings_notifier.velocity_modifier_falloff,
- &falloff_knob, &Knob::setValue);
CONNECT(this, settings_notifier.velocity_modifier_weight,
&attack_knob, &Knob::setValue);
+ CONNECT(this, settings_notifier.velocity_modifier_falloff,
+ &falloff_knob, &Knob::setValue);
+ CONNECT(this, settings_notifier.velocity_stddev,
+ this, &HumanizerframeContent::stddevSettingsValueChanged);
CONNECT(&attack_knob, valueChangedNotifier,
this, &HumanizerframeContent::attackValueChanged);
-
CONNECT(&falloff_knob, valueChangedNotifier,
this, &HumanizerframeContent::falloffValueChanged);
-
+ CONNECT(&stddev_knob, valueChangedNotifier,
+ this, &HumanizerframeContent::stddevKnobValueChanged);
}
void HumanizerframeContent::attackValueChanged(float value)
@@ -80,4 +89,14 @@ void HumanizerframeContent::falloffValueChanged(float value)
settings.velocity_modifier_falloff.store(value);
}
+void HumanizerframeContent::stddevKnobValueChanged(float value)
+{
+ settings.velocity_stddev.store(value * 3.0f + 0.5f );
+}
+
+void HumanizerframeContent::stddevSettingsValueChanged(float value)
+{
+ stddev_knob.setValue((value - 0.5f) / 3.0f);
+}
+
} // GUI::
diff --git a/plugingui/humanizerframecontent.h b/plugingui/humanizerframecontent.h
index e13f739..61ba73b 100644
--- a/plugingui/humanizerframecontent.h
+++ b/plugingui/humanizerframecontent.h
@@ -93,14 +93,18 @@ public:
private:
void attackValueChanged(float value);
void falloffValueChanged(float value);
+ void stddevKnobValueChanged(float value);
+ void stddevSettingsValueChanged(float value);
GridLayout layout{this, 4, 1};
LabeledControl attack{this, "Attack"};
LabeledControl falloff{this, "Release"};
+ LabeledControl stddev{this, "StdDev"};
Knob attack_knob{&attack};
Knob falloff_knob{&falloff};
+ Knob stddev_knob{&stddev};
Settings& settings;
SettingsNotifier& settings_notifier;