touchscreen: Fix seeking to end of track in WPS

Seeking to the very end of the track with the touchscreen caused
rapid skipping through the playlist because each touch event
generates a separate seek operation, kind of like rapidly pressing
a physical button. Fix this bug by executing the seek operation
only for the release event.

Change-Id: Ic1080065a68e7cc2ba98e2f27293c954f2ec8fb2
This commit is contained in:
Aidan MacDonald 2022-07-28 21:07:16 +01:00
parent 010d22ed29
commit 02ad19c959
3 changed files with 21 additions and 3 deletions

View file

@ -193,6 +193,13 @@ static int skintouch_to_wps(void)
case ACTION_STD_HOTKEY:
return ACTION_WPS_HOTKEY;
#endif
case ACTION_TOUCH_SCROLLBAR_SET:
audio_pre_ff_rewind();
gstate->id3->elapsed = gstate->id3->length*offset/1000;
return ACTION_TOUCHSCREEN;
case ACTION_TOUCH_SCROLLBAR_END:
audio_ff_rewind(gstate->id3->elapsed);
return ACTION_TOUCHSCREEN;
case ACTION_TOUCH_SCROLLBAR:
gstate->id3->elapsed = gstate->id3->length*offset/1000;
audio_pre_ff_rewind();