summaryrefslogtreecommitdiff
path: root/plugingui/humanizerframecontent.cc
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2018-06-08 16:40:01 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2018-06-08 16:40:01 +0200
commit42003bd802d868182bf040e86f2cf2773b8ee851 (patch)
tree86c345b86d0d7567ee1301fb28f20bcc11e80f97 /plugingui/humanizerframecontent.cc
parentc00110f801ae9de05a7f4c250918e4c05588b1d9 (diff)
Add reset on double click for all the knobs.
Diffstat (limited to 'plugingui/humanizerframecontent.cc')
-rw-r--r--plugingui/humanizerframecontent.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/plugingui/humanizerframecontent.cc b/plugingui/humanizerframecontent.cc
index dbb6007..51725d6 100644
--- a/plugingui/humanizerframecontent.cc
+++ b/plugingui/humanizerframecontent.cc
@@ -45,18 +45,21 @@ HumanizerframeContent::HumanizerframeContent(Widget* parent,
attack.resize(80, 80);
attack_knob.resize(30, 30);
attack_knob.showValue(false);
+ attack_knob.setDefaultValue(Settings::velocity_modifier_weight_default);
attack.setControl(&attack_knob);
layout.addItem(&attack);
falloff.resize(80, 80);
falloff_knob.resize(30, 30);
falloff_knob.showValue(false);
+ falloff_knob.setDefaultValue(Settings::velocity_modifier_falloff_default);
falloff.setControl(&falloff_knob);
layout.addItem(&falloff);
stddev.resize(80, 80);
stddev_knob.resize(30, 30);
stddev_knob.showValue(false);
+ stddev_knob.setDefaultValue(stddevSettingsToKnob(Settings::velocity_stddev_default));
stddev.setControl(&stddev_knob);
layout.addItem(&stddev);
@@ -79,6 +82,16 @@ HumanizerframeContent::HumanizerframeContent(Widget* parent,
this, &HumanizerframeContent::stddevKnobValueChanged);
}
+float HumanizerframeContent::stddevSettingsToKnob(float value)
+{
+ return (value - 0.5f) / 3.0f;
+}
+
+float HumanizerframeContent::stddevKnobToSettings(float value)
+{
+ return value * 3.0f + 0.5f;
+}
+
void HumanizerframeContent::attackValueChanged(float value)
{
settings.velocity_modifier_weight.store(value);
@@ -91,12 +104,14 @@ void HumanizerframeContent::falloffValueChanged(float value)
void HumanizerframeContent::stddevKnobValueChanged(float value)
{
- settings.velocity_stddev.store(value * 3.0f + 0.5f );
+ auto settings_value = stddevKnobToSettings(value);
+ settings.velocity_stddev.store(settings_value);
}
void HumanizerframeContent::stddevSettingsValueChanged(float value)
{
- stddev_knob.setValue((value - 0.5f) / 3.0f);
+ auto knob_value = stddevSettingsToKnob(value);
+ stddev_knob.setValue(knob_value);
}
} // GUI::