summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/action.h8
-rw-r--r--apps/gui/gwps.c26
-rw-r--r--apps/gui/wps_parser.c5
3 files changed, 37 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;};
1162static struct touchaction touchactions[] = { 1162static 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};
1167static int parse_touchregion(const char *wps_bufptr, 1168static 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 != '|'))