fix: improve playback-health and touch-gestures tuning

- playback-health: skip bandwidth warning when buffer is healthy
  (configurable via bandwidth_buffer_mult, default 10× warning threshold)
- touch-gestures: use finer steps at low volume/brightness (<10%)
  (configurable via volume_step_fine, brightness_step_fine, fine_threshold)
This commit is contained in:
2025-12-14 12:28:57 +01:00
parent 256cfc5f82
commit f4064e013c
2 changed files with 227 additions and 9 deletions

View File

@@ -22,7 +22,10 @@ local config = {
steps_per_screen = 40, -- target steps across full height; 50% height ≈ 100% change with 5% steps
deadzone_px = 4, -- ignore tiny jiggles before the first step (lower = snappier)
volume_step = 5, -- percent per step
volume_step_fine = 1, -- step when below fine_threshold
brightness_step = 5, -- screen brightness percent per step
brightness_step_fine = 1, -- step when below fine_threshold
fine_threshold = 10, -- use fine steps below this percent
seek_step = 5, -- seconds per seek step
max_volume = 130, -- clamp volume to this ceiling
min_brightness = 1, -- minimum brightness percent (avoid turning off screen)
@@ -281,14 +284,17 @@ local function apply_steps(kind, steps)
if not current then
return
end
local next_value = current + (steps * config.volume_step)
local step = current < config.fine_threshold and config.volume_step_fine or config.volume_step
local next_value = current + (steps * step)
set_volume_percent(next_value)
elseif kind == "brightness" then
local current = current_brightness_percent()
if not current then
return
end
local next_value = current + (steps * config.brightness_step)
local step = current < config.fine_threshold and config.brightness_step_fine
or config.brightness_step
local next_value = current + (steps * step)
set_brightness_percent(next_value)
elseif kind == "seek" then
local seconds = steps * config.seek_step