diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-05-15 05:36:16 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-05-15 05:36:16 +0000 |
commit | c1267dc70088474731ab360244d90340d7c877ad (patch) | |
tree | 2b598f63148415b5c703eeeb9c536c85f08d4184 | |
parent | 33d08e831514025504e91283fc9d3a426c972a61 (diff) | |
download | rockbox-c1267dc70088474731ab360244d90340d7c877ad.tar.gz rockbox-c1267dc70088474731ab360244d90340d7c877ad.zip |
allow the user to change the shuffle and repeat modes from the touchscreen, update the mr500 default wps to show how to do it (hint, press the shuffle/rep icon)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20937 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/action.h | 8 | ||||
-rw-r--r-- | apps/gui/gwps.c | 26 | ||||
-rw-r--r-- | apps/gui/wps_parser.c | 5 | ||||
-rw-r--r-- | wps/cabbiev2.320x240x16.mrobe500.wps | 2 |
4 files changed, 39 insertions, 2 deletions
diff --git a/apps/action.h b/apps/action.h index 743e1470dc..bd215debb8 100644 --- a/apps/action.h +++ b/apps/action.h | |||
@@ -228,6 +228,14 @@ enum { | |||
228 | ACTION_KBD_DOWN, | 228 | ACTION_KBD_DOWN, |
229 | ACTION_KBD_MORSE_INPUT, | 229 | ACTION_KBD_MORSE_INPUT, |
230 | ACTION_KBD_MORSE_SELECT, | 230 | ACTION_KBD_MORSE_SELECT, |
231 | |||
232 | #ifdef HAVE_TOUCHSCREEN | ||
233 | /* the following are helper actions for touchscreen targets, | ||
234 | * These are for actions which are not doable or required if buttons are | ||
235 | * being used, but are nice additions if the touchscreen is used */ | ||
236 | ACTION_TOUCH_SHUFFLE, | ||
237 | ACTION_TOUCH_REPMODE, | ||
238 | #endif | ||
231 | 239 | ||
232 | 240 | ||
233 | LAST_ACTION_PLACEHOLDER, /* custom actions should be this + something */ | 241 | LAST_ACTION_PLACEHOLDER, /* custom actions should be this + something */ |
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 273f5d8e61..ae9dc453f5 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c | |||
@@ -64,6 +64,8 @@ | |||
64 | #include "appevents.h" | 64 | #include "appevents.h" |
65 | #include "viewport.h" | 65 | #include "viewport.h" |
66 | #include "pcmbuf.h" | 66 | #include "pcmbuf.h" |
67 | #include "option_select.h" | ||
68 | #include "dsp.h" | ||
67 | 69 | ||
68 | #define RESTORE_WPS_INSTANTLY 0l | 70 | #define RESTORE_WPS_INSTANTLY 0l |
69 | #define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick)) | 71 | #define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick)) |
@@ -732,7 +734,29 @@ long gui_wps_show(void) | |||
732 | restore = true; | 734 | restore = true; |
733 | } | 735 | } |
734 | break; | 736 | break; |
735 | 737 | #ifdef HAVE_TOUCHSCREEN | |
738 | case ACTION_TOUCH_SHUFFLE: /* toggle shuffle mode */ | ||
739 | { | ||
740 | global_settings.playlist_shuffle = | ||
741 | !global_settings.playlist_shuffle; | ||
742 | #if CONFIG_CODEC == SWCODEC | ||
743 | dsp_set_replaygain(); | ||
744 | #endif | ||
745 | if (global_settings.playlist_shuffle) | ||
746 | playlist_randomise(NULL, current_tick, true); | ||
747 | else | ||
748 | playlist_sort(NULL, true); | ||
749 | } | ||
750 | break; | ||
751 | case ACTION_TOUCH_REPMODE: /* cycle the repeat mode setting */ | ||
752 | { | ||
753 | const struct settings_list *rep_setting = | ||
754 | find_setting(&global_settings.repeat_mode, NULL); | ||
755 | option_select_next_val(rep_setting, false, true); | ||
756 | audio_flush_and_reload_tracks(); | ||
757 | } | ||
758 | break; | ||
759 | #endif /* HAVE_TOUCHSCREEN */ | ||
736 | case ACTION_REDRAW: /* yes are locked, just redraw */ | 760 | case ACTION_REDRAW: /* yes are locked, just redraw */ |
737 | /* fall througgh */ | 761 | /* fall througgh */ |
738 | case ACTION_NONE: /* Timeout, do an partial update */ | 762 | case ACTION_NONE: /* Timeout, do an partial update */ |
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index 290f370fe7..d8155d71df 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c | |||
@@ -1162,7 +1162,8 @@ struct touchaction {char* s; int action;}; | |||
1162 | static struct touchaction touchactions[] = { | 1162 | static struct touchaction touchactions[] = { |
1163 | {"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP }, | 1163 | {"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP }, |
1164 | {"prev", ACTION_WPS_SKIPPREV }, {"next", ACTION_WPS_SKIPNEXT }, | 1164 | {"prev", ACTION_WPS_SKIPPREV }, {"next", ACTION_WPS_SKIPNEXT }, |
1165 | {"menu", ACTION_WPS_MENU }, {"browse", ACTION_WPS_BROWSE } | 1165 | {"menu", ACTION_WPS_MENU }, {"browse", ACTION_WPS_BROWSE }, |
1166 | {"shuffle", ACTION_TOUCH_SHUFFLE }, {"repmode", ACTION_TOUCH_REPMODE } | ||
1166 | }; | 1167 | }; |
1167 | static int parse_touchregion(const char *wps_bufptr, | 1168 | static int parse_touchregion(const char *wps_bufptr, |
1168 | struct wps_token *token, struct wps_data *wps_data) | 1169 | struct wps_token *token, struct wps_data *wps_data) |
@@ -1184,6 +1185,8 @@ static int parse_touchregion(const char *wps_bufptr, | |||
1184 | * rwd | 1185 | * rwd |
1185 | * menu - go back to the main menu | 1186 | * menu - go back to the main menu |
1186 | * browse - go back to the file/db browser | 1187 | * browse - go back to the file/db browser |
1188 | * shuffle - toggle shuffle mode | ||
1189 | * repmode - cycle the repeat mode | ||
1187 | */ | 1190 | */ |
1188 | 1191 | ||
1189 | if ((wps_data->touchregion_count +1 >= MAX_TOUCHREGIONS) || (*ptr != '|')) | 1192 | if ((wps_data->touchregion_count +1 >= MAX_TOUCHREGIONS) || (*ptr != '|')) |
diff --git a/wps/cabbiev2.320x240x16.mrobe500.wps b/wps/cabbiev2.320x240x16.mrobe500.wps index 222f51bc41..56613ecfa1 100644 --- a/wps/cabbiev2.320x240x16.mrobe500.wps +++ b/wps/cabbiev2.320x240x16.mrobe500.wps | |||
@@ -4,6 +4,8 @@ | |||
4 | %wd | 4 | %wd |
5 | %T|286|207|24|24|play| | 5 | %T|286|207|24|24|play| |
6 | %T|0|207|84|24|menu| | 6 | %T|0|207|84|24|menu| |
7 | %T|218|211|24|24|shuffle| | ||
8 | %T|261|207|24|24|repmode| | ||
7 | %X|wpsbackdrop-320x240x16.bmp| | 9 | %X|wpsbackdrop-320x240x16.bmp| |
8 | %xl|A|lock-320x240x16.bmp|91|207|2| | 10 | %xl|A|lock-320x240x16.bmp|91|207|2| |
9 | %xl|B|battery-320x240x16.bmp|126|207|10| | 11 | %xl|B|battery-320x240x16.bmp|126|207|10| |