diff options
-rw-r--r-- | apps/gui/gwps-common.c | 6 | ||||
-rw-r--r-- | apps/gui/gwps.c | 19 | ||||
-rw-r--r-- | apps/gui/gwps.h | 5 | ||||
-rw-r--r-- | apps/gui/wps_parser.c | 14 | ||||
-rw-r--r-- | wps/cabbiev2.320x240x16.mrobe500.wps | 3 |
5 files changed, 40 insertions, 7 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 9a69c74bf3..9cfff4cba8 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -268,7 +268,13 @@ bool ffwd_rew(int button) | |||
268 | break; | 268 | break; |
269 | } | 269 | } |
270 | if (!exit) | 270 | if (!exit) |
271 | { | ||
271 | button = get_action(CONTEXT_WPS|ALLOW_SOFTLOCK,TIMEOUT_BLOCK); | 272 | button = get_action(CONTEXT_WPS|ALLOW_SOFTLOCK,TIMEOUT_BLOCK); |
273 | #ifdef HAVE_TOUCHSCREEN | ||
274 | if (button == ACTION_TOUCHSCREEN) | ||
275 | button = wps_get_touchaction(gui_wps[SCREEN_MAIN].data); | ||
276 | #endif | ||
277 | } | ||
272 | } | 278 | } |
273 | return usb; | 279 | return usb; |
274 | } | 280 | } |
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index ae9dc453f5..c89a6fcbb4 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c | |||
@@ -295,15 +295,16 @@ void gwps_draw_statusbars(void) | |||
295 | viewportmanager_set_statusbar(wpsbars); | 295 | viewportmanager_set_statusbar(wpsbars); |
296 | } | 296 | } |
297 | #ifdef HAVE_TOUCHSCREEN | 297 | #ifdef HAVE_TOUCHSCREEN |
298 | static int wps_get_touchaction(struct wps_data *data) | 298 | int wps_get_touchaction(struct wps_data *data) |
299 | { | 299 | { |
300 | short x,y; | 300 | short x,y; |
301 | short vx, vy; | 301 | short vx, vy; |
302 | int type = action_get_touchscreen_press(&x, &y); | 302 | int type = action_get_touchscreen_press(&x, &y); |
303 | int i; | 303 | int i; |
304 | static int last_action = ACTION_NONE; | ||
304 | struct touchregion *r; | 305 | struct touchregion *r; |
305 | if (type != BUTTON_REL) | 306 | bool repeated = (type == BUTTON_REPEAT); |
306 | return ACTION_TOUCHSCREEN; | 307 | bool released = (type == BUTTON_REL); |
307 | for (i=0; i<data->touchregion_count; i++) | 308 | for (i=0; i<data->touchregion_count; i++) |
308 | { | 309 | { |
309 | r = &data->touchregion[i]; | 310 | r = &data->touchregion[i]; |
@@ -320,9 +321,19 @@ static int wps_get_touchaction(struct wps_data *data) | |||
320 | /* now see if the point is inside this region */ | 321 | /* now see if the point is inside this region */ |
321 | if (vx >= r->x && vx < r->x+r->width && | 322 | if (vx >= r->x && vx < r->x+r->width && |
322 | vy >= r->y && vy < r->y+r->height) | 323 | vy >= r->y && vy < r->y+r->height) |
323 | return r->action; | 324 | { |
325 | if ((repeated && r->repeat) || | ||
326 | (released && !r->repeat)) | ||
327 | { | ||
328 | last_action = r->action; | ||
329 | return r->action; | ||
330 | } | ||
331 | } | ||
324 | } | 332 | } |
325 | } | 333 | } |
334 | if ((last_action == ACTION_WPS_SEEKBACK || last_action == ACTION_WPS_SEEKFWD)) | ||
335 | return ACTION_WPS_STOPSEEK; | ||
336 | last_action = ACTION_TOUCHSCREEN; | ||
326 | return ACTION_TOUCHSCREEN; | 337 | return ACTION_TOUCHSCREEN; |
327 | } | 338 | } |
328 | #endif | 339 | #endif |
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index f3562214a0..ac1cbad60b 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h | |||
@@ -375,6 +375,7 @@ struct touchregion { | |||
375 | short int y; /* y-pos */ | 375 | short int y; /* y-pos */ |
376 | short int width; /* width */ | 376 | short int width; /* width */ |
377 | short int height; /* height */ | 377 | short int height; /* height */ |
378 | bool repeat; /* requires the area be held for the action */ | ||
378 | int action; /* action this button will return */ | 379 | int action; /* action this button will return */ |
379 | }; | 380 | }; |
380 | #define MAX_TOUCHREGIONS 12 | 381 | #define MAX_TOUCHREGIONS 12 |
@@ -533,6 +534,10 @@ extern struct gui_wps gui_wps[NB_SCREENS]; | |||
533 | 534 | ||
534 | void gui_sync_wps_init(void); | 535 | void gui_sync_wps_init(void); |
535 | 536 | ||
537 | #ifdef HAVE_TOUCHSCREEN | ||
538 | int wps_get_touchaction(struct wps_data *data); | ||
539 | #endif | ||
540 | |||
536 | #ifdef HAVE_ALBUMART | 541 | #ifdef HAVE_ALBUMART |
537 | /* gives back if WPS contains an albumart tag */ | 542 | /* gives back if WPS contains an albumart tag */ |
538 | bool gui_sync_wps_uses_albumart(void); | 543 | bool gui_sync_wps_uses_albumart(void); |
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index 7211e6c86a..bd599509ae 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c | |||
@@ -1163,6 +1163,7 @@ struct touchaction {char* s; int action;}; | |||
1163 | static struct touchaction touchactions[] = { | 1163 | static struct touchaction touchactions[] = { |
1164 | {"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP }, | 1164 | {"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP }, |
1165 | {"prev", ACTION_WPS_SKIPPREV }, {"next", ACTION_WPS_SKIPNEXT }, | 1165 | {"prev", ACTION_WPS_SKIPPREV }, {"next", ACTION_WPS_SKIPNEXT }, |
1166 | {"ffwd", ACTION_WPS_SEEKFWD }, {"rwd", ACTION_WPS_SEEKBACK }, | ||
1166 | {"menu", ACTION_WPS_MENU }, {"browse", ACTION_WPS_BROWSE }, | 1167 | {"menu", ACTION_WPS_MENU }, {"browse", ACTION_WPS_BROWSE }, |
1167 | {"shuffle", ACTION_TOUCH_SHUFFLE }, {"repmode", ACTION_TOUCH_REPMODE }, | 1168 | {"shuffle", ACTION_TOUCH_SHUFFLE }, {"repmode", ACTION_TOUCH_REPMODE }, |
1168 | {"quickscreen", ACTION_WPS_QUICKSCREEN },{"contextmenu", ACTION_WPS_CONTEXT }, | 1169 | {"quickscreen", ACTION_WPS_QUICKSCREEN },{"contextmenu", ACTION_WPS_CONTEXT }, |
@@ -1178,13 +1179,14 @@ static int parse_touchregion(const char *wps_bufptr, | |||
1178 | int x,y,w,h; | 1179 | int x,y,w,h; |
1179 | 1180 | ||
1180 | /* format: %T|x|y|width|height|action| | 1181 | /* format: %T|x|y|width|height|action| |
1182 | * if action starts with & the area must be held to happen | ||
1181 | * action is one of: | 1183 | * action is one of: |
1182 | * play - play/pause playback | 1184 | * play - play/pause playback |
1183 | * stop - stop playback, exit the wps | 1185 | * stop - stop playback, exit the wps |
1184 | * prev - prev track | 1186 | * prev - prev track |
1185 | * next - next track | 1187 | * next - next track |
1186 | * ffwd | 1188 | * ffwd - seek forward |
1187 | * rwd | 1189 | * rwd - seek backwards |
1188 | * menu - go back to the main menu | 1190 | * menu - go back to the main menu |
1189 | * browse - go back to the file/db browser | 1191 | * browse - go back to the file/db browser |
1190 | * shuffle - toggle shuffle mode | 1192 | * shuffle - toggle shuffle mode |
@@ -1213,6 +1215,14 @@ static int parse_touchregion(const char *wps_bufptr, | |||
1213 | region->height = h; | 1215 | region->height = h; |
1214 | region->wvp = &wps_data->viewports[wps_data->num_viewports]; | 1216 | region->wvp = &wps_data->viewports[wps_data->num_viewports]; |
1215 | i = 0; | 1217 | i = 0; |
1218 | if (*action == '&') | ||
1219 | { | ||
1220 | action++; | ||
1221 | region->repeat = true; | ||
1222 | } | ||
1223 | else | ||
1224 | region->repeat = false; | ||
1225 | |||
1216 | while ((region->action == ACTION_NONE) && | 1226 | while ((region->action == ACTION_NONE) && |
1217 | (i < sizeof(touchactions)/sizeof(*touchactions))) | 1227 | (i < sizeof(touchactions)/sizeof(*touchactions))) |
1218 | { | 1228 | { |
diff --git a/wps/cabbiev2.320x240x16.mrobe500.wps b/wps/cabbiev2.320x240x16.mrobe500.wps index ad66fbb02b..a18babd0f4 100644 --- a/wps/cabbiev2.320x240x16.mrobe500.wps +++ b/wps/cabbiev2.320x240x16.mrobe500.wps | |||
@@ -65,8 +65,9 @@ | |||
65 | #%T|50|5|24|24|pitch| | 65 | #%T|50|5|24|24|pitch| |
66 | %T|80|5|24|24|contextmenu| | 66 | %T|80|5|24|24|contextmenu| |
67 | %T|110|5|24|24|quickscreen| | 67 | %T|110|5|24|24|quickscreen| |
68 | %T|150|5|24|24|&rwd| | ||
69 | %T|175|5|24|24|&ffwd| | ||
68 | %T|150|5|24|24|prev| | 70 | %T|150|5|24|24|prev| |
69 | %T|175|5|24|24|next| | 71 | %T|175|5|24|24|next| |
70 | |||
71 | %Vl|u|0|74|-|30|1|-|-| | 72 | %Vl|u|0|74|-|30|1|-|-| |
72 | #purposly left blank | 73 | #purposly left blank |