diff options
author | André Nusser <andre.nusser@googlemail.com> | 2020-04-30 20:40:24 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2020-04-30 20:40:24 +0200 |
commit | 02ffd5a39bf36fb0fa4a4c068734747185fafcfa (patch) | |
tree | 133ffbaf0dd50164768478dccb1b390271a5a821 | |
parent | 1908c9efa50806ffc383d23da6b6d0d018ad6c8e (diff) |
Change names of setting values for powermap.
-rw-r--r-- | plugingui/powerwidget.cc | 62 | ||||
-rw-r--r-- | src/powermapfilter.cc | 8 | ||||
-rw-r--r-- | src/settings.h | 70 |
3 files changed, 70 insertions, 70 deletions
diff --git a/plugingui/powerwidget.cc b/plugingui/powerwidget.cc index c53a134..2d24fa0 100644 --- a/plugingui/powerwidget.cc +++ b/plugingui/powerwidget.cc @@ -52,13 +52,13 @@ PowerWidget::PowerWidget(GUI::Widget* parent, shelf_label.resize(59, 16); shelf_checkbox.resize(59, 40); - CONNECT(&settings_notifier, shelf, &shelf_checkbox, + CONNECT(&settings_notifier, powermap_shelf, &shelf_checkbox, &GUI::CheckBox::setChecked); } void PowerWidget::chk_shelf(bool v) { - settings.shelf.store(v); + settings.powermap_shelf.store(v); } void PowerWidget::repaintEvent(GUI::RepaintEvent *repaintEvent) @@ -91,19 +91,19 @@ PowerWidget::Canvas::Canvas(GUI::Widget* parent, { CONNECT(this, settings_notifier.enable_powermap, this, &PowerWidget::Canvas::parameterChangedBool); - CONNECT(this, settings_notifier.fixed0_x, + CONNECT(this, settings_notifier.powermap_fixed0_x, this, &PowerWidget::Canvas::parameterChangedFloat); - CONNECT(this, settings_notifier.fixed0_y, + CONNECT(this, settings_notifier.powermap_fixed0_y, this, &PowerWidget::Canvas::parameterChangedFloat); - CONNECT(this, settings_notifier.fixed1_x, + CONNECT(this, settings_notifier.powermap_fixed1_x, this, &PowerWidget::Canvas::parameterChangedFloat); - CONNECT(this, settings_notifier.fixed1_y, + CONNECT(this, settings_notifier.powermap_fixed1_y, this, &PowerWidget::Canvas::parameterChangedFloat); - CONNECT(this, settings_notifier.fixed2_x, + CONNECT(this, settings_notifier.powermap_fixed2_x, this, &PowerWidget::Canvas::parameterChangedFloat); - CONNECT(this, settings_notifier.fixed2_y, + CONNECT(this, settings_notifier.powermap_fixed2_y, this, &PowerWidget::Canvas::parameterChangedFloat); - CONNECT(this, settings_notifier.shelf, + CONNECT(this, settings_notifier.powermap_shelf, this, &PowerWidget::Canvas::parameterChangedBool); parameterChangedFloat(0); @@ -173,20 +173,20 @@ void PowerWidget::Canvas::repaintEvent(GUI::RepaintEvent *repaintEvent) // draw the fixed nodes of the spline float rad = radius * width(); p.setColour(GUI::Colour{0.0f, 1.0f, 0.0f, 0.7f}); - p.drawFilledCircle(x0 + settings.fixed0_x.load() * width0, - y0 + height0 - settings.fixed0_y.load() * height0, rad); + p.drawFilledCircle(x0 + settings.powermap_fixed0_x.load() * width0, + y0 + height0 - settings.powermap_fixed0_y.load() * height0, rad); p.drawCircle(x0 + power_map.getFixed0().in * width0, y0 + height0 - power_map.getFixed0().out * height0, rad + 1); p.setColour(GUI::Colour{1.0f, 1.0f, 0.0f, 0.7f}); - p.drawFilledCircle(x0 + settings.fixed1_x.load() * width0, - y0 + height0 - settings.fixed1_y.load() * height0, rad); + p.drawFilledCircle(x0 + settings.powermap_fixed1_x.load() * width0, + y0 + height0 - settings.powermap_fixed1_y.load() * height0, rad); p.drawCircle(x0 + power_map.getFixed1().in * width0, y0 + height0 - power_map.getFixed1().out * height0, rad + 1); p.setColour(GUI::Colour{1.0f, 0.0f, 0.0f, 0.7f}); - p.drawFilledCircle(x0 + settings.fixed2_x.load() * width0, - y0 + height0 - settings.fixed2_y.load() * height0, rad); + p.drawFilledCircle(x0 + settings.powermap_fixed2_x.load() * width0, + y0 + height0 - settings.powermap_fixed2_y.load() * height0, rad); p.drawCircle(x0 + power_map.getFixed2().in * width0, y0 + height0 - power_map.getFixed2().out * height0, rad + 1); } @@ -210,20 +210,20 @@ void PowerWidget::Canvas::buttonEvent(GUI::ButtonEvent* buttonEvent) in_point = -1; break; case GUI::Direction::down: - if(std::abs(mx0 - settings.fixed0_x.load()) < radius_x && - std::abs(my0 - settings.fixed0_y.load()) < radius_y) + if(std::abs(mx0 - settings.powermap_fixed0_x.load()) < radius_x && + std::abs(my0 - settings.powermap_fixed0_y.load()) < radius_y) { in_point = 0; } - if(std::abs(mx0 - settings.fixed1_x.load()) < radius_x && - std::abs(my0 - settings.fixed1_y.load()) < radius_y) + if(std::abs(mx0 - settings.powermap_fixed1_x.load()) < radius_x && + std::abs(my0 - settings.powermap_fixed1_y.load()) < radius_y) { in_point = 1; } - if(std::abs(mx0 - settings.fixed2_x.load()) < radius_x && - std::abs(my0 - settings.fixed2_y.load()) < radius_y) + if(std::abs(mx0 - settings.powermap_fixed2_x.load()) < radius_x && + std::abs(my0 - settings.powermap_fixed2_y.load()) < radius_y) { in_point = 2; } @@ -252,18 +252,18 @@ void PowerWidget::Canvas::mouseMoveEvent(GUI::MouseMoveEvent* mouseMoveEvent) switch(in_point) { case 0: - settings.fixed0_x.store(clamp(mx0, 0, 1)); - settings.fixed0_y.store(clamp(my0, 0, 1)); + settings.powermap_fixed0_x.store(clamp(mx0, 0, 1)); + settings.powermap_fixed0_y.store(clamp(my0, 0, 1)); redraw(); break; case 1: - settings.fixed1_x.store(clamp(mx0, 0, 1)); - settings.fixed1_y.store(clamp(my0, 0, 1)); + settings.powermap_fixed1_x.store(clamp(mx0, 0, 1)); + settings.powermap_fixed1_y.store(clamp(my0, 0, 1)); redraw(); break; case 2: - settings.fixed2_x.store(clamp(mx0, 0, 1)); - settings.fixed2_y.store(clamp(my0, 0, 1)); + settings.powermap_fixed2_x.store(clamp(mx0, 0, 1)); + settings.powermap_fixed2_y.store(clamp(my0, 0, 1)); redraw(); break; default: @@ -300,10 +300,10 @@ void PowerWidget::Canvas::mouseLeaveEvent() void PowerWidget::Canvas::parameterChangedFloat(float) { - power_map.setFixed0({settings.fixed0_x.load(), settings.fixed0_y.load()}); - power_map.setFixed1({settings.fixed1_x.load(), settings.fixed1_y.load()}); - power_map.setFixed2({settings.fixed2_x.load(), settings.fixed2_y.load()}); - power_map.setShelf(settings.shelf.load()); + power_map.setFixed0({settings.powermap_fixed0_x.load(), settings.powermap_fixed0_y.load()}); + power_map.setFixed1({settings.powermap_fixed1_x.load(), settings.powermap_fixed1_y.load()}); + power_map.setFixed2({settings.powermap_fixed2_x.load(), settings.powermap_fixed2_y.load()}); + power_map.setShelf(settings.powermap_shelf.load()); enabled = settings.enable_powermap.load(); redraw(); } diff --git a/src/powermapfilter.cc b/src/powermapfilter.cc index da88482..702a837 100644 --- a/src/powermapfilter.cc +++ b/src/powermapfilter.cc @@ -40,10 +40,10 @@ bool PowermapFilter::filter(event_t& event, size_t pos) if (settings.enable_powermap.load()) { - powermap.setFixed0({settings.fixed0_x.load(), settings.fixed0_y.load()}); - powermap.setFixed1({settings.fixed1_x.load(), settings.fixed1_y.load()}); - powermap.setFixed2({settings.fixed2_x.load(), settings.fixed2_y.load()}); - powermap.setShelf(settings.shelf.load()); + powermap.setFixed0({settings.powermap_fixed0_x.load(), settings.powermap_fixed0_y.load()}); + powermap.setFixed1({settings.powermap_fixed1_x.load(), settings.powermap_fixed1_y.load()}); + powermap.setFixed2({settings.powermap_fixed2_x.load(), settings.powermap_fixed2_y.load()}); + powermap.setShelf(settings.powermap_shelf.load()); event.velocity = powermap.map(event.velocity); } diff --git a/src/settings.h b/src/settings.h index 4755bb2..471d730 100644 --- a/src/settings.h +++ b/src/settings.h @@ -146,13 +146,13 @@ struct Settings // Powermap parameters Atomic<bool> enable_powermap; - Atomic<float> fixed0_x{0.}; - Atomic<float> fixed0_y{0.}; - Atomic<float> fixed1_x{.5}; - Atomic<float> fixed1_y{.5}; - Atomic<float> fixed2_x{1.}; - Atomic<float> fixed2_y{1.}; - Atomic<bool> shelf{true}; + Atomic<float> powermap_fixed0_x{0.}; + Atomic<float> powermap_fixed0_y{0.}; + Atomic<float> powermap_fixed1_x{.5}; + Atomic<float> powermap_fixed1_y{.5}; + Atomic<float> powermap_fixed2_x{1.}; + Atomic<float> powermap_fixed2_y{1.}; + Atomic<bool> powermap_shelf{true}; Atomic<std::size_t> audition_counter{0}; Atomic<std::string> audition_instrument; @@ -220,13 +220,13 @@ struct SettingsGetter SettingRef<float> latency_current; SettingRef<bool> enable_powermap; - SettingRef<float> fixed0_x; - SettingRef<float> fixed0_y; - SettingRef<float> fixed1_x; - SettingRef<float> fixed1_y; - SettingRef<float> fixed2_x; - SettingRef<float> fixed2_y; - SettingRef<bool> shelf; + SettingRef<float> powermap_fixed0_x; + SettingRef<float> powermap_fixed0_y; + SettingRef<float> powermap_fixed1_x; + SettingRef<float> powermap_fixed1_y; + SettingRef<float> powermap_fixed2_x; + SettingRef<float> powermap_fixed2_y; + SettingRef<bool> powermap_shelf; SettingRef<std::size_t> audition_counter; SettingRef<std::string> audition_instrument; @@ -277,13 +277,13 @@ struct SettingsGetter , latency_regain{settings.latency_regain} , latency_current{settings.latency_current} , enable_powermap{settings.enable_powermap} - , fixed0_x{settings.fixed0_x} - , fixed0_y{settings.fixed0_y} - , fixed1_x{settings.fixed1_x} - , fixed1_y{settings.fixed1_y} - , fixed2_x{settings.fixed2_x} - , fixed2_y{settings.fixed2_y} - , shelf{settings.shelf} + , powermap_fixed0_x{settings.powermap_fixed0_x} + , powermap_fixed0_y{settings.powermap_fixed0_y} + , powermap_fixed1_x{settings.powermap_fixed1_x} + , powermap_fixed1_y{settings.powermap_fixed1_y} + , powermap_fixed2_x{settings.powermap_fixed2_x} + , powermap_fixed2_y{settings.powermap_fixed2_y} + , powermap_shelf{settings.powermap_shelf} , audition_counter{settings.audition_counter} , audition_instrument{settings.audition_instrument} , audition_velocity{settings.audition_velocity} @@ -349,13 +349,13 @@ public: Notifier<float> latency_current; Notifier<bool> enable_powermap; - Notifier<float> fixed0_x; - Notifier<float> fixed0_y; - Notifier<float> fixed1_x; - Notifier<float> fixed1_y; - Notifier<float> fixed2_x; - Notifier<float> fixed2_y; - Notifier<bool> shelf; + Notifier<float> powermap_fixed0_x; + Notifier<float> powermap_fixed0_y; + Notifier<float> powermap_fixed1_x; + Notifier<float> powermap_fixed1_y; + Notifier<float> powermap_fixed2_x; + Notifier<float> powermap_fixed2_y; + Notifier<bool> powermap_shelf; Notifier<std::size_t> audition_counter; Notifier<std::string> audition_instrument; @@ -420,13 +420,13 @@ public: EVAL(latency_current); EVAL(enable_powermap); - EVAL(fixed0_x); - EVAL(fixed0_y); - EVAL(fixed1_x); - EVAL(fixed1_y); - EVAL(fixed2_x); - EVAL(fixed2_y); - EVAL(shelf); + EVAL(powermap_fixed0_x); + EVAL(powermap_fixed0_y); + EVAL(powermap_fixed1_x); + EVAL(powermap_fixed1_y); + EVAL(powermap_fixed2_x); + EVAL(powermap_fixed2_y); + EVAL(powermap_shelf); EVAL(audition_counter); EVAL(audition_instrument); |