summaryrefslogtreecommitdiffhomepage
path: root/tracker-tobii-eyex
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-tobii-eyex')
-rw-r--r--tracker-tobii-eyex/tobii-eyex-dialog.ui49
-rw-r--r--tracker-tobii-eyex/tobii-eyex.cpp16
-rw-r--r--tracker-tobii-eyex/tobii-eyex.hpp12
3 files changed, 42 insertions, 35 deletions
diff --git a/tracker-tobii-eyex/tobii-eyex-dialog.ui b/tracker-tobii-eyex/tobii-eyex-dialog.ui
index 81fc13d6..1a85f417 100644
--- a/tracker-tobii-eyex/tobii-eyex-dialog.ui
+++ b/tracker-tobii-eyex/tobii-eyex-dialog.ui
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>715</width>
+ <width>710</width>
<height>440</height>
</rect>
</property>
@@ -208,25 +208,6 @@
</property>
</widget>
</item>
- <item row="0" column="2">
- <widget class="QSlider" name="speed">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="tickPosition">
- <enum>QSlider::TicksAbove</enum>
- </property>
- <property name="tickInterval">
- <number>25</number>
- </property>
- </widget>
- </item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
@@ -563,11 +544,30 @@
</property>
</widget>
</item>
+ <item row="0" column="2">
+ <widget class="QSlider" name="speed">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="tickPosition">
+ <enum>QSlider::TicksAbove</enum>
+ </property>
+ <property name="tickInterval">
+ <number>25</number>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
<item>
- <widget class="QFunctionConfigurator" name="relative_mode_gain" native="true">
+ <widget class="spline_widget" name="relative_mode_gain" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
@@ -616,6 +616,13 @@
</item>
</layout>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>spline_widget</class>
+ <extends>QWidget</extends>
+ <header>spline-widget/spline-widget.hpp</header>
+ </customwidget>
+ </customwidgets>
<resources>
<include location="tobii-eyex-res.qrc"/>
</resources>
diff --git a/tracker-tobii-eyex/tobii-eyex.cpp b/tracker-tobii-eyex/tobii-eyex.cpp
index 709f1b8f..74c31240 100644
--- a/tracker-tobii-eyex/tobii-eyex.cpp
+++ b/tracker-tobii-eyex/tobii-eyex.cpp
@@ -44,14 +44,14 @@ static constexpr t clamp(t datum, t min, t max)
void rel_settings::draw_spline()
{
- Map& spline = acc_mode_spline;
+ spline& spline = acc_mode_spline;
spline.removeAllPoints();
static constexpr float std_norm_expt = 1.f/3;
- const float norm_expt = std_norm_expt * float(expt_norm.get());
+ const float norm_expt = std_norm_expt * float(expt_norm->cur());
static constexpr float std_norm_lin = 2.f/3;
- const float norm_lin = clamp<float>((1-norm_expt) * lin_norm.get() * std_norm_lin, 0, 1);
+ const float norm_lin = clamp((1-norm_expt) * lin_norm->cur() * std_norm_lin, 0., 1.);
}
@@ -62,22 +62,22 @@ rel_settings::rel_settings() :
expt_slope(b, "exponent-slope", s(1.5, 1.25, 3)),
expt_norm(b, "exponent-norm", s(1, .25, 4)),
lin_norm(b, "linear-norm", s(1, .25, 4)),
- acc_mode_spline(100, 100)
+ acc_mode_spline(100, 100, "")
{
QObject::connect(&dz_end_pt,
- static_cast<void(base_value::*)(const slider_value&)>(&base_value::valueChanged),
+ static_cast<void(base_value::*)(const slider_value&) const>(&base_value::valueChanged),
this,
&rel_settings::draw_spline);
QObject::connect(&expt_slope,
- static_cast<void(base_value::*)(const slider_value&)>(&base_value::valueChanged),
+ static_cast<void(base_value::*)(const slider_value&) const>(&base_value::valueChanged),
this,
&rel_settings::draw_spline);
QObject::connect(&expt_norm,
- static_cast<void(base_value::*)(const slider_value&)>(&base_value::valueChanged),
+ static_cast<void(base_value::*)(const slider_value&) const>(&base_value::valueChanged),
this,
&rel_settings::draw_spline);
QObject::connect(&lin_norm,
- static_cast<void(base_value::*)(const slider_value&)>(&base_value::valueChanged),
+ static_cast<void(base_value::*)(const slider_value&) const>(&base_value::valueChanged),
this,
&rel_settings::draw_spline);
draw_spline();
diff --git a/tracker-tobii-eyex/tobii-eyex.hpp b/tracker-tobii-eyex/tobii-eyex.hpp
index f64f2495..aeac4d89 100644
--- a/tracker-tobii-eyex/tobii-eyex.hpp
+++ b/tracker-tobii-eyex/tobii-eyex.hpp
@@ -11,12 +11,12 @@
#include <EyeX.h>
#include "ui_tobii-eyex-dialog.h"
-#include "opentrack/plugin-api.hpp"
-#include "opentrack-compat/options.hpp"
+#include "api/plugin-api.hpp"
+#include "options/options.hpp"
using namespace options;
-#include "opentrack-compat/timer.hpp"
-#include "spline-widget/functionconfig.h"
-#include "qfunctionconfigurator.h"
+#include "compat/timer.hpp"
+#include "spline-widget/spline.hpp"
+#include "spline-widget/spline-widget.hpp"
#include <atomic>
#include <QObject>
@@ -34,7 +34,7 @@ class rel_settings final : public QObject, public opts
public:
using s = slider_value;
value<slider_value> speed, dz_end_pt, expt_slope, expt_norm, lin_norm;
- Map acc_mode_spline;
+ spline acc_mode_spline;
rel_settings();
private slots:
void draw_spline();