diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c index edb1a7b1a2..eaa71c9b70 100644 --- a/apps/gui/skin_engine/skin_touchsupport.c +++ b/apps/gui/skin_engine/skin_touchsupport.c @@ -33,6 +33,7 @@ #include "splash.h" #include "playlist.h" #include "dsp_misc.h" +#include "playback.h" /** Disarms all touchregions. */ void skin_disarm_touchregions(struct gui_wps *gwps) @@ -195,13 +196,32 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset) switch (action) { case ACTION_TOUCH_SCROLLBAR: + { + action = ACTION_TOUCHSCREEN; + + struct wps_state* gwps = get_wps_state(); + if (!gwps->id3) + break; + if (gevent.id == GESTURE_HOLD || gevent.id == GESTURE_DRAGSTART || gevent.id == GESTURE_DRAG) - action = ACTION_TOUCH_SCROLLBAR_SET; + { + audio_pre_ff_rewind(); + gwps->id3->elapsed = gwps->id3->length * (*edge_offset) / 1000; + } else if (gevent.id == GESTURE_RELEASE) - action = ACTION_TOUCH_SCROLLBAR_END; - break; + { + audio_ff_rewind(gwps->id3->elapsed); + } + else + { + gwps->id3->elapsed = gwps->id3->length * (*edge_offset) / 1000; + audio_pre_ff_rewind(); + audio_ff_rewind(gwps->id3->elapsed); + } + + } break; case ACTION_TOUCH_VOLUME: { diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 4e3fd2d6cb..30e76c121c 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -170,7 +170,6 @@ void wps_do_action(enum wps_do_action_type action, bool updatewps) static int skintouch_to_wps(void) { int offset = 0; - struct wps_state *gstate = get_wps_state(); struct gui_wps *gwps = skin_get_gwps(WPS, SCREEN_MAIN); int button = skin_get_touchaction(gwps, &offset); switch (button) @@ -193,18 +192,6 @@ 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(); - audio_ff_rewind(gstate->id3->elapsed); - return ACTION_TOUCHSCREEN; } return button; } diff --git a/apps/radio/radio_skin.c b/apps/radio/radio_skin.c index dc38faa31a..987524ad13 100644 --- a/apps/radio/radio_skin.c +++ b/apps/radio/radio_skin.c @@ -115,7 +115,8 @@ int fms_do_button_loop(bool update_screen) case ACTION_STD_MENU: return ACTION_FM_MENU; case ACTION_TOUCH_SCROLLBAR: - /* TODO */ + /* TODO - skin_get_touchaction has this hardcoded to seek in + * current track, refactor it if this is ever implemented. */ break; } #endif