diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-10 12:52:36 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-10 12:52:36 +0200 |
commit | 8a6f73b3a6ca555da750cecf9565d2feb36f5303 (patch) | |
tree | dc1b04417504cb33f1ae36864df3771395564836 | |
parent | acfb88b6361ce74ddb909be50d7acc2c4c77499c (diff) |
filter/accela: make gain less sluggish overall
-rw-r--r-- | filter-accela/accela-settings.hpp | 28 | ||||
-rw-r--r-- | filter-accela/ftnoir_accela_filtercontrols.ui | 2 | ||||
-rw-r--r-- | filter-accela/ftnoir_filter_accela.cpp | 24 | ||||
-rw-r--r-- | migration/20160917_00-accela.cpp | 4 |
4 files changed, 29 insertions, 29 deletions
diff --git a/filter-accela/accela-settings.hpp b/filter-accela/accela-settings.hpp index 138e8af7..75adb8f7 100644 --- a/filter-accela/accela-settings.hpp +++ b/filter-accela/accela-settings.hpp @@ -6,23 +6,24 @@ using namespace options; struct settings_accela : opts { - static constexpr double rot_gains[16][2] = + struct gains { - { 8, 700 }, - { 7, 300 }, - { 6, 160 }, - { 5, 95 }, + double x, y; + }; - { 4, 55 }, - { 3, 25 }, - { 1.66, 10 }, - { 1, 4 }, - { .5, .53 }, + static constexpr gains rot_gains[16] = + { + { 11, 500 }, + { 9, 300 }, + { 6, 150 }, + { 2.66, 35 }, + { 1.66, 8 }, + { 1, 1.5 }, + { .5, .4 }, { 0, 0 }, - { -1, 0 } }; - static constexpr double pos_gains[16][2] = + static constexpr gains pos_gains[16] = { { 9, 200 }, { 8, 150 }, @@ -35,7 +36,6 @@ struct settings_accela : opts { .66, .75 }, { .33, .375 }, { 0, 0 }, - { -1, 0 } }; static void make_splines(spline& rot, spline& trans); @@ -50,7 +50,7 @@ struct settings_accela : opts pos_sensitivity(b, "translation-sensitivity", slider_value(1., .05, 1.5)), rot_deadzone(b, "rotation-deadzone", slider_value(.03, 0, .1)), pos_deadzone(b, "translation-deadzone", slider_value(.1, 0, 1)), - ewma(b, "ewma", slider_value(0, 0, 300)), + ewma(b, "ewma", slider_value(0, 0, 200)), rot_nonlinearity(b, "rotation-nonlinearity", slider_value(1.2, 1, 1.3)) {} }; diff --git a/filter-accela/ftnoir_accela_filtercontrols.ui b/filter-accela/ftnoir_accela_filtercontrols.ui index 76affd68..22c18b10 100644 --- a/filter-accela/ftnoir_accela_filtercontrols.ui +++ b/filter-accela/ftnoir_accela_filtercontrols.ui @@ -80,7 +80,7 @@ <number>0</number> </property> <property name="maximum"> - <number>12</number> + <number>20</number> </property> <property name="pageStep"> <number>5</number> diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp index c6813b8e..0336221e 100644 --- a/filter-accela/ftnoir_filter_accela.cpp +++ b/filter-accela/ftnoir_filter_accela.cpp @@ -17,8 +17,8 @@ using std::pow; using std::copysign; using std::fmin; -constexpr double settings_accela::rot_gains[16][2]; -constexpr double settings_accela::pos_gains[16][2]; +constexpr settings_accela::gains settings_accela::rot_gains[16]; +constexpr settings_accela::gains settings_accela::pos_gains[16]; accela::accela() : first_run(true) { @@ -158,21 +158,21 @@ void accela::filter(const double* input, double *output) } } -void settings_accela::make_splines(spline& rot, spline& trans) +void settings_accela::make_splines(spline& rot, spline& pos) { rot = spline(); - trans = spline(); + pos = spline(); - rot.set_max_input(rot_gains[0][0]); - trans.set_max_input(pos_gains[0][0]); - rot.set_max_output(rot_gains[0][1]); - trans.set_max_output(pos_gains[0][1]); + rot.set_max_input(rot_gains[0].x); + pos.set_max_input(pos_gains[0].x); + rot.set_max_output(rot_gains[0].y); + pos.set_max_output(pos_gains[0].y); - for (int i = 0; rot_gains[i][0] >= 0; i++) - rot.add_point(QPointF(rot_gains[i][0], rot_gains[i][1])); + for (const auto& val : rot_gains) + rot.add_point(QPointF(val.x, val.y)); - for (int i = 0; pos_gains[i][0] >= 0; i++) - trans.add_point(QPointF(pos_gains[i][0], pos_gains[i][1])); + for (const auto& val : pos_gains) + pos.add_point(QPointF(val.x, val.y)); } OPENTRACK_DECLARE_FILTER(accela, dialog_accela, accelaDll) diff --git a/migration/20160917_00-accela.cpp b/migration/20160917_00-accela.cpp index 832dcccf..7704a4fe 100644 --- a/migration/20160917_00-accela.cpp +++ b/migration/20160917_00-accela.cpp @@ -117,8 +117,8 @@ struct move_accela_to_sliders : migration }; // odr -constexpr double settings_accela::rot_gains[16][2]; -constexpr double settings_accela::pos_gains[16][2]; +constexpr settings_accela::gains settings_accela::rot_gains[16]; +constexpr settings_accela::gains settings_accela::pos_gains[16]; constexpr const char* move_accela_to_sliders::old_bundle_name; constexpr const char* move_accela_to_sliders::new_bundle_name; |