summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2022-01-08 12:43:07 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2022-01-22 23:15:29 +0100
commit414606b64aa6c6cf3209861b81a92a6af873937f (patch)
tree408992e785dde59748aa2f94bd8666f190575567 /plugingui
parent235ad6fbbce2e0ae9e06db960a5ba3b099936ace (diff)
Make UI events const refs and celan up redundant use of virtual with override.event_cleanup
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/bleedcontrolframecontent.h2
-rw-r--r--plugingui/diskstreamingframecontent.h2
-rw-r--r--plugingui/drumkitframecontent.h4
-rw-r--r--plugingui/drumkittab.cc28
-rw-r--r--plugingui/drumkittab.h6
-rw-r--r--plugingui/filebrowser.cc2
-rw-r--r--plugingui/filebrowser.h4
-rw-r--r--plugingui/humaniservisualiser.cc4
-rw-r--r--plugingui/humaniservisualiser.h6
-rw-r--r--plugingui/mainwindow.cc2
-rw-r--r--plugingui/mainwindow.h2
-rw-r--r--plugingui/powerwidget.cc30
-rw-r--r--plugingui/powerwidget.h14
-rw-r--r--plugingui/resamplingframecontent.h2
-rw-r--r--plugingui/statusframecontent.h2
-rw-r--r--plugingui/visualizerframecontent.h4
16 files changed, 57 insertions, 57 deletions
diff --git a/plugingui/bleedcontrolframecontent.h b/plugingui/bleedcontrolframecontent.h
index fadb98e..f7b3227 100644
--- a/plugingui/bleedcontrolframecontent.h
+++ b/plugingui/bleedcontrolframecontent.h
@@ -44,7 +44,7 @@ public:
SettingsNotifier& settings_notifier);
// From Widget
- virtual void resize(std::size_t width, std::size_t height) override;
+ void resize(std::size_t width, std::size_t height) override;
void setEnabled(bool enabled);
diff --git a/plugingui/diskstreamingframecontent.h b/plugingui/diskstreamingframecontent.h
index 10ed90a..14ae855 100644
--- a/plugingui/diskstreamingframecontent.h
+++ b/plugingui/diskstreamingframecontent.h
@@ -46,7 +46,7 @@ public:
SettingsNotifier& settings_notifier);
// From Widget
- virtual void resize(std::size_t width, std::size_t height) override;
+ void resize(std::size_t width, std::size_t height) override;
private:
void limitSettingsValueChanged(std::size_t value);
diff --git a/plugingui/drumkitframecontent.h b/plugingui/drumkitframecontent.h
index 4c5cc9e..ac52a96 100644
--- a/plugingui/drumkitframecontent.h
+++ b/plugingui/drumkitframecontent.h
@@ -48,7 +48,7 @@ public:
BrowseFile(dggui::Widget* parent);
// From Widget
- virtual void resize(std::size_t width, std::size_t height) override;
+ void resize(std::size_t width, std::size_t height) override;
std::size_t getLineEditWidth();
std::size_t getButtonWidth();
@@ -77,7 +77,7 @@ public:
Config& config);
// From Widget
- virtual void resize(std::size_t width, std::size_t height) override;
+ void resize(std::size_t width, std::size_t height) override;
void kitBrowseClick();
void midimapBrowseClick();
diff --git a/plugingui/drumkittab.cc b/plugingui/drumkittab.cc
index 6323e94..1245bba 100644
--- a/plugingui/drumkittab.cc
+++ b/plugingui/drumkittab.cc
@@ -82,13 +82,13 @@ void DrumkitTab::resize(std::size_t width, std::size_t height)
height-instrument_name_label.height()-5);
}
-void DrumkitTab::buttonEvent(dggui::ButtonEvent* buttonEvent)
+void DrumkitTab::buttonEvent(const dggui::ButtonEvent& buttonEvent)
{
if(map_image)
{
- if(buttonEvent->button == dggui::MouseButton::right)
+ if(buttonEvent.button == dggui::MouseButton::right)
{
- if(buttonEvent->direction == dggui::Direction::down)
+ if(buttonEvent.direction == dggui::Direction::down)
{
dggui::Painter painter(*this);
painter.drawImage(drumkit_image_x, drumkit_image_y, *map_image);
@@ -97,7 +97,7 @@ void DrumkitTab::buttonEvent(dggui::ButtonEvent* buttonEvent)
return;
}
- if(buttonEvent->direction == dggui::Direction::up)
+ if(buttonEvent.direction == dggui::Direction::up)
{
dggui::Painter painter(*this);
painter.clear();
@@ -112,16 +112,16 @@ void DrumkitTab::buttonEvent(dggui::ButtonEvent* buttonEvent)
}
}
- if(buttonEvent->button == dggui::MouseButton::left)
+ if(buttonEvent.button == dggui::MouseButton::left)
{
- if(buttonEvent->direction == dggui::Direction::down)
+ if(buttonEvent.direction == dggui::Direction::down)
{
- triggerAudition(buttonEvent->x, buttonEvent->y);
+ triggerAudition(buttonEvent.x, buttonEvent.y);
highlightInstrument(current_index);
redraw();
}
- if(buttonEvent->direction == dggui::Direction::up)
+ if(buttonEvent.direction == dggui::Direction::up)
{
if(shows_instrument_overlay)
{
@@ -140,21 +140,21 @@ void DrumkitTab::buttonEvent(dggui::ButtonEvent* buttonEvent)
}
}
-void DrumkitTab::scrollEvent(dggui::ScrollEvent* scrollEvent)
+void DrumkitTab::scrollEvent(const dggui::ScrollEvent& scrollEvent)
{
- current_velocity -= 0.01 * scrollEvent->delta;
+ current_velocity -= 0.01 * scrollEvent.delta;
current_velocity = std::max(std::min(current_velocity, 1.0f), 0.0f);
updateVelocityLabel();
velocity_label.resizeToText();
- triggerAudition(scrollEvent->x, scrollEvent->y);
+ triggerAudition(scrollEvent.x, scrollEvent.y);
}
-void DrumkitTab::mouseMoveEvent(dggui::MouseMoveEvent* mouseMoveEvent)
+void DrumkitTab::mouseMoveEvent(const dggui::MouseMoveEvent& mouseMoveEvent)
{
// change to image coordinates
- const auto x = mouseMoveEvent->x - drumkit_image_x;
- const auto y = mouseMoveEvent->y - drumkit_image_y;
+ const auto x = mouseMoveEvent.x - drumkit_image_x;
+ const auto y = mouseMoveEvent.y - drumkit_image_y;
auto index = pos_to_colour_index(x, y);
diff --git a/plugingui/drumkittab.h b/plugingui/drumkittab.h
index ad89fb1..f513276 100644
--- a/plugingui/drumkittab.h
+++ b/plugingui/drumkittab.h
@@ -54,9 +54,9 @@ public:
// From dggui::Widget:
void resize(std::size_t width, std::size_t height) override;
- void buttonEvent(dggui::ButtonEvent* buttonEvent) override;
- void scrollEvent(dggui::ScrollEvent* scrollEvent) override;
- void mouseMoveEvent(dggui::MouseMoveEvent* mouseMoveEvent) override;
+ void buttonEvent(const dggui::ButtonEvent& buttonEvent) override;
+ void scrollEvent(const dggui::ScrollEvent& scrollEvent) override;
+ void mouseMoveEvent(const dggui::MouseMoveEvent& mouseMoveEvent) override;
void mouseLeaveEvent() override;
void init(const std::string& image_file, const std::string& map_file);
diff --git a/plugingui/filebrowser.cc b/plugingui/filebrowser.cc
index d4fc009..433ece2 100644
--- a/plugingui/filebrowser.cc
+++ b/plugingui/filebrowser.cc
@@ -139,7 +139,7 @@ void FileBrowser::resize(std::size_t width, std::size_t height)
btn_sel.resize(btn_w, btn_h);
}
-void FileBrowser::repaintEvent(dggui::RepaintEvent* repaintEvent)
+void FileBrowser::repaintEvent(const dggui::RepaintEvent& repaintEvent)
{
dggui::Painter p(*this);
p.drawImageStretched(0,0, back, width(), height());
diff --git a/plugingui/filebrowser.h b/plugingui/filebrowser.h
index 0620ef3..eef3c33 100644
--- a/plugingui/filebrowser.h
+++ b/plugingui/filebrowser.h
@@ -54,8 +54,8 @@ public:
// From Widget:
bool isFocusable() override { return true; }
- virtual void repaintEvent(dggui::RepaintEvent* repaintEvent) override;
- virtual void resize(std::size_t width, std::size_t height) override;
+ void repaintEvent(const dggui::RepaintEvent& repaintEvent) override;
+ void resize(std::size_t width, std::size_t height) override;
//! Return the filename selected in the browser.
std::string getFilename() const;
diff --git a/plugingui/humaniservisualiser.cc b/plugingui/humaniservisualiser.cc
index 1045e31..426ec52 100644
--- a/plugingui/humaniservisualiser.cc
+++ b/plugingui/humaniservisualiser.cc
@@ -45,7 +45,7 @@ HumaniserVisualiser::HumaniserVisualiser(dggui::Widget* parent,
canvas.move(7, 7);
}
-void HumaniserVisualiser::repaintEvent(dggui::RepaintEvent *repaintEvent)
+void HumaniserVisualiser::repaintEvent(const dggui::RepaintEvent& repaintEvent)
{
dggui::Painter p(*this);
@@ -90,7 +90,7 @@ HumaniserVisualiser::Canvas::Canvas(dggui::Widget* parent,
this, &HumaniserVisualiser::Canvas::velocityStddevChanged);
}
-void HumaniserVisualiser::Canvas::repaintEvent(dggui::RepaintEvent *repaintEvent)
+void HumaniserVisualiser::Canvas::repaintEvent(const dggui::RepaintEvent& repaintEvent)
{
if(width() < 1 || height() < 1)
{
diff --git a/plugingui/humaniservisualiser.h b/plugingui/humaniservisualiser.h
index 028f10d..75aabd7 100644
--- a/plugingui/humaniservisualiser.h
+++ b/plugingui/humaniservisualiser.h
@@ -45,8 +45,8 @@ public:
SettingsNotifier& settings_notifier);
// From Widget:
- virtual void repaintEvent(dggui::RepaintEvent *repaintEvent) override;
- virtual void resize(std::size_t width, std::size_t height) override;
+ void repaintEvent(const dggui::RepaintEvent& repaintEvent) override;
+ void resize(std::size_t width, std::size_t height) override;
private:
dggui::TexturedBox box{getImageCache(), ":resources/widget.png",
@@ -62,7 +62,7 @@ private:
SettingsNotifier& settings_notifier);
// From Widget:
- virtual void repaintEvent(dggui::RepaintEvent *repaintEvent) override;
+ void repaintEvent(const dggui::RepaintEvent& repaintEvent) override;
void latencyEnabledChanged(bool enabled);
void velocityEnabledChanged(bool enabled);
diff --git a/plugingui/mainwindow.cc b/plugingui/mainwindow.cc
index a4ad7b5..357ae5d 100644
--- a/plugingui/mainwindow.cc
+++ b/plugingui/mainwindow.cc
@@ -81,7 +81,7 @@ bool MainWindow::processEvents()
return true;
}
-void MainWindow::repaintEvent(dggui::RepaintEvent* repaintEvent)
+void MainWindow::repaintEvent(const dggui::RepaintEvent& repaintEvent)
{
if(!visible())
{
diff --git a/plugingui/mainwindow.h b/plugingui/mainwindow.h
index ae0da8b..253800d 100644
--- a/plugingui/mainwindow.h
+++ b/plugingui/mainwindow.h
@@ -65,7 +65,7 @@ private:
void changeDrumkitTabVisibility(bool visible);
// From Widget
- void repaintEvent(dggui::RepaintEvent* repaintEvent) override final;
+ void repaintEvent(const dggui::RepaintEvent& repaintEvent) override final;
Config config;
SettingsNotifier settings_notifier;
diff --git a/plugingui/powerwidget.cc b/plugingui/powerwidget.cc
index 9be0c48..b61fd82 100644
--- a/plugingui/powerwidget.cc
+++ b/plugingui/powerwidget.cc
@@ -66,7 +66,7 @@ void PowerWidget::chk_shelf(bool v)
settings.powermap_shelf.store(v);
}
-void PowerWidget::repaintEvent(dggui::RepaintEvent *repaintEvent)
+void PowerWidget::repaintEvent(const dggui::RepaintEvent& repaintEvent)
{
dggui::Painter p(*this);
box.setSize(width() - 59 - 64, height());
@@ -118,7 +118,7 @@ PowerWidget::Canvas::Canvas(dggui::Widget* parent,
parameterChangedFloat(0);
}
-void PowerWidget::Canvas::repaintEvent(dggui::RepaintEvent *repaintEvent)
+void PowerWidget::Canvas::repaintEvent(const dggui::RepaintEvent& repaintEvent)
{
if(width() < 1 || height() < 1)
{
@@ -214,20 +214,20 @@ void PowerWidget::Canvas::repaintEvent(dggui::RepaintEvent *repaintEvent)
p.drawText(8, height() / 2 - (font.textWidth(_("out")) / 2), font, _("out"), false, true);
}
-void PowerWidget::Canvas::buttonEvent(dggui::ButtonEvent* buttonEvent)
+void PowerWidget::Canvas::buttonEvent(const dggui::ButtonEvent& buttonEvent)
{
const float x0 = brd;
const float y0 = brd;
const float width0 = (int)width() - 2 * brd;
const float height0 = (int)height() - 2 * brd;
- float mx0 = (float)(buttonEvent->x - x0) / width0;
- float my0 = (float)(((int)height() - buttonEvent->y) - y0) / height0;
+ float mx0 = (float)(buttonEvent.x - x0) / width0;
+ float my0 = (float)(((int)height() - buttonEvent.y) - y0) / height0;
float radius_x = radius * 2;
float radius_y = radius * width0 / height0 * 2;
- switch(buttonEvent->direction)
+ switch(buttonEvent.direction)
{
case dggui::Direction::up:
in_point = -1;
@@ -262,15 +262,15 @@ float clamp(float val, float min, float max)
}
}
-void PowerWidget::Canvas::mouseMoveEvent(dggui::MouseMoveEvent* mouseMoveEvent)
+void PowerWidget::Canvas::mouseMoveEvent(const dggui::MouseMoveEvent& mouseMoveEvent)
{
const float x0 = brd;
const float y0 = brd;
const float width0 = (int)width() - 2 * brd;
const float height0 = (int)height() - 2 * brd;
- float mx0 = (float)(mouseMoveEvent->x - x0) / width0;
- float my0 = (float)(((int)height() - mouseMoveEvent->y) - y0) / height0;
+ float mx0 = (float)(mouseMoveEvent.x - x0) / width0;
+ float my0 = (float)(((int)height() - mouseMoveEvent.y) - y0) / height0;
switch(in_point)
{
@@ -296,18 +296,18 @@ void PowerWidget::Canvas::mouseMoveEvent(dggui::MouseMoveEvent* mouseMoveEvent)
switch(in_point)
{
case 0:
- settings.fixed0_x.store(clamp((float)mouseMoveEvent->x / width()));
- settings.fixed0_y.store(1.0f - clamp((float)mouseMoveEvent->y / height()));
+ settings.fixed0_x.store(clamp((float)mouseMoveEvent.x / width()));
+ settings.fixed0_y.store(1.0f - clamp((float)mouseMoveEvent.y / height()));
redraw();
break;
case 1:
- settings.fixed1_x.store(clamp((float)mouseMoveEvent->x / width()));
- settings.fixed1_y.store(1.0f - clamp((float)mouseMoveEvent->y / height()));
+ settings.fixed1_x.store(clamp((float)mouseMoveEvent.x / width()));
+ settings.fixed1_y.store(1.0f - clamp((float)mouseMoveEvent.y / height()));
redraw();
break;
case 2:
- settings.fixed2_x.store(clamp((float)mouseMoveEvent->x / width()));
- settings.fixed2_y.store(1.0f - clamp((float)mouseMoveEvent->y / height()));
+ settings.fixed2_x.store(clamp((float)mouseMoveEvent.x / width()));
+ settings.fixed2_y.store(1.0f - clamp((float)mouseMoveEvent.y / height()));
redraw();
break;
default:
diff --git a/plugingui/powerwidget.h b/plugingui/powerwidget.h
index 3a7bb8e..6080b37 100644
--- a/plugingui/powerwidget.h
+++ b/plugingui/powerwidget.h
@@ -51,8 +51,8 @@ public:
SettingsNotifier& settings_notifier);
// From Widget:
- virtual void repaintEvent(dggui::RepaintEvent *repaintEvent) override;
- virtual void resize(std::size_t width, std::size_t height) override;
+ void repaintEvent(const dggui::RepaintEvent& repaintEvent) override;
+ void resize(std::size_t width, std::size_t height) override;
private:
dggui::TexturedBox box{getImageCache(), ":resources/widget.png",
@@ -68,11 +68,11 @@ private:
SettingsNotifier& settings_notifier);
// From Widget:
- virtual bool catchMouse() override { return true; }
- virtual void repaintEvent(dggui::RepaintEvent *repaintEvent) override;
- virtual void buttonEvent(dggui::ButtonEvent* buttonEvent) override;
- virtual void mouseMoveEvent(dggui::MouseMoveEvent* mouseMoveEvent) override;
- virtual void mouseLeaveEvent() override;
+ bool catchMouse() override { return true; }
+ void repaintEvent(const dggui::RepaintEvent& repaintEvent) override;
+ void buttonEvent(const dggui::ButtonEvent& buttonEvent) override;
+ void mouseMoveEvent(const dggui::MouseMoveEvent& mouseMoveEvent) override;
+ void mouseLeaveEvent() override;
private:
Powermap power_map;
diff --git a/plugingui/resamplingframecontent.h b/plugingui/resamplingframecontent.h
index 3bdddc6..758fb63 100644
--- a/plugingui/resamplingframecontent.h
+++ b/plugingui/resamplingframecontent.h
@@ -46,7 +46,7 @@ public:
SettingsNotifier& settings_notifier);
// From Widget
- virtual void resize(std::size_t width, std::size_t height) override;
+ void resize(std::size_t width, std::size_t height) override;
private:
void updateContent();
diff --git a/plugingui/statusframecontent.h b/plugingui/statusframecontent.h
index 55f7a16..123df89 100644
--- a/plugingui/statusframecontent.h
+++ b/plugingui/statusframecontent.h
@@ -44,7 +44,7 @@ public:
SettingsNotifier& settings_notifier);
// From Widget
- virtual void resize(std::size_t width, std::size_t height) override;
+ void resize(std::size_t width, std::size_t height) override;
void updateContent();
diff --git a/plugingui/visualizerframecontent.h b/plugingui/visualizerframecontent.h
index abf54c4..3579f9f 100644
--- a/plugingui/visualizerframecontent.h
+++ b/plugingui/visualizerframecontent.h
@@ -48,8 +48,8 @@ public:
VisualizerframeContent(dggui::Widget* parent, Settings& settings,
SettingsNotifier& settings_notifier);
- // From Widget
- virtual void resize(std::size_t width, std::size_t height) override;
+ // From Widget
+ void resize(std::size_t width, std::size_t height) override;
private:
HumaniserVisualiser visualizer;