summaryrefslogtreecommitdiffhomepage
path: root/filter-ewma2
diff options
context:
space:
mode:
Diffstat (limited to 'filter-ewma2')
-rw-r--r--filter-ewma2/ftnoir_ewma_filtercontrols.ui4
-rw-r--r--filter-ewma2/ftnoir_filter_ewma2.cpp6
-rw-r--r--filter-ewma2/ftnoir_filter_ewma2.h12
-rw-r--r--filter-ewma2/ftnoir_filter_ewma2_dialog.cpp14
4 files changed, 18 insertions, 18 deletions
diff --git a/filter-ewma2/ftnoir_ewma_filtercontrols.ui b/filter-ewma2/ftnoir_ewma_filtercontrols.ui
index 17990e82..d5cc082e 100644
--- a/filter-ewma2/ftnoir_ewma_filtercontrols.ui
+++ b/filter-ewma2/ftnoir_ewma_filtercontrols.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>UICFilterControls</class>
- <widget class="QWidget" name="UICFilterControls">
+ <class>UICdialog_ewma</class>
+ <widget class="QWidget" name="UICdialog_ewma">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
diff --git a/filter-ewma2/ftnoir_filter_ewma2.cpp b/filter-ewma2/ftnoir_filter_ewma2.cpp
index beceb4c2..687b5589 100644
--- a/filter-ewma2/ftnoir_filter_ewma2.cpp
+++ b/filter-ewma2/ftnoir_filter_ewma2.cpp
@@ -22,11 +22,11 @@
// to minSmooth at a rate controlled by the powCurve setting.
-FTNoIR_Filter::FTNoIR_Filter() : first_run(true)
+ewma::ewma() : first_run(true)
{
}
-void FTNoIR_Filter::filter(const double *input, double *output)
+void ewma::filter(const double *input, double *output)
{
// Start the timer and initialise filter state if it's not running.
if (first_run)
@@ -76,4 +76,4 @@ void FTNoIR_Filter::filter(const double *input, double *output)
}
}
-OPENTRACK_DECLARE_FILTER(FTNoIR_Filter, FilterControls, FTNoIR_FilterDll)
+OPENTRACK_DECLARE_FILTER(ewma, dialog_ewma, ewmaDll)
diff --git a/filter-ewma2/ftnoir_filter_ewma2.h b/filter-ewma2/ftnoir_filter_ewma2.h
index 8680971b..b857e8d9 100644
--- a/filter-ewma2/ftnoir_filter_ewma2.h
+++ b/filter-ewma2/ftnoir_filter_ewma2.h
@@ -20,10 +20,10 @@ struct settings : opts {
};
-class FTNoIR_Filter : public IFilter
+class ewma : public IFilter
{
public:
- FTNoIR_Filter();
+ ewma();
void filter(const double *input, double *output);
private:
// Deltas are smoothed over the last 1/60sec.
@@ -38,16 +38,16 @@ private:
bool first_run;
};
-class FilterControls: public IFilterDialog
+class dialog_ewma: public IFilterDialog
{
Q_OBJECT
public:
- FilterControls();
+ dialog_ewma();
void register_filter(IFilter*) override {}
void unregister_filter() override {}
private:
- Ui::UICFilterControls ui;
+ Ui::UICdialog_ewma ui;
settings s;
private slots:
@@ -56,7 +56,7 @@ private slots:
void update_labels(int);
};
-class FTNoIR_FilterDll : public Metadata
+class ewmaDll : public Metadata
{
public:
QString name() { return QString("EWMA"); }
diff --git a/filter-ewma2/ftnoir_filter_ewma2_dialog.cpp b/filter-ewma2/ftnoir_filter_ewma2_dialog.cpp
index 79fcd959..5372767d 100644
--- a/filter-ewma2/ftnoir_filter_ewma2_dialog.cpp
+++ b/filter-ewma2/ftnoir_filter_ewma2_dialog.cpp
@@ -5,7 +5,7 @@
#include "api/plugin-api.hpp"
#include "ui_ftnoir_ewma_filtercontrols.h"
-FilterControls::FilterControls()
+dialog_ewma::dialog_ewma()
{
ui.setupUi(this);
@@ -16,9 +16,9 @@ FilterControls::FilterControls()
tie_setting(s.kMinSmoothing, ui.minSmooth);
tie_setting(s.kSmoothingScaleCurve, ui.powCurve);
- connect(ui.powCurve, &QSlider::valueChanged, this, &FilterControls::update_labels);
- connect(ui.minSmooth, &QSlider::valueChanged, this, &FilterControls::update_labels);
- connect(ui.maxSmooth, &QSlider::valueChanged, this, &FilterControls::update_labels);
+ connect(ui.powCurve, &QSlider::valueChanged, this, &dialog_ewma::update_labels);
+ connect(ui.minSmooth, &QSlider::valueChanged, this, &dialog_ewma::update_labels);
+ connect(ui.maxSmooth, &QSlider::valueChanged, this, &dialog_ewma::update_labels);
using std::min;
using std::max;
@@ -32,18 +32,18 @@ FilterControls::FilterControls()
update_labels(0);
}
-void FilterControls::doOK()
+void dialog_ewma::doOK()
{
s.b->save();
close();
}
-void FilterControls::doCancel()
+void dialog_ewma::doCancel()
{
close();
}
-void FilterControls::update_labels(int)
+void dialog_ewma::update_labels(int)
{
ui.curve_label->setText(QString::number(static_cast<slider_value>(s.kSmoothingScaleCurve).cur() * 100, 'f', 2) + "%");
ui.min_label->setText(QString::number(static_cast<slider_value>(s.kMinSmoothing).cur() * 100, 'f', 2) + "%");