diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-02-05 09:33:00 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-02-16 19:15:47 +0100 |
commit | 664f9c94fbb570f0b5abae1b36c5940275813096 (patch) | |
tree | ab4b62edf3521ee0a6fe2cbad716dcb5d867c1cf /logic/work.cpp | |
parent | b52fd95f1cc86e86ecb696eab07c8d6b6a2e9f5d (diff) |
logic/pipeline: simplify
The pipeline code is hard to understand for programmers due to the
practice of putting all logic into a single function.
Split it up into logical components.
This needs more testing and bug reports. It's a big change with possibly
many regressions all over the place.
Issue: #688
Diffstat (limited to 'logic/work.cpp')
-rw-r--r-- | logic/work.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/logic/work.cpp b/logic/work.cpp index cdc27b05..11ec9912 100644 --- a/logic/work.cpp +++ b/logic/work.cpp @@ -65,17 +65,17 @@ Work::Work(Mappings& m, event_handler& ev, QFrame* frame, std::shared_ptr<dylib tracker(std::make_shared<pipeline>(m, libs, ev, *logger)), sc(std::make_shared<Shortcuts>()), keys { - key_tuple(s.key_center1, [&](bool) { tracker->center(); }, true), - key_tuple(s.key_center2, [&](bool) { tracker->center(); }, true), + key_tuple(s.key_center1, [&](bool) { tracker->set_center(); }, true), + key_tuple(s.key_center2, [&](bool) { tracker->set_center(); }, true), key_tuple(s.key_toggle1, [&](bool) { tracker->toggle_enabled(); }, true), key_tuple(s.key_toggle2, [&](bool) { tracker->toggle_enabled(); }, true), - key_tuple(s.key_zero1, [&](bool) { tracker->zero(); }, true), - key_tuple(s.key_zero2, [&](bool) { tracker->zero(); }, true), + key_tuple(s.key_zero1, [&](bool) { tracker->toggle_zero(); }, true), + key_tuple(s.key_zero2, [&](bool) { tracker->toggle_zero(); }, true), - key_tuple(s.key_toggle_press1, [&](bool x) { tracker->set_toggle(!x); }, false), - key_tuple(s.key_toggle_press2, [&](bool x) { tracker->set_toggle(!x); }, false), + key_tuple(s.key_toggle_press1, [&](bool x) { tracker->set_enabled(!x); }, false), + key_tuple(s.key_toggle_press2, [&](bool x) { tracker->set_enabled(!x); }, false), key_tuple(s.key_zero_press1, [&](bool x) { tracker->set_zero(x); }, false), key_tuple(s.key_zero_press2, [&](bool x) { tracker->set_zero(x); }, false), |