summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/gwps.c26
-rw-r--r--apps/gui/wps_parser.c5
2 files changed, 29 insertions, 2 deletions
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 @@
#include "appevents.h"
#include "viewport.h"
#include "pcmbuf.h"
+#include "option_select.h"
+#include "dsp.h"
#define RESTORE_WPS_INSTANTLY 0l
#define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick))
@@ -732,7 +734,29 @@ long gui_wps_show(void)
restore = true;
}
break;
-
+#ifdef HAVE_TOUCHSCREEN
+ case ACTION_TOUCH_SHUFFLE: /* toggle shuffle mode */
+ {
+ global_settings.playlist_shuffle =
+ !global_settings.playlist_shuffle;
+#if CONFIG_CODEC == SWCODEC
+ dsp_set_replaygain();
+#endif
+ if (global_settings.playlist_shuffle)
+ playlist_randomise(NULL, current_tick, true);
+ else
+ playlist_sort(NULL, true);
+ }
+ break;
+ case ACTION_TOUCH_REPMODE: /* cycle the repeat mode setting */
+ {
+ const struct settings_list *rep_setting =
+ find_setting(&global_settings.repeat_mode, NULL);
+ option_select_next_val(rep_setting, false, true);
+ audio_flush_and_reload_tracks();
+ }
+ break;
+#endif /* HAVE_TOUCHSCREEN */
case ACTION_REDRAW: /* yes are locked, just redraw */
/* fall througgh */
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;};
static struct touchaction touchactions[] = {
{"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP },
{"prev", ACTION_WPS_SKIPPREV }, {"next", ACTION_WPS_SKIPNEXT },
- {"menu", ACTION_WPS_MENU }, {"browse", ACTION_WPS_BROWSE }
+ {"menu", ACTION_WPS_MENU }, {"browse", ACTION_WPS_BROWSE },
+ {"shuffle", ACTION_TOUCH_SHUFFLE }, {"repmode", ACTION_TOUCH_REPMODE }
};
static int parse_touchregion(const char *wps_bufptr,
struct wps_token *token, struct wps_data *wps_data)
@@ -1184,6 +1185,8 @@ static int parse_touchregion(const char *wps_bufptr,
* rwd
* menu - go back to the main menu
* browse - go back to the file/db browser
+ * shuffle - toggle shuffle mode
+ * repmode - cycle the repeat mode
*/
if ((wps_data->touchregion_count +1 >= MAX_TOUCHREGIONS) || (*ptr != '|'))