summaryrefslogtreecommitdiff
path: root/src/tangara/input/input_touch_wheel.hpp
diff options
context:
space:
mode:
authorTab_theFox <tab_thefox@noreply.codeberg.org>2025-03-23 17:45:19 +0100
committerTab_theFox <tab_thefox@noreply.codeberg.org>2025-04-22 22:23:47 +0200
commitdc5676229d19f317b97df6a3d3582bbb02df33df (patch)
tree2036ecb5b6fdefaabc6beb9ac7cab21dcadcad56 /src/tangara/input/input_touch_wheel.hpp
parent79c9f0b6ccfec97f23563010f134d842c4240582 (diff)
downloadtangara-fw-dc5676229d19f317b97df6a3d3582bbb02df33df.tar.gz
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)
Diffstat (limited to 'src/tangara/input/input_touch_wheel.hpp')
-rw-r--r--src/tangara/input/input_touch_wheel.hpp8
1 files changed, 7 insertions, 1 deletions
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<InputEvent>& 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