From dc5676229d19f317b97df6a3d3582bbb02df33df Mon Sep 17 00:00:00 2001 From: Tab_theFox Date: Sun, 23 Mar 2025 17:45:19 +0100 Subject: add single touch shourtcuts for touch wheel This allows you to use the touch wheel for quick playback control: - bottom quadrant for play/pause - left and right quadrant for track skip back / forward - top quadrant to seek back 25 seconds (handy when listening to a podcast) --- src/tangara/input/input_touch_wheel.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/tangara/input/input_touch_wheel.hpp') diff --git a/src/tangara/input/input_touch_wheel.hpp b/src/tangara/input/input_touch_wheel.hpp index 3f2ed49e..9c9135b4 100644 --- a/src/tangara/input/input_touch_wheel.hpp +++ b/src/tangara/input/input_touch_wheel.hpp @@ -23,7 +23,7 @@ namespace input { class TouchWheel : public IInputDevice { public: - TouchWheel(drivers::NvsStorage&, drivers::TouchWheel&); + TouchWheel(drivers::NvsStorage&, drivers::TouchWheel&, audio::TrackQueue&); auto read(lv_indev_data_t* data, std::vector& events) -> void override; @@ -35,6 +35,8 @@ class TouchWheel : public IInputDevice { auto sensitivity() -> lua::Property&; + auto activate_buttons(bool activate) -> void; + private: const int64_t SCROLL_TIMEOUT_US = 250000; // 250ms @@ -44,6 +46,8 @@ class TouchWheel : public IInputDevice { drivers::NvsStorage& nvs_; drivers::TouchWheel& wheel_; + audio::TrackQueue& queue_; + lua::Property sensitivity_; TriggerHooks centre_; @@ -54,10 +58,12 @@ class TouchWheel : public IInputDevice { bool locked_; bool is_scrolling_; + uint64_t last_scroll_; uint8_t threshold_; bool is_first_read_; uint8_t last_angle_; int64_t last_wheel_touch_time_; + bool buttons_active_; }; } // namespace input -- cgit v1.2.3