summaryrefslogtreecommitdiff
path: root/plugingui/humanizerframecontent.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-04-17 16:33:45 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2017-04-17 16:33:58 +0200
commitcbb0f0f34e71630cb59ac4a831daf445f58a6427 (patch)
tree1114dd2b50aa4a63832e595bec445170f6ba12fb /plugingui/humanizerframecontent.cc
parentfebd5dec458e9fb066dab218b07d6c42b53ea5b1 (diff)
Connect humanizer controls to settings.
Diffstat (limited to 'plugingui/humanizerframecontent.cc')
-rw-r--r--plugingui/humanizerframecontent.cc51
1 files changed, 35 insertions, 16 deletions
diff --git a/plugingui/humanizerframecontent.cc b/plugingui/humanizerframecontent.cc
index 9795b76..d8363b9 100644
--- a/plugingui/humanizerframecontent.cc
+++ b/plugingui/humanizerframecontent.cc
@@ -26,38 +26,57 @@
*/
#include "humanizerframecontent.h"
+#include <settings.h>
+
#include "painter.h"
namespace GUI
{
-HumanizerframeContent::HumanizerframeContent(Widget* parent) : Widget(parent)
+HumanizerframeContent::HumanizerframeContent(Widget* parent,
+ Settings& settings,
+ SettingsNotifier& settings_notifier)
+ : Widget(parent)
+ , settings(settings)
+ , settings_notifier(settings_notifier)
{
// FIXME, is resizeChildren broken?
layout.setResizeChildren(true);
layout.setVAlignment(VAlignment::center);
attack.resize(80, 80);
- attackKnob.resize(30, 30);
- attackKnob.showValue(false);
- attack.setControl(&attackKnob);
+ attack_knob.resize(30, 30);
+ attack_knob.showValue(false);
+ attack.setControl(&attack_knob);
layout.addItem(&attack);
falloff.resize(80, 80);
- falloffKnob.resize(30, 30);
- falloffKnob.showValue(false);
- falloff.setControl(&falloffKnob);
+ falloff_knob.resize(30, 30);
+ falloff_knob.showValue(false);
+ falloff.setControl(&falloff_knob);
layout.addItem(&falloff);
- // TODO: connect the knobs to the right functions
- // CONNECT(&humanizeControls->velocityCheck, stateChangedNotifier,
- // this, &DGWindow::velocityCheckClick);
- //
- // CONNECT(&humanizeControls->attackKnob, valueChangedNotifier,
- // this, &DGWindow::attackValueChanged);
- //
- // CONNECT(&humanizeControls->falloffKnob, valueChangedNotifier,
- // this, &DGWindow::falloffValueChanged);
+ CONNECT(this, settings_notifier.velocity_modifier_falloff,
+ &falloff_knob, &Knob::setValue);
+ CONNECT(this, settings_notifier.velocity_modifier_weight,
+ &attack_knob, &Knob::setValue);
+
+ CONNECT(&attack_knob, valueChangedNotifier,
+ this, &HumanizerframeContent::attackValueChanged);
+
+ CONNECT(&falloff_knob, valueChangedNotifier,
+ this, &HumanizerframeContent::falloffValueChanged);
+
+}
+
+void HumanizerframeContent::attackValueChanged(float value)
+{
+ settings.velocity_modifier_weight.store(value);
+}
+
+void HumanizerframeContent::falloffValueChanged(float value)
+{
+ settings.velocity_modifier_falloff.store(value);
}
} // GUI::