Index: apps/gui/gwps-common.c =================================================================== --- apps/gui/gwps-common.c (revision 18777) +++ apps/gui/gwps-common.c (working copy) @@ -1394,6 +1394,16 @@ token->value.i)) return "v"; return NULL; + case WPS_TOKEN_VIEWMODE: + if (intval) + { + if (data->current_mode > limit) + data->current_mode = 1; + *intval = data->current_mode; + } + snprintf(buf, buf_size, "%d", data->current_mode); + return buf; + default: return NULL; } Index: apps/gui/wps_debug.c =================================================================== --- apps/gui/wps_debug.c (revision 18777) +++ apps/gui/wps_debug.c (working copy) @@ -435,6 +435,9 @@ snprintf(buf, bufsize, "Volume button timeout:%d", token->value.i); break; + case WPS_TOKEN_VIEWMODE: + snprintf(buf, bufsize, "viewmode"); + break; default: snprintf(buf, bufsize, "FIXME (code: %d)", token->type); Index: apps/gui/gwps.c =================================================================== --- apps/gui/gwps.c (revision 18777) +++ apps/gui/gwps.c (working copy) @@ -135,7 +135,7 @@ bool update_track = false; int i; long last_left = 0, last_right = 0; - + bool isremote = false; wps_state_init(); #ifdef HAVE_LCD_CHARCELLS @@ -233,7 +233,10 @@ #else button = get_action(CONTEXT_WPS|ALLOW_SOFTLOCK,HZ/5); #endif - +#if NB_SCREENS > 1 + isremote = get_action_statuscode(NULL)&ACTION_REMOTE; +#endif + /* Exit if audio has stopped playing. This can happen if using the sleep timer with the charger plugged or if starting a recording from F1 */ @@ -291,13 +294,23 @@ break; case ACTION_WPS_BROWSE: + if (gui_wps[isremote?1:0].data->current_mode > -1) + { + /* will get set to 0 eventually again in wps_parser.c */ + gui_wps[isremote?1:0].data->current_mode = + gui_wps[isremote?1:0].data->current_mode+1; + restore = true; + } + else + { #ifdef HAVE_LCD_CHARCELLS - status_set_record(false); - status_set_audio(false); + status_set_record(false); + status_set_audio(false); #endif - FOR_NB_SCREENS(i) - gui_wps[i].display->stop_scroll(); - return GO_TO_PREVIOUS_BROWSER; + FOR_NB_SCREENS(i) + gui_wps[i].display->stop_scroll(); + return GO_TO_PREVIOUS_BROWSER; + } break; /* play/pause */ Index: apps/gui/gwps.h =================================================================== --- apps/gui/gwps.h (revision 18777) +++ apps/gui/gwps.h (working copy) @@ -295,7 +295,10 @@ WPS_VIEWPORT_ENABLE, /* buttons */ - WPS_TOKEN_BUTTON_VOLUME + WPS_TOKEN_BUTTON_VOLUME, + + WPS_TOKEN_VIEWMODE + }; struct wps_token { @@ -429,6 +432,8 @@ /* tick the volume button was last pressed */ unsigned int button_time_volume; + + char current_mode; }; /* initial setup of wps_data */ Index: apps/gui/wps_parser.c =================================================================== --- apps/gui/wps_parser.c (revision 18777) +++ apps/gui/wps_parser.c (working copy) @@ -162,6 +162,8 @@ static int parse_albumart_conditional(const char *wps_bufptr, struct wps_token *token, struct wps_data *wps_data); #endif /* HAVE_ALBUMART */ +static int parse_viewmode(const char *wps_bufptr, + struct wps_token *token, struct wps_data *wps_data); #ifdef CONFIG_RTC #define WPS_RTC_REFRESH WPS_REFRESH_DYNAMIC @@ -281,6 +283,8 @@ { WPS_TOKEN_PLAYBACK_STATUS, "mp", WPS_REFRESH_DYNAMIC, NULL }, { WPS_TOKEN_BUTTON_VOLUME, "mv", WPS_REFRESH_DYNAMIC, parse_timeout }, + { WPS_TOKEN_VIEWMODE, "mo", WPS_REFRESH_STATIC, + parse_viewmode }, #ifdef HAVE_LCD_BITMAP { WPS_TOKEN_PEAKMETER, "pm", WPS_REFRESH_PEAK_METER, NULL }, @@ -1123,6 +1127,15 @@ }; #endif /* HAVE_ALBUMART */ +static int parse_viewmode(const char *wps_bufptr, + struct wps_token *token, + struct wps_data *wps_data) +{ + (void)wps_bufptr; (void)token; + wps_data->current_mode = 1; + /* are we going to add parameters? */ + return 0; +} /* Parse a generic token from the given string. Return the length read */ static int parse_token(const char *wps_bufptr, struct wps_data *wps_data) { @@ -1457,6 +1470,7 @@ wps_data->full_line_progressbar = false; #endif wps_data->button_time_volume = 0; + wps_data->current_mode = -1; wps_data->wps_loaded = false; }