summaryrefslogtreecommitdiff
path: root/plugingui/maintab.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2020-05-02 13:48:23 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2020-05-02 13:48:23 +0200
commit2c395c676ebe4c821ac7126323ab0c15febb9bfe (patch)
tree13f6c49c208875c96b3f87d41ce8456c3441676a /plugingui/maintab.cc
parentc9134d86d393e3acba278d886482b84d3e4bf722 (diff)
Add new powermap widgget to the plugingui.
Diffstat (limited to 'plugingui/maintab.cc')
-rw-r--r--plugingui/maintab.cc40
1 files changed, 31 insertions, 9 deletions
diff --git a/plugingui/maintab.cc b/plugingui/maintab.cc
index e09d530..9959f7e 100644
--- a/plugingui/maintab.cc
+++ b/plugingui/maintab.cc
@@ -81,6 +81,15 @@ The pink areas indicate the spread of the position and velocity of the\n\
next note in line. The wider the area the more the note can move in time\n\
and velocity.";
+constexpr char power_tip[] = "\
+This function controls how the input powers are mapped to the powers that\n\
+DrumGizmo uses for selecting samples. You can control the function by dragging\n\
+and dropping the three colorful control points. Additionally, you can either\n\
+use a shelf, which draws a horizontal line from the green and red control\n\
+points to the left/right side. Or you can turn off the shelf, and then the\n\
+function goes through the lower left corner, then the three control points,\n\
+and then the upper right corner, enabling to draw more complicated functions.";
+
} // end anonymous namespace
namespace GUI
@@ -100,27 +109,30 @@ MainTab::MainTab(Widget* parent,
, timingframe_content{this, settings, settings_notifier}
, sampleselectionframe_content{this, settings, settings_notifier}
, visualizerframe_content{this, settings, settings_notifier}
+ , powerframe_content{this, settings, settings_notifier}
, settings(settings)
, settings_notifier(settings_notifier)
{
layout.setSpacing(0);
layout.setResizeChildren(true);
- add("Drumkit", drumkit_frame, drumkitframe_content, 15, 0);
- add("Status", status_frame, statusframe_content, 15, 0);
- add("Resampling", resampling_frame, resamplingframe_content, 10, 0);
- add("Disk Streaming", diskstreaming_frame, diskstreamingframe_content, 9, 0);
+ add("Drumkit", drumkit_frame, drumkitframe_content, 12, 0);
+ add("Status", status_frame, statusframe_content, 14, 0);
+ add("Resampling", resampling_frame, resamplingframe_content, 9, 0);
+ add("Disk Streaming", diskstreaming_frame, diskstreamingframe_content, 7, 0);
+ add("Bleed Control", bleedcontrol_frame, bleedcontrolframe_content, 7, 0);
- add("Velocity Humanizer", humanizer_frame, humanizerframe_content, 10, 1);
+ add("Velocity Humanizer", humanizer_frame, humanizerframe_content, 8, 1);
humanizer_frame.setHelpText(humanizer_tip);
- add("Timing Humanizer", timing_frame, timingframe_content, 10, 1);
+ add("Timing Humanizer", timing_frame, timingframe_content, 8, 1);
timing_frame.setHelpText(timing_tip);
add("Sample Selection", sampleselection_frame,
- sampleselectionframe_content, 10, 1);
+ sampleselectionframe_content, 8, 1);
sampleselection_frame.setHelpText(sampleselection_tip);
- add("Visualizer", visualizer_frame, visualizerframe_content, 10, 1);
+ add("Visualizer", visualizer_frame, visualizerframe_content, 8, 1);
visualizer_frame.setHelpText(visualizer_tip);
- add("Bleed Control", bleedcontrol_frame, bleedcontrolframe_content, 9, 1);
+ add("Velocity Curve", power_frame, powerframe_content, 17, 1);
+ power_frame.setHelpText(power_tip);
humanizer_frame.setOnSwitch(settings.enable_velocity_modifier);
bleedcontrol_frame.setOnSwitch(settings.enable_bleed_control);
@@ -146,6 +158,11 @@ MainTab::MainTab(Widget* parent,
this, &MainTab::timingOnChange);
CONNECT(&bleedcontrol_frame, onEnabledChanged,
&bleedcontrolframe_content, &BleedcontrolframeContent::setEnabled);
+
+ CONNECT(&settings_notifier, enable_powermap,
+ &power_frame, &FrameWidget::setOnSwitch);
+ CONNECT(&power_frame, onSwitchChangeNotifier,
+ this, &MainTab::powerOnChange);
}
void MainTab::resize(std::size_t width, std::size_t height)
@@ -178,6 +195,11 @@ void MainTab::timingOnChange(bool on)
settings.enable_latency_modifier.store(on);
}
+void MainTab::powerOnChange(bool on)
+{
+ settings.enable_powermap.store(on);
+}
+
void MainTab::add(std::string const& title, FrameWidget& frame, Widget& content,
std::size_t height, int column)
{