From 4d9ede3d127572efe2605d28f5930a475137e273 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 5 Nov 2017 13:57:32 +0100 Subject: Add stddev sample selection scalar to UI. --- plugingui/humanizerframecontent.cc | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'plugingui/humanizerframecontent.cc') 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:: -- cgit v1.2.3