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
This commit is contained in:
roman.artiukhin 2023-03-26 12:12:52 +03:00 committed by Aidan MacDonald
parent 5c36643132
commit 4fb37ecbc6
2 changed files with 43 additions and 12 deletions

View file

@ -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)