From 4fb37ecbc692fdbb2e46aeaccf411caf631f9699 Mon Sep 17 00:00:00 2001 From: "roman.artiukhin" Date: Sun, 26 Mar 2023 12:12:52 +0300 Subject: Skip Length across tracks Allows to use Prev button to skip length from the end of previous track. Can be enabled with: Settings -> Playback Settings -> Skip Length set to some time interval and Settings -> Playback Settings -> Rewind Across Tracks set to Yes Change-Id: I99f234035a8a5acc9cbfe05ea83971ec5ddc59ea --- apps/gui/wps.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'apps/gui') diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 10c971fcc4..2a595f74e6 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -464,7 +464,21 @@ static void play_hop(int direction) if (direction > 0) next_track(); else if (direction < 0) + { + if (step > 0 && global_settings.rewind_across_tracks && elapsed < DEFAULT_SKIP_THRESH && playlist_check(-1)) + { + bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false; + if (!audio_paused) + audio_pause(); + audio_prev(); + audio_ff_rewind(-step); + if (!audio_paused) + audio_resume(); + return; + } + prev_track(DEFAULT_SKIP_THRESH); + } return; } else if (direction == 1 && step >= remaining) -- cgit v1.2.3