diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-10-12 18:56:26 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-10-12 17:08:59 +0000 |
commit | c57b524d3038dd1d94379038d362dea5b2896c60 (patch) | |
tree | e6946995a856f91d6e0f069fa8aa0a88e38d164d /logic/work.hpp | |
parent | 95d18c6a04b83943b0c3d095fedb681a2a0a2c0b (diff) |
logic/pipeline: cleanup only
Diffstat (limited to 'logic/work.hpp')
-rw-r--r-- | logic/work.hpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/logic/work.hpp b/logic/work.hpp index 212bb15d..8177e654 100644 --- a/logic/work.hpp +++ b/logic/work.hpp @@ -37,12 +37,27 @@ class OTR_LOGIC_EXPORT Work final : public TR public: using fn_t = std::function<void(bool)>; using key_tuple = std::tuple<key_opts&, fn_t, bool>; - main_settings s; // tracker needs settings, so settings must come before it + main_settings s; // pipeline needs settings, so settings must come before it runtime_libraries libs; // idem - std::unique_ptr<TrackLogger> logger; // must come before tracker, since tracker depends on it + std::unique_ptr<TrackLogger> logger { make_logger(s) }; // must come before pipeline, since pipeline depends on it pipeline pipeline_; Shortcuts sc; - std::vector<key_tuple> keys; + + std::vector<key_tuple> keys { + // third argument means "keydown only" + key_tuple(s.key_center1, [&](bool x) { pipeline_.set_held_center(x); }, false), + key_tuple(s.key_center2, [&](bool x) { pipeline_.set_held_center(x); }, false), + + key_tuple(s.key_toggle1, [&](bool) { pipeline_.toggle_enabled(); }, true), + key_tuple(s.key_toggle2, [&](bool) { pipeline_.toggle_enabled(); }, true), + key_tuple(s.key_toggle_press1, [&](bool x) { pipeline_.set_enabled(!x); }, false), + key_tuple(s.key_toggle_press2, [&](bool x) { pipeline_.set_enabled(!x); }, false), + + key_tuple(s.key_zero1, [&](bool) { pipeline_.toggle_zero(); }, true), + key_tuple(s.key_zero2, [&](bool) { pipeline_.toggle_zero(); }, true), + key_tuple(s.key_zero_press1, [&](bool x) { pipeline_.set_zero(x); }, false), + key_tuple(s.key_zero_press2, [&](bool x) { pipeline_.set_zero(x); }, false), + }; Work(Mappings& m, event_handler& ev, QFrame* frame, const dylibptr& tracker, const dylibptr& filter, const dylibptr& proto); |