diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-14 16:21:56 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-16 07:49:10 +0100 |
commit | 42e6b27e1afda7fcd8beddd9676ba7edb6363a34 (patch) | |
tree | 43177e1c1f3bd07fc189f5038d76ecfafda754a5 /filter-accela | |
parent | 28530b61616852785f144ab67f67d7df435f8ec6 (diff) |
modernize only
- replace `static constexpr inline' with `static constexpr'.
`inline' is implied.
- use braced initializer lists where applicable
- still missing `override' usages
Diffstat (limited to 'filter-accela')
-rw-r--r-- | filter-accela/ftnoir_filter_accela.cpp | 14 | ||||
-rw-r--r-- | filter-accela/ftnoir_filter_accela.h | 6 | ||||
-rw-r--r-- | filter-accela/ftnoir_filter_accela_dialog.cpp | 4 |
3 files changed, 13 insertions, 11 deletions
diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp index 56ac9b5c..9e973586 100644 --- a/filter-accela/ftnoir_filter_accela.cpp +++ b/filter-accela/ftnoir_filter_accela.cpp @@ -31,7 +31,7 @@ static void do_deltas(const double* deltas, double* output, F&& fun) dist += deltas[k]*deltas[k]; dist = sqrt(dist); - const double value = double(fun(dist)); + const double value = fun(dist); for (unsigned k = 0; k < N; k++) { @@ -82,14 +82,14 @@ void accela::filter(const double* input, double *output) return; } - const double rot_thres { s.rot_smoothing }; - const double pos_thres { s.pos_smoothing }; + const double rot_thres{s.rot_smoothing}; + const double pos_thres{s.pos_smoothing}; const double dt = t.elapsed_seconds(); t.start(); - const double rot_dz = s.rot_deadzone.to<double>(); - const double pos_dz = s.pos_deadzone.to<double>(); + const double rot_dz{ s.rot_deadzone}; + const double pos_dz{ s.pos_deadzone}; // rot @@ -142,10 +142,10 @@ void settings_accela::make_splines(spline& rot, spline& pos) rot.clear(); pos.clear(); for (const auto& val : rot_gains) - rot.add_point(QPointF(val.x, val.y)); + rot.add_point({ val.x, val.y }); for (const auto& val : pos_gains) - pos.add_point(QPointF(val.x, val.y)); + pos.add_point({ val.x, val.y }); } OPENTRACK_DECLARE_FILTER(accela, dialog_accela, accelaDll) diff --git a/filter-accela/ftnoir_filter_accela.h b/filter-accela/ftnoir_filter_accela.h index a3f93756..9112b0b8 100644 --- a/filter-accela/ftnoir_filter_accela.h +++ b/filter-accela/ftnoir_filter_accela.h @@ -17,6 +17,8 @@ #include <QMutex> #include <QTimer> +//#define DEBUG_ACCELA + class accela : public IFilter { public: @@ -57,6 +59,6 @@ class accelaDll : public Metadata { Q_OBJECT - QString name() { return tr("Accela"); } - QIcon icon() { return QIcon(":/images/filter-16.png"); } + QString name() override { return tr("Accela"); } + QIcon icon() override { return QIcon(":/images/filter-16.png"); } }; diff --git a/filter-accela/ftnoir_filter_accela_dialog.cpp b/filter-accela/ftnoir_filter_accela_dialog.cpp index 51c31ca4..d63f27fd 100644 --- a/filter-accela/ftnoir_filter_accela_dialog.cpp +++ b/filter-accela/ftnoir_filter_accela_dialog.cpp @@ -42,7 +42,7 @@ dialog_accela::dialog_accela() QDialog dr; spline_widget r(&dr); dr.setWindowTitle("Accela rotation gain"); r.set_preview_only(true); r.setEnabled(true); - r.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); r.setConfig(&rot); + r.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); r.set_config(&rot); r.setFixedSize(1024, 600); dr.show(); dr.exec(); @@ -52,7 +52,7 @@ dialog_accela::dialog_accela() QDialog dt; spline_widget t(&dt); dt.setWindowTitle("Accela translation gain"); t.set_preview_only(true); t.setEnabled(true); - dt.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); t.setConfig(&pos); + dt.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); t.set_config(&pos); t.setFixedSize(1024, 600); dt.show(); dt.exec(); |